Go to the documentation of this file.
52 #define AD4170_R1B (1ul << 16)
53 #define AD4170_R2B (2ul << 16)
54 #define AD4170_R3B (3ul << 16)
55 #define AD4170_R4B (4ul << 16)
56 #define AD4170_TRANSF_LEN(x) ((x) >> 16)
57 #define AD4170_ADDR(x) ((x) & 0xFFFF)
59 #define AD4170_SPI_SYNC_PATTERN 0x2645
61 #define AD4170_REG_READ_6(x) (((x) & 0x3F) | 0x40)
62 #define AD4170_REG_WRITE_6(x) ((x) & 0x3F)
63 #define AD4170_REG_READ_14(x) (((x) & 0x3FFF) | 0x4000)
64 #define AD4170_REG_WRITE_14(x) ((x) & 0x3FFF)
65 #define AD4170_REG_INTERFACE_CONFIG_A (AD4170_R1B | 0x00)
66 #define AD4170_REG_INTERFACE_CONFIG_B (AD4170_R1B | 0x01)
67 #define AD4170_REG_DEVICE_CONFIG (AD4170_R1B | 0x02)
68 #define AD4170_REG_CHIP_TYPE (AD4170_R1B | 0x03)
69 #define AD4170_REG_PRODUCT_ID_L (AD4170_R1B | 0x04)
70 #define AD4170_REG_PRODUCT_ID_H (AD4170_R1B | 0x05)
71 #define AD4170_REG_CHIP_GRADE (AD4170_R1B | 0x06)
72 #define AD4170_REG_SCRATCH_PAD (AD4170_R1B | 0x0a)
73 #define AD4170_REG_SPI_REVISION (AD4170_R1B | 0x0b)
74 #define AD4170_REG_VENDOR_L (AD4170_R1B | 0x0c)
75 #define AD4170_REG_VENDOR_H (AD4170_R1B | 0x0d)
76 #define AD4170_REG_INTERFACE_CONFIG_C (AD4170_R1B | 0x10)
77 #define AD4170_REG_INTERFACE_STATUS_A (AD4170_R1B | 0x11)
78 #define AD4170_REG_DATA_STATUS (AD4170_R2B | 0x14)
79 #define AD4170_REG_DATA_16b (AD4170_R2B | 0x16)
80 #define AD4170_REG_DATA_16b_STATUS (AD4170_R3B | 0x18)
81 #define AD4170_REG_DATA_24b (AD4170_R3B | 0x1c)
82 #define AD4170_REG_DATA_24b_STATUS (AD4170_R4B | 0x20)
83 #define AD4170_REG_DATA_32b (AD4170_R4B | 0x24)
84 #define AD4170_REG_DATA_PER_CHANNEL(ch) (AD4170_R4B | (0x28 + 4 * (ch)))
85 #define AD4170_REG_PIN_MUXING (AD4170_R2B | 0x68)
86 #define AD4170_REG_CLOCK_CTRL (AD4170_R2B | 0x6a)
87 #define AD4170_REG_STANDBY_CTRL (AD4170_R2B | 0x6c)
88 #define AD4170_REG_POWER_DOWN_SW (AD4170_R2B | 0x6e)
89 #define AD4170_REG_ADC_CTRL (AD4170_R2B | 0x70)
90 #define AD4170_REG_ERROR_EN (AD4170_R2B | 0x72)
91 #define AD4170_REG_ERROR (AD4170_R2B | 0x74)
92 #define AD4170_REG_CHANNEL_EN (AD4170_R2B | 0x78)
93 #define AD4170_REG_ADC_CHANNEL_SETUP(ch) (AD4170_R2B | (0x80 + 4 * (ch)))
94 #define AD4170_REG_ADC_CHANNEL_MAP(ch) (AD4170_R2B | (0x82 + 4 * (ch)))
95 #define AD4170_REG_ADC_SETUPS_MISC(n) (AD4170_R2B | (0xc0 + 14 * (n)))
96 #define AD4170_REG_ADC_SETUPS_AFE(n) (AD4170_R2B | (0xc2 + 14 * (n)))
97 #define AD4170_REG_ADC_SETUPS_FILTER(n) (AD4170_R2B | (0xc4 + 14 * (n)))
98 #define AD4170_REG_ADC_SETUPS_FILTER_FS(n) (AD4170_R2B | (0xc6 + 14 * (n)))
99 #define AD4170_REG_ADC_SETUPS_OFFSET(n) (AD4170_R3B | (0xc8 + 14 * (n)))
100 #define AD4170_REG_ADC_SETUPS_GAIN(n) (AD4170_R3B | (0xcb + 14 * (n)))
101 #define AD4170_REG_REF_CONTROL (AD4170_R2B | 0x130)
102 #define AD4170_REG_V_BIAS (AD4170_R2B | 0x134)
103 #define AD4170_REG_I_PULLUP (AD4170_R2B | 0x136)
104 #define AD4170_REG_CURRENT_SOURCE(n) (AD4170_R2B | (0x138 + 2 * (n)))
105 #define AD4170_REG_FIR_CONTROL (AD4170_R2B | 0x140)
106 #define AD4170_REG_COEFF_WRITE_DATA (AD4170_R4B | 0x143)
107 #define AD4170_REG_COEFF_READ_DATA (AD4170_R4B | 0x147)
108 #define AD4170_REG_COEFF_ADDRESS (AD4170_R2B | 0x14b)
109 #define AD4170_REG_COEFF_WRRD_STB (AD4170_R2B | 0x14d)
110 #define AD4170_REG_DAC_SPAN (AD4170_R2B | 0x150)
111 #define AD4170_REG_DAC_CHANNEL_EN (AD4170_R2B | 0x152)
112 #define AD4170_REG_DAC_HW_TOGGLE_MASK (AD4170_R2B | 0x154)
113 #define AD4170_REG_DAC_HW_LDAC_MASK (AD4170_R2B | 0x156)
114 #define AD4170_REG_DAC_DATA(ch) (AD4170_R2B | (0x158 + 2 * (ch)))
115 #define AD4170_REG_DAC_SW_TOGGLE_TRIGGERS (AD4170_R2B | 0x168)
116 #define AD4170_REG_DAC_SW_LDAC_TRIGGERS (AD4170_R2B | 0x16a)
117 #define AD4170_REG_DAC_INPUTA(ch) (AD4170_R2B | (0x16c + 2 * (ch)))
118 #define AD4170_REG_DAC_INPUTB(ch) (AD4170_R2B | (0x17c + 2 * (ch)))
119 #define AD4170_REG_GPIO_MODE (AD4170_R2B | 0x190)
120 #define AD4170_REG_OUTPUT_DATA (AD4170_R2B | 0x192)
121 #define AD4170_REG_INPUT_DATA (AD4170_R2B | 0x194)
124 #define AD4170_SW_RESET_MSK NO_OS_BIT(7)
125 #define AD4170_ADDR_ASCENSION_MSK NO_OS_BIT(5)
126 #define AD4170_SDO_ENABLE_MSK NO_OS_BIT(4)
127 #define AD4170_SW_RESETX_MSK NO_OS_BIT(0)
130 #define AD4170_INTERFACE_CONFIG_B_SINGLE_INST_MSK NO_OS_BIT(7)
131 #define AD4170_INTERFACE_CONFIG_B_SHORT_INSTRUCTION_MSK NO_OS_BIT(3)
132 #define AD4170_INTERFACE_CONFIG_B_SHORT_INSTRUCTION(x) (((x) & 0x1) << 3)
135 #define AD4170_INTERFACE_CONFIG_C_CRC_MSK (NO_OS_BIT(7) | NO_OS_BIT(6) | NO_OS_BIT(1) | NO_OS_BIT(0))
136 #define AD4170_INTERFACE_CONFIG_C_CRC(x) (((~x) & 0x3) | (((x) << 6) & 0xC0))
137 #define AD4170_INTERFACE_CONFIG_C_STRICT_REG_ACCESS_MSK NO_OS_BIT(5)
138 #define AD4170_INTERFACE_CONFIG_C_STRICT_REG_ACCESS(x) (((x) & 0x1) << 5)
139 #define AD4170_CRC8_POLYNOMIAL 0x7
140 #define AD4170_CRC8_INITIAL_VALUE 0xA5
143 #define AD4170_INTERFACE_STATUS_A_NOT_READY_ERR_MSK NO_OS_BIT(7)
144 #define AD4170_INTERFACE_STATUS_A_CLOCK_COUNT_ERR_MSK NO_OS_BIT(4)
145 #define AD4170_INTERFACE_STATUS_A_CRC_ERR_MSK NO_OS_BIT(3)
146 #define AD4170_INTERFACE_STATUS_A_INVALID_ACCESS_ERR_MSK NO_OS_BIT(2)
147 #define AD4170_INTERFACE_STATUS_A_PARTIAL_ACCESS_ERR_MSK NO_OS_BIT(1)
148 #define AD4170_INTERFACE_STATUS_A_ADDR_INVALID_ERR_MSK NO_OS_BIT(0)
151 #define AD4170_PRODUCT_ID_L_VALUE 0x40
152 #define AD4170_PRODUCT_ID_H_VALUE 0x0
155 #define AD4190_PRODUCT_ID_L_VALUE 0x48
156 #define AD4190_PRODUCT_ID_H_VALUE 0x0
159 #define AD4170_DATA_STATUS_MASTER_ERR_S_MSK NO_OS_BIT(7)
160 #define AD4170_DATA_STATUS_POR_FLAG_S_MSK NO_OS_BIT(6)
161 #define AD4170_DATA_STATUS_RDYB_MSK NO_OS_BIT(5)
162 #define AD4170_DATA_STATUS_SETTLED_FIR_MSK NO_OS_BIT(4)
163 #define AD4170_DATA_STATUS_CH_ACTIVE_MSK NO_OS_GENMASK(3,0)
166 #define AD4170_PIN_MUXING_CHAN_TO_GPIO_MSK NO_OS_BIT(14)
167 #define AD4170_PIN_MUXING_DIG_AUX2_CTRL_MSK NO_OS_GENMASK(7,6)
168 #define AD4170_PIN_MUXING_DIG_AUX1_CTRL_MSK NO_OS_GENMASK(5,4)
169 #define AD4170_PIN_MUXING_SYNC_CTRL_MSK NO_OS_GENMASK(3,2)
170 #define AD4170_PIN_MUXING_DIG_OUT_STR_MSK NO_OS_BIT(1)
171 #define AD4170_PIN_MUXING_SDO_RDBY_DLY_MSK NO_OS_BIT(0)
174 #define AD4170_CLOCK_CTRL_DCLK_DIVIDE_MSK NO_OS_GENMASK(7,6)
175 #define AD4170_CLOCK_CTRL_CLOCKDIV_MSK NO_OS_GENMASK(5,4)
176 #define AD4170_CLOCK_CTRL_CLOCKSEL_MSK NO_OS_GENMASK(1,0)
179 #define AD4170_STANDBY_CTRL_STB_EN_CLOCK_MSK NO_OS_BIT(8)
180 #define AD4170_STANDBY_CTRL_STB_EN_IPULLUP_MSK NO_OS_BIT(7)
181 #define AD4170_STANDBY_CTRL_STB_EN_DIAGNOSTICS_MSK NO_OS_BIT(6)
182 #define AD4170_STANDBY_CTRL_STB_EN_DAC_MSK NO_OS_BIT(5)
183 #define AD4170_STANDBY_CTRL_STB_EN_PDSW1_MSK NO_OS_BIT(4)
184 #define AD4170_STANDBY_CTRL_STB_EN_PDSW0_MSK NO_OS_BIT(3)
185 #define AD4170_STANDBY_CTRL_STB_EN_VBIAS_MSK NO_OS_BIT(2)
186 #define AD4170_STANDBY_CTRL_STB_EN_IEXC_MSK NO_OS_BIT(1)
187 #define AD4170_STANDBY_CTRL_STB_EN_REFERENCE_MSK NO_OS_BIT(0)
190 #define AD4170_POWER_DOWN_SW_PDSW1_MSK NO_OS_BIT(1)
191 #define AD4170_POWER_DOWN_SW_PDSW0_MSK NO_OS_BIT(0)
194 #define AD4170_ADC_CTRL_PARALLEL_FILT_EN_MSK NO_OS_BIT(8)
195 #define AD4170_ADC_CTRL_MULTI_DATA_REG_SEL_MSK NO_OS_BIT(7)
196 #define AD4170_ADC_CTRL_CONT_READ_STATUS_EN_MSK NO_OS_BIT(6)
197 #define AD4170_REG_CTRL_CONT_READ_MSK NO_OS_GENMASK(5,4)
198 #define AD4170_REG_CTRL_MODE_MSK NO_OS_GENMASK(3,0)
201 #define AD4170_ERROR_DEVICE_ERROR_MSK NO_OS_BIT(15)
202 #define AD4170_ERROR_DLDO_PSM_ERR_MSK NO_OS_BIT(13)
203 #define AD4170_ERROR_ALDO_PSM_ERR_MSK NO_OS_BIT(12)
204 #define AD4170_ERROR_IOUT3_COMP_ERR_MSK NO_OS_BIT(11)
205 #define AD4170_ERROR_IOUT2_COMP_ERR_MSK NO_OS_BIT(10)
206 #define AD4170_ERROR_IOUT1_COMP_ERR_MSK NO_OS_BIT(9)
207 #define AD4170_ERROR_IOUT0_COMP_ERR_MSK NO_OS_BIT(8)
208 #define AD4170_ERROR_REF_DIFF_MIN_ERR_MSK NO_OS_BIT(7)
209 #define AD4170_ERROR_REF_OV_UV_ERR_MSK NO_OS_BIT(6)
210 #define AD4170_ERROR_AINM_OV_UV_ERR_MSK NO_OS_BIT(5)
211 #define AD4170_ERROR_AINP_OV_UV_ERR_MSK NO_OS_BIT(4)
212 #define AD4170_ERROR_ADC_CONV_ERR_MSK NO_OS_BIT(3)
213 #define AD4170_ERROR_MM_CRC_ERR_MSK NO_OS_BIT(1)
214 #define AD4170_ERROR_ROM_CRC_ERR_MSK NO_OS_BIT(0)
217 #define AD4170_CHANNEL(ch) NO_OS_BIT(ch)
220 #define AD4170_CHANNEL_SETUPN_REPEAT_N_MSK NO_OS_GENMASK(15,8)
221 #define AD4170_CHANNEL_SETUPN_DELAY_N_MSK NO_OS_GENMASK(6,4)
222 #define AD4170_CHANNEL_SETUPN_SETUP_N_MSK NO_OS_GENMASK(2,0)
225 #define AD4170_CHANNEL_MAPN_AINP_MSK NO_OS_GENMASK(12,8)
226 #define AD4170_CHANNEL_MAPN_AINM_MSK NO_OS_GENMASK(4,0)
229 #define AD4170_ADC_SETUPS_MISC_CHOP_IEXC_MSK NO_OS_GENMASK(15,14)
230 #define AD4170_ADC_SETUPS_MISC_CHOP_ADC_MSK NO_OS_GENMASK(9,8)
231 #define AD4170_ADC_SETUPS_MISC_BURNOUT_MSK NO_OS_GENMASK(1,0)
234 #define AD4170_ADC_SETUPS_AFE_REF_BUF_M_MSK NO_OS_GENMASK(11,10)
235 #define AD4170_ADC_SETUPS_AFE_REF_BUF_P_MSK NO_OS_GENMASK(9,8)
236 #define AD4170_ADC_SETUPS_AFE_REF_SELECT_MSK NO_OS_GENMASK(6,5)
237 #define AD4170_ADC_SETUPS_AFE_BIPOLAR_MSK NO_OS_BIT(4)
238 #define AD4170_ADC_SETUPS_AFE_PGA_GAIN_MSK NO_OS_GENMASK(3,0)
241 #define AD4170_ADC_SETUPS_POST_FILTER_SEL_MSK NO_OS_GENMASK(7,4)
242 #define AD4170_ADC_SETUPS_FILTER_TYPE_MSK NO_OS_GENMASK(3,0)
245 #define AD4170_CURRENT_SOURCE_I_OUT_PIN_MSK NO_OS_GENMASK(12,8)
246 #define AD4170_CURRENT_SOURCE_I_OUT_VAL_MSK NO_OS_GENMASK(2,0)
249 #define AD4170_REF_CONTROL_REF_EN_MSK NO_OS_BIT(0)
252 #define AD4170_FIR_CONTROL_IIR_MODE_MSK NO_OS_BIT(15)
253 #define AD4170_FIR_CONTROL_FIR_MODE_MSK NO_OS_GENMASK(14,12)
254 #define AD4170_FIR_CONTROL_COEFF_SET_MSK NO_OS_BIT(10)
255 #define AD4170_FIR_CONTROL_FIR_LENGTH_MSK NO_OS_GENMASK(6,0)
258 #define AD4170_REG_DAC_SPAN_DAC_GAIN_MSK NO_OS_BIT(0)
261 #define AD4170_REG_DAC_CHANNEL_EN_DAC_EN_MSK NO_OS_BIT(0)
264 #define AD4170_REG_DAC_HW_TOGGLE_MASK_HW_TOGGLE_EN_MSK NO_OS_BIT(0)
267 #define AD4170_REG_DAC_HW_LDAC_MASK_HW_LDAC_EN_MSK NO_OS_BIT(0)
270 #define AD4170_REG_DAC_DATA_MSK NO_OS_GENMASK(11,0)
273 #define AD4170_REG_DAC_SW_TOGGLE_TRIGGERS_SW_TOGGLE_MSK NO_OS_BIT(0)
276 #define AD4170_REG_DAC_SW_LDAC_TRIGGERS_SW_LDAC_EN_MSK NO_OS_BIT(0)
278 #define AD4170_NUM_CHANNELS 16
279 #define AD4170_NUM_SETUPS 8
280 #define AD4170_NUM_CURRENT_SOURCE 4
281 #define AD4170_FIR_COEFF_MAX_LENGTH 72
1067 uint32_t *reg_data);
1085 uint16_t nb_samples);
1087 uint16_t nb_samples);
1089 uint16_t nb_samples);
1091 uint16_t nb_samples);
1093 uint16_t nb_samples);
1095 uint8_t *status_out, uint16_t nb_samples);
#define AD4170_ADC_SETUPS_AFE_REF_BUF_P_MSK
Definition: ad4170.h:235
int ad4170_set_pin_muxing(struct ad4170_dev *dev, struct ad4170_pin_muxing pin_muxing)
Set the AD4170 Pin Muxing settings.
Definition: ad4170.c:1049
struct ad4170_spi_settings spi_settings
Definition: ad4170.h:1012
@ AD4170_DCLKDIVBY8
Definition: ad4170.h:390
ad4170_pga_gain
PGA Gain Selection.
Definition: ad4170.h:673
@ AD4170_CHANNEL_NOT_TO_GPIO
Definition: ad4170.h:289
#define AD4170_REG_FIR_CONTROL
Definition: ad4170.h:105
@ AD4170_I_OUT_AIN0
Definition: ad4170.h:793
#define AD4170_REG_DAC_HW_TOGGLE_MASK_HW_TOGGLE_EN_MSK
Definition: ad4170.h:264
enum ad4170_fir_coeff_set coeff_set
Definition: ad4170.h:906
struct ad4170_adc_ctrl adc_ctrl
Definition: ad4170.h:955
@ AD4170_REFIN1_P
Definition: ad4170.h:551
int ad4170_set_fir_control(struct ad4170_dev *dev, struct ad4170_fir_control fir_control)
Set the AD4170 FIR control settings.
Definition: ad4170.c:1560
struct ad4170_ref_control ref_control
Definition: ad4170.h:965
@ AD4170_DLY_16384
Definition: ad4170.h:515
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:669
uint32_t timeout
Definition: ad413x.c:55
struct ad4170_config config
Definition: ad4170.h:1043
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:85
enum ad4170_fir_mode fir_mode
Definition: ad4170.h:904
#define AD4170_REG_CURRENT_SOURCE(n)
Definition: ad4170.h:104
Filter register settings.
Definition: ad4170.h:753
struct no_os_gpio_init_param * gpio_dig_aux2
Definition: ad4170.h:1022
@ AD4170_FIR_ASYM
Definition: ad4170.h:884
ad4170_cont_read
Configures continuous Data Register Read/Transmit.
Definition: ad4170.h:440
#define AD4170_REG_DAC_SW_TOGGLE_TRIGGERS
Definition: ad4170.h:115
struct ad4170_dac_config dac
Definition: ad4170.h:975
int ad4170_reset_spi_interface(struct ad4170_dev *dev)
Reset the SPI interface by sending reset sequence to device.
Definition: ad4170.c:410
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:1693
struct ad4170_pin_muxing pin_muxing
Definition: ad4170.h:945
#define AD4170_PRODUCT_ID_H_VALUE
Definition: ad4170.h:152
int ad4170_get_error(struct ad4170_dev *dev, uint16_t *error)
Get the Error register.
Definition: ad4170.c:1252
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:1705
enum ad4170_id id
Definition: ad4170.h:1031
@ AD4170_REF_BUF_PRE
Definition: ad4170.h:647
#define AD4170_REG_DAC_SPAN
Definition: ad4170.h:110
#define AD4170_NUM_SETUPS
Definition: ad4170.h:279
struct no_os_spi_init_param spi_init
Definition: ad4170.h:1033
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:1336
#define AD4170_REG_ADC_SETUPS_FILTER_FS(n)
Definition: ad4170.h:98
struct no_os_gpio_desc * gpio_sync_inb
Definition: ad4170.h:1047
int ad4170_init(struct ad4170_dev **device, struct ad4170_init_param *init_param)
Initialize an AD4170 device structure.
Definition: ad4170.c:1760
FIR_Control register settings.
Definition: ad4170.h:902
uint32_t gain
Definition: ad4170.h:775
int ad4170_continuous_read_exit(struct ad4170_dev *dev)
Exit continuous read mode.
Definition: ad4170.c:919
@ AD4170_BURNOUT_10U
Definition: ad4170.h:625
@ AD4170_I_OUT_AIN10
Definition: ad4170.h:813
#define AD4170_CLOCK_CTRL_CLOCKDIV_MSK
Definition: ad4170.h:175
ad4170_i_out_val
Current Source Value.
Definition: ad4170.h:840
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:1241
@ AD4170_CHOP_OFF
Definition: ad4170.h:604
@ AD4170_MODE_POWER_DOWN
Definition: ad4170.h:465
ad4170_mode
ADC Operating Mode.
Definition: ad4170.h:453
ADC_Ctrl register settings.
Definition: ad4170.h:482
@ AD4170_I_OUT_AIN4
Definition: ad4170.h:801
@ AD4170_PGA_GAIN_1_PRECHARGE
Definition: ad4170.h:693
struct ad4170_channel_map map[AD4170_NUM_CHANNELS]
Definition: ad4170.h:961
@ AD4170_DIG_STR_DEFAULT
Definition: ad4170.h:343
@ AD4170_CHOP_IEXC_AB
Definition: ad4170.h:591
@ AD4170_FIR_COEFF_SET0
Definition: ad4170.h:893
int ad4170_set_clocksel(struct ad4170_dev *dev, enum ad4170_clocksel sel)
Set the AD4170 clock selection configuration.
Definition: ad4170.c:1145
ad4170_filter_type
Filter Mode for Sinc-Based Filters.
Definition: ad4170.h:740
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
@ AD4170_REFIN2_N
Definition: ad4170.h:554
struct ad4170_setup setups[AD4170_NUM_SETUPS]
Definition: ad4170.h:963
@ AD4170_MODE_CONT_IIR
Definition: ad4170.h:459
#define AD4170_REG_ADC_SETUPS_FILTER(n)
Definition: ad4170.h:97
#define AD4170_FIR_CONTROL_FIR_MODE_MSK
Definition: ad4170.h:253
@ AD4170_POST_FILTER_AVG16
Definition: ad4170.h:729
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:506
#define AD4170_CHANNEL_SETUPN_DELAY_N_MSK
Definition: ad4170.h:221
Header file of SPI Interface.
@ ID_AD4170
Definition: ad4170.h:996
int ad4170_set_spi_settings(struct ad4170_dev *dev, const struct ad4170_spi_settings *spi_settings)
Set the AD4170 SPI settings.
Definition: ad4170.c:1008
#define AD4170_REG_CHIP_TYPE
Definition: ad4170.h:68
AFE register settings.
Definition: ad4170.h:700
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:559
#define AD4170_REG_DAC_INPUTB(ch)
Definition: ad4170.h:118
@ AD4170_DIG_AUX2_LDAC
Definition: ad4170.h:302
int ad4170_set_ref_control(struct ad4170_dev *dev, bool enable)
Set the AD4170 Ref Control.
Definition: ad4170.c:1465
enum ad4170_cont_read cont_read
Definition: ad4170.h:490
enum ad4170_dig_aux1_ctrl dig_aux1_ctrl
Definition: ad4170.h:369
@ AD4170_I_OUT_AIN8
Definition: ad4170.h:809
#define AD4170_REG_CTRL_CONT_READ_MSK
Definition: ad4170.h:197
#define AD4170_REG_CHIP_GRADE
Definition: ad4170.h:71
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:721
#define AD4170_ADC_SETUPS_MISC_CHOP_ADC_MSK
Definition: ad4170.h:230
#define AD4170_REG_WRITE_14(x)
Definition: ad4170.h:64
@ AD4170_I_OUT_AIN1
Definition: ad4170.h:795
uint32_t offset
Definition: ad4170.h:773
int ad4170_set_fir_control(struct ad4170_dev *dev, struct ad4170_fir_control fir_control)
Set the AD4170 FIR control settings.
Definition: ad4170.c:1560
@ AD4170_BURNOUT_OFF
Definition: ad4170.h:619
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:227
@ ID_AD4172
Definition: ad4170.h:998
struct ad4170_misc misc
Definition: ad4170.h:765
int ad4170_dac_sw_ldac(struct ad4170_dev *dev, bool polarity)
Perform a software LDAC.
Definition: ad4170.c:1717
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:506
@ AD4170_POST_FILTER_AVG20
Definition: ad4170.h:731
#define AD4170_ADC_CTRL_PARALLEL_FILT_EN_MSK
Definition: ad4170.h:194
int ad4170_continuous_read_exit(struct ad4170_dev *dev)
Exit continuous read mode.
Definition: ad4170.c:919
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:695
int ad4170_set_dclk_div(struct ad4170_dev *dev, enum ad4170_dclk_div div)
Set the AD4170 DCLK configuration.
Definition: ad4170.c:1085
@ AD4170_POST_FILTER_60MS
Definition: ad4170.h:725
@ AD4170_I_OUT_1500UA
Definition: ad4170.h:856
#define AD4170_DATA_STATUS_POR_FLAG_S_MSK
Definition: ad4170.h:160
#define AD4170_CHANNEL_SETUPN_SETUP_N_MSK
Definition: ad4170.h:222
#define AD4170_REG_POWER_DOWN_SW
Definition: ad4170.h:88
int ad4170_set_error_en(struct ad4170_dev *dev, uint16_t error_en)
Set the AD4170 Error enable settings.
Definition: ad4170.c:1219
struct no_os_gpio_init_param * gpio_dig_aux1
Definition: ad4170.h:1020
#define AD4170_FIR_CONTROL_FIR_LENGTH_MSK
Definition: ad4170.h:255
@ AD4170_I_OUT_250UA
Definition: ad4170.h:850
struct no_os_gpio_desc * gpio_dig_aux2
Definition: ad4170.h:1057
@ AD4170_EXTERNAL_OSC
Definition: ad4170.h:418
enum ad4170_dclk_div dclk_divide
Definition: ad4170.h:429
ad4170_ref_buf
REFIN Buffer Enable.
Definition: ad4170.h:645
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:708
@ AD4170_DLY_0
Definition: ad4170.h:501
#define AD4170_NUM_CURRENT_SOURCE
Definition: ad4170.h:280
@ AD4170_DIG_AUX2_SYNC
Definition: ad4170.h:304
#define AD4170_REG_DAC_SPAN_DAC_GAIN_MSK
Definition: ad4170.h:258
@ AD4170_REF_BUF_FULL
Definition: ad4170.h:649
@ AD4170_AIN12
Definition: ad4170.h:535
@ AD4170_I_OUT_50UA
Definition: ad4170.h:846
@ AD4170_PGA_GAIN_8
Definition: ad4170.h:681
@ AD4170_I_OUT_10UA
Definition: ad4170.h:844
@ AD4170_AVDD_AVSS_P
Definition: ad4170.h:542
Definition: ad9361_util.h:75
@ AD4170_CHOP_MUX
Definition: ad4170.h:606
#define AD4170_SPI_SYNC_PATTERN
Definition: ad4170.h:59
#define AD4170_ADC_SETUPS_MISC_CHOP_IEXC_MSK
Definition: ad4170.h:229
#define AD4170_REG_READ_6(x)
Definition: ad4170.h:61
#define AD4170_CLOCK_CTRL_DCLK_DIVIDE_MSK
Definition: ad4170.h:174
@ AD4170_SDO_RDY_CSB
Definition: ad4170.h:356
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:123
@ AD4170_BURNOUT_100N
Definition: ad4170.h:621
bool bipolar
Definition: ad4170.h:708
int ad4170_get_status(struct ad4170_dev *dev, uint16_t *status)
Get status from register Data_Status.
Definition: ad4170.c:582
#define AD4170_ADC_CTRL_MULTI_DATA_REG_SEL_MSK
Definition: ad4170.h:195
#define AD4170_REG_ADC_CHANNEL_SETUP(ch)
Definition: ad4170.h:93
@ AD4170_DCLKDIVBY1
Definition: ad4170.h:384
bool digif
Definition: ad4170.h:1059
uint16_t standby_ctrl
Definition: ad4170.h:949
#define AD4170_REG_ERROR_EN
Definition: ad4170.h:90
enum ad4170_sdo_rdby_dly sdo_rdby_dly
Definition: ad4170.h:375
int ad4170_set_mclk_div(struct ad4170_dev *dev, enum ad4170_mclk_div clk_div)
Set the AD4170 MCLK configuration.
Definition: ad4170.c:1115
@ AD4170_FILT_SINC3
Definition: ad4170.h:746
#define AD4170_REG_PRODUCT_ID_L
Definition: ad4170.h:69
@ AD4170_OPEN
Definition: ad4170.h:556
@ AD4170_AIN14
Definition: ad4170.h:537
enum ad4170_filter_type filter_type
Definition: ad4170.h:757
#define AD4170_REG_DAC_SW_TOGGLE_TRIGGERS_SW_TOGGLE_MSK
Definition: ad4170.h:273
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:53
#define AD4170_REG_ADC_CTRL
Definition: ad4170.h:89
@ AD4170_CHOP_IEXC_OFF
Definition: ad4170.h:589
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:130
ad4170_chop_iexc
Excitation Current Chopping Control.
Definition: ad4170.h:587
int ad4170_set_standby_ctrl(struct ad4170_dev *dev, uint16_t standby_ctrl)
Set the AD4170 Standby control settings.
Definition: ad4170.c:1175
@ AD4170_POST_FILTER_AVG24
Definition: ad4170.h:733
@ AD4170_I_OUT_AINCOM
Definition: ad4170.h:825
@ AD4170_DAC_GAIN_1
Definition: ad4170.h:919
#define AD4170_REG_DAC_INPUTA(ch)
Definition: ad4170.h:117
struct ad4170_clock_ctrl clock_ctrl
Definition: ad4170.h:947
#define AD4170_ADC_SETUPS_FILTER_TYPE_MSK
Definition: ad4170.h:242
int ad4170_set_powerdown_sw(struct ad4170_dev *dev, uint16_t powerdown_sw)
Set the AD4170 Powerdown switches settings.
Definition: ad4170.c:1197
@ AD4170_FIR_DEFAULT
Definition: ad4170.h:874
ad4170_dac_gain
DAC Output Span.
Definition: ad4170.h:917
#define AD4170_CURRENT_SOURCE_I_OUT_VAL_MSK
Definition: ad4170.h:246
@ AD4170_EXTERNAL_XTAL
Definition: ad4170.h:420
@ AD4170_DIG_AUX1_RDY
Definition: ad4170.h:317
int ad4170_regmap(struct ad4170_dev *dev)
Debugging function to print the register map to console.
Definition: ad4170.c:1967
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:457
@ AD4170_CHOP_IEXC_CD
Definition: ad4170.h:593
@ AD4170_PGA_GAIN_16
Definition: ad4170.h:683
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:121
@ AD4170_DIG_AUX1_SYNC
Definition: ad4170.h:319
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:682
@ AD4170_AIN11
Definition: ad4170.h:534
@ AD4170_FIR_ANTISYM_ODD
Definition: ad4170.h:880
@ AD4170_INTERNAL_OSC_OUTPUT
Definition: ad4170.h:416
#define AD4170_INTERFACE_CONFIG_C_CRC(x)
Definition: ad4170.h:136
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:695
@ AD4170_AIN10
Definition: ad4170.h:533
uint16_t powerdown_sw
Definition: ad4170.h:951
#define AD4170_REG_DAC_HW_LDAC_MASK
Definition: ad4170.h:113
@ AD4170_MODE_SELF_OFFSET_CAL
Definition: ad4170.h:473
#define AD4170_REG_COEFF_READ_DATA
Definition: ad4170.h:107
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:387
int ad4170_regmap(struct ad4170_dev *dev)
Debugging function to print the register map to console.
Definition: ad4170.c:1967
#define ECOMM
Definition: ad4170.h:49
@ AD4170_FIR_ANTISYM_EVEN
Definition: ad4170.h:882
#define AD4170_REG_REF_CONTROL
Definition: ad4170.h:101
enum ad4170_sync_ctrl sync_ctrl
Definition: ad4170.h:371
@ AD4170_DLY_256
Definition: ad4170.h:505
#define AD4170_REG_ADC_SETUPS_OFFSET(n)
Definition: ad4170.h:99
#define AD4170_FIR_COEFF_MAX_LENGTH
Definition: ad4170.h:281
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:1364
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:132
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:559
int ad4170_set_powerdown_sw(struct ad4170_dev *dev, uint16_t powerdown_sw)
Set the AD4170 Powerdown switches settings.
Definition: ad4170.c:1197
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:1336
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
@ AD4170_CHOP_ACX_4PIN
Definition: ad4170.h:608
int ad4170_spi_reg_read(struct ad4170_dev *dev, uint32_t reg_addr, uint32_t *reg_data)
Read device register.
Definition: ad4170.c:236
int ad4170_remove(struct ad4170_dev *dev)
Remove the device and free al the resources.
Definition: ad4170.c:1954
ad4170_fir_mode
Selects FIR Type.
Definition: ad4170.h:872
struct no_os_spi_init_param spi_init
Definition: ad4170.h:1010
@ AD4170_I_OUT_AIN11
Definition: ad4170.h:815
struct ad4170_filter filter
Definition: ad4170.h:769
Pin_Muxing register settings.
Definition: ad4170.h:363
#define AD4170_INTERFACE_CONFIG_B_SHORT_INSTRUCTION_MSK
Definition: ad4170.h:131
@ AD4170_I_OUT_AIN6
Definition: ad4170.h:805
bool cont_read_status_en
Definition: ad4170.h:488
ad4170_burnout
Burnout Current Values.
Definition: ad4170.h:617
struct ad4170_fir_control fir_control
Definition: ad4170.h:973
#define AD4170_ADC_SETUPS_AFE_BIPOLAR_MSK
Definition: ad4170.h:237
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:387
#define AD4170_PIN_MUXING_DIG_OUT_STR_MSK
Definition: ad4170.h:170
ad4170_ref_select
ADC Reference Selection.
Definition: ad4170.h:658
#define AD4170_INTERFACE_CONFIG_B_SHORT_INSTRUCTION(x)
Definition: ad4170.h:132
int ad4170_set_dclk_div(struct ad4170_dev *dev, enum ad4170_dclk_div clk_div)
Set the AD4170 DCLK configuration.
Definition: ad4170.c:1085
@ AD4170_ALDO
Definition: ad4170.h:547
@ AD4170_IOVDD_DGND_N
Definition: ad4170.h:545
#define AD4170_REG_DAC_HW_TOGGLE_MASK
Definition: ad4170.h:112
ad4170_dig_aux2_ctrl
Configures Functionality of DIG_AUX2 Pin.
Definition: ad4170.h:298
@ AD4170_INTERNAL_OSC
Definition: ad4170.h:414
int ad4170_dac_sw_ldac(struct ad4170_dev *dev, bool polarity)
Perform a software LDAC.
Definition: ad4170.c:1717
@ AD4170_CLKDIVBY1
Definition: ad4170.h:399
void no_os_crc8_populate_msb(uint8_t *table, const uint8_t polynomial)
#define AD4170_REG_DAC_SW_LDAC_TRIGGERS
Definition: ad4170.h:116
int ad4170_get_data16(struct ad4170_dev *dev, uint16_t *data)
Get data from register Data_16b.
Definition: ad4170.c:433
#define AD4190_PRODUCT_ID_H_VALUE
Definition: ad4170.h:156
NO_OS_DECLARE_CRC8_TABLE(ad4170_crc8)
Ref_Control register settings.
Definition: ad4170.h:782
#define AD4170_REG_ERROR
Definition: ad4170.h:91
enum ad4170_id id
Definition: ad4170.h:1008
Misc register settings.
Definition: ad4170.h:632
enum ad4170_pga_gain pga_gain
Definition: ad4170.h:710
bool ref_en
Definition: ad4170.h:784
@ AD4170_SYNC_STANDARD
Definition: ad4170.h:332
#define AD4170_REG_PRODUCT_ID_H
Definition: ad4170.h:70
int ad4170_set_standby_ctrl(struct ad4170_dev *dev, uint16_t standby_ctrl)
Set the AD4170 Standby control settings.
Definition: ad4170.c:1175
ad4170_dclk_div
Continuous Transmit Data Clock Divider.
Definition: ad4170.h:382
@ AD4170_AIN16
Definition: ad4170.h:539
@ AD4170_REFIN_REFIN2
Definition: ad4170.h:662
@ AD4170_DCLKDIVBY2
Definition: ad4170.h:386
int ad4170_set_mclk_div(struct ad4170_dev *dev, enum ad4170_mclk_div div)
Set the AD4170 MCLK configuration.
Definition: ad4170.c:1115
enum ad4170_dig_aux2_ctrl dig_aux2_ctrl
Definition: ad4170.h:367
@ AD4170_I_OUT_AIN2
Definition: ad4170.h:797
enum ad4170_i_out_pin i_out_pin
Definition: ad4170.h:864
int ad4170_set_setup(struct ad4170_dev *dev, uint8_t n, struct ad4170_setup setup)
Configure an ADC setup.
Definition: ad4170.c:1391
@ AD4170_AIN13
Definition: ad4170.h:536
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:669
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:809
AD4170 configuration.
Definition: ad4170.h:943
#define AD4170_CHANNEL_MAPN_AINP_MSK
Definition: ad4170.h:225
@ AD4170_DIG_AUX1_MODOUT
Definition: ad4170.h:321
Channel_Setup register settings.
Definition: ad4170.h:563
int ad4170_continuous_transmit_exit(struct ad4170_dev *dev)
Exit continuous transmit mode.
Definition: ad4170.c:944
struct ad4170_config ad4170_config_reset
Definition: ad4170.c:52
int ad4170_get_status(struct ad4170_dev *dev, uint16_t *status)
Get status from register Data_Status.
Definition: ad4170.c:582
#define AD4170_ADC_SETUPS_AFE_PGA_GAIN_MSK
Definition: ad4170.h:238
uint16_t i_pullup
Definition: ad4170.h:969
@ AD4170_IOVDD_DGND_P
Definition: ad4170.h:544
#define AD4170_REG_DAC_HW_LDAC_MASK_HW_LDAC_EN_MSK
Definition: ad4170.h:267
@ AD4170_I_OUT_100UA
Definition: ad4170.h:848
#define AD4170_PIN_MUXING_CHAN_TO_GPIO_MSK
Definition: ad4170.h:166
#define AD4170_CHANNEL(ch)
Definition: ad4170.h:217
struct no_os_gpio_init_param * gpio_sync_inb_init
Definition: ad4170.h:1045
uint16_t v_bias
Definition: ad4170.h:967
int ad4170_reset(struct ad4170_dev *dev)
Perform a software reset.
Definition: ad4170.c:978
int ad4170_set_i_pullup(struct ad4170_dev *dev, uint16_t ch_mask)
Set the AD4170 Input pullup.
Definition: ad4170.c:1509
bool parallel_filt_en
Definition: ad4170.h:484
@ AD4170_AIN3
Definition: ad4170.h:526
@ AD4170_CLKDIVBY4
Definition: ad4170.h:403
@ AD4170_MODE_CONT
Definition: ad4170.h:455
#define AD4170_REG_DAC_CHANNEL_EN
Definition: ad4170.h:111
@ AD4170_I_OUT_AIN5
Definition: ad4170.h:803
uint32_t rdy_conv_timeout
Definition: ad4170.h:1014
bool hw_toggle
Definition: ad4170.h:934
@ AD4170_REFIN_REFIN1
Definition: ad4170.h:660
#define AD4170_SW_RESET_MSK
Definition: ad4170.h:124
int ad4170_set_clocksel(struct ad4170_dev *dev, enum ad4170_clocksel sel)
Set the AD4170 clock selection configuration.
Definition: ad4170.c:1145
#define AD4170_REG_SCRATCH_PAD
Definition: ad4170.h:72
@ AD4170_MODE_SYS_GAIN_CAL
Definition: ad4170.h:471
#define AD4170_CURRENT_SOURCE_I_OUT_PIN_MSK
Definition: ad4170.h:245
@ AD4170_PGA_GAIN_1
Definition: ad4170.h:675
#define AD4170_REG_DATA_24b_STATUS
Definition: ad4170.h:82
struct ad4170_config config
Definition: ad4170.h:1016
@ AD4170_AVSS
Definition: ad4170.h:549
uint16_t filter_fs
Definition: ad4170.h:771
#define AD4170_REG_V_BIAS
Definition: ad4170.h:102
#define AD4170_REG_DATA_16b_STATUS
Definition: ad4170.h:80
#define AD4170_PIN_MUXING_DIG_AUX1_CTRL_MSK
Definition: ad4170.h:168
ad4170_sync_ctrl
Configures SYNC_IN Pin for ADC Synchronization.
Definition: ad4170.h:328
@ AD4170_I_OUT_GPIO2
Definition: ad4170.h:831
#define AD4170_TRANSF_LEN(x)
Definition: ad4170.h:56
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:1532
@ AD4170_DIG_STR_HIGH
Definition: ad4170.h:345
enum ad4170_ref_buf ref_buf_m
Definition: ad4170.h:702
Sequencer Setup register settings.
Definition: ad4170.h:764
@ AD4170_AIN6
Definition: ad4170.h:529
#define AD4170_REG_DEVICE_CONFIG
Definition: ad4170.h:67
ad4170_fir_coeff_set
Selects FIR coefficient set.
Definition: ad4170.h:891
uint8_t setup_n
Definition: ad4170.h:569
int ad4170_set_error_en(struct ad4170_dev *dev, uint16_t error_en)
Set the AD4170 Error enable settings.
Definition: ad4170.c:1219
int ad4170_reset_spi_interface(struct ad4170_dev *dev)
Reset the SPI interface by sending reset sequence to device.
Definition: ad4170.c:410
#define AD4170_REG_INTERFACE_CONFIG_B
Definition: ad4170.h:66
bool big_endian
Definition: ad4170.h:1041
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:110
Structure holding SPI descriptor.
Definition: no_os_spi.h:177
enum ad4170_dig_out_str dig_out_str
Definition: ad4170.h:373
@ AD4170_DAC
Definition: ad4170.h:546
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:1532
#define AD4170_ADC_CTRL_CONT_READ_STATUS_EN_MSK
Definition: ad4170.h:196
@ AD4170_CHOP_IEXC_ABCD
Definition: ad4170.h:595
ad4170_ain
Multiplexer Positive/Negative Input for This Channel.
Definition: ad4170.h:522
@ AD4170_MODE_SYS_OFFSET_CAL
Definition: ad4170.h:469
bool hw_ldac
Definition: ad4170.h:936
#define AD4170_REG_CTRL_MODE_MSK
Definition: ad4170.h:198
#define AD4170_REG_DATA_PER_CHANNEL(ch)
Definition: ad4170.h:84
ad4170_dig_out_str
Configures the drive strength of the Digital Outputs.
Definition: ad4170.h:341
uint8_t fir_length
Definition: ad4170.h:908
int ad4170_get_data16(struct ad4170_dev *dev, uint16_t *data)
Get data from register Data_16b.
Definition: ad4170.c:433
struct ad4170_channel_setup setup[AD4170_NUM_CHANNELS]
Definition: ad4170.h:959
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:1364
uint8_t repeat_n
Definition: ad4170.h:565
enum ad4170_clocksel clocksel
Definition: ad4170.h:433
@ AD4170_REFIN1_N
Definition: ad4170.h:552
#define AD4170_ADC_SETUPS_AFE_REF_SELECT_MSK
Definition: ad4170.h:236
@ AD4170_PGA_GAIN_64
Definition: ad4170.h:687
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:1241
int ad4170_set_adc_ctrl(struct ad4170_dev *dev, struct ad4170_adc_ctrl adc_ctrl)
Set the AD4170 ADC Control.
Definition: ad4170.c:1275
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:102
@ AD4170_DIG_AUX2_MODOUT
Definition: ad4170.h:306
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:1681
@ AD4170_PGA_GAIN_0P5
Definition: ad4170.h:691
bool short_instruction
Definition: ad4170.h:984
@ AD4170_CONT_READ_ON
Definition: ad4170.h:444
@ AD4170_REFIN_AVDD
Definition: ad4170.h:666
#define AD4170_REG_VENDOR_H
Definition: ad4170.h:75
Header file for the ad4170 driver.
int32_t * fir_coefficients
Definition: ad4170.h:910
#define AD4170_PIN_MUXING_SYNC_CTRL_MSK
Definition: ad4170.h:169
int ad4170_continuous_transmit_exit(struct ad4170_dev *dev)
Exit continuous transmit mode.
Definition: ad4170.c:944
@ ID_AD4190
Definition: ad4170.h:999
@ AD4170_I_OUT_GPIO1
Definition: ad4170.h:829
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:708
@ AD4170_AIN15
Definition: ad4170.h:538
struct no_os_gpio_init_param * gpio_dig_aux2_init
Definition: ad4170.h:1053
@ AD4170_I_OUT_AIN14
Definition: ad4170.h:821
enum ad4170_dac_gain gain
Definition: ad4170.h:932
#define AD4170_PIN_MUXING_DIG_AUX2_CTRL_MSK
Definition: ad4170.h:167
#define AD4170_REG_SPI_REVISION
Definition: ad4170.h:73
int ad4170_dac_sw_toggle(struct ad4170_dev *dev, bool polarity)
Perform a software toggle.
Definition: ad4170.c:1729
@ AD4170_I_OUT_AIN15
Definition: ad4170.h:823
int ad4170_set_dac_config(struct ad4170_dev *dev, struct ad4170_dac_config config)
Set the AD4170 DAC settings.
Definition: ad4170.c:1625
#define AD4170_PRODUCT_ID_L_VALUE
Definition: ad4170.h:151
@ AD4170_REF_BUF_BYPASS
Definition: ad4170.h:651
@ AD4170_MODE_IDLE
Definition: ad4170.h:467
#define AD4170_REG_CHANNEL_EN
Definition: ad4170.h:92
#define AD4170_REG_PIN_MUXING
Definition: ad4170.h:85
@ AD4170_FILT_SINC5
Definition: ad4170.h:744
#define AD4170_REG_DAC_SW_LDAC_TRIGGERS_SW_LDAC_EN_MSK
Definition: ad4170.h:276
bool multi_data_reg_sel
Definition: ad4170.h:486
Channel_Map register settings. Selects Analog Inputs for This Sequencer Channel.
Definition: ad4170.h:576
#define AD4170_REG_READ_14(x)
Definition: ad4170.h:63
@ AD4170_FILT_SINC5_AVG
Definition: ad4170.h:742
AD4170 SPI init paraeter structure, used for initializing the ad4170_dev.
Definition: ad4170.h:1006
int ad4170_init(struct ad4170_dev **device, struct ad4170_init_param *init_param)
Initialize an AD4170 device structure.
Definition: ad4170.c:1760
#define AD4170_REG_DAC_DATA_MSK
Definition: ad4170.h:270
@ AD4170_POST_FILTER_NONE
Definition: ad4170.h:719
@ AD4170_AVDD_AVSS_N
Definition: ad4170.h:543
enum ad4170_mclk_div clockdiv
Definition: ad4170.h:431
@ AD4170_AIN0
Definition: ad4170.h:523
int ad4170_spi_reg_read(struct ad4170_dev *dev, uint32_t reg_addr, uint32_t *reg_data)
Read device register.
Definition: ad4170.c:236
struct no_os_gpio_init_param * gpio_sync_inb
Definition: ad4170.h:1018
int ad4170_set_channel_en(struct ad4170_dev *dev, uint16_t channel_en)
Enable AD4170 channels.
Definition: ad4170.c:1313
@ AD4170_FIR_COEFF_SET1
Definition: ad4170.h:895
#define AD4170_REG_DAC_DATA(ch)
Definition: ad4170.h:114
struct ad4170_config ad4170_config_reset
Definition: ad4170.c:52
#define AD4170_REG_I_PULLUP
Definition: ad4170.h:103
#define NO_OS_BIT(x)
Definition: no_os_util.h:51
uint8_t no_os_crc8(const uint8_t *table, const uint8_t *pdata, size_t nbytes, uint8_t crc)
@ AD4170_CLKDIVBY2
Definition: ad4170.h:401
@ AD4170_DLDO
Definition: ad4170.h:548
int ad4170_set_i_pullup(struct ad4170_dev *dev, uint16_t ch_mask)
Set the AD4170 Input pullup.
Definition: ad4170.c:1509
@ ID_AD4171
Definition: ad4170.h:997
@ AD4170_PGA_GAIN_4
Definition: ad4170.h:679
@ AD4170_CHOP_ACX_2PIN
Definition: ad4170.h:610
#define AD4170_ADDR(x)
Definition: ad4170.h:57
@ AD4170_CHANNEL_TO_GPIO
Definition: ad4170.h:291
Current_Source register settings.
Definition: ad4170.h:863
@ AD4170_REFIN2_P
Definition: ad4170.h:553
@ AD4170_REFIN_REFOUT
Definition: ad4170.h:664
@ AD4170_AIN9
Definition: ad4170.h:532
struct ad4170_current_source current_source[AD4170_NUM_CURRENT_SOURCE]
Definition: ad4170.h:971
#define AD4170_CHANNEL_SETUPN_REPEAT_N_MSK
Definition: ad4170.h:220
#define AD4170_PIN_MUXING_SDO_RDBY_DLY_MSK
Definition: ad4170.h:171
ad4170_dig_aux1_ctrl
Configures Functionality of DIG_AUX1 Pin.
Definition: ad4170.h:313
#define AD4170_ADC_SETUPS_MISC_BURNOUT_MSK
Definition: ad4170.h:231
unsigned int no_os_hweight8(uint8_t word)
uint16_t error_en
Definition: ad4170.h:953
#define AD4170_FIR_CONTROL_COEFF_SET_MSK
Definition: ad4170.h:254
enum ad4170_mode mode
Definition: ad4170.h:492
@ AD4170_MODE_SINGLE
Definition: ad4170.h:461
enum ad4170_i_out_val i_out_val
Definition: ad4170.h:865
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:120
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:457
#define AD4170_REG_COEFF_WRRD_STB
Definition: ad4170.h:109
@ AD4170_TEMP_SENSOR_P
Definition: ad4170.h:540
enum ad4170_burnout burnout
Definition: ad4170.h:638
enum ad4170_chop_adc chop_adc
Definition: ad4170.h:636
@ AD4170_I_OUT_AIN13
Definition: ad4170.h:819
@ AD4170_MODE_CONT_FIR
Definition: ad4170.h:457
@ AD4170_I_OUT_GPIO0
Definition: ad4170.h:827
ad4170_post_filter
Optional Post-Filter configuration.
Definition: ad4170.h:717
#define AD4190_PRODUCT_ID_L_VALUE
Definition: ad4170.h:155
@ AD4170_AIN1
Definition: ad4170.h:524
int ad4170_dac_sw_toggle(struct ad4170_dev *dev, bool polarity)
Perform a software toggle.
Definition: ad4170.c:1729
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:203
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:119
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:809
enum ad4170_chan_to_gpio chan_to_gpio
Definition: ad4170.h:365
@ AD4170_REFOUT
Definition: ad4170.h:555
#define AD4170_REG_ADC_SETUPS_MISC(n)
Definition: ad4170.h:95
int ad4170_get_data32(struct ad4170_dev *dev, uint32_t *data)
Get data from register Data_32b.
Definition: ad4170.c:531
int ad4170_remove(struct ad4170_dev *dev)
Remove the device and free al the resources.
Definition: ad4170.c:1954
ad4170_id
Device selector ID.
Definition: ad4170.h:995
enum ad4170_chop_iexc chop_iexc
Definition: ad4170.h:634
#define AD4170_ADC_SETUPS_AFE_REF_BUF_M_MSK
Definition: ad4170.h:234
#define AD4170_REG_COEFF_WRITE_DATA
Definition: ad4170.h:106
bool enabled
Definition: ad4170.h:930
ad4170_delay_n
Delay to Add After Channel Switch.
Definition: ad4170.h:499
int ad4170_spi_reg_write(struct ad4170_dev *dev, uint32_t reg_addr, uint32_t reg_data)
Write device register.
Definition: ad4170.c:313
#define AD4170_ADC_SETUPS_POST_FILTER_SEL_MSK
Definition: ad4170.h:241
ad4170_sdo_rdby_dly
Reset Interface on CS or SCLK.
Definition: ad4170.h:352
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:1741
@ AD4170_POST_FILTER_50MS
Definition: ad4170.h:723
@ AD4170_DLY_4096
Definition: ad4170.h:511
@ AD4170_I_OUT_AIN9
Definition: ad4170.h:811
@ AD4170_POST_FILTER_40MS
Definition: ad4170.h:721
@ AD4170_SYNC_ALTERNATE
Definition: ad4170.h:334
#define AD4170_REG_ADC_SETUPS_GAIN(n)
Definition: ad4170.h:100
bool dig_aux2_output
Definition: ad4170.h:1055
bool sync_loss_detect
Definition: ad4170.h:988
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:1693
ad4170_chop_adc
ADC/Mux Chopping Control.
Definition: ad4170.h:602
int ad4170_get_data24(struct ad4170_dev *dev, uint32_t *data)
Get data from register Data_24b.
Definition: ad4170.c:482
int ad4170_get_data32(struct ad4170_dev *dev, uint32_t *data)
Get data from register Data_32b.
Definition: ad4170.c:531
@ AD4170_PGA_GAIN_2
Definition: ad4170.h:677
@ AD4170_DLY_2048
Definition: ad4170.h:509
int ad4170_reset(struct ad4170_dev *dev)
Perform a software reset.
Definition: ad4170.c:978
int ad4170_get_error(struct ad4170_dev *dev, uint16_t *error)
Get the Error register.
Definition: ad4170.c:1252
#define AD4170_REG_STANDBY_CTRL
Definition: ad4170.h:87
@ AD4170_POST_FILTER_FAST_AC
Definition: ad4170.h:727
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:682
int ad4170_set_v_bias(struct ad4170_dev *dev, uint16_t ch_mask)
Set the AD4170 Voltage bias.
Definition: ad4170.c:1487
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
#define AD4170_NUM_CHANNELS
Definition: ad4170.h:278
int ad4170_set_channel_en(struct ad4170_dev *dev, uint16_t channel_en)
Enable AD4170 channels.
Definition: ad4170.c:1313
#define AD4170_INTERFACE_CONFIG_C_CRC_MSK
Definition: ad4170.h:135
@ AD4170_I_OUT_1000UA
Definition: ad4170.h:854
@ AD4170_DCLKDIVBY4
Definition: ad4170.h:388
Header file of GPIO Interface.
@ AD4170_FIR_SYM_EVEN
Definition: ad4170.h:878
int ad4170_set_adc_ctrl(struct ad4170_dev *dev, struct ad4170_adc_ctrl adc_ctrl)
Set the AD4170 ADC Control.
Definition: ad4170.c:1275
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:1681
int ad4170_set_ref_control(struct ad4170_dev *dev, bool enable)
Set the AD4170 Ref Control.
Definition: ad4170.c:1465
@ AD4170_AIN8
Definition: ad4170.h:531
ad4170_mclk_div
Master Clock Divider.
Definition: ad4170.h:397
@ AD4170_DLY_16
Definition: ad4170.h:503
uint16_t channel_en
Definition: ad4170.h:957
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:721
int ad4170_set_setup(struct ad4170_dev *dev, uint8_t n, struct ad4170_setup setup)
Configure an ADC setup.
Definition: ad4170.c:1391
enum ad4170_ref_select ref_select
Definition: ad4170.h:706
@ AD4170_DAC_GAIN_2
Definition: ad4170.h:921
#define AD4170_REG_CLOCK_CTRL
Definition: ad4170.h:86
@ AD4170_AIN2
Definition: ad4170.h:525
#define AD4170_REG_COEFF_ADDRESS
Definition: ad4170.h:108
@ AD4170_DGND
Definition: ad4170.h:550
int ad4170_set_dac_config(struct ad4170_dev *dev, struct ad4170_dac_config config)
Set the AD4170 DAC settings.
Definition: ad4170.c:1625
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
@ AD4170_MODE_STANDBY
Definition: ad4170.h:463
int ad4170_get_data24(struct ad4170_dev *dev, uint32_t *data)
Get data from register Data_24b.
Definition: ad4170.c:482
@ AD4170_DIG_AUX1_DISABLED
Definition: ad4170.h:315
#define AD4170_REG_DAC_CHANNEL_EN_DAC_EN_MSK
Definition: ad4170.h:261
int ad4170_set_v_bias(struct ad4170_dev *dev, uint16_t ch_mask)
Set the AD4170 Voltage bias.
Definition: ad4170.c:1487
bool crc_enabled
Definition: ad4170.h:986
#define AD4170_CHANNEL_MAPN_AINM_MSK
Definition: ad4170.h:226
@ AD4170_PGA_GAIN_128
Definition: ad4170.h:689
Header file of utility functions.
#define AD4170_SW_RESETX_MSK
Definition: ad4170.h:127
@ AD4170_MODE_SELF_GAIN_CAL
Definition: ad4170.h:475
@ AD4170_AIN5
Definition: ad4170.h:528
#define AD4170_CRC8_INITIAL_VALUE
Definition: ad4170.h:140
@ AD4170_DIG_AUX2_DISABLED
Definition: ad4170.h:300
ad4170_i_out_pin
Current Source Destination.
Definition: ad4170.h:791
struct ad4170_spi_settings spi_settings
Definition: ad4170.h:1037
#define AD4170_REG_ADC_SETUPS_AFE(n)
Definition: ad4170.h:96
struct no_os_gpio_desc * gpio_dig_aux1
Definition: ad4170.h:1051
#define AD4170_REG_DATA_16b
Definition: ad4170.h:79
#define AD4170_REG_DATA_24b
Definition: ad4170.h:81
Clock_Ctrl register settings.
Definition: ad4170.h:427
@ AD4170_CONT_TRANSMIT_ON
Definition: ad4170.h:446
uint32_t rdy_conv_timeout
Definition: ad4170.h:1039
#define AD4170_REG_INTERFACE_CONFIG_C
Definition: ad4170.h:76
AD4170 device descriptor.
Definition: ad4170.h:1029
#define AD4170_REG_DATA_32b
Definition: ad4170.h:83
enum ad4170_ain ainm
Definition: ad4170.h:580
#define AD4170_REG_WRITE_6(x)
Definition: ad4170.h:62
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:153
enum ad4170_ref_buf ref_buf_p
Definition: ad4170.h:704
@ AD4170_I_OUT_500UA
Definition: ad4170.h:852
DAC Config settings (registers HW_LDAC_Mask, HW_Toggle_Mask, Channel_En and DAC_Span)
Definition: ad4170.h:928
@ AD4170_I_OUT_GPIO3
Definition: ad4170.h:833
enum ad4170_ain ainp
Definition: ad4170.h:578
int ad4170_spi_reg_write(struct ad4170_dev *dev, uint32_t reg_addr, uint32_t reg_data)
Write device register.
Definition: ad4170.c:313
@ AD4170_I_OUT_AIN3
Definition: ad4170.h:799
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:1741
AD4170 SPI settings.
Definition: ad4170.h:982
@ AD4170_SYNC_DISABLED
Definition: ad4170.h:330
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:1705
int ad4170_set_pin_muxing(struct ad4170_dev *dev, struct ad4170_pin_muxing pin_muxing)
Set the AD4170 Pin Muxing settings.
Definition: ad4170.c:1049
#define AD4170_REG_VENDOR_L
Definition: ad4170.h:74
@ AD4170_I_OUT_AIN7
Definition: ad4170.h:807
struct no_os_gpio_init_param * gpio_dig_aux1_init
Definition: ad4170.h:1049
#define AD4170_REG_DATA_STATUS
Definition: ad4170.h:78
@ AD4170_I_OUT_AIN12
Definition: ad4170.h:817
@ AD4170_DLY_1024
Definition: ad4170.h:507
#define AD4170_CLOCK_CTRL_CLOCKSEL_MSK
Definition: ad4170.h:176
Header file of CRC-8 computation.
@ AD4170_PGA_GAIN_32
Definition: ad4170.h:685
@ AD4170_CLKDIVBY8
Definition: ad4170.h:405
@ AD4170_AIN4
Definition: ad4170.h:527
#define AD4170_REG_INTERFACE_CONFIG_A
Definition: ad4170.h:65
enum ad4170_post_filter post_filter_sel
Definition: ad4170.h:755
@ AD4170_AIN7
Definition: ad4170.h:530
@ AD4170_DLY_8192
Definition: ad4170.h:513
@ AD4170_CONT_READ_OFF
Definition: ad4170.h:442
#define AD4170_REG_ADC_CHANNEL_MAP(ch)
Definition: ad4170.h:94
@ AD4170_BURNOUT_2U
Definition: ad4170.h:623
@ AD4170_I_OUT_0UA
Definition: ad4170.h:842
ad4170_clocksel
ADC Clock Select.
Definition: ad4170.h:412
@ AD4170_FIR_SYM_ODD
Definition: ad4170.h:876
struct no_os_spi_desc * spi_desc
Definition: ad4170.h:1035
@ AD4170_TEMP_SENSOR_N
Definition: ad4170.h:541
@ AD4170_SDO_RDY_SCLK
Definition: ad4170.h:354
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:131
enum ad4170_delay_n delay_n
Definition: ad4170.h:567
struct ad4170_afe afe
Definition: ad4170.h:767
ad4170_chan_to_gpio
Enables Current Channel Number Be Output to GPIO Pins.
Definition: ad4170.h:287
#define AD4170_REG_INTERFACE_STATUS_A
Definition: ad4170.h:77
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:81