Go to the documentation of this file.
46 #define AD4170_R1B (1ul << 16)
47 #define AD4170_R2B (2ul << 16)
48 #define AD4170_R3B (3ul << 16)
49 #define AD4170_R4B (4ul << 16)
50 #define AD4170_TRANSF_LEN(x) ((x) >> 16)
51 #define AD4170_ADDR(x) ((x) & 0xFFFF)
53 #define AD4170_SPI_SYNC_PATTERN 0x2645
55 #define AD4170_REG_READ_6(x) (((x) & 0x3F) | 0x40)
56 #define AD4170_REG_WRITE_6(x) ((x) & 0x3F)
57 #define AD4170_REG_READ_14(x) (((x) & 0x3FFF) | 0x4000)
58 #define AD4170_REG_WRITE_14(x) ((x) & 0x3FFF)
59 #define AD4170_REG_INTERFACE_CONFIG_A (AD4170_R1B | 0x00)
60 #define AD4170_REG_INTERFACE_CONFIG_B (AD4170_R1B | 0x01)
61 #define AD4170_REG_DEVICE_CONFIG (AD4170_R1B | 0x02)
62 #define AD4170_REG_CHIP_TYPE (AD4170_R1B | 0x03)
63 #define AD4170_REG_PRODUCT_ID_L (AD4170_R1B | 0x04)
64 #define AD4170_REG_PRODUCT_ID_H (AD4170_R1B | 0x05)
65 #define AD4170_REG_CHIP_GRADE (AD4170_R1B | 0x06)
66 #define AD4170_REG_SCRATCH_PAD (AD4170_R1B | 0x0a)
67 #define AD4170_REG_SPI_REVISION (AD4170_R1B | 0x0b)
68 #define AD4170_REG_VENDOR_L (AD4170_R1B | 0x0c)
69 #define AD4170_REG_VENDOR_H (AD4170_R1B | 0x0d)
70 #define AD4170_REG_INTERFACE_CONFIG_C (AD4170_R1B | 0x10)
71 #define AD4170_REG_INTERFACE_STATUS_A (AD4170_R1B | 0x11)
72 #define AD4170_REG_DATA_STATUS (AD4170_R2B | 0x14)
73 #define AD4170_REG_DATA_16b (AD4170_R2B | 0x16)
74 #define AD4170_REG_DATA_16b_STATUS (AD4170_R3B | 0x18)
75 #define AD4170_REG_DATA_24b (AD4170_R3B | 0x1c)
76 #define AD4170_REG_DATA_24b_STATUS (AD4170_R4B | 0x20)
77 #define AD4170_REG_DATA_32b (AD4170_R4B | 0x24)
78 #define AD4170_REG_DATA_PER_CHANNEL(ch) (AD4170_R3B | (0x28 + 4 * (ch)))
79 #define AD4170_REG_PIN_MUXING (AD4170_R2B | 0x68)
80 #define AD4170_REG_CLOCK_CTRL (AD4170_R2B | 0x6a)
81 #define AD4170_REG_STANDBY_CTRL (AD4170_R2B | 0x6c)
82 #define AD4170_REG_POWER_DOWN_SW (AD4170_R2B | 0x6e)
83 #define AD4170_REG_ADC_CTRL (AD4170_R2B | 0x70)
84 #define AD4170_REG_ERROR_EN (AD4170_R2B | 0x72)
85 #define AD4170_REG_ERROR (AD4170_R2B | 0x74)
86 #define AD4170_REG_CHANNEL_EN (AD4170_R2B | 0x78)
87 #define AD4170_REG_ADC_CHANNEL_SETUP(ch) (AD4170_R2B | (0x80 + 4 * (ch)))
88 #define AD4170_REG_ADC_CHANNEL_MAP(ch) (AD4170_R2B | (0x82 + 4 * (ch)))
89 #define AD4170_REG_ADC_SETUPS_MISC(n) (AD4170_R2B | (0xc0 + 14 * (n)))
90 #define AD4170_REG_ADC_SETUPS_AFE(n) (AD4170_R2B | (0xc2 + 14 * (n)))
91 #define AD4170_REG_ADC_SETUPS_FILTER(n) (AD4170_R2B | (0xc4 + 14 * (n)))
92 #define AD4170_REG_ADC_SETUPS_FILTER_FS(n) (AD4170_R2B | (0xc6 + 14 * (n)))
93 #define AD4170_REG_ADC_SETUPS_OFFSET(n) (AD4170_R3B | (0xc8 + 14 * (n)))
94 #define AD4170_REG_ADC_SETUPS_GAIN(n) (AD4170_R3B | (0xcb + 14 * (n)))
95 #define AD4170_REG_REF_CONTROL (AD4170_R2B | 0x130)
96 #define AD4170_REG_V_BIAS (AD4170_R2B | 0x134)
97 #define AD4170_REG_I_PULLUP (AD4170_R2B | 0x136)
98 #define AD4170_REG_CURRENT_SOURCE(n) (AD4170_R2B | (0x138 + 2 * (n)))
99 #define AD4170_REG_FIR_CONTROL (AD4170_R2B | 0x140)
100 #define AD4170_REG_COEFF_WRITE_DATA (AD4170_R4B | 0x143)
101 #define AD4170_REG_COEFF_READ_DATA (AD4170_R4B | 0x147)
102 #define AD4170_REG_COEFF_ADDRESS (AD4170_R2B | 0x14b)
103 #define AD4170_REG_COEFF_WRRD_STB (AD4170_R2B | 0x14d)
104 #define AD4170_REG_DAC_SPAN (AD4170_R2B | 0x150)
105 #define AD4170_REG_DAC_CHANNEL_EN (AD4170_R2B | 0x152)
106 #define AD4170_REG_DAC_HW_TOGGLE_MASK (AD4170_R2B | 0x154)
107 #define AD4170_REG_DAC_HW_LDAC_MASK (AD4170_R2B | 0x156)
108 #define AD4170_REG_DAC_DATA(ch) (AD4170_R2B | (0x158 + 2 * (ch)))
109 #define AD4170_REG_DAC_SW_TOGGLE_TRIGGERS (AD4170_R2B | 0x168)
110 #define AD4170_REG_DAC_SW_LDAC_TRIGGERS (AD4170_R2B | 0x16a)
111 #define AD4170_REG_DAC_INPUTA(ch) (AD4170_R2B | (0x16c + 2 * (ch)))
112 #define AD4170_REG_DAC_INPUTB(ch) (AD4170_R2B | (0x17c + 2 * (ch)))
113 #define AD4170_REG_GPIO_MODE (AD4170_R2B | 0x190)
114 #define AD4170_REG_OUTPUT_DATA (AD4170_R2B | 0x192)
115 #define AD4170_REG_INPUT_DATA (AD4170_R2B | 0x194)
118 #define AD4170_SW_RESET_MSK NO_OS_BIT(7)
119 #define AD4170_ADDR_ASCENSION_MSK NO_OS_BIT(5)
120 #define AD4170_SDO_ENABLE_MSK NO_OS_BIT(4)
121 #define AD4170_SW_RESETX_MSK NO_OS_BIT(0)
124 #define AD4170_INTERFACE_CONFIG_B_SINGLE_INST_MSK NO_OS_BIT(7)
125 #define AD4170_INTERFACE_CONFIG_B_SHORT_INSTRUCTION_MSK NO_OS_BIT(3)
126 #define AD4170_INTERFACE_CONFIG_B_SHORT_INSTRUCTION(x) (((x) & 0x1) << 3)
129 #define AD4170_INTERFACE_CONFIG_C_CRC_MSK (NO_OS_BIT(7) | NO_OS_BIT(6) | NO_OS_BIT(1) | NO_OS_BIT(0))
130 #define AD4170_INTERFACE_CONFIG_C_CRC(x) (((~x) & 0x3) | (((x) << 6) & 0xC0))
131 #define AD4170_INTERFACE_CONFIG_C_STRICT_REG_ACCESS_MSK NO_OS_BIT(5)
132 #define AD4170_INTERFACE_CONFIG_C_STRICT_REG_ACCESS(x) (((x) & 0x1) << 5)
133 #define AD4170_CRC8_POLYNOMIAL 0x7
134 #define AD4170_CRC8_INITIAL_VALUE 0xA5
137 #define AD4170_INTERFACE_STATUS_A_NOT_READY_ERR_MSK NO_OS_BIT(7)
138 #define AD4170_INTERFACE_STATUS_A_CLOCK_COUNT_ERR_MSK NO_OS_BIT(4)
139 #define AD4170_INTERFACE_STATUS_A_CRC_ERR_MSK NO_OS_BIT(3)
140 #define AD4170_INTERFACE_STATUS_A_INVALID_ACCESS_ERR_MSK NO_OS_BIT(2)
141 #define AD4170_INTERFACE_STATUS_A_PARTIAL_ACCESS_ERR_MSK NO_OS_BIT(1)
142 #define AD4170_INTERFACE_STATUS_A_ADDR_INVALID_ERR_MSK NO_OS_BIT(0)
145 #define AD4170_PRODUCT_ID_L_VALUE 0x40
146 #define AD4170_PRODUCT_ID_H_VALUE 0x0
149 #define AD4190_PRODUCT_ID_L_VALUE 0x48
150 #define AD4190_PRODUCT_ID_H_VALUE 0x0
153 #define AD4170_DATA_STATUS_MASTER_ERR_S_MSK NO_OS_BIT(7)
154 #define AD4170_DATA_STATUS_POR_FLAG_S_MSK NO_OS_BIT(6)
155 #define AD4170_DATA_STATUS_RDYB_MSK NO_OS_BIT(5)
156 #define AD4170_DATA_STATUS_SETTLED_FIR_MSK NO_OS_BIT(4)
157 #define AD4170_DATA_STATUS_CH_ACTIVE_MSK NO_OS_GENMASK(3,0)
160 #define AD4170_PIN_MUXING_CHAN_TO_GPIO_MSK NO_OS_BIT(14)
161 #define AD4170_PIN_MUXING_DIG_AUX2_CTRL_MSK NO_OS_GENMASK(7,6)
162 #define AD4170_PIN_MUXING_DIG_AUX1_CTRL_MSK NO_OS_GENMASK(5,4)
163 #define AD4170_PIN_MUXING_SYNC_CTRL_MSK NO_OS_GENMASK(3,2)
164 #define AD4170_PIN_MUXING_DIG_OUT_STR_MSK NO_OS_BIT(1)
165 #define AD4170_PIN_MUXING_SDO_RDBY_DLY_MSK NO_OS_BIT(0)
168 #define AD4170_CLOCK_CTRL_DCLK_DIVIDE_MSK NO_OS_GENMASK(7,6)
169 #define AD4170_CLOCK_CTRL_CLOCKDIV_MSK NO_OS_GENMASK(5,4)
170 #define AD4170_CLOCK_CTRL_CLOCKSEL_MSK NO_OS_GENMASK(1,0)
173 #define AD4170_STANDBY_CTRL_STB_EN_CLOCK_MSK NO_OS_BIT(8)
174 #define AD4170_STANDBY_CTRL_STB_EN_IPULLUP_MSK NO_OS_BIT(7)
175 #define AD4170_STANDBY_CTRL_STB_EN_DIAGNOSTICS_MSK NO_OS_BIT(6)
176 #define AD4170_STANDBY_CTRL_STB_EN_DAC_MSK NO_OS_BIT(5)
177 #define AD4170_STANDBY_CTRL_STB_EN_PDSW1_MSK NO_OS_BIT(4)
178 #define AD4170_STANDBY_CTRL_STB_EN_PDSW0_MSK NO_OS_BIT(3)
179 #define AD4170_STANDBY_CTRL_STB_EN_VBIAS_MSK NO_OS_BIT(2)
180 #define AD4170_STANDBY_CTRL_STB_EN_IEXC_MSK NO_OS_BIT(1)
181 #define AD4170_STANDBY_CTRL_STB_EN_REFERENCE_MSK NO_OS_BIT(0)
184 #define AD4170_POWER_DOWN_SW_PDSW1_MSK NO_OS_BIT(1)
185 #define AD4170_POWER_DOWN_SW_PDSW0_MSK NO_OS_BIT(0)
188 #define AD4170_ADC_CTRL_PARALLEL_FILT_EN_MSK NO_OS_BIT(8)
189 #define AD4170_ADC_CTRL_MULTI_DATA_REG_SEL_MSK NO_OS_BIT(7)
190 #define AD4170_ADC_CTRL_CONT_READ_STATUS_EN_MSK NO_OS_BIT(6)
191 #define AD4170_REG_CTRL_CONT_READ_MSK NO_OS_GENMASK(5,4)
192 #define AD4170_REG_CTRL_MODE_MSK NO_OS_GENMASK(3,0)
195 #define AD4170_ERROR_DEVICE_ERROR_MSK NO_OS_BIT(15)
196 #define AD4170_ERROR_DLDO_PSM_ERR_MSK NO_OS_BIT(13)
197 #define AD4170_ERROR_ALDO_PSM_ERR_MSK NO_OS_BIT(12)
198 #define AD4170_ERROR_IOUT3_COMP_ERR_MSK NO_OS_BIT(11)
199 #define AD4170_ERROR_IOUT2_COMP_ERR_MSK NO_OS_BIT(10)
200 #define AD4170_ERROR_IOUT1_COMP_ERR_MSK NO_OS_BIT(9)
201 #define AD4170_ERROR_IOUT0_COMP_ERR_MSK NO_OS_BIT(8)
202 #define AD4170_ERROR_REF_DIFF_MIN_ERR_MSK NO_OS_BIT(7)
203 #define AD4170_ERROR_REF_OV_UV_ERR_MSK NO_OS_BIT(6)
204 #define AD4170_ERROR_AINM_OV_UV_ERR_MSK NO_OS_BIT(5)
205 #define AD4170_ERROR_AINP_OV_UV_ERR_MSK NO_OS_BIT(4)
206 #define AD4170_ERROR_ADC_CONV_ERR_MSK NO_OS_BIT(3)
207 #define AD4170_ERROR_MM_CRC_ERR_MSK NO_OS_BIT(1)
208 #define AD4170_ERROR_ROM_CRC_ERR_MSK NO_OS_BIT(0)
211 #define AD4170_CHANNEL(ch) NO_OS_BIT(ch)
214 #define AD4170_CHANNEL_SETUPN_REPEAT_N_MSK NO_OS_GENMASK(15,8)
215 #define AD4170_CHANNEL_SETUPN_DELAY_N_MSK NO_OS_GENMASK(6,4)
216 #define AD4170_CHANNEL_SETUPN_SETUP_N_MSK NO_OS_GENMASK(2,0)
219 #define AD4170_CHANNEL_MAPN_AINP_MSK NO_OS_GENMASK(12,8)
220 #define AD4170_CHANNEL_MAPN_AINM_MSK NO_OS_GENMASK(4,0)
223 #define AD4170_ADC_SETUPS_MISC_CHOP_IEXC_MSK NO_OS_GENMASK(15,14)
224 #define AD4170_ADC_SETUPS_MISC_CHOP_ADC_MSK NO_OS_GENMASK(9,8)
225 #define AD4170_ADC_SETUPS_MISC_BURNOUT_MSK NO_OS_GENMASK(1,0)
228 #define AD4170_ADC_SETUPS_AFE_REF_BUF_M_MSK NO_OS_GENMASK(11,10)
229 #define AD4170_ADC_SETUPS_AFE_REF_BUF_P_MSK NO_OS_GENMASK(9,8)
230 #define AD4170_ADC_SETUPS_AFE_REF_SELECT_MSK NO_OS_GENMASK(6,5)
231 #define AD4170_ADC_SETUPS_AFE_BIPOLAR_MSK NO_OS_BIT(4)
232 #define AD4170_ADC_SETUPS_AFE_PGA_GAIN_MSK NO_OS_GENMASK(3,0)
235 #define AD4170_ADC_SETUPS_POST_FILTER_SEL_MSK NO_OS_GENMASK(7,4)
236 #define AD4170_ADC_SETUPS_FILTER_TYPE_MSK NO_OS_GENMASK(3,0)
239 #define AD4170_CURRENT_SOURCE_I_OUT_PIN_MSK NO_OS_GENMASK(12,8)
240 #define AD4170_CURRENT_SOURCE_I_OUT_VAL_MSK NO_OS_GENMASK(2,0)
243 #define AD4170_REF_CONTROL_REF_EN_MSK NO_OS_BIT(0)
246 #define AD4170_FIR_CONTROL_IIR_MODE_MSK NO_OS_BIT(15)
247 #define AD4170_FIR_CONTROL_FIR_MODE_MSK NO_OS_GENMASK(14,12)
248 #define AD4170_FIR_CONTROL_COEFF_SET_MSK NO_OS_BIT(10)
249 #define AD4170_FIR_CONTROL_FIR_LENGTH_MSK NO_OS_GENMASK(6,0)
252 #define AD4170_REG_DAC_SPAN_DAC_GAIN_MSK NO_OS_BIT(0)
255 #define AD4170_REG_DAC_CHANNEL_EN_DAC_EN_MSK NO_OS_BIT(0)
258 #define AD4170_REG_DAC_HW_TOGGLE_MASK_HW_TOGGLE_EN_MSK NO_OS_BIT(0)
261 #define AD4170_REG_DAC_HW_LDAC_MASK_HW_LDAC_EN_MSK NO_OS_BIT(0)
264 #define AD4170_REG_DAC_DATA_MSK NO_OS_GENMASK(11,0)
267 #define AD4170_REG_DAC_SW_TOGGLE_TRIGGERS_SW_TOGGLE_MSK NO_OS_BIT(0)
270 #define AD4170_REG_DAC_SW_LDAC_TRIGGERS_SW_LDAC_EN_MSK NO_OS_BIT(0)
272 #define AD4170_NUM_CHANNELS 16
273 #define AD4170_NUM_SETUPS 8
274 #define AD4170_NUM_CURRENT_SOURCE 4
275 #define AD4170_FIR_COEFF_MAX_LENGTH 72
1062 uint32_t *reg_data);
1080 uint16_t nb_samples);
1082 uint16_t nb_samples);
1084 uint16_t nb_samples);
1086 uint16_t nb_samples);
1088 uint16_t nb_samples);
1090 uint8_t *status_out, uint16_t nb_samples);
#define AD4170_ADC_SETUPS_AFE_REF_BUF_P_MSK
Definition: ad4170.h:229
int ad4170_set_pin_muxing(struct ad4170_dev *dev, struct ad4170_pin_muxing pin_muxing)
Set the AD4170 Pin Muxing settings.
Definition: ad4170.c:1043
struct ad4170_spi_settings spi_settings
Definition: ad4170.h:1007
@ AD4170_DCLKDIVBY8
Definition: ad4170.h:384
ad4170_pga_gain
PGA Gain Selection.
Definition: ad4170.h:667
@ AD4170_CHANNEL_NOT_TO_GPIO
Definition: ad4170.h:283
#define AD4170_REG_FIR_CONTROL
Definition: ad4170.h:99
@ AD4170_I_OUT_AIN0
Definition: ad4170.h:787
#define AD4170_REG_DAC_HW_TOGGLE_MASK_HW_TOGGLE_EN_MSK
Definition: ad4170.h:258
enum ad4170_fir_coeff_set coeff_set
Definition: ad4170.h:900
struct ad4170_adc_ctrl adc_ctrl
Definition: ad4170.h:949
@ AD4170_REFIN1_P
Definition: ad4170.h:545
int ad4170_set_fir_control(struct ad4170_dev *dev, struct ad4170_fir_control fir_control)
Set the AD4170 FIR control settings.
Definition: ad4170.c:1554
struct ad4170_ref_control ref_control
Definition: ad4170.h:959
@ AD4170_DLY_16384
Definition: ad4170.h:509
int ad4170_read16(struct ad4170_dev *dev, uint32_t *pbuf, uint16_t nb_samples)
Read multiple samples using direct register access from Data_16b.
Definition: ad4170.c:663
uint32_t timeout
Definition: ad413x.c:49
struct ad4170_config config
Definition: ad4170.h:1038
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
enum ad4170_fir_mode fir_mode
Definition: ad4170.h:898
#define AD4170_REG_CURRENT_SOURCE(n)
Definition: ad4170.h:98
Filter register settings.
Definition: ad4170.h:747
struct no_os_gpio_init_param * gpio_dig_aux2
Definition: ad4170.h:1017
@ AD4170_FIR_ASYM
Definition: ad4170.h:878
ad4170_cont_read
Configures continuous Data Register Read/Transmit.
Definition: ad4170.h:434
#define AD4170_REG_DAC_SW_TOGGLE_TRIGGERS
Definition: ad4170.h:109
struct ad4170_dac_config dac
Definition: ad4170.h:969
int ad4170_reset_spi_interface(struct ad4170_dev *dev)
Reset the SPI interface by sending reset sequence to device.
Definition: ad4170.c:404
int ad4170_set_dac_inputa(struct ad4170_dev *dev, uint16_t code)
Set the AD4170 DAC data by writing the INPUTA register to be loaded separately by LDAC or Toggle oper...
Definition: ad4170.c:1687
struct ad4170_pin_muxing pin_muxing
Definition: ad4170.h:939
#define AD4170_PRODUCT_ID_H_VALUE
Definition: ad4170.h:146
int ad4170_get_error(struct ad4170_dev *dev, uint16_t *error)
Get the Error register.
Definition: ad4170.c:1246
int ad4170_set_dac_inputb(struct ad4170_dev *dev, uint16_t code)
Set the AD4170 DAC data by writing the INPUTB register to be loaded separately by LDAC or Toggle oper...
Definition: ad4170.c:1699
enum ad4170_id id
Definition: ad4170.h:1026
@ AD4170_REF_BUF_PRE
Definition: ad4170.h:641
#define AD4170_REG_DAC_SPAN
Definition: ad4170.h:104
#define AD4170_NUM_SETUPS
Definition: ad4170.h:273
struct no_os_spi_init_param spi_init
Definition: ad4170.h:1028
int ad4170_set_channel_setup(struct ad4170_dev *dev, uint8_t ch, struct ad4170_channel_setup setup)
Set the AD4170 Channel specific setup.
Definition: ad4170.c:1330
#define AD4170_REG_ADC_SETUPS_FILTER_FS(n)
Definition: ad4170.h:92
struct no_os_gpio_desc * gpio_sync_inb
Definition: ad4170.h:1042
int ad4170_init(struct ad4170_dev **device, struct ad4170_init_param *init_param)
Initialize an AD4170 device structure.
Definition: ad4170.c:1754
FIR_Control register settings.
Definition: ad4170.h:896
uint32_t gain
Definition: ad4170.h:769
int ad4170_continuous_read_exit(struct ad4170_dev *dev)
Exit continuous read mode.
Definition: ad4170.c:913
@ AD4170_BURNOUT_10U
Definition: ad4170.h:619
@ AD4170_I_OUT_AIN10
Definition: ad4170.h:807
#define AD4170_CLOCK_CTRL_CLOCKDIV_MSK
Definition: ad4170.h:169
ad4170_i_out_val
Current Source Value.
Definition: ad4170.h:834
int ad4170_set_error(struct ad4170_dev *dev, uint16_t error)
Set the Error register with a value to clear specific errors.
Definition: ad4170.c:1235
@ AD4170_CHOP_OFF
Definition: ad4170.h:598
@ AD4170_MODE_POWER_DOWN
Definition: ad4170.h:459
ad4170_mode
ADC Operating Mode.
Definition: ad4170.h:447
ADC_Ctrl register settings.
Definition: ad4170.h:476
@ AD4170_I_OUT_AIN4
Definition: ad4170.h:795
@ AD4170_PGA_GAIN_1_PRECHARGE
Definition: ad4170.h:687
struct ad4170_channel_map map[AD4170_NUM_CHANNELS]
Definition: ad4170.h:955
@ AD4170_DIG_STR_DEFAULT
Definition: ad4170.h:337
@ AD4170_CHOP_IEXC_AB
Definition: ad4170.h:585
@ AD4170_FIR_COEFF_SET0
Definition: ad4170.h:887
int ad4170_set_clocksel(struct ad4170_dev *dev, enum ad4170_clocksel sel)
Set the AD4170 clock selection configuration.
Definition: ad4170.c:1139
ad4170_filter_type
Filter Mode for Sinc-Based Filters.
Definition: ad4170.h:734
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
@ AD4170_REFIN2_N
Definition: ad4170.h:548
struct ad4170_setup setups[AD4170_NUM_SETUPS]
Definition: ad4170.h:957
@ AD4170_MODE_CONT_IIR
Definition: ad4170.h:453
#define AD4170_REG_ADC_SETUPS_FILTER(n)
Definition: ad4170.h:91
#define AD4170_FIR_CONTROL_FIR_MODE_MSK
Definition: ad4170.h:247
@ AD4170_POST_FILTER_AVG16
Definition: ad4170.h:723
int ad4170_get_data24s(struct ad4170_dev *dev, uint32_t *data, uint8_t *status)
Get data and status from register Data_24b_Status.
Definition: ad4170.c:500
#define AD4170_CHANNEL_SETUPN_DELAY_N_MSK
Definition: ad4170.h:215
Header file of SPI Interface.
@ ID_AD4170
Definition: ad4170.h:990
int ad4170_set_spi_settings(struct ad4170_dev *dev, const struct ad4170_spi_settings *spi_settings)
Set the AD4170 SPI settings.
Definition: ad4170.c:1002
#define AD4170_REG_CHIP_TYPE
Definition: ad4170.h:62
AFE register settings.
Definition: ad4170.h:694
int ad4170_get_ch_data(struct ad4170_dev *dev, uint8_t ch, uint32_t *data)
Get data from register Data_Per_Channel[n].
Definition: ad4170.c:553
#define AD4170_REG_DAC_INPUTB(ch)
Definition: ad4170.h:112
@ AD4170_DIG_AUX2_LDAC
Definition: ad4170.h:296
int ad4170_set_ref_control(struct ad4170_dev *dev, bool enable)
Set the AD4170 Ref Control.
Definition: ad4170.c:1459
enum ad4170_cont_read cont_read
Definition: ad4170.h:484
enum ad4170_dig_aux1_ctrl dig_aux1_ctrl
Definition: ad4170.h:363
@ AD4170_I_OUT_AIN8
Definition: ad4170.h:803
#define AD4170_REG_CTRL_CONT_READ_MSK
Definition: ad4170.h:191
#define AD4170_REG_CHIP_GRADE
Definition: ad4170.h:65
int ad4170_read32(struct ad4170_dev *dev, uint32_t *pbuf, uint16_t nb_samples)
Read multiple samples using direct register access from Data_32b.
Definition: ad4170.c:715
#define AD4170_ADC_SETUPS_MISC_CHOP_ADC_MSK
Definition: ad4170.h:224
#define AD4170_REG_WRITE_14(x)
Definition: ad4170.h:58
@ AD4170_I_OUT_AIN1
Definition: ad4170.h:789
uint32_t offset
Definition: ad4170.h:767
int ad4170_set_fir_control(struct ad4170_dev *dev, struct ad4170_fir_control fir_control)
Set the AD4170 FIR control settings.
Definition: ad4170.c:1554
@ AD4170_BURNOUT_OFF
Definition: ad4170.h:613
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
@ ID_AD4172
Definition: ad4170.h:992
struct ad4170_misc misc
Definition: ad4170.h:759
int ad4170_dac_sw_ldac(struct ad4170_dev *dev, bool polarity)
Perform a software LDAC.
Definition: ad4170.c:1711
int ad4170_get_data24s(struct ad4170_dev *dev, uint32_t *data, uint8_t *status)
Get data and status from register Data_24b_Status.
Definition: ad4170.c:500
@ AD4170_POST_FILTER_AVG20
Definition: ad4170.h:725
#define AD4170_ADC_CTRL_PARALLEL_FILT_EN_MSK
Definition: ad4170.h:188
int ad4170_continuous_read_exit(struct ad4170_dev *dev)
Exit continuous read mode.
Definition: ad4170.c:913
Header file of Delay functions.
int ad4170_read24(struct ad4170_dev *dev, uint32_t *pbuf, uint16_t nb_samples)
Read multiple samples using direct register access from Data_24.
Definition: ad4170.c:689
int ad4170_set_dclk_div(struct ad4170_dev *dev, enum ad4170_dclk_div div)
Set the AD4170 DCLK configuration.
Definition: ad4170.c:1079
@ AD4170_POST_FILTER_60MS
Definition: ad4170.h:719
@ AD4170_I_OUT_1500UA
Definition: ad4170.h:850
#define AD4170_DATA_STATUS_POR_FLAG_S_MSK
Definition: ad4170.h:154
#define AD4170_CHANNEL_SETUPN_SETUP_N_MSK
Definition: ad4170.h:216
#define AD4170_REG_POWER_DOWN_SW
Definition: ad4170.h:82
int ad4170_set_error_en(struct ad4170_dev *dev, uint16_t error_en)
Set the AD4170 Error enable settings.
Definition: ad4170.c:1213
struct no_os_gpio_init_param * gpio_dig_aux1
Definition: ad4170.h:1015
#define AD4170_FIR_CONTROL_FIR_LENGTH_MSK
Definition: ad4170.h:249
@ AD4170_I_OUT_250UA
Definition: ad4170.h:844
struct no_os_gpio_desc * gpio_dig_aux2
Definition: ad4170.h:1052
@ AD4170_EXTERNAL_OSC
Definition: ad4170.h:412
enum ad4170_dclk_div dclk_divide
Definition: ad4170.h:423
ad4170_ref_buf
REFIN Buffer Enable.
Definition: ad4170.h:639
int ad4170_read24s(struct ad4170_dev *dev, uint32_t *pbuf, uint16_t nb_samples)
Read multiple samples using direct register access from Data_24_Status.
Definition: ad4170.c:702
@ AD4170_DLY_0
Definition: ad4170.h:495
#define AD4170_NUM_CURRENT_SOURCE
Definition: ad4170.h:274
@ AD4170_DIG_AUX2_SYNC
Definition: ad4170.h:298
#define AD4170_REG_DAC_SPAN_DAC_GAIN_MSK
Definition: ad4170.h:252
@ AD4170_REF_BUF_FULL
Definition: ad4170.h:643
@ AD4170_AIN12
Definition: ad4170.h:529
@ AD4170_I_OUT_50UA
Definition: ad4170.h:840
@ AD4170_PGA_GAIN_8
Definition: ad4170.h:675
@ AD4170_I_OUT_10UA
Definition: ad4170.h:838
@ AD4170_AVDD_AVSS_P
Definition: ad4170.h:536
Definition: ad9361_util.h:69
@ AD4170_CHOP_MUX
Definition: ad4170.h:600
#define AD4170_SPI_SYNC_PATTERN
Definition: ad4170.h:53
#define AD4170_ADC_SETUPS_MISC_CHOP_IEXC_MSK
Definition: ad4170.h:223
#define AD4170_REG_READ_6(x)
Definition: ad4170.h:55
#define AD4170_CLOCK_CTRL_DCLK_DIVIDE_MSK
Definition: ad4170.h:168
@ AD4170_SDO_RDY_CSB
Definition: ad4170.h:350
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
@ AD4170_BURNOUT_100N
Definition: ad4170.h:615
bool bipolar
Definition: ad4170.h:702
int ad4170_get_status(struct ad4170_dev *dev, uint16_t *status)
Get status from register Data_Status.
Definition: ad4170.c:576
#define AD4170_ADC_CTRL_MULTI_DATA_REG_SEL_MSK
Definition: ad4170.h:189
#define AD4170_REG_ADC_CHANNEL_SETUP(ch)
Definition: ad4170.h:87
@ AD4170_DCLKDIVBY1
Definition: ad4170.h:378
bool digif
Definition: ad4170.h:1054
uint16_t standby_ctrl
Definition: ad4170.h:943
#define AD4170_REG_ERROR_EN
Definition: ad4170.h:84
enum ad4170_sdo_rdby_dly sdo_rdby_dly
Definition: ad4170.h:369
int ad4170_set_mclk_div(struct ad4170_dev *dev, enum ad4170_mclk_div clk_div)
Set the AD4170 MCLK configuration.
Definition: ad4170.c:1109
@ AD4170_FILT_SINC3
Definition: ad4170.h:740
#define AD4170_REG_PRODUCT_ID_L
Definition: ad4170.h:63
@ AD4170_OPEN
Definition: ad4170.h:550
@ AD4170_AIN14
Definition: ad4170.h:531
enum ad4170_filter_type filter_type
Definition: ad4170.h:751
#define AD4170_REG_DAC_SW_TOGGLE_TRIGGERS_SW_TOGGLE_MSK
Definition: ad4170.h:267
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:49
#define AD4170_REG_ADC_CTRL
Definition: ad4170.h:83
@ AD4170_CHOP_IEXC_OFF
Definition: ad4170.h:583
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
ad4170_chop_iexc
Excitation Current Chopping Control.
Definition: ad4170.h:581
int ad4170_set_standby_ctrl(struct ad4170_dev *dev, uint16_t standby_ctrl)
Set the AD4170 Standby control settings.
Definition: ad4170.c:1169
@ AD4170_POST_FILTER_AVG24
Definition: ad4170.h:727
@ AD4170_I_OUT_AINCOM
Definition: ad4170.h:819
@ AD4170_DAC_GAIN_1
Definition: ad4170.h:913
#define AD4170_REG_DAC_INPUTA(ch)
Definition: ad4170.h:111
struct ad4170_clock_ctrl clock_ctrl
Definition: ad4170.h:941
#define AD4170_ADC_SETUPS_FILTER_TYPE_MSK
Definition: ad4170.h:236
int ad4170_set_powerdown_sw(struct ad4170_dev *dev, uint16_t powerdown_sw)
Set the AD4170 Powerdown switches settings.
Definition: ad4170.c:1191
@ AD4170_FIR_DEFAULT
Definition: ad4170.h:868
ad4170_dac_gain
DAC Output Span.
Definition: ad4170.h:911
#define AD4170_CURRENT_SOURCE_I_OUT_VAL_MSK
Definition: ad4170.h:240
@ AD4170_EXTERNAL_XTAL
Definition: ad4170.h:414
@ AD4170_DIG_AUX1_RDY
Definition: ad4170.h:311
int ad4170_regmap(struct ad4170_dev *dev)
Debugging function to print the register map to console.
Definition: ad4170.c:1962
int ad4170_get_data16s(struct ad4170_dev *dev, uint16_t *data, uint8_t *status)
Get data and status from register Data_16b_Status.
Definition: ad4170.c:451
@ AD4170_CHOP_IEXC_CD
Definition: ad4170.h:587
@ AD4170_PGA_GAIN_16
Definition: ad4170.h:677
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:115
@ AD4170_DIG_AUX1_SYNC
Definition: ad4170.h:313
int ad4170_read16s(struct ad4170_dev *dev, uint32_t *pbuf, uint16_t nb_samples)
Read multiple samples using direct register access from Data_16b_Status.
Definition: ad4170.c:676
@ AD4170_AIN11
Definition: ad4170.h:528
@ AD4170_FIR_ANTISYM_ODD
Definition: ad4170.h:874
@ AD4170_INTERNAL_OSC_OUTPUT
Definition: ad4170.h:410
#define AD4170_INTERFACE_CONFIG_C_CRC(x)
Definition: ad4170.h:130
int ad4170_read24(struct ad4170_dev *dev, uint32_t *pbuf, uint16_t nb_samples)
Read multiple samples using direct register access from Data_24.
Definition: ad4170.c:689
@ AD4170_AIN10
Definition: ad4170.h:527
uint16_t powerdown_sw
Definition: ad4170.h:945
#define AD4170_REG_DAC_HW_LDAC_MASK
Definition: ad4170.h:107
@ AD4170_MODE_SELF_OFFSET_CAL
Definition: ad4170.h:467
#define AD4170_REG_COEFF_READ_DATA
Definition: ad4170.h:101
int ad4170_spi_reg_write_mask(struct ad4170_dev *dev, uint32_t reg_addr, uint8_t mask, uint32_t reg_data)
SPI write device register using a mask.
Definition: ad4170.c:381
int ad4170_regmap(struct ad4170_dev *dev)
Debugging function to print the register map to console.
Definition: ad4170.c:1962
#define ECOMM
Definition: ad4170.h:43
@ AD4170_FIR_ANTISYM_EVEN
Definition: ad4170.h:876
#define AD4170_REG_REF_CONTROL
Definition: ad4170.h:95
enum ad4170_sync_ctrl sync_ctrl
Definition: ad4170.h:365
@ AD4170_DLY_256
Definition: ad4170.h:499
#define AD4170_REG_ADC_SETUPS_OFFSET(n)
Definition: ad4170.h:93
#define AD4170_FIR_COEFF_MAX_LENGTH
Definition: ad4170.h:275
int ad4170_set_channel_map(struct ad4170_dev *dev, uint8_t ch, struct ad4170_channel_map map)
Set the AD4170 Channel specific map.
Definition: ad4170.c:1358
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
int ad4170_get_ch_data(struct ad4170_dev *dev, uint8_t ch, uint32_t *data)
Get data from register Data_Per_Channel[n].
Definition: ad4170.c:553
int ad4170_set_powerdown_sw(struct ad4170_dev *dev, uint16_t powerdown_sw)
Set the AD4170 Powerdown switches settings.
Definition: ad4170.c:1191
int ad4170_set_channel_setup(struct ad4170_dev *dev, uint8_t ch, struct ad4170_channel_setup setup)
Set the AD4170 Channel specific setup.
Definition: ad4170.c:1330
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
@ AD4170_CHOP_ACX_4PIN
Definition: ad4170.h:602
int ad4170_spi_reg_read(struct ad4170_dev *dev, uint32_t reg_addr, uint32_t *reg_data)
Read device register.
Definition: ad4170.c:230
int ad4170_remove(struct ad4170_dev *dev)
Remove the device and free al the resources.
Definition: ad4170.c:1949
ad4170_fir_mode
Selects FIR Type.
Definition: ad4170.h:866
struct no_os_spi_init_param spi_init
Definition: ad4170.h:1005
@ AD4170_I_OUT_AIN11
Definition: ad4170.h:809
struct ad4170_filter filter
Definition: ad4170.h:763
Pin_Muxing register settings.
Definition: ad4170.h:357
#define AD4170_INTERFACE_CONFIG_B_SHORT_INSTRUCTION_MSK
Definition: ad4170.h:125
@ AD4170_I_OUT_AIN6
Definition: ad4170.h:799
bool cont_read_status_en
Definition: ad4170.h:482
ad4170_burnout
Burnout Current Values.
Definition: ad4170.h:611
struct ad4170_fir_control fir_control
Definition: ad4170.h:967
#define AD4170_ADC_SETUPS_AFE_BIPOLAR_MSK
Definition: ad4170.h:231
int ad4170_spi_reg_write_mask(struct ad4170_dev *dev, uint32_t reg_addr, uint8_t mask, uint32_t reg_data)
SPI write device register using a mask.
Definition: ad4170.c:381
#define AD4170_PIN_MUXING_DIG_OUT_STR_MSK
Definition: ad4170.h:164
ad4170_ref_select
ADC Reference Selection.
Definition: ad4170.h:652
#define AD4170_INTERFACE_CONFIG_B_SHORT_INSTRUCTION(x)
Definition: ad4170.h:126
int ad4170_set_dclk_div(struct ad4170_dev *dev, enum ad4170_dclk_div clk_div)
Set the AD4170 DCLK configuration.
Definition: ad4170.c:1079
@ AD4170_ALDO
Definition: ad4170.h:541
@ AD4170_IOVDD_DGND_N
Definition: ad4170.h:539
#define AD4170_REG_DAC_HW_TOGGLE_MASK
Definition: ad4170.h:106
ad4170_dig_aux2_ctrl
Configures Functionality of DIG_AUX2 Pin.
Definition: ad4170.h:292
@ AD4170_INTERNAL_OSC
Definition: ad4170.h:408
int ad4170_dac_sw_ldac(struct ad4170_dev *dev, bool polarity)
Perform a software LDAC.
Definition: ad4170.c:1711
@ AD4170_CLKDIVBY1
Definition: ad4170.h:393
void no_os_crc8_populate_msb(uint8_t *table, const uint8_t polynomial)
#define AD4170_REG_DAC_SW_LDAC_TRIGGERS
Definition: ad4170.h:110
int ad4170_get_data16(struct ad4170_dev *dev, uint16_t *data)
Get data from register Data_16b.
Definition: ad4170.c:427
#define AD4190_PRODUCT_ID_H_VALUE
Definition: ad4170.h:150
NO_OS_DECLARE_CRC8_TABLE(ad4170_crc8)
Ref_Control register settings.
Definition: ad4170.h:776
#define AD4170_REG_ERROR
Definition: ad4170.h:85
enum ad4170_id id
Definition: ad4170.h:1003
Misc register settings.
Definition: ad4170.h:626
enum ad4170_pga_gain pga_gain
Definition: ad4170.h:704
bool ref_en
Definition: ad4170.h:778
@ AD4170_SYNC_STANDARD
Definition: ad4170.h:326
#define AD4170_REG_PRODUCT_ID_H
Definition: ad4170.h:64
int ad4170_set_standby_ctrl(struct ad4170_dev *dev, uint16_t standby_ctrl)
Set the AD4170 Standby control settings.
Definition: ad4170.c:1169
ad4170_dclk_div
Continuous Transmit Data Clock Divider.
Definition: ad4170.h:376
@ AD4170_AIN16
Definition: ad4170.h:533
@ AD4170_REFIN_REFIN2
Definition: ad4170.h:656
@ AD4170_DCLKDIVBY2
Definition: ad4170.h:380
int ad4170_set_mclk_div(struct ad4170_dev *dev, enum ad4170_mclk_div div)
Set the AD4170 MCLK configuration.
Definition: ad4170.c:1109
enum ad4170_dig_aux2_ctrl dig_aux2_ctrl
Definition: ad4170.h:361
@ AD4170_I_OUT_AIN2
Definition: ad4170.h:791
enum ad4170_i_out_pin i_out_pin
Definition: ad4170.h:858
int ad4170_set_setup(struct ad4170_dev *dev, uint8_t n, struct ad4170_setup setup)
Configure an ADC setup.
Definition: ad4170.c:1385
@ AD4170_AIN13
Definition: ad4170.h:530
int ad4170_read16(struct ad4170_dev *dev, uint32_t *pbuf, uint16_t nb_samples)
Read multiple samples using direct register access from Data_16b.
Definition: ad4170.c:663
int ad4170_continuous_read(struct ad4170_dev *dev, uint32_t *data_out, uint8_t *status_out, uint16_t nb_samples)
Read multiple samples in continuous read mode.
Definition: ad4170.c:803
AD4170 configuration.
Definition: ad4170.h:937
#define AD4170_CHANNEL_MAPN_AINP_MSK
Definition: ad4170.h:219
@ AD4170_DIG_AUX1_MODOUT
Definition: ad4170.h:315
Channel_Setup register settings.
Definition: ad4170.h:557
int ad4170_continuous_transmit_exit(struct ad4170_dev *dev)
Exit continuous transmit mode.
Definition: ad4170.c:938
struct ad4170_config ad4170_config_reset
Definition: ad4170.c:46
int ad4170_get_status(struct ad4170_dev *dev, uint16_t *status)
Get status from register Data_Status.
Definition: ad4170.c:576
#define AD4170_ADC_SETUPS_AFE_PGA_GAIN_MSK
Definition: ad4170.h:232
uint16_t i_pullup
Definition: ad4170.h:963
@ AD4170_IOVDD_DGND_P
Definition: ad4170.h:538
#define AD4170_REG_DAC_HW_LDAC_MASK_HW_LDAC_EN_MSK
Definition: ad4170.h:261
@ AD4170_I_OUT_100UA
Definition: ad4170.h:842
#define AD4170_PIN_MUXING_CHAN_TO_GPIO_MSK
Definition: ad4170.h:160
#define AD4170_CHANNEL(ch)
Definition: ad4170.h:211
@ ID_AD4195
Definition: ad4170.h:994
struct no_os_gpio_init_param * gpio_sync_inb_init
Definition: ad4170.h:1040
uint16_t v_bias
Definition: ad4170.h:961
int ad4170_reset(struct ad4170_dev *dev)
Perform a software reset.
Definition: ad4170.c:972
int ad4170_set_i_pullup(struct ad4170_dev *dev, uint16_t ch_mask)
Set the AD4170 Input pullup.
Definition: ad4170.c:1503
bool parallel_filt_en
Definition: ad4170.h:478
@ AD4170_AIN3
Definition: ad4170.h:520
@ AD4170_CLKDIVBY4
Definition: ad4170.h:397
@ AD4170_MODE_CONT
Definition: ad4170.h:449
#define AD4170_REG_DAC_CHANNEL_EN
Definition: ad4170.h:105
@ AD4170_I_OUT_AIN5
Definition: ad4170.h:797
uint32_t rdy_conv_timeout
Definition: ad4170.h:1009
bool hw_toggle
Definition: ad4170.h:928
@ AD4170_REFIN_REFIN1
Definition: ad4170.h:654
#define AD4170_SW_RESET_MSK
Definition: ad4170.h:118
int ad4170_set_clocksel(struct ad4170_dev *dev, enum ad4170_clocksel sel)
Set the AD4170 clock selection configuration.
Definition: ad4170.c:1139
#define AD4170_REG_SCRATCH_PAD
Definition: ad4170.h:66
@ AD4170_MODE_SYS_GAIN_CAL
Definition: ad4170.h:465
#define AD4170_CURRENT_SOURCE_I_OUT_PIN_MSK
Definition: ad4170.h:239
@ AD4170_PGA_GAIN_1
Definition: ad4170.h:669
#define AD4170_REG_DATA_24b_STATUS
Definition: ad4170.h:76
struct ad4170_config config
Definition: ad4170.h:1011
@ AD4170_AVSS
Definition: ad4170.h:543
uint16_t filter_fs
Definition: ad4170.h:765
#define AD4170_REG_V_BIAS
Definition: ad4170.h:96
#define AD4170_REG_DATA_16b_STATUS
Definition: ad4170.h:74
#define AD4170_PIN_MUXING_DIG_AUX1_CTRL_MSK
Definition: ad4170.h:162
ad4170_sync_ctrl
Configures SYNC_IN Pin for ADC Synchronization.
Definition: ad4170.h:322
@ AD4170_I_OUT_GPIO2
Definition: ad4170.h:825
#define AD4170_TRANSF_LEN(x)
Definition: ad4170.h:50
int ad4170_set_current_source(struct ad4170_dev *dev, uint8_t n, struct ad4170_current_source current_source)
Set the AD4170 Excitation Current.
Definition: ad4170.c:1526
@ AD4170_DIG_STR_HIGH
Definition: ad4170.h:339
enum ad4170_ref_buf ref_buf_m
Definition: ad4170.h:696
Sequencer Setup register settings.
Definition: ad4170.h:758
@ AD4170_AIN6
Definition: ad4170.h:523
#define AD4170_REG_DEVICE_CONFIG
Definition: ad4170.h:61
ad4170_fir_coeff_set
Selects FIR coefficient set.
Definition: ad4170.h:885
uint8_t setup_n
Definition: ad4170.h:563
int ad4170_set_error_en(struct ad4170_dev *dev, uint16_t error_en)
Set the AD4170 Error enable settings.
Definition: ad4170.c:1213
int ad4170_reset_spi_interface(struct ad4170_dev *dev)
Reset the SPI interface by sending reset sequence to device.
Definition: ad4170.c:404
#define AD4170_REG_INTERFACE_CONFIG_B
Definition: ad4170.h:60
bool big_endian
Definition: ad4170.h:1036
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
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
enum ad4170_dig_out_str dig_out_str
Definition: ad4170.h:367
@ AD4170_DAC
Definition: ad4170.h:540
int ad4170_set_current_source(struct ad4170_dev *dev, uint8_t n, struct ad4170_current_source current_source)
Set the AD4170 Excitation Current.
Definition: ad4170.c:1526
#define AD4170_ADC_CTRL_CONT_READ_STATUS_EN_MSK
Definition: ad4170.h:190
@ AD4170_CHOP_IEXC_ABCD
Definition: ad4170.h:589
ad4170_ain
Multiplexer Positive/Negative Input for This Channel.
Definition: ad4170.h:516
@ AD4170_MODE_SYS_OFFSET_CAL
Definition: ad4170.h:463
bool hw_ldac
Definition: ad4170.h:930
#define AD4170_REG_CTRL_MODE_MSK
Definition: ad4170.h:192
#define AD4170_REG_DATA_PER_CHANNEL(ch)
Definition: ad4170.h:78
ad4170_dig_out_str
Configures the drive strength of the Digital Outputs.
Definition: ad4170.h:335
uint8_t fir_length
Definition: ad4170.h:902
int ad4170_get_data16(struct ad4170_dev *dev, uint16_t *data)
Get data from register Data_16b.
Definition: ad4170.c:427
struct ad4170_channel_setup setup[AD4170_NUM_CHANNELS]
Definition: ad4170.h:953
int ad4170_set_channel_map(struct ad4170_dev *dev, uint8_t ch, struct ad4170_channel_map map)
Set the AD4170 Channel specific map.
Definition: ad4170.c:1358
uint8_t repeat_n
Definition: ad4170.h:559
enum ad4170_clocksel clocksel
Definition: ad4170.h:427
@ AD4170_REFIN1_N
Definition: ad4170.h:546
#define AD4170_ADC_SETUPS_AFE_REF_SELECT_MSK
Definition: ad4170.h:230
@ AD4170_PGA_GAIN_64
Definition: ad4170.h:681
int ad4170_set_error(struct ad4170_dev *dev, uint16_t error)
Set the Error register with a value to clear specific errors.
Definition: ad4170.c:1235
int ad4170_set_adc_ctrl(struct ad4170_dev *dev, struct ad4170_adc_ctrl adc_ctrl)
Set the AD4170 ADC Control.
Definition: ad4170.c:1269
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
@ AD4170_DIG_AUX2_MODOUT
Definition: ad4170.h:300
int ad4170_set_dac_data(struct ad4170_dev *dev, uint16_t code)
Set the AD4170 DAC data by directly writing the DAT_DATA register.
Definition: ad4170.c:1675
@ AD4170_PGA_GAIN_0P5
Definition: ad4170.h:685
bool short_instruction
Definition: ad4170.h:978
@ AD4170_CONT_READ_ON
Definition: ad4170.h:438
@ AD4170_REFIN_AVDD
Definition: ad4170.h:660
#define AD4170_REG_VENDOR_H
Definition: ad4170.h:69
Header file for the ad4170 driver.
int32_t * fir_coefficients
Definition: ad4170.h:904
#define AD4170_PIN_MUXING_SYNC_CTRL_MSK
Definition: ad4170.h:163
int ad4170_continuous_transmit_exit(struct ad4170_dev *dev)
Exit continuous transmit mode.
Definition: ad4170.c:938
@ ID_AD4190
Definition: ad4170.h:993
@ AD4170_I_OUT_GPIO1
Definition: ad4170.h:823
int ad4170_read24s(struct ad4170_dev *dev, uint32_t *pbuf, uint16_t nb_samples)
Read multiple samples using direct register access from Data_24_Status.
Definition: ad4170.c:702
@ AD4170_AIN15
Definition: ad4170.h:532
struct no_os_gpio_init_param * gpio_dig_aux2_init
Definition: ad4170.h:1048
@ AD4170_I_OUT_AIN14
Definition: ad4170.h:815
enum ad4170_dac_gain gain
Definition: ad4170.h:926
#define AD4170_PIN_MUXING_DIG_AUX2_CTRL_MSK
Definition: ad4170.h:161
#define AD4170_REG_SPI_REVISION
Definition: ad4170.h:67
int ad4170_dac_sw_toggle(struct ad4170_dev *dev, bool polarity)
Perform a software toggle.
Definition: ad4170.c:1723
@ AD4170_I_OUT_AIN15
Definition: ad4170.h:817
int ad4170_set_dac_config(struct ad4170_dev *dev, struct ad4170_dac_config config)
Set the AD4170 DAC settings.
Definition: ad4170.c:1619
#define AD4170_PRODUCT_ID_L_VALUE
Definition: ad4170.h:145
@ AD4170_REF_BUF_BYPASS
Definition: ad4170.h:645
@ AD4170_MODE_IDLE
Definition: ad4170.h:461
#define AD4170_REG_CHANNEL_EN
Definition: ad4170.h:86
#define AD4170_REG_PIN_MUXING
Definition: ad4170.h:79
@ AD4170_FILT_SINC5
Definition: ad4170.h:738
#define AD4170_REG_DAC_SW_LDAC_TRIGGERS_SW_LDAC_EN_MSK
Definition: ad4170.h:270
bool multi_data_reg_sel
Definition: ad4170.h:480
Channel_Map register settings. Selects Analog Inputs for This Sequencer Channel.
Definition: ad4170.h:570
#define AD4170_REG_READ_14(x)
Definition: ad4170.h:57
@ AD4170_FILT_SINC5_AVG
Definition: ad4170.h:736
AD4170 SPI init paraeter structure, used for initializing the ad4170_dev.
Definition: ad4170.h:1001
int ad4170_init(struct ad4170_dev **device, struct ad4170_init_param *init_param)
Initialize an AD4170 device structure.
Definition: ad4170.c:1754
#define AD4170_REG_DAC_DATA_MSK
Definition: ad4170.h:264
@ AD4170_POST_FILTER_NONE
Definition: ad4170.h:713
@ AD4170_AVDD_AVSS_N
Definition: ad4170.h:537
enum ad4170_mclk_div clockdiv
Definition: ad4170.h:425
@ AD4170_AIN0
Definition: ad4170.h:517
int ad4170_spi_reg_read(struct ad4170_dev *dev, uint32_t reg_addr, uint32_t *reg_data)
Read device register.
Definition: ad4170.c:230
struct no_os_gpio_init_param * gpio_sync_inb
Definition: ad4170.h:1013
int ad4170_set_channel_en(struct ad4170_dev *dev, uint16_t channel_en)
Enable AD4170 channels.
Definition: ad4170.c:1307
@ AD4170_FIR_COEFF_SET1
Definition: ad4170.h:889
#define AD4170_REG_DAC_DATA(ch)
Definition: ad4170.h:108
struct ad4170_config ad4170_config_reset
Definition: ad4170.c:46
#define AD4170_REG_I_PULLUP
Definition: ad4170.h:97
#define NO_OS_BIT(x)
Definition: no_os_util.h:45
uint8_t no_os_crc8(const uint8_t *table, const uint8_t *pdata, size_t nbytes, uint8_t crc)
@ AD4170_CLKDIVBY2
Definition: ad4170.h:395
@ AD4170_DLDO
Definition: ad4170.h:542
int ad4170_set_i_pullup(struct ad4170_dev *dev, uint16_t ch_mask)
Set the AD4170 Input pullup.
Definition: ad4170.c:1503
@ ID_AD4171
Definition: ad4170.h:991
@ AD4170_PGA_GAIN_4
Definition: ad4170.h:673
@ AD4170_CHOP_ACX_2PIN
Definition: ad4170.h:604
#define AD4170_ADDR(x)
Definition: ad4170.h:51
@ AD4170_CHANNEL_TO_GPIO
Definition: ad4170.h:285
Current_Source register settings.
Definition: ad4170.h:857
@ AD4170_REFIN2_P
Definition: ad4170.h:547
@ AD4170_REFIN_REFOUT
Definition: ad4170.h:658
@ AD4170_AIN9
Definition: ad4170.h:526
struct ad4170_current_source current_source[AD4170_NUM_CURRENT_SOURCE]
Definition: ad4170.h:965
#define AD4170_CHANNEL_SETUPN_REPEAT_N_MSK
Definition: ad4170.h:214
#define AD4170_PIN_MUXING_SDO_RDBY_DLY_MSK
Definition: ad4170.h:165
ad4170_dig_aux1_ctrl
Configures Functionality of DIG_AUX1 Pin.
Definition: ad4170.h:307
#define AD4170_ADC_SETUPS_MISC_BURNOUT_MSK
Definition: ad4170.h:225
unsigned int no_os_hweight8(uint8_t word)
uint16_t error_en
Definition: ad4170.h:947
#define AD4170_FIR_CONTROL_COEFF_SET_MSK
Definition: ad4170.h:248
enum ad4170_mode mode
Definition: ad4170.h:486
@ AD4170_MODE_SINGLE
Definition: ad4170.h:455
enum ad4170_i_out_val i_out_val
Definition: ad4170.h:859
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
int ad4170_get_data16s(struct ad4170_dev *dev, uint16_t *data, uint8_t *status)
Get data and status from register Data_16b_Status.
Definition: ad4170.c:451
#define AD4170_REG_COEFF_WRRD_STB
Definition: ad4170.h:103
@ AD4170_TEMP_SENSOR_P
Definition: ad4170.h:534
enum ad4170_burnout burnout
Definition: ad4170.h:632
enum ad4170_chop_adc chop_adc
Definition: ad4170.h:630
@ AD4170_I_OUT_AIN13
Definition: ad4170.h:813
@ AD4170_MODE_CONT_FIR
Definition: ad4170.h:451
@ AD4170_I_OUT_GPIO0
Definition: ad4170.h:821
ad4170_post_filter
Optional Post-Filter configuration.
Definition: ad4170.h:711
#define AD4190_PRODUCT_ID_L_VALUE
Definition: ad4170.h:149
@ AD4170_AIN1
Definition: ad4170.h:518
int ad4170_dac_sw_toggle(struct ad4170_dev *dev, bool polarity)
Perform a software toggle.
Definition: ad4170.c:1723
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
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
int ad4170_continuous_read(struct ad4170_dev *dev, uint32_t *data_out, uint8_t *status_out, uint16_t nb_samples)
Read multiple samples in continuous read mode.
Definition: ad4170.c:803
enum ad4170_chan_to_gpio chan_to_gpio
Definition: ad4170.h:359
@ AD4170_REFOUT
Definition: ad4170.h:549
#define AD4170_REG_ADC_SETUPS_MISC(n)
Definition: ad4170.h:89
int ad4170_get_data32(struct ad4170_dev *dev, uint32_t *data)
Get data from register Data_32b.
Definition: ad4170.c:525
int ad4170_remove(struct ad4170_dev *dev)
Remove the device and free al the resources.
Definition: ad4170.c:1949
ad4170_id
Device selector ID.
Definition: ad4170.h:989
enum ad4170_chop_iexc chop_iexc
Definition: ad4170.h:628
#define AD4170_ADC_SETUPS_AFE_REF_BUF_M_MSK
Definition: ad4170.h:228
#define AD4170_REG_COEFF_WRITE_DATA
Definition: ad4170.h:100
bool enabled
Definition: ad4170.h:924
ad4170_delay_n
Delay to Add After Channel Switch.
Definition: ad4170.h:493
int ad4170_spi_reg_write(struct ad4170_dev *dev, uint32_t reg_addr, uint32_t reg_data)
Write device register.
Definition: ad4170.c:307
#define AD4170_ADC_SETUPS_POST_FILTER_SEL_MSK
Definition: ad4170.h:235
ad4170_sdo_rdby_dly
Reset Interface on CS or SCLK.
Definition: ad4170.h:346
int ad4170_dac_hw_toggle(struct ad4170_dev *dev, bool polarity)
Perform a hardware toggle using the DIG_AUX2 pin, assumed to be pre-configured for this.
Definition: ad4170.c:1735
@ AD4170_POST_FILTER_50MS
Definition: ad4170.h:717
@ AD4170_DLY_4096
Definition: ad4170.h:505
@ AD4170_I_OUT_AIN9
Definition: ad4170.h:805
@ AD4170_POST_FILTER_40MS
Definition: ad4170.h:715
@ AD4170_SYNC_ALTERNATE
Definition: ad4170.h:328
#define AD4170_REG_ADC_SETUPS_GAIN(n)
Definition: ad4170.h:94
bool dig_aux2_output
Definition: ad4170.h:1050
bool sync_loss_detect
Definition: ad4170.h:982
int ad4170_set_dac_inputa(struct ad4170_dev *dev, uint16_t code)
Set the AD4170 DAC data by writing the INPUTA register to be loaded separately by LDAC or Toggle oper...
Definition: ad4170.c:1687
ad4170_chop_adc
ADC/Mux Chopping Control.
Definition: ad4170.h:596
int ad4170_get_data24(struct ad4170_dev *dev, uint32_t *data)
Get data from register Data_24b.
Definition: ad4170.c:476
int ad4170_get_data32(struct ad4170_dev *dev, uint32_t *data)
Get data from register Data_32b.
Definition: ad4170.c:525
@ AD4170_PGA_GAIN_2
Definition: ad4170.h:671
@ AD4170_DLY_2048
Definition: ad4170.h:503
int ad4170_reset(struct ad4170_dev *dev)
Perform a software reset.
Definition: ad4170.c:972
int ad4170_get_error(struct ad4170_dev *dev, uint16_t *error)
Get the Error register.
Definition: ad4170.c:1246
#define AD4170_REG_STANDBY_CTRL
Definition: ad4170.h:81
@ AD4170_POST_FILTER_FAST_AC
Definition: ad4170.h:721
int ad4170_read16s(struct ad4170_dev *dev, uint32_t *pbuf, uint16_t nb_samples)
Read multiple samples using direct register access from Data_16b_Status.
Definition: ad4170.c:676
int ad4170_set_v_bias(struct ad4170_dev *dev, uint16_t ch_mask)
Set the AD4170 Voltage bias.
Definition: ad4170.c:1481
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
#define AD4170_NUM_CHANNELS
Definition: ad4170.h:272
int ad4170_set_channel_en(struct ad4170_dev *dev, uint16_t channel_en)
Enable AD4170 channels.
Definition: ad4170.c:1307
#define AD4170_INTERFACE_CONFIG_C_CRC_MSK
Definition: ad4170.h:129
@ AD4170_I_OUT_1000UA
Definition: ad4170.h:848
@ AD4170_DCLKDIVBY4
Definition: ad4170.h:382
Header file of GPIO Interface.
@ AD4170_FIR_SYM_EVEN
Definition: ad4170.h:872
int ad4170_set_adc_ctrl(struct ad4170_dev *dev, struct ad4170_adc_ctrl adc_ctrl)
Set the AD4170 ADC Control.
Definition: ad4170.c:1269
int ad4170_set_dac_data(struct ad4170_dev *dev, uint16_t code)
Set the AD4170 DAC data by directly writing the DAT_DATA register.
Definition: ad4170.c:1675
int ad4170_set_ref_control(struct ad4170_dev *dev, bool enable)
Set the AD4170 Ref Control.
Definition: ad4170.c:1459
@ AD4170_AIN8
Definition: ad4170.h:525
ad4170_mclk_div
Master Clock Divider.
Definition: ad4170.h:391
@ AD4170_DLY_16
Definition: ad4170.h:497
uint16_t channel_en
Definition: ad4170.h:951
int ad4170_read32(struct ad4170_dev *dev, uint32_t *pbuf, uint16_t nb_samples)
Read multiple samples using direct register access from Data_32b.
Definition: ad4170.c:715
int ad4170_set_setup(struct ad4170_dev *dev, uint8_t n, struct ad4170_setup setup)
Configure an ADC setup.
Definition: ad4170.c:1385
enum ad4170_ref_select ref_select
Definition: ad4170.h:700
@ AD4170_DAC_GAIN_2
Definition: ad4170.h:915
#define AD4170_REG_CLOCK_CTRL
Definition: ad4170.h:80
@ AD4170_AIN2
Definition: ad4170.h:519
#define AD4170_REG_COEFF_ADDRESS
Definition: ad4170.h:102
@ AD4170_DGND
Definition: ad4170.h:544
int ad4170_set_dac_config(struct ad4170_dev *dev, struct ad4170_dac_config config)
Set the AD4170 DAC settings.
Definition: ad4170.c:1619
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
@ AD4170_MODE_STANDBY
Definition: ad4170.h:457
int ad4170_get_data24(struct ad4170_dev *dev, uint32_t *data)
Get data from register Data_24b.
Definition: ad4170.c:476
@ AD4170_DIG_AUX1_DISABLED
Definition: ad4170.h:309
#define AD4170_REG_DAC_CHANNEL_EN_DAC_EN_MSK
Definition: ad4170.h:255
int ad4170_set_v_bias(struct ad4170_dev *dev, uint16_t ch_mask)
Set the AD4170 Voltage bias.
Definition: ad4170.c:1481
bool crc_enabled
Definition: ad4170.h:980
#define AD4170_CHANNEL_MAPN_AINM_MSK
Definition: ad4170.h:220
@ AD4170_PGA_GAIN_128
Definition: ad4170.h:683
Header file of utility functions.
#define AD4170_SW_RESETX_MSK
Definition: ad4170.h:121
@ AD4170_MODE_SELF_GAIN_CAL
Definition: ad4170.h:469
@ AD4170_AIN5
Definition: ad4170.h:522
#define AD4170_CRC8_INITIAL_VALUE
Definition: ad4170.h:134
@ AD4170_DIG_AUX2_DISABLED
Definition: ad4170.h:294
ad4170_i_out_pin
Current Source Destination.
Definition: ad4170.h:785
struct ad4170_spi_settings spi_settings
Definition: ad4170.h:1032
#define AD4170_REG_ADC_SETUPS_AFE(n)
Definition: ad4170.h:90
struct no_os_gpio_desc * gpio_dig_aux1
Definition: ad4170.h:1046
#define AD4170_REG_DATA_16b
Definition: ad4170.h:73
#define AD4170_REG_DATA_24b
Definition: ad4170.h:75
Clock_Ctrl register settings.
Definition: ad4170.h:421
@ AD4170_CONT_TRANSMIT_ON
Definition: ad4170.h:440
uint32_t rdy_conv_timeout
Definition: ad4170.h:1034
#define AD4170_REG_INTERFACE_CONFIG_C
Definition: ad4170.h:70
AD4170 device descriptor.
Definition: ad4170.h:1024
#define AD4170_REG_DATA_32b
Definition: ad4170.h:77
enum ad4170_ain ainm
Definition: ad4170.h:574
#define AD4170_REG_WRITE_6(x)
Definition: ad4170.h:56
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
enum ad4170_ref_buf ref_buf_p
Definition: ad4170.h:698
@ AD4170_I_OUT_500UA
Definition: ad4170.h:846
DAC Config settings (registers HW_LDAC_Mask, HW_Toggle_Mask, Channel_En and DAC_Span)
Definition: ad4170.h:922
@ AD4170_I_OUT_GPIO3
Definition: ad4170.h:827
enum ad4170_ain ainp
Definition: ad4170.h:572
int ad4170_spi_reg_write(struct ad4170_dev *dev, uint32_t reg_addr, uint32_t reg_data)
Write device register.
Definition: ad4170.c:307
@ AD4170_I_OUT_AIN3
Definition: ad4170.h:793
int ad4170_dac_hw_toggle(struct ad4170_dev *dev, bool polarity)
Perform a hardware toggle using the DIG_AUX2 pin, assumed to be pre-configured for this.
Definition: ad4170.c:1735
AD4170 SPI settings.
Definition: ad4170.h:976
@ AD4170_SYNC_DISABLED
Definition: ad4170.h:324
int ad4170_set_dac_inputb(struct ad4170_dev *dev, uint16_t code)
Set the AD4170 DAC data by writing the INPUTB register to be loaded separately by LDAC or Toggle oper...
Definition: ad4170.c:1699
int ad4170_set_pin_muxing(struct ad4170_dev *dev, struct ad4170_pin_muxing pin_muxing)
Set the AD4170 Pin Muxing settings.
Definition: ad4170.c:1043
#define AD4170_REG_VENDOR_L
Definition: ad4170.h:68
@ AD4170_I_OUT_AIN7
Definition: ad4170.h:801
struct no_os_gpio_init_param * gpio_dig_aux1_init
Definition: ad4170.h:1044
#define AD4170_REG_DATA_STATUS
Definition: ad4170.h:72
@ AD4170_I_OUT_AIN12
Definition: ad4170.h:811
@ AD4170_DLY_1024
Definition: ad4170.h:501
#define AD4170_CLOCK_CTRL_CLOCKSEL_MSK
Definition: ad4170.h:170
Header file of CRC-8 computation.
@ AD4170_PGA_GAIN_32
Definition: ad4170.h:679
@ AD4170_CLKDIVBY8
Definition: ad4170.h:399
@ AD4170_AIN4
Definition: ad4170.h:521
#define AD4170_REG_INTERFACE_CONFIG_A
Definition: ad4170.h:59
enum ad4170_post_filter post_filter_sel
Definition: ad4170.h:749
@ AD4170_AIN7
Definition: ad4170.h:524
@ AD4170_DLY_8192
Definition: ad4170.h:507
@ AD4170_CONT_READ_OFF
Definition: ad4170.h:436
#define AD4170_REG_ADC_CHANNEL_MAP(ch)
Definition: ad4170.h:88
@ AD4170_BURNOUT_2U
Definition: ad4170.h:617
@ AD4170_I_OUT_0UA
Definition: ad4170.h:836
ad4170_clocksel
ADC Clock Select.
Definition: ad4170.h:406
@ AD4170_FIR_SYM_ODD
Definition: ad4170.h:870
struct no_os_spi_desc * spi_desc
Definition: ad4170.h:1030
@ AD4170_TEMP_SENSOR_N
Definition: ad4170.h:535
@ AD4170_SDO_RDY_SCLK
Definition: ad4170.h:348
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
enum ad4170_delay_n delay_n
Definition: ad4170.h:561
struct ad4170_afe afe
Definition: ad4170.h:761
ad4170_chan_to_gpio
Enables Current Channel Number Be Output to GPIO Pins.
Definition: ad4170.h:281
#define AD4170_REG_INTERFACE_STATUS_A
Definition: ad4170.h:71
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