Go to the documentation of this file.
46 #define AD7689_CFG_CFG_MSK NO_OS_BIT(13)
47 #define AD7689_CFG_INCC_MSK NO_OS_GENMASK(12,10)
48 #define AD7689_CFG_INX_MSK NO_OS_GENMASK(9,7)
49 #define AD7689_CFG_BW_MSK NO_OS_BIT(6)
50 #define AD7689_CFG_REF_MSK NO_OS_GENMASK(5,3)
51 #define AD7689_CFG_SEQ_MSK NO_OS_GENMASK(2,1)
52 #define AD7689_CFG_RB_MSK NO_OS_BIT(0)
179 uint32_t nb_samples);
int32_t ad7689_read_config(struct ad7689_dev *dev, struct ad7689_config *config)
Read the device's CFG register.
Definition: ad7689.c:222
@ AD7689_UNIPOLAR_GND
Definition: ad7689.h:85
@ AD7689_SEQ_UPDATE_CFG
Definition: ad7689.h:126
#define AD7689_CFG_REF_MSK
Definition: ad7689.h:50
enum ad7689_ref ref
Definition: ad7689.h:145
@ AD7689_SEQ_SCAN_ALL
Definition: ad7689.h:130
int32_t no_os_spi_write_and_read(struct no_os_spi_desc *desc, uint8_t *data, uint16_t bytes_number)
Write and read data to/from SPI.
Definition: no_os_spi.c:165
struct no_os_spi_desc * spi_desc
Definition: ad7689.h:169
Header file of SPI Interface.
@ ID_AD7689
Definition: ad7689.h:60
#define AD7689_CFG_RB_MSK
Definition: ad7689.h:52
int32_t ad7689_write_config(struct ad7689_dev *dev, struct ad7689_config *config)
Write the device's CFG register.
Definition: ad7689.c:199
#define pr_err(fmt, args...)
Definition: no_os_print_log.h:94
@ AD7689_SEQ_DISABLE
Definition: ad7689.h:124
int32_t ad7689_read(struct ad7689_dev *dev, uint16_t *data, uint32_t nb_samples)
Read ADC samples.
Definition: ad7689.c:256
Header file of Delay functions.
int32_t ad7689_write_config(struct ad7689_dev *dev, struct ad7689_config *config)
Write the device's CFG register.
Definition: ad7689.c:199
enum ad7689_bw bw
Definition: ad7689.h:143
ad7689_bw
Low-pass filter bandwidth selection.
Definition: ad7689.h:92
#define AD7689_CFG_INCC_MSK
Definition: ad7689.h:47
AD7689 configuration.
Definition: ad7689.h:137
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:60
bool
Definition: common.h:54
enum ad7689_incc incc
Definition: ad7689.h:139
ad7689_ref
Reference/buffer selection.
Definition: ad7689.h:103
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
@ AD7689_BW_QUARTER
Definition: ad7689.h:94
@ AD7689_SEQ_SCAN_ALL_THEN_TEMP
Definition: ad7689.h:128
@ AD7689_TEMPERATURE_SENSOR
Definition: ad7689.h:79
const char * name
Definition: ad7689.h:163
@ AD7689_UNIPOLAR_DIFFERENTIAL_PAIRS
Definition: ad7689.h:81
@ AD7689_BIPOLAR_DIFFERENTIAL_PAIRS
Definition: ad7689.h:75
struct ad7689_config configs[2]
Definition: ad7689.h:167
bool rb
Definition: ad7689.h:149
#define AD7689_CFG_CFG_MSK
Definition: ad7689.h:46
ad7689_device_id
Device ID definitions.
Definition: ad7689.h:58
@ AD7689_BW_FULL
Definition: ad7689.h:96
@ AD7689_UNIPOLAR_COM
Definition: ad7689.h:83
@ ID_AD7949
Definition: ad7689.h:64
struct ad7689_config config
Definition: ad7689.h:156
Structure holding SPI descriptor.
Definition: no_os_spi.h:177
#define AD7689_CFG_INX_MSK
Definition: ad7689.h:48
enum ad7689_seq seq
Definition: ad7689.h:147
int32_t ad7689_remove(struct ad7689_dev *dev)
Remove the driver's descriptor by freeing the associated resources.
Definition: ad7689.c:285
#define AD7689_CFG_SEQ_MSK
Definition: ad7689.h:51
ad7689_seq
Channel sequencer configuration.
Definition: ad7689.h:122
Header file for the ad7689 driver.
ad7689_incc
Input channel configuration.
Definition: ad7689.h:73
@ AD7689_REF_IBUF
Definition: ad7689.h:115
@ ID_AD7699
Definition: ad7689.h:66
enum ad7689_device_id id
Definition: ad7689.h:165
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:75
@ AD7689_BIPOLAR_COM
Definition: ad7689.h:77
@ AD7689_REF_EXTERNAL_TEMP_IBUF
Definition: ad7689.h:111
int32_t ad7689_remove(struct ad7689_dev *dev)
Remove the driver's descriptor by freeing the associated resources.
Definition: ad7689.c:285
#define NULL
Definition: wrapper.h:64
@ AD7689_REF_INTERNAL_4p096V
Definition: ad7689.h:107
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:119
int32_t ad7689_init(struct ad7689_dev **dev, struct ad7689_init_param *init_param)
Initialize the ad7689 driver and create a descriptor.
Definition: ad7689.c:147
int32_t no_os_spi_remove(struct no_os_spi_desc *desc)
Free the resources allocated by no_os_spi_init().
Definition: no_os_spi.c:122
uint8_t inx
Definition: ad7689.h:141
@ AD7689_REF_EXTERNAL
Definition: ad7689.h:113
int32_t ad7689_read(struct ad7689_dev *dev, uint16_t *data, uint32_t nb_samples)
Read ADC samples.
Definition: ad7689.c:256
@ ID_AD7682
Definition: ad7689.h:62
int32_t ad7689_init(struct ad7689_dev **dev, struct ad7689_init_param *init_param)
Initialize the ad7689 driver and create a descriptor.
Definition: ad7689.c:147
@ AD7689_REF_INTERNAL_2p5V
Definition: ad7689.h:105
int32_t no_os_spi_init(struct no_os_spi_desc **desc, const struct no_os_spi_init_param *param)
Initialize the SPI communication peripheral.
Definition: no_os_spi.c:58
Header file of utility functions.
struct no_os_spi_init_param spi_init
Definition: ad7689.h:158
const char * ad7689_device_name[]
Definition: ad7689.c:47
int32_t ad7689_read_config(struct ad7689_dev *dev, struct ad7689_config *config)
Read the device's CFG register.
Definition: ad7689.c:222
#define AD7689_CFG_BW_MSK
Definition: ad7689.h:49
@ AD7689_REF_EXTERNAL_TEMP
Definition: ad7689.h:109
enum ad7689_device_id id
Definition: ad7689.h:154
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:131