no-OS
ad719x.h
Go to the documentation of this file.
1 /***************************************************************************/
34 #ifndef __AD719X_H__
35 #define __AD719X_H__
36 
37 /******************************************************************************/
38 /***************************** Include Files **********************************/
39 /******************************************************************************/
40 #include <stdint.h>
41 #include "no_os_gpio.h"
42 #include "no_os_spi.h"
43 #include "no_os_util.h"
44 
45 /******************************************************************************/
46 /******************************** AD719X **************************************/
47 /******************************************************************************/
48 
49 /* SPI slave device ID */
50 #define AD719X_SLAVE_ID 1
51 
52 /* AD719X Register Map */
53 #define AD719X_REG_COMM 0 // Communications Register (WO, 8-bit)
54 #define AD719X_REG_STAT 0 // Status Register (RO, 8-bit)
55 #define AD719X_REG_MODE 1 // Mode Register (RW, 24-bit
56 #define AD719X_REG_CONF 2 // Configuration Register (RW, 24-bit)
57 #define AD719X_REG_DATA 3 // Data Register (RO, 24/32-bit)
58 #define AD719X_REG_ID 4 // ID Register (RO, 8-bit)
59 #define AD719X_REG_GPOCON 5 // GPOCON Register (RW, 8-bit)
60 #define AD719X_REG_OFFSET 6 // Offset Register (RW, 24-bit
61 #define AD719X_REG_FULLSCALE 7 // Full-Scale Register (RW, 24-bit)
62 
63 /* Communications Register Bit Designations (AD719X_REG_COMM) */
64 #define AD719X_COMM_WEN (1 << 7) // Write Enable.
65 #define AD719X_COMM_WRITE (0 << 6) // Write Operation.
66 #define AD719X_COMM_READ (1 << 6) // Read Operation.
67 #define AD719X_COMM_ADDR(x) (((x) & 0x7) << 3) // Register Address.
68 #define AD719X_COMM_CREAD (1 << 2) // Continuous Read of Data Register.
69 
70 /* Status Register Bit Designations (AD719X_REG_STAT) */
71 #define AD719X_STAT_RDY (1 << 7) // Ready.
72 #define AD719X_STAT_ERR (1 << 6) // ADC error bit.
73 #define AD719X_STAT_NOREF (1 << 5) // Error no external reference.
74 #define AD719X_STAT_PARITY (1 << 4) // Parity check of the data register.
75 #define AD719X_STAT_CH3 (1 << 3) // Channel 3.
76 #define AD719X_STAT_CH2 (1 << 2) // Channel 2.
77 #define AD719X_STAT_CH1 (1 << 1) // Channel 1.
78 #define AD719X_STAT_CH0 (1 << 0) // Channel 0.
79 
80 /* Mode Register Bit Designations (AD719X_REG_MODE) */
81 #define AD719X_MODE_SEL(x) (((uint32_t)(x) & 0x7) << 21) // Operation Mode Select.
82 #define AD719X_MODE_DAT_STA ((uint32_t)1 << 20) // Status Register transmission.
83 #define AD719X_MODE_CLKSRC(x) (((uint32_t)(x) & 0x3) << 18) // Clock Source Select.
84 #define AD719X_MODE_AVG(x) (((uint32_t)(x) & 0x3) << 16) // Fast settling filter.
85 #define AD719X_MODE_SINC3 (1 << 15) // SINC3 Filter Select.
86 #define AD719X_MODE_ENPAR (1 << 13) // Parity Enable.
87 #define AD719X_MODE_CLKDIV (1 << 12) // Clock divide by 2 (AD7190/2 only).
88 #define AD719X_MODE_SCYCLE (1 << 11) // Single cycle conversion.
89 #define AD719X_MODE_REJ60 (1 << 10) // 50/60Hz notch filter.
90 #define AD719X_MODE_RATE(x) ((x) & 0x3FF) // Filter Update Rate Select.
91 
92 /* Mode Register: AD719X_MODE_AVG(x) options */
93 #define AD719X_AVG_NONE 0 // No averaging (fast settling mode disabled).
94 #define AD719X_AVG_BY_2 1 // Average by 2.
95 #define AD719X_AVG_BY_8 2 // Average by 8.
96 #define AD719X_AVG_BY_16 3 // Average by 16.
97 
98 /* Configuration Register Bit Designations (AD719X_REG_CONF) */
99 #define AD719X_CONF_CHOP ((uint32_t)1 << 23) // CHOP enable.
100 #define AD719X_CONF_REFSEL ((uint32_t)1 << 20) // REFIN1/REFIN2 Reference Select.
101 #define AD719X_CONF_PSEUDO ((uint32_t)1 << 18) // Pseudo differential analog inputs.
102 #define AD719X_CONF_CHAN(x) ((uint32_t)((x) & 0x3FF) << 8) // Channel select.
103 #define AD719X_CONF_BURN (1 << 7) // Burnout current enable.
104 #define AD719X_CONF_REFDET (1 << 6) // Reference detect enable.
105 #define AD719X_CONF_BUF (1 << 4) // Buffered Mode Enable.
106 #define AD719X_CONF_UNIPOLAR (1 << 3) // Unipolar/Bipolar Enable.
107 #define AD719X_CONF_GAIN(x) ((x) & 0x7) // Gain Select.
108 
109 /* Channel Mask */
110 #define AD719X_CH_MASK(channel) NO_OS_BIT(channel)
111 
112 /* Configuration Register: AD719X_CONF_CHAN(x) options */
113 #define AD719X_CH_0 0
114 #define AD719X_CH_1 1
115 #define AD719X_CH_2 2
116 #define AD719X_CH_3 3
117 #define AD719X_CH_4 4
118 #define AD719X_CH_5 5
119 #define AD719X_CH_6 6
120 #define AD719X_CH_7 7
121 #define AD719X_CH_TEMP 8
122 #define AD719X_CH_SHORT 9
123 
124 /* ID Register Bit Designations (AD7193_REG_ID) */
125 #define AD7190_4_ID_MASK 0x0F
126 #define AD7195_ID_MASK 0xFF
127 
128 /* GPOCON Register Bit Designations (AD719X_REG_GPOCON) */
129 #define AD719X_GPOCON_BPDSW (1 << 6) // Bridge power-down switch enable
130 #define AD719X_GPOCON_GP32EN (1 << 5) // Digital Output P3 and P2 enable
131 #define AD719X_GPOCON_GP10EN (1 << 4) // Digital Output P1 and P0 enable
132 #define AD719X_GPOCON_P3DAT (1 << 3) // P3 state
133 #define AD719X_GPOCON_P2DAT (1 << 2) // P2 state
134 #define AD719X_GPOCON_P1DAT (1 << 1) // P1 state
135 #define AD719X_GPOCON_P0DAT (1 << 0) // P0 state
136 
137 /******************************************************************************/
138 /*************************** Types Declarations *******************************/
139 /******************************************************************************/
140 
142 // ADC Gain (CONF Reg)
143  AD719X_ADC_GAIN_1 = 0, // Gain 1
144  AD719X_ADC_GAIN_8 = 3, // Gain 8
145  AD719X_ADC_GAIN_16 = 4, // Gain 16
146  AD719X_ADC_GAIN_32 = 5, // Gain 32
147  AD719X_ADC_GAIN_64 = 6, // Gain 64
148  AD719X_ADC_GAIN_128 = 7 // Gain 128
149 };
150 
152  // External crystal. The external crystal is connected from MCLK1 to MCLK2.
154  // External Clock applied to MCLK2
156  // Internal 4.92 MHz clock. Pin MCLK2 is tristated.
158  // Internal 4.92 MHz clock. The internal clock is available on MCLK2.
160 };
161 
163  // Continuous Conversion Mode
165  // Single Conversion Mode
167  // Idle Mode
169  // Power-Down Mode
171  // Internal Zero-Scale Calibration
173  // Internal Full-Scale Calibration4
175  // System Zero-Scale Calibration5
177  // System Full-Scale Calibration
179 };
180 
182  AD7190 = 0x4,
183  AD7192 = 0x0,
184  AD7193 = 0x2,
185  AD7194 = 0x3,
186  AD7195 = 0xA6
187 };
188 
189 struct ad719x_dev {
190  /* SPI */
192  /* GPIO */
195  /* Device Settings */
199  uint16_t data_rate_code;
201  uint8_t input_mode;
202  uint8_t buffer;
203  uint8_t bpdsw_mode;
205 };
206 
208  /* SPI */
210  /* GPIO */
212  /* Optional GPIO pin - only for multiple devices */
214  /* Device Settings */
218  uint16_t data_rate_code;
220  uint8_t input_mode;
221  uint8_t buffer;
222  uint8_t bpdsw_mode;
224 };
225 
226 /******************************************************************************/
227 /************************ Functions Declarations ******************************/
228 /******************************************************************************/
229 
231 int ad719x_init(struct ad719x_dev **device,
233 
235 int ad719x_remove(struct ad719x_dev *dev);
236 
238 int ad719x_set_register_value(struct ad719x_dev *dev, uint8_t reg_addr,
239  uint32_t reg_value, uint8_t bytes_number);
240 
242 int ad719x_get_register_value(struct ad719x_dev *dev, uint8_t reg_addr,
243  uint8_t bytes_number, uint32_t *reg_data);
244 
245 /* Write masked data into device register. */
247  uint8_t reg_addr, uint32_t mask, uint32_t data,
248  uint8_t bytes);
249 
251 int ad719x_reset(struct ad719x_dev *dev);
252 
254 int ad719x_set_operating_mode(struct ad719x_dev *dev,
255  enum ad719x_adc_modes opt_mode);
256 
258 int ad719x_wait_rdy_go_low(struct ad719x_dev *dev);
259 
261 int ad719x_channels_select(struct ad719x_dev *dev, uint16_t chn_mask);
262 
264 int ad719x_calibrate(struct ad719x_dev *dev,
265  uint8_t mode, uint8_t channel);
266 
268 int ad719x_config_input_mode(struct ad719x_dev *dev, uint8_t mode);
269 
271 int ad719x_buffer_select(struct ad719x_dev *dev, uint8_t buff_en);
272 
274 int ad719x_output_rate_select(struct ad719x_dev *dev,
275  uint16_t out_rate_code);
276 
278 int ad719x_clock_select(struct ad719x_dev *dev,
279  enum ad719x_adc_clock clk_select);
280 
282 int ad719x_set_bridge_switch(struct ad719x_dev *dev, uint8_t bpdsw_select);
283 
285 int ad719x_range_setup(struct ad719x_dev *dev,
286  uint8_t polarity, enum ad719x_adc_gain range);
287 
289 int ad719x_single_conversion(struct ad719x_dev *dev, uint32_t *reg_data);
290 
292 int ad719x_continuous_read_avg(struct ad719x_dev *dev,
293  uint8_t sample_number, uint32_t *samples_avg);
294 
296 int ad719x_temperature_read(struct ad719x_dev *dev, float *temp);
297 
299 float ad719x_convert_to_volts(struct ad719x_dev *dev,
300  uint32_t raw_data, float v_ref);
301 
302 #endif /* __AD719X_H__ */
ad719x_clock_select
int ad719x_clock_select(struct ad719x_dev *dev, enum ad719x_adc_clock clk_select)
Selects the clock source of the ADC.
Definition: ad719x.c:539
AD719X_MODE_IDLE
@ AD719X_MODE_IDLE
Definition: ad719x.h:168
timeout
uint32_t timeout
Definition: ad413x.c:49
no_os_alloc.h
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
AD719X_MODE_SINGLE
@ AD719X_MODE_SINGLE
Definition: ad719x.h:166
ad719x_reset
int ad719x_reset(struct ad719x_dev *dev)
Resets the device.
Definition: ad719x.c:310
no_os_spi_write_and_read
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:159
ad719x_init_param::sync_pin
struct no_os_gpio_init_param * sync_pin
Definition: ad719x.h:213
no_os_spi.h
Header file of SPI Interface.
ad719x_reset
int ad719x_reset(struct ad719x_dev *dev)
Resets the device.
Definition: ad719x.c:310
ad719x_set_bridge_switch
int ad719x_set_bridge_switch(struct ad719x_dev *dev, uint8_t bpdsw_select)
Opens or closes the bridge power-down switch of the ADC.
Definition: ad719x.c:566
no_os_gpio_get_value
int32_t no_os_gpio_get_value(struct no_os_gpio_desc *desc, uint8_t *value)
Get the value of the specified GPIO.
Definition: no_os_gpio.c:221
AD719X_MODE_CAL_INT_ZERO
@ AD719X_MODE_CAL_INT_ZERO
Definition: ad719x.h:172
ad719x_init_param::input_mode
uint8_t input_mode
Definition: ad719x.h:220
ad719x_get_register_value
int ad719x_get_register_value(struct ad719x_dev *dev, uint8_t reg_addr, uint8_t bytes_number, uint32_t *reg_data)
Reads the value of a register.
Definition: ad719x.c:250
AD719X_MODE_SEL
#define AD719X_MODE_SEL(x)
Definition: ad719x.h:81
ad719x_set_register_value
int ad719x_set_register_value(struct ad719x_dev *dev, uint8_t reg_addr, uint32_t reg_value, uint8_t bytes_number)
Writes data into a register.
Definition: ad719x.c:216
no_os_delay.h
Header file of Delay functions.
AD719X_CONF_GAIN
#define AD719X_CONF_GAIN(x)
Definition: ad719x.h:107
AD719X_MODE_CAL_SYS_ZERO
@ AD719X_MODE_CAL_SYS_ZERO
Definition: ad719x.h:176
AD719X_MODE_CLKSRC
#define AD719X_MODE_CLKSRC(x)
Definition: ad719x.h:83
ad719x_buffer_select
int ad719x_buffer_select(struct ad719x_dev *dev, uint8_t buff_en)
Enables or disables the buffer on the ADC input channels.
Definition: ad719x.c:486
ad719x_wait_rdy_go_low
int ad719x_wait_rdy_go_low(struct ad719x_dev *dev)
Waits for RDY pin to go low.
Definition: ad719x.c:364
ad719x_init
int ad719x_init(struct ad719x_dev **device, struct ad719x_init_param init_param)
Initializes the communication peripheral and the initial Values for AD719X Board and resets the devic...
Definition: ad719x.c:58
ad719x_init_param::current_polarity
uint8_t current_polarity
Definition: ad719x.h:215
device
Definition: ad9361_util.h:69
AD719X_MODE_PWRDN
@ AD719X_MODE_PWRDN
Definition: ad719x.h:170
NO_OS_GPIO_HIGH
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
ad719x_channels_select
int ad719x_channels_select(struct ad719x_dev *dev, uint16_t chn_mask)
Selects the channels to be enabled.
Definition: ad719x.c:392
ad719x_calibrate
int ad719x_calibrate(struct ad719x_dev *dev, uint8_t mode, uint8_t channel)
Performs the given calibration to the specified channel.
Definition: ad719x.c:431
ad719x_temperature_read
int ad719x_temperature_read(struct ad719x_dev *dev, float *temp)
Read data from temperature sensor and converts it to Celsius degrees.
Definition: ad719x.c:697
no_os_gpio_direction_input
int32_t no_os_gpio_direction_input(struct no_os_gpio_desc *desc)
Enable the input direction of the specified GPIO.
Definition: no_os_gpio.c:124
AD719X_ADC_GAIN_128
@ AD719X_ADC_GAIN_128
Definition: ad719x.h:148
AD719X_REG_CONF
#define AD719X_REG_CONF
Definition: ad719x.h:56
AD719X_MODE_CAL_SYS_FULL
@ AD719X_MODE_CAL_SYS_FULL
Definition: ad719x.h:178
AD719X_REG_GPOCON
#define AD719X_REG_GPOCON
Definition: ad719x.h:59
ad719x_dev::bpdsw_mode
uint8_t bpdsw_mode
Definition: ad719x.h:203
ad719x_temperature_read
int ad719x_temperature_read(struct ad719x_dev *dev, float *temp)
Read data from temperature sensor and converts it to Celsius degrees.
Definition: ad719x.c:697
AD719X_EXT_CRYSTAL_MCLK1_MCLK2
@ AD719X_EXT_CRYSTAL_MCLK1_MCLK2
Definition: ad719x.h:153
AD7190_4_ID_MASK
#define AD7190_4_ID_MASK
Definition: ad719x.h:125
AD719X_ADC_GAIN_64
@ AD719X_ADC_GAIN_64
Definition: ad719x.h:147
AD719X_COMM_ADDR
#define AD719X_COMM_ADDR(x)
Definition: ad719x.h:67
ad719x_set_register_value
int ad719x_set_register_value(struct ad719x_dev *dev, uint8_t reg_addr, uint32_t reg_val, uint8_t bytes_number)
Writes data into a register.
Definition: ad719x.c:216
ad719x_init_param::gpio_miso
struct no_os_gpio_init_param * gpio_miso
Definition: ad719x.h:211
ad719x_config_input_mode
int ad719x_config_input_mode(struct ad719x_dev *dev, uint8_t mode)
Configures the input mode of the ADC.
Definition: ad719x.c:459
no_os_error.h
Error codes definition.
ad719x_channels_select
int ad719x_channels_select(struct ad719x_dev *dev, uint16_t chn_mask)
Selects the channels to be enabled.
Definition: ad719x.c:392
AD719X_CH_MASK
#define AD719X_CH_MASK(channel)
Definition: ad719x.h:110
ad719x_dev::sync_pin
struct no_os_gpio_desc * sync_pin
Definition: ad719x.h:194
ad719x_init_param
Definition: ad719x.h:207
AD719X_ADC_GAIN_16
@ AD719X_ADC_GAIN_16
Definition: ad719x.h:145
AD719X_REG_DATA
#define AD719X_REG_DATA
Definition: ad719x.h:57
AD719X_CONF_BUF
#define AD719X_CONF_BUF
Definition: ad719x.h:105
ad719x_continuous_read_avg
int ad719x_continuous_read_avg(struct ad719x_dev *dev, uint8_t sample_number, uint32_t *samples_avg)
Returns the average of several conversion results.
Definition: ad719x.c:656
AD719X_MODE_CAL_INT_FULL
@ AD719X_MODE_CAL_INT_FULL
Definition: ad719x.h:174
ad719x_init_param::bpdsw_mode
uint8_t bpdsw_mode
Definition: ad719x.h:222
ad719x_dev::gpio_miso
struct no_os_gpio_desc * gpio_miso
Definition: ad719x.h:193
ad719x_set_bridge_switch
int ad719x_set_bridge_switch(struct ad719x_dev *dev, uint8_t bpdsw_select)
Opens or closes the bridge power-down switch of the ADC.
Definition: ad719x.c:566
ad719x_dev::current_polarity
uint8_t current_polarity
Definition: ad719x.h:196
ad719x_continuous_read_avg
int ad719x_continuous_read_avg(struct ad719x_dev *dev, uint8_t sample_number, uint32_t *samples_avg)
Returns the average of several conversion results.
Definition: ad719x.c:656
ad719x_range_setup
int ad719x_range_setup(struct ad719x_dev *dev, uint8_t polarity, enum ad719x_adc_gain gain)
Selects the polarity of the conversion and the ADC input range.
Definition: ad719x.c:598
AD7190
@ AD7190
Definition: ad719x.h:182
AD719X_REG_ID
#define AD719X_REG_ID
Definition: ad719x.h:58
ad719x_clock_select
int ad719x_clock_select(struct ad719x_dev *dev, enum ad719x_adc_clock clk_select)
Selects the clock source of the ADC.
Definition: ad719x.c:539
ad719x_adc_gain
ad719x_adc_gain
Definition: ad719x.h:141
AD7195_ID_MASK
#define AD7195_ID_MASK
Definition: ad719x.h:126
ad719x_init_param::current_gain
enum ad719x_adc_gain current_gain
Definition: ad719x.h:216
ad719x_range_setup
int ad719x_range_setup(struct ad719x_dev *dev, uint8_t polarity, enum ad719x_adc_gain range)
Selects the polarity of the conversion and the ADC input range.
Definition: ad719x.c:598
ad719x_adc_clock
ad719x_adc_clock
Definition: ad719x.h:151
ad719x_dev::input_mode
uint8_t input_mode
Definition: ad719x.h:201
no_os_gpio_remove
int32_t no_os_gpio_remove(struct no_os_gpio_desc *desc)
Free the resources allocated by no_os_gpio_get().
Definition: no_os_gpio.c:104
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
ad719x_dev::data_rate_code
uint16_t data_rate_code
Definition: ad719x.h:199
ad719x_set_masked_register_value
int ad719x_set_masked_register_value(struct ad719x_dev *dev, uint8_t reg_addr, uint32_t mask, uint32_t data, uint8_t bytes)
Write masked data into device register.
Definition: ad719x.c:285
AD719X_COMM_READ
#define AD719X_COMM_READ
Definition: ad719x.h:66
ad719x_adc_modes
ad719x_adc_modes
Definition: ad719x.h:162
AD7192
@ AD7192
Definition: ad719x.h:183
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
ad719x_remove
int ad719x_remove(struct ad719x_dev *dev)
Free the resources allocated by ad719x_init().
Definition: ad719x.c:189
ad719x_dev::buffer
uint8_t buffer
Definition: ad719x.h:202
AD719X_GPOCON_BPDSW
#define AD719X_GPOCON_BPDSW
Definition: ad719x.h:129
AD719X_CONF_PSEUDO
#define AD719X_CONF_PSEUDO
Definition: ad719x.h:101
AD719X_CH_2
#define AD719X_CH_2
Definition: ad719x.h:115
no_os_gpio_get
int32_t no_os_gpio_get(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Obtain the GPIO decriptor.
Definition: no_os_gpio.c:49
ad719x_dev::clock_source
enum ad719x_adc_clock clock_source
Definition: ad719x.h:200
no_os_malloc
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
ad719x_init_param::chip_id
enum ad719x_chip_id chip_id
Definition: ad719x.h:223
ad719x_remove
int ad719x_remove(struct ad719x_dev *dev)
Free the resources allocated by ad719x_init().
Definition: ad719x.c:189
ad719x_set_operating_mode
int ad719x_set_operating_mode(struct ad719x_dev *dev, enum ad719x_adc_modes opt_mode)
Sets device into the specified operating mode.
Definition: ad719x.c:342
ad719x_single_conversion
int ad719x_single_conversion(struct ad719x_dev *dev, uint32_t *reg_data)
Returns the result of a single conversion.
Definition: ad719x.c:625
ad719x_chip_id
ad719x_chip_id
Definition: ad719x.h:181
AD719X_INT_CLK_4_92_MHZ_TRIST
@ AD719X_INT_CLK_4_92_MHZ_TRIST
Definition: ad719x.h:157
ad719x_get_register_value
int ad719x_get_register_value(struct ad719x_dev *dev, uint8_t reg_addr, uint8_t bytes_number, uint32_t *reg_data)
Reads the value of a register.
Definition: ad719x.c:250
AD7193
@ AD7193
Definition: ad719x.h:184
AD7194
@ AD7194
Definition: ad719x.h:185
no_os_free
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:69
ad719x_set_operating_mode
int ad719x_set_operating_mode(struct ad719x_dev *dev, enum ad719x_adc_modes opt_mode)
Sets device into the specified operating mode.
Definition: ad719x.c:342
ad719x_wait_rdy_go_low
int ad719x_wait_rdy_go_low(struct ad719x_dev *dev)
Waits for RDY pin to go low.
Definition: ad719x.c:364
ad719x_init
int ad719x_init(struct ad719x_dev **device, struct ad719x_init_param init_param)
Initializes the communication peripheral and the initial Values for AD719X Board and resets the devic...
Definition: ad719x.c:58
ad719x_init_param::operating_mode
enum ad719x_adc_modes operating_mode
Definition: ad719x.h:217
AD719X_COMM_WRITE
#define AD719X_COMM_WRITE
Definition: ad719x.h:65
AD719X_MODE_RATE
#define AD719X_MODE_RATE(x)
Definition: ad719x.h:90
ad719x_init_param::spi_init
struct no_os_spi_init_param * spi_init
Definition: ad719x.h:209
no_os_udelay
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
ad719x_dev::current_gain
enum ad719x_adc_gain current_gain
Definition: ad719x.h:197
no_os_gpio_set_value
int32_t no_os_gpio_set_value(struct no_os_gpio_desc *desc, uint8_t value)
Set the value of the specified GPIO.
Definition: no_os_gpio.c:197
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
ad719x_calibrate
int ad719x_calibrate(struct ad719x_dev *dev, uint8_t mode, uint8_t channel)
Performs the given calibration to the specified channel.
Definition: ad719x.c:431
AD719X_MODE_CONT
@ AD719X_MODE_CONT
Definition: ad719x.h:164
ad719x_init_param::clock_source
enum ad719x_adc_clock clock_source
Definition: ad719x.h:219
ad719x_dev::spi_desc
struct no_os_spi_desc * spi_desc
Definition: ad719x.h:191
ad719x_convert_to_volts
float ad719x_convert_to_volts(struct ad719x_dev *dev, uint32_t raw_data, float v_ref)
Converts 24-bit raw data to milivolts.
Definition: ad719x.c:738
ad719x_single_conversion
int ad719x_single_conversion(struct ad719x_dev *dev, uint32_t *reg_data)
Returns the result of a single conversion.
Definition: ad719x.c:625
ad719x_init_param::data_rate_code
uint16_t data_rate_code
Definition: ad719x.h:218
ad719x_set_masked_register_value
int ad719x_set_masked_register_value(struct ad719x_dev *dev, uint8_t reg_addr, uint32_t mask, uint32_t reg_data, uint8_t bytes)
Write masked data into device register.
Definition: ad719x.c:285
AD719X_CH_TEMP
#define AD719X_CH_TEMP
Definition: ad719x.h:121
no_os_spi_remove
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:116
ad719x_dev::chip_id
enum ad719x_chip_id chip_id
Definition: ad719x.h:204
no_os_gpio.h
Header file of GPIO Interface.
ad719x_convert_to_volts
float ad719x_convert_to_volts(struct ad719x_dev *dev, uint32_t raw_data, float v_ref)
Converts 24-bit raw data to milivolts.
Definition: ad719x.c:738
AD719X_INT_CLK_4_92_MHZ
@ AD719X_INT_CLK_4_92_MHZ
Definition: ad719x.h:159
no_os_spi_init
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:52
ad719x_output_rate_select
int ad719x_output_rate_select(struct ad719x_dev *dev, uint16_t out_rate_code)
Selects the filter output data rate of the ADC.
Definition: ad719x.c:510
ad719x_config_input_mode
int ad719x_config_input_mode(struct ad719x_dev *dev, uint8_t mode)
Configures the input mode of the ADC.
Definition: ad719x.c:459
AD7195
@ AD7195
Definition: ad719x.h:186
no_os_util.h
Header file of utility functions.
ad719x_buffer_select
int ad719x_buffer_select(struct ad719x_dev *dev, uint8_t buff_en)
Enables or disables the buffer on the ADC input channels.
Definition: ad719x.c:486
AD719X_ADC_GAIN_32
@ AD719X_ADC_GAIN_32
Definition: ad719x.h:146
AD719X_EXT_CRYSTAL_MCLK2
@ AD719X_EXT_CRYSTAL_MCLK2
Definition: ad719x.h:155
ad719x_output_rate_select
int ad719x_output_rate_select(struct ad719x_dev *dev, uint16_t out_rate_code)
Selects the filter output data rate of the ADC.
Definition: ad719x.c:510
no_os_gpio_direction_output
int32_t no_os_gpio_direction_output(struct no_os_gpio_desc *desc, uint8_t value)
Enable the output direction of the specified GPIO.
Definition: no_os_gpio.c:147
AD719X_ADC_GAIN_8
@ AD719X_ADC_GAIN_8
Definition: ad719x.h:144
ad719x_dev::operating_mode
enum ad719x_adc_modes operating_mode
Definition: ad719x.h:198
ad719x_sync_control
int ad719x_sync_control(struct ad719x_dev *dev, uint8_t value)
Control SYNC pin for synchronization of multiple devices.
Definition: ad719x.c:764
ad719x.h
Header file of AD7190/2/3/4/5 Driver.
AD719X_CONF_CHAN
#define AD719X_CONF_CHAN(x)
Definition: ad719x.h:102
ad719x_init_param::buffer
uint8_t buffer
Definition: ad719x.h:221
AD719X_REG_MODE
#define AD719X_REG_MODE
Definition: ad719x.h:55
ad719x_dev
Definition: ad719x.h:189
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
AD719X_CONF_UNIPOLAR
#define AD719X_CONF_UNIPOLAR
Definition: ad719x.h:106
AD719X_ADC_GAIN_1
@ AD719X_ADC_GAIN_1
Definition: ad719x.h:143
no_os_gpio_get_optional
int32_t no_os_gpio_get_optional(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Get the value of an optional GPIO.
Definition: no_os_gpio.c:75