Go to the documentation of this file.
55 #define AD74416H_N_CHANNELS 4
57 #define AD74416H_CH_A 0
58 #define AD74416H_CH_B 1
59 #define AD74416H_CH_C 2
60 #define AD74416H_CH_D 3
63 #define AD74416H_RSENSE 12
65 #define AD74416H_ADC_MAX_VALUE 16777215
68 #define AD74416H_NOP 0x00
69 #define AD74416H_CH_FUNC_SETUP(x) (0x01 + (x * 12))
70 #define AD74416H_ADC_CONFIG(x) (0x02 + (x * 12))
71 #define AD74416H_DIN_CONFIG0(x) (0x03 + (x * 12))
72 #define AD74416H_DIN_CONFIG1(x) (0x04 + (x * 12))
73 #define AD74416H_OUTPUT_CONFIG(x) (0x05 + (x * 12))
74 #define AD74416H_RTD_CONFIG(x) (0x06 + (x * 12))
75 #define AD74416H_FET_LKG_COMP(x) (0x07 + (x * 12))
76 #define AD74416H_DO_EXT_CONFIG(x) (0x08 + (x * 12))
77 #define AD74416H_I_BURNOUT_CONFIG(x) (0x09 + (x * 12))
78 #define AD74416H_DAC_CODE(x) (0x0A + (x * 12))
79 #define AD74416H_DAC_ACTIVE(x) (0x0C + (x * 12))
80 #define AD74416H_GPIO_CONFIG(x) (0x32 + x)
81 #define AD74416H_PWR_OPTIM_CONFIG 0x38
82 #define AD74416H_ADC_CONV_CTRL 0x39
83 #define AD74416H_DIAG_ASSIGN 0x3A
84 #define AD74416H_WTD_CONFIG 0x3B
85 #define AD74416H_DIN_COMP_OUT 0x3E
86 #define AD74416H_ALERT_STATUS 0x3F
87 #define AD74416H_LIVE_STATUS 0x40
88 #define AD74416H_ADC_RESULT_UPR(x) (0x41 + (x * 2))
89 #define AD74416H_ADC_RESULT(x) (0x42 + (x * 2))
90 #define AD74416H_ADC_DIAG_RESULT(x) (0x49 + x)
91 #define AD74416H_LAST_ADC_RESULT_UPR 0x4D
92 #define AD74416H_LAST_ADC_RESULT 0x4E
93 #define AD74416H_DIN_COUNTER(x) (0x50 + (x * 2))
94 #define AD74416H_SUPPLY_ALERT_STATUS 0x57
95 #define AD74416H_CHANNEL_ALERT_STATUS(x) (0x58 + x)
96 #define AD74416H_ALERT_MASK 0x5C
97 #define AD74416H_SUPPLY_ALERT_MASK 0x5D
98 #define AD74416H_CHANNEL_ALERT_MASK(x) (0x5E + x)
99 #define AD74416H_READ_SELECT 0x6E
100 #define AD74416H_BURST_READ_SEL 0x6F
101 #define AD74416H_THERM_RST 0x73
102 #define AD74416H_CMD_KEY 0x74
103 #define AD74416H_BORADCAST_CMD_KEY 0x75
104 #define AD74416H_SCRATCH(x) (0x76 + x)
105 #define AD74416H_GENERIC_ID 0x7A
106 #define AD74416H_SILICON_REV 0x7B
107 #define AD74416H_SILICON_ID0 0x7D
108 #define AD74416H_SILICON_ID1 0x7E
109 #define AD74416H_HART_ALERT_STATUS(x) (0x80 + (x * 16))
110 #define AD74416H_HART_RX(x) (0x81 + (x * 16))
111 #define AD74416H_HART_TX(x) (0x82 + (x * 16))
112 #define AD74416H_HART_FCR(x) (0x83 + (x * 16))
113 #define AD74416H_HART_MCR(x) (0x84 + (x * 16))
114 #define AD74416H_HART_RFC(x) (0x85 + (x * 16))
115 #define AD74416H_HART_TFC(x) (0x86 + (x * 16))
116 #define AD74416H_HART_ALERT_MASK(x) (0x87 + (x * 16))
117 #define AD74416H_HART_CONFIG(x) (0x88 + (x * 16))
118 #define AD74416H_HART_TX_PREM(x) (0x89 + (x * 16))
119 #define AD74416H_HART_EVDET(x) (0x8A + (x * 16))
120 #define AD74416H_HART_TX_GAIN(x) (0x8B + (x * 16))
121 #define AD74416H_HART_GPIO_IF_CONFIG 0xC0
122 #define AD74416H_HART_GPIO_MON_CONFIG(x) (0xC1 + x)
125 #define AD74416H_CMD_KEY_RESET_1 0x15FA
126 #define AD74416H_CMD_KEY_RESET_2 0xAF51
128 #define AD74416H_SPI_RD_RET_INFO_MSK NO_OS_BIT(8)
129 #define AD74416H_ERR_CLR_MSK NO_OS_GENMASK(15, 0)
130 #define AD74416H_SPI_CRC_ERR_MSK NO_OS_BIT(13)
133 #define AD74416H_CH_FUNC_SETUP_MSK NO_OS_GENMASK(3, 0)
136 #define AD74416H_ADC_CONV_RATE_MSK NO_OS_GENMASK(10, 8)
137 #define AD74416H_ADC_CONV_RANGE_MSK NO_OS_GENMASK(6, 4)
138 #define AD74416H_CONV_MUX_MSK NO_OS_GENMASK(2, 0)
141 #define AD74416H_COUNT_EN_MSK NO_OS_BIT(15)
142 #define AD74416H_DIN_INV_COMP_OUT_MSK NO_OS_BIT(14)
143 #define AD74416H_COMPARATOR_EN_MSK NO_OS_BIT(13)
144 #define AD74416H_DIN_SINK_RANGE_MSK NO_OS_BIT(12)
145 #define AD74416H_DIN_SINK_MSK NO_OS_GENMASK(11, 7)
146 #define AD74416H_DEBOUNCE_MODE_MSK NO_OS_BIT(6)
147 #define AD74416H_DEBOUNCE_TIME_MSK NO_OS_GENMASK(4, 0)
150 #define AD74416H_DIN_INPUT_SELECT_MSK NO_OS_BIT(10)
151 #define AD74416H_DIN_SC_DET_EN_MSK NO_OS_BIT(9)
152 #define AD74416H_DIN_OC_DET_EN_MSK NO_OS_BIT(8)
153 #define AD74416H_DIN_THRESH_MODE_MSK NO_OS_BIT(7)
154 #define AD74416H_COMP_THRESH_MSK NO_OS_GENMASK(6, 0)
157 #define AD74416H_AVDD_SELECT_MSK NO_OS_GENMASK(15, 14)
158 #define AD74416H_ALARM_DEG_PERIOD_MSK NO_OS_BIT(12)
159 #define AD74VOUT_4W_EN_MSK NO_OS_BIT(11)
160 #define AD74416H_WAIT_LDAC_CMD_MSK NO_OS_BIT(10)
161 #define AD74416H_VOUT_RANGE_MSK NO_OS_BIT(7)
162 #define AD74416H_SLEW_EN_MSK NO_OS_GENMASK(6, 5)
163 #define AD74416H_SLEW_LIN_STEP_MSK NO_OS_GENMASK(4, 3)
164 #define AD74416H_SLEW_LIN_RATE_MSK NO_OS_GENMASK(2, 1)
165 #define AD74416H_I_LIMIT_MSK NO_OS_BIT(0)
168 #define AD74416H_RTD_ADC_REF_MSK NO_OS_BIT(3)
169 #define AD74416H_RTD_MODE_SEL_MSK NO_OS_BIT(2)
170 #define AD74416H_RTD_EXC_SWAP_MSK NO_OS_BIT(1)
171 #define AD74416H_RTD_CURRENT_MSK NO_OS_BIT(0)
174 #define AD74416H_FET_SRC_LKG_COMP_EN_MSK NO_OS_BIT(0)
177 #define AD74416H_DO_T2_MSK NO_OS_GENMASK(12, 8)
178 #define AD74416H_DO_DATA_MSK NO_OS_BIT(7)
179 #define AD74416H_DO_T1_MSK NO_OS_GENMASK(6, 2)
180 #define AD74416H_DO_SRC_SEL_MSK NO_OS_BIT(1)
181 #define AD74416H_DO_MODE_MSK NO_OS_BIT(0)
184 #define AD74416H_BRN_SEN_VSENSEN_CURR_MSK NO_OS_GENMASK(6, 5)
185 #define AD74416H_BRN_SEN_VSENSEN_POL_MSK NO_OS_BIT(4)
186 #define AD74416H_BRN_VIOUT_CURR_MSK NO_OS_GENAMSK(2, 1)
187 #define AD74416H_BRN_VIOUT_POL_MSK NO_OS_BIT(0)
190 #define AD74416H_DAC_CODE_MSK NO_OS_GENMASK(15, 0)
193 #define AD74416H_DAC_ACTIVE_MSK NO_OS_GENMASK(15, 0)
196 #define AD74416H_ADC_RDY_CTRL_MSK NO_OS_BIT(12)
197 #define AD74416H_CONV_RATE_DIAG_MSK NO_OS_GENMASK(11, 10)
198 #define AD74416H_CONV_SEQ_MSK NO_OS_GENMASK(9, 8)
199 #define AD74416H_DIAG_EN_MSK(x) (NO_OS_BIT(x) << 4)
200 #define AD74416H_CH_EN_MSK(x) NO_OS_BIT(x)
203 #define AD74416H_DIAG_ASSIGN_MSK(x) (NO_OS_GENMASK(3, 0) << ((x) * 4))
206 #define AD74416H_DIN_DO_MSK NO_OS_BIT(7, 6)
207 #define AD74416H_GPI_DATA_MSK NO_OS_BIT(5)
208 #define AD74416H_GPO_DATA_MSK NO_OS_BIT(4)
209 #define AD74416H_GP_WK_PD_EN_MSK NO_OS_BIT(3)
210 #define AD74416H_GPIO_SELECT_MSK NO_OS_GENMASK(2, 0)
213 #define AD74416H_REF_EN_MSK NO_OS_BIT(13)
214 #define AD74416H_SENSE_AGND_OPT_MSK NO_OS_BIT(12)
215 #define AD74416H_SENSE_HF_OPT_D_MSK NO_OS_BIT(11)
216 #define AD74416H_SENSE_HF_OPT_C_MSK NO_OS_BIT(10)
217 #define AD74416H_SENSE_HF_OPT_B_MSK NO_OS_BIT(9)
218 #define AD74416H_SENSE_HF_OPT_A_MSK NO_OS_BIT(8)
219 #define AD74416H_SENSE_LF_OPT_D_MSK NO_OS_BIT(7)
220 #define AD74416H_SENSE_LF_OPT_C_MSK NO_OS_BIT(6)
221 #define AD74416H_SENSE_LF_OPT_B_MSK NO_OS_BIT(5)
222 #define AD74416H_SENSE_LF_OPT_A_MSK NO_OS_BIT(4)
223 #define AD74416H_VSENSEN_OPT_D_MSK NO_OS_BIT(3)
224 #define AD74416H_VSENSEN_OPT_C_MSK NO_OS_BIT(2)
225 #define AD74416H_VSENSEN_OPT_B_MSK NO_OS_BIT(1)
226 #define AD74416H_VSENSEN_OPT_A_MSK NO_OS_BIT(0)
229 #define AD74416H_WDT_EN_MSK NO_OS_BIT(4)
230 #define AD74416H_WDT_TIMEOUT_MSK NO_OS_GENMASK(3, 0)
233 #define AD74416H_DIN_COMP_OUT_D_MSK NO_OS_BIT(3)
234 #define AD74416H_DIN_COMP_OUT_C_MSK NO_OS_BIT(2)
235 #define AD74416H_DIN_COMP_OUT_B_MSK NO_OS_BIT(1)
236 #define AD74416H_DIN_COMP_OUT_A_MSK NO_OS_BIT(0)
239 #define AD74416H_HART_ALERT_D_MSK NO_OS_BIT(15)
240 #define AD74416H_HART_ALERT_C_MSK NO_OS_BIT(14)
241 #define AD74416H_HART_ALERT_B_MSK NO_OS_BIT(13)
242 #define AD74416H_HART_ALERT_A_MSK NO_OS_BIT(12)
243 #define AD74416H_CHANNEL_ALERT_D_MSK NO_OS_BIT(11)
244 #define AD74416H_CHANNEL_ALERT_C_MSK NO_OS_BIT(10)
245 #define AD74416H_CHANNEL_ALERT_B_MSK NO_OS_BIT(9)
246 #define AD74416H_CHANNEL_ALERT_A_MSK NO_OS_BIT(8)
247 #define AD74416H_ADC_ERR_MSK NO_OS_BIT(5)
248 #define AD74416H_TEMP_ALERT_MSK NO_OS_BIT(4)
249 #define AD74416H_SPI_ERR_MSK NO_OS_BIT(3)
250 #define AD74416H_SUPPLY_ERR_MSK NO_OS_BIT(2)
251 #define AD74416H_WDT_RESET_OCCURRED_MSK NO_OS_BIT(1)
252 #define AD74416H_RESET_OCCURRED_MSK NO_OS_BIT(0)
255 #define AD74416H_ANALOG_IO_STATUS_D_MSK NO_OS_BIT(15)
256 #define AD74416H_ANALOG_IO_STATUS_C_MSK NO_OS_BIT(14)
257 #define AD74416H_ANALOG_IO_STATUS_B_MSK NO_OS_BIT(13)
258 #define AD74416H_ANALOG_IO_STATUS_A_MSK NO_OS_BIT(12)
259 #define AD74416H_DO_STATUS_D_MSK NO_OS_BIT(11)
260 #define AD74416H_DO_STATUS_C_MSK NO_OS_BIT(10)
261 #define AD74416H_DO_STATUS_B_MSK NO_OS_BIT(9)
262 #define AD74416H_DO_STATUS_A_MSK NO_OS_BIT(8)
263 #define AD74416H_DIN_STATUS_D_MSK NO_OS_BIT(7)
264 #define AD74416H_DIN_STATUS_C_MSK NO_OS_BIT(6)
265 #define AD74416H_DIN_STATUS_B_MSK NO_OS_BIT(5)
266 #define AD74416H_DIN_STATUS_A_MSK NO_OS_BIT(4)
267 #define AD74416H_TEMP_ALERT_STATUS_MSK NO_OS_BIT(3)
268 #define AD74416H_ADC_DATA_RDY_MSK NO_OS_BIT(2)
269 #define AD74416H_ADC_BUSY_MSK NO_OS_BIT(1)
270 #define AD74416H_SUPPLY_STATUS_MSK NO_OS_BIT(0)
273 #define AD74416H_CONV_RES_MUX_MSK NO_OS_GENMASK(15, 13)
274 #define AD74416H_CONV_RES_RANGE_MSK NO_OS_GENMASK(12, 10)
275 #define AD74416H_CONV_SEQ_COUNT_MSK NO_OS_GENAMSK(9. 8)
276 #define AD74416H_CONV_RES_UPR_MSK NO_OS_GENMASK(7, 0)
279 #define AD74416H_CONV_RESULT_MSK NO_OS_GENMASK(15, 0)
282 #define AD74416H_DIAG_RESULT_MSK NO_OS_GENMASK(15, 0)
285 #define AD74416H_LAST_CONV_CH_MSK NO_OS_GENAMSK(10 8)
286 #define AD74416H_LAST_CONV_RES_UPR_MSK NO_OS_GENMASK(7, 0)
289 #define AD74416H_LAST_CONV_RES_MSK NO_OS_GENMASK(15, 0)
292 #define AD74416H_DIN_CNT_UPR_MSK NO_OS_GENMASK(15, 0)
295 #define AD74416H_DIN_CNT_MSK NO_OS_GENMASK(15, 0)
298 #define AD74416H_AVDD_HI_ERR_MSK NO_OS_BIT(6)
299 #define AD74416H_AVDD_LO_ERR_MSK NO_OS_BIT(5)
300 #define AD74416H_DO_VDD_ERR_MSK NO_OS_BIT(4)
301 #define AD74416H_AVCC_ERR_MSK NO_OS_BIT(3)
302 #define AD74416H_DVCC_ERR_MSK NO_OS_BIT(2)
303 #define AD74416H_AVSS_ERR_MSK NO_OS_BIT(1)
304 #define AD74416H_CAL_MEM_ERR_MSK NO_OS_BIT(0)
307 #define AD74416H_ANALOG_IO_OC_MSK NO_OS_BIT(5)
308 #define AD74416H_ANALOG_IO_SC_MSK NO_OS_BIT(4)
309 #define AD74416H_DO_TIMEOUT_MSK NO_OS_BIT(3)
310 #define AD74416H_DO_SC_MSK NO_OS_BIT(2)
311 #define AD74416H_DIN_OC_MSK NO_OS_BIT(1)
312 #define AD74416H_DIN_SC_MSK NO_OS_BIT(0)
315 #define AD74416H_READBACK_ADDR_MSK NO_OS_GENMASK(8, 0)
318 #define AD74416H_BURST_READ_SEL_MSK NO_OS_GENMASK(15, 0)
321 #define AD74416H_THERM_RST_EN_MSK NO_OS_BIT(0)
324 #define AD74416H_CMD_KEY_MSK NO_OS_GENMASK(15, 0)
327 #define AD74416H_BROADCAST_CMD_KEY_MSK NO_OS_GENMASK(15, 0)
330 #define AD74416H_SCRATCH_BITS_MSK NO_OS_GENMASK(15, 0)
333 #define AD74416H_GENERIC_ID_MSK NO_OS_GENMASK(2, 0)
336 #define AD74416H_SILICON_REV_ID_MSK NO_OS_GENMASK(7, 0)
339 #define AD74416H_UID0_MSK NO_OS_GENMASK(6, 0)
342 #define AD74416H_UID2_MSK NO_OS_GENMASK(11, 6)
343 #define AD74416H_UID1_MSK NO_OS_GENMASK(5, 0)
346 #define AD74416H_FRM_MON_STATE_MSK NO_OS_GENMASK(15, 13)
347 #define AD74416H_EOM_MSK NO_OS_BIT(12)
348 #define AD74416H_RX_BCNT_MSK NO_OS_BIT(11)
349 #define AD74416H_RX_CMD_MSK NO_OS_BIT(10)
350 #define AD74416H_SOM_MSK NO_OS_BIT(9)
351 #define AD74416H_CD_MSK NO_OS_BIT(8)
352 #define AD74416H_CD_EDGE_DET_MSK NO_OS_BIT(7)
353 #define AD74416H_TX_COMPLETE_MSK NO_OS_BIT(6)
354 #define AD74416H_TX_FIFO_ALERT_MSK NO_OS_BIT(5)
355 #define AD74416H_RX_FIFO_ALERT_MSK NO_OS_BIT(4)
356 #define AD74416H_RX_OVERFLOW_ERR_MSK NO_OS_BIT(3)
357 #define AD74416H_FRAME_ERR_MSK NO_OS_BIT(2)
358 #define AD74416H_PARITY_ERR_MSK NO_OS_BIT(1)
359 #define AD74416H_GAP_ERR_MSK NO_OS_BIT(0)
362 #define AD74416H_RFGI_MSK NO_OS_BIT(11)
363 #define AD74416H_RFFE_MSK NO_OS_BIT(10)
364 #define AD74416H_RFPE_MSK NO_OS_BIT(9)
365 #define AD74416H_RFBI_MSK NO_OS_BIT(8)
366 #define AD74416H_RBR_MSK NO_OS_GENMASK(7, 0)
369 #define AD74416H_TDR_MSK NO_OS_GENMASK(7, 0)
372 #define AD74416H_TFTRIG_MSK NO_OS_GENMASK(11, 8)
373 #define AD74416H_RFTRIG_MSK NO_OS_GENMASK(6, 3)
374 #define AD74416H_TFCLR_MSK NO_OS_BIT(2)
375 #define AD74416H_RFCLR_MSK NO_OS_BIT(1)
376 #define AD74416H_FIFOEN_MSK NO_OS_BIT(0)
379 #define AD74416H_RTS_MSK NO_OS_BIT(0)
382 #define AD74416H_RFC_MSK NO_OS_GENMASK(4, 0)
385 #define AD74416H_TFC_MSK NO_OS_GENMASK(4, 0)
388 #define AD74416H_CD_EXTD_QUAL_MSK NO_OS_BIT(13)
389 #define AD74416H_FRM_MON_RX_PREMX2_MSK NO_OS_BIT(12)
390 #define AD74416H_FRM_MON_RST_GAP_MSK NO_OS_BIT(11)
391 #define AD74416H_FRM_MON_RST_CD_MSK NO_OS_BIT(10)
392 #define AD74416H_RX_ALL_CHARS_MSK NO_OS_BIT(9)
393 #define AD74416H_FRM_MON_EN_MSK NO_OS_BIT(8)
394 #define AD74416H_EVENT_DET_SEL_MSK NO_OS_GENMASK(7, 6)
395 #define AD74416H_TX_1B_AFTER_RST_MSK NO_OS_BIT(5)
396 #define AD74416H_AUTO_CLR_RST_MSK NO_OS_BIT(4)
397 #define AD74416H_CD_EDGE_SEL_MSK NO_OS_GENAMSK(3, 2)
398 #define AD74416H_MODEM_DUPLEX_MSK NO_OS_BIT(1)
399 #define AD74416H_MODEM_PWRUP_MSK NO_OS_BIT(0)
402 #define AD74416H_TX_PREM_CNT_MSK NO_OS_GENMASK(4, 0)
405 #define AD74416H_EVENT_DET_TIME_MSK NO_OS_GENMASK(15, 0)
408 #define AD74416H_TX_GAIN_MSK NO_OS_GENMASK(3, 0)
411 #define AD74416H_HART_GPIO_IF_CH_MSK NO_OS_GENMASK(3, 2)
412 #define AD74416H_HART_GPIO_IF_SEL_MSK NO_OS_GENMASK(1, 0)
415 #define AD74416H_HART_GPIO_MON_CH_MSK NO_OS_GENMASK(4, 3)
416 #define AD74416H_HART_GPIO_MON_SEL_MSK NO_OS_GENMASK(2, 0)
418 #define AD74416H_TEMP_OFFSET -2392
419 #define AD74416H_TEMP_SCALE 8950
420 #define AD74416H_TEMP_SCALE_DIV 1000
422 #define AD74416H_FRAME_SIZE 5
423 #define AD74416H_THRESHOLD_DAC_RANGE 98
424 #define AD74416H_THRESHOLD_RANGE 30000
425 #define AD74416H_DAC_RANGE 12000
426 #define AD74416H_DAC_CURRENT_RANGE 25000
427 #define AD74416H_DAC_RESOLUTION 16
428 #define AD74414H_DAC_RESOLUTION 14
429 #define AD74116H_CONV_TIME_US 1000000
650 uint16_t *, uint32_t);
798 #endif // _AD74416H_H
uint8_t DO_STATUS_D
Definition: ad74416h.h:599
#define AD74416H_DIAG_ASSIGN
Definition: ad74416h.h:83
int ad74416h_set_gpio_config(struct ad74416h_desc *, uint32_t, enum ad74416h_gpio_select)
Set the GPIO operation mode.
Definition: ad74416h.c:797
int ad74416h_set_therm_rst(struct ad74416h_desc *desc, bool enable)
Enable or disable the higher thermal reset.
Definition: ad74416h.c:926
@ AD74416H_START_CONT
Definition: ad74416h.h:524
@ AD74416H_STEP_1_5_PERCENT
Definition: ad74416h.h:553
@ AD74416H_START_SINGLE
Definition: ad74416h.h:523
#define AD74416H_DIN_COMP_OUT
Definition: ad74416h.h:85
void no_os_put_unaligned_be16(uint16_t val, uint8_t *buf)
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:85
uint8_t ANALOG_IO_STATUS_B
Definition: ad74416h.h:601
int ad74416h_set_gpio_config(struct ad74416h_desc *desc, uint32_t ch, enum ad74416h_gpio_select config)
Set the GPIO operation mode.
Definition: ad74416h.c:797
@ AD74416H_LIN_RATE_230KHZ4
Definition: ad74416h.h:565
ad74416h_gpio_select
GPO operation modes.
Definition: ad74416h.h:464
int ad74416h_get_diag(struct ad74416h_desc *, uint32_t, uint16_t *)
Get the diagnostic value for a specific channel.
Definition: ad74416h.c:717
enum ad74416h_vout_range vout_range
Definition: ad74416h.h:628
@ AD74416H_DIAG_DVCC
Definition: ad74416h.h:534
int ad74416h_set_debounce_mode(struct ad74416h_desc *desc, uint32_t ch, enum ad74416h_debounce_mode mode)
Set the debounce mode for the IOx inputs when the ADC is running in digital input mode.
Definition: ad74416h.c:739
@ AD74416H_4K8SPS
Definition: ad74416h.h:493
#define AD74416H_THERM_RST
Definition: ad74416h.h:101
#define NO_OS_GENMASK(h, l)
Definition: no_os_util.h:86
int ad74416h_reg_read(struct ad74416h_desc *desc, uint32_t addr, uint16_t *val)
Read a register's value.
Definition: ad74416h.c:222
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
@ AD74416H_DIGITAL_INPUT_LOOP
Definition: ad74416h.h:455
int ad74416h_dac_current_to_code(struct ad74416h_desc *, uint32_t, uint16_t *)
Convers a microamp value in the corresponding DAC 16 bit code.
Definition: ad74416h.c:131
ad74416h_vout_range
Possible voltage output ranges for the DAC.
Definition: ad74416h.h:571
#define AD77416H_DEV_ADDRESS_MSK
Definition: ad74416h.c:55
@ AD74416H_RNG_NEG104_104MV
Definition: ad74416h.h:482
Header file of SPI Interface.
Header file of AD74416h Driver.
int ad74416h_set_diag(struct ad74416h_desc *, uint32_t, enum ad74416h_diag_mode)
Set which diagnostic value to be loaded in the DIAG_RESULT register.
Definition: ad74416h.c:693
#define AD74416H_FRAME_SIZE
Definition: ad74416h.h:422
uint8_t SUPPLY_STATUS
Definition: ad74416h.h:588
int ad74416h_get_adc_single(struct ad74416h_desc *desc, uint32_t ch, uint16_t *val)
Get a single ADC raw value for a specific channel, then power down the ADC.
Definition: ad74416h.c:514
int ad74416h_set_channel_vout_range(struct ad74416h_desc *desc, uint32_t ch, enum ad74416h_vout_range vout_range)
Set the voltage range for a specific channel.
Definition: ad74416h.c:637
@ AD74416H_AVDD_C
Definition: ad74416h.h:545
@ AD74416H_VOLTAGE_IN
Definition: ad74416h.h:450
@ AD74416H_DIAG_LDO1V8
Definition: ad74416h.h:536
uint8_t ADC_DATA_RDY
Definition: ad74416h.h:590
@ ID_AD74416H
Definition: ad74416h.h:439
int ad74416h_set_debounce_time(struct ad74416h_desc *, uint32_t, uint32_t)
Set the debounce settle time for the IOx inputs when the ADC is running in digital input mode.
Definition: ad74416h.c:754
bool enabled
Definition: ad74416h.h:626
@ AD74416H_10SPS_50_60HZ_HART_REJECTION
Definition: ad74416h.h:490
int ad74416h_reg_write(struct ad74416h_desc *desc, uint32_t addr, uint16_t val)
Write a register's value.
Definition: ad74416h.c:207
Header file of Delay functions.
uint8_t DIN_STATUS_B
Definition: ad74416h.h:593
@ AD74416H_DIAG_AVDD_HI
Definition: ad74416h.h:537
int ad74416h_reset(struct ad74416h_desc *)
Perform software or hardware reset and wait for device reset time.
Definition: ad74416h.c:936
#define AD74416H_DIN_DEBOUNCE_LEN
Definition: ad74416h.c:54
#define AD74416H_GPIO_SELECT_MSK
Definition: ad74416h.h:210
int ad74416h_get_adc_conv_mux(struct ad74416h_desc *desc, uint32_t ch, enum ad74416h_adc_conv_mux *val)
Get the ADC Input Node for conversion.
Definition: ad74416h.c:445
int ad74416h_set_adc_conv_mux(struct ad74416h_desc *, uint32_t, enum ad74416h_adc_conv_mux)
Set the ADC Input Node for conversion.
Definition: ad74416h.c:466
#define AD74416H_CONV_SEQ_MSK
Definition: ad74416h.h:198
uint8_t DIN_STATUS_C
Definition: ad74416h.h:594
int ad74416h_set_threshold(struct ad74416h_desc *desc, uint32_t ch, uint32_t threshold)
Set the threshold, for which a signal would be considered high, when the ADC is running in digital in...
Definition: ad74416h.c:812
ad74416h_debounce_mode
Debounce modes for the IOx inputs when using the digital input op mode.
Definition: ad74416h.h:513
#define AD74416H_I_LIMIT_MSK
Definition: ad74416h.h:165
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:123
struct no_os_spi_desc * spi_desc
Definition: ad74416h.h:638
struct no_os_gpio_init_param * reset_gpio_param
Definition: ad74416h.h:618
enum ad74416h_dev_id id
Definition: ad74416h.h:615
ad74416h_adc_range
Conversion range configuration values.
Definition: ad74416h.h:475
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:60
@ AD74416H_STEP_22_2_PERCENT
Definition: ad74416h.h:555
@ AD74416H_GPIO_CONFIG_DATA
Definition: ad74416h.h:466
#define AD74414H_DAC_RESOLUTION
Definition: ad74416h.h:428
int ad74416h_set_channel_function(struct ad74416h_desc *desc, uint32_t ch, enum ad74416h_op_mode ch_func)
Set the operation mode for a specific channel.
Definition: ad74416h.c:582
#define AD74416H_COMP_THRESH_MSK
Definition: ad74416h.h:154
@ AD74416H_RNG_NEG2P5_2P5V
Definition: ad74416h.h:483
@ AD74416H_CURRENT_IN_LOOP
Definition: ad74416h.h:452
int ad74416h_dac_voltage_to_code(struct ad74416h_desc *desc, int32_t mvolts, uint16_t *code, uint32_t ch)
Converts a millivolt value in the corresponding DAC 16 bit code.
Definition: ad74416h.c:86
#define AD74416H_CMD_KEY_RESET_1
Definition: ad74416h.h:125
@ AD74416H_RNG_NEG0P3125_0V
Definition: ad74416h.h:479
int ad74416h_init(struct ad74416h_desc **desc, struct ad74416h_init_param *init_param)
Initialize the device structure.
Definition: ad74416h.c:997
uint8_t TEMP_ALERT_STATUS
Definition: ad74416h.h:591
#define AD74416H_GPO_DATA_MSK
Definition: ad74416h.h:208
#define AD74416H_DAC_RESOLUTION
Definition: ad74416h.h:427
@ AD74416H_DO_C
Definition: ad74416h.h:544
ad74416h_lin_rate
Possible update rates for a DAC when slew control is enabled.
Definition: ad74416h.h:561
ad74416h_adc_rate
Conversion configuration values.
Definition: ad74416h.h:489
uint16_t value
Definition: ad74416h.h:611
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:121
int ad74416h_dac_voltage_to_code(struct ad74416h_desc *, int32_t, uint16_t *, uint32_t)
Converts a millivolt value in the corresponding DAC 16 bit code.
Definition: ad74416h.c:86
#define AD74416H_SLEW_LIN_STEP_MSK
Definition: ad74416h.h:163
int ad74416h_get_adc_rate(struct ad74416h_desc *, uint32_t, enum ad74416h_adc_rate *)
Get the ADC Conversion Rate for a specific channel.
Definition: ad74416h.c:410
@ AD74416H_DIAG_TEMP
Definition: ad74416h.h:533
@ AD74416H_RNG_0_0P625V
Definition: ad74416h.h:481
int ad74416h_gpio_set(struct ad74416h_desc *desc, uint32_t ch, uint8_t val)
Set the logic value of a GPO pin.
Definition: ad74416h.c:854
@ AD74416H_I_LIMIT0
Definition: ad74416h.h:580
uint8_t ANALOG_IO_STATUS_A
Definition: ad74416h.h:600
int ad74416h_get_adc_conv_mux(struct ad74416h_desc *, uint32_t, enum ad74416h_adc_conv_mux *)
Get the ADC Input Node for conversion.
Definition: ad74416h.c:445
uint8_t DIN_STATUS_A
Definition: ad74416h.h:592
uint8_t comm_buff[AD74416H_FRAME_SIZE]
Definition: ad74416h.h:639
#define AD74416H_DIAG_EN_MSK(x)
Definition: ad74416h.h:199
Used to store the live status bit fields.
Definition: ad74416h.h:609
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:132
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
@ AD74416H_LIN_RATE_4KHZ8
Definition: ad74416h.h:562
#define AD74416H_ADC_RESULT_UPR(x)
Definition: ad74416h.h:88
int ad74416h_get_adc_rate(struct ad74416h_desc *desc, uint32_t ch, enum ad74416h_adc_rate *val)
Get the ADC Conversion Rate for a specific channel.
Definition: ad74416h.c:410
@ AD74416H_DIAG_AVCC
Definition: ad74416h.h:535
#define AD74416H_CMD_KEY
Definition: ad74416h.h:102
#define AD74416H_N_CHANNELS
Definition: ad74416h.h:55
@ AD74416H_DEBOUNCE_MODE_1
Definition: ad74416h.h:515
#define AD74416H_DEBOUNCE_MODE_MSK
Definition: ad74416h.h:146
int ad74416h_set_threshold(struct ad74416h_desc *, uint32_t, uint32_t)
Set the threshold, for which a signal would be considered high, when the ADC is running in digital in...
Definition: ad74416h.c:812
uint8_t DO_STATUS_A
Definition: ad74416h.h:596
int ad74416h_get_adc_range(struct ad74416h_desc *, uint32_t, uint16_t *)
Get the ADC measurement range for a specific channel.
Definition: ad74416h.c:363
int ad74416h_set_channel_i_limit(struct ad74416h_desc *, uint32_t, enum ad74416h_i_limit)
Set the current limit for a specific DAC channel in vout mode.
Definition: ad74416h.c:659
#define AD74416H_OUTPUT_CONFIG(x)
Definition: ad74416h.h:73
#define AD74416H_DIN_CONFIG0(x)
Definition: ad74416h.h:71
#define AD74416H_DAC_RANGE
Definition: ad74416h.h:425
enum ad74416h_dev_id id
Definition: ad74416h.h:636
#define AD74416H_ADC_RESULT(x)
Definition: ad74416h.h:89
int ad74416h_set_diag(struct ad74416h_desc *desc, uint32_t ch, enum ad74416h_diag_mode diag_code)
Set which diagnostic value to be loaded in the DIAG_RESULT register.
Definition: ad74416h.c:693
#define AD74416H_CONV_RES_UPR_MSK
Definition: ad74416h.h:276
Bitfield struct which maps on the LIVE_STATUS register.
Definition: ad74416h.h:587
@ AD74416H_DIAG_AGND
Definition: ad74416h.h:532
@ AD74416H_200SPS_HART_REJECTION
Definition: ad74416h.h:496
#define AD74416H_DIAG_RESULT_MSK
Definition: ad74416h.h:282
@ AD74416H_1K2SPS
Definition: ad74416h.h:492
void no_os_crc8_populate_msb(uint8_t *table, const uint8_t polynomial)
@ AD74416H_STEP_0_8_PERCENT
Definition: ad74416h.h:552
#define AD74416H_TEMP_SCALE
Definition: ad74416h.h:419
uint8_t dev_addr
Definition: ad74416h.h:637
#define AD74416H_SCRATCH(x)
Definition: ad74416h.h:104
int ad74416h_gpio_set(struct ad74416h_desc *, uint32_t, uint8_t)
Set the logic value of a GPO pin.
Definition: ad74416h.c:854
@ AD74416H_LIN_RATE_76KHZ8
Definition: ad74416h.h:563
@ AD74416H_CURRENT_OUT
Definition: ad74416h.h:449
#define AD74416H_GPIO_CONFIG(x)
Definition: ad74416h.h:80
@ AD74416H_MUX_HF_TO_LF
Definition: ad74416h.h:504
#define AD74416H_CH_FUNC_SETUP(x)
Definition: ad74416h.h:69
#define AD74416H_CH_FUNC_SETUP_MSK
Definition: ad74416h.h:133
@ AD74416H_MUX_AGND_TO_AGND
Definition: ad74416h.h:507
@ AD74416H_DIAG_DO_VDD
Definition: ad74416h.h:541
@ AD74416H_STOP_PWR_UP
Definition: ad74416h.h:522
#define AD74416H_THRESHOLD_RANGE
Definition: ad74416h.h:424
#define AD74416H_ADC_CONFIG(x)
Definition: ad74416h.h:70
int ad74416h_get_live(struct ad74416h_desc *desc, union ad74416h_live_status *status)
Read the live status bits.
Definition: ad74416h.c:872
#define AD74416H_READ_SELECT
Definition: ad74416h.h:99
@ AD74416H_STEP_6_1_PERCENT
Definition: ad74416h.h:554
#define AD74416H_ADC_DIAG_RESULT(x)
Definition: ad74416h.h:90
int ad74416h_set_adc_range(struct ad74416h_desc *, uint32_t, enum ad74416h_adc_range)
Set the ADC measurement range for a specific channel.
Definition: ad74416h.c:384
#define AD74416H_DIAG_ASSIGN_MSK(x)
Definition: ad74416h.h:203
#define AD74416H_DO_EXT_CONFIG(x)
Definition: ad74416h.h:76
int ad74416h_dac_slew_disable(struct ad74416h_desc *desc, uint32_t ch)
Disable the slew rate control.
Definition: ad74416h.c:912
@ AD74416H_GPIO_CONFIG_HIGH_Z
Definition: ad74416h.h:465
int ad74416h_gpio_get(struct ad74416h_desc *, uint32_t, uint8_t *)
Get the GPO value for a specific channel.
Definition: ad74416h.c:776
#define AD74416H_DAC_CURRENT_RANGE
Definition: ad74416h.h:426
uint8_t ANALOG_IO_STATUS_C
Definition: ad74416h.h:602
int ad74416h_set_diag_channel_enable(struct ad74416h_desc *desc, uint32_t ch, bool status)
Enable conversions on a diagnostic register.
Definition: ad74416h.c:349
int ad74416h_do_set(struct ad74416h_desc *, uint32_t, uint8_t)
Set the DO value of a channel.
Definition: ad74416h.c:841
int ad74416h_reg_update(struct ad74416h_desc *desc, uint32_t addr, uint16_t mask, uint16_t val)
Update a register's field.
Definition: ad74416h.c:248
#define AD74416H_CH_EN_MSK(x)
Definition: ad74416h.h:200
@ AD74416H_CURRENT_IN_EXT
Definition: ad74416h.h:451
ad74416h_dev_id
Supported device ids.
Definition: ad74416h.h:438
int ad74416h_set_info(struct ad74416h_desc *desc, uint16_t mode)
int ad74416h_reg_update(struct ad74416h_desc *, uint32_t, uint16_t, uint16_t)
Update a register's field.
Definition: ad74416h.c:248
#define AD74416H_LIVE_STATUS
Definition: ad74416h.h:87
int ad74416h_get_raw_adc_result(struct ad74416h_desc *desc, uint32_t ch, uint32_t *val)
Read the raw ADC raw conversion value.
Definition: ad74416h.c:294
#define AD74416H_CRC_POLYNOMIAL
Definition: ad74416h.c:53
uint8_t DO_STATUS_C
Definition: ad74416h.h:598
#define AD74416H_TEMP_OFFSET
Definition: ad74416h.h:418
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
ad74416h_adc_conv_mux
ADC input configuration values.
Definition: ad74416h.h:502
ad74416h_i_limit
DAC Current limits in Vout mode.
Definition: ad74416h.h:579
int ad74416h_get_raw_adc_result(struct ad74416h_desc *, uint32_t, uint32_t *)
Read the raw ADC raw conversion value.
Definition: ad74416h.c:294
@ AD74416H_GPIO_CONFIG_IN
Definition: ad74416h.h:467
@ AD74416H_HIGH_Z
Definition: ad74416h.h:447
@ AD74416H_MUX_LF_TO_VSENSEN
Definition: ad74416h.h:506
@ AD74416H_CURRENT_OUT_HART
Definition: ad74416h.h:456
@ AD74416H_RNG_NEG12_12_V
Definition: ad74416h.h:477
int ad74416h_set_adc_channel_enable(struct ad74416h_desc *, uint32_t, bool)
Enable/disable a specific ADC channel.
Definition: ad74416h.c:327
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:102
Definition: ad74416h.h:614
uint8_t ANALOG_IO_STATUS_D
Definition: ad74416h.h:603
int ad74416h_set_debounce_time(struct ad74416h_desc *desc, uint32_t ch, uint32_t time)
Set the debounce settle time for the IOx inputs when the ADC is running in digital input mode.
Definition: ad74416h.c:754
int ad74416h_reg_write(struct ad74416h_desc *, uint32_t, uint16_t)
Write a register's value.
Definition: ad74416h.c:207
int ad74416h_set_channel_i_limit(struct ad74416h_desc *desc, uint32_t ch, enum ad74416h_i_limit i_limit)
Set the current limit for a specific DAC channel in vout mode.
Definition: ad74416h.c:659
uint8_t DO_STATUS_B
Definition: ad74416h.h:597
#define AD74416H_NOP
Definition: ad74416h.h:68
uint8_t ADC_BUSY
Definition: ad74416h.h:589
int ad74416h_reg_read_raw(struct ad74416h_desc *desc, uint32_t addr, uint8_t *val)
Read a raw communication frame.
Definition: ad74416h.c:176
int ad74416h_set_therm_rst(struct ad74416h_desc *, bool)
Enable or disable the higher thermal reset.
Definition: ad74416h.c:926
@ AD74416H_DIAG_AVSS
Definition: ad74416h.h:539
int ad74416h_set_channel_function(struct ad74416h_desc *, uint32_t, enum ad74416h_op_mode)
Set the operation mode for a specific channel.
Definition: ad74416h.c:582
#define AD74416H_THRESHOLD_DAC_RANGE
Definition: ad74416h.h:423
int ad74416h_get_temp(struct ad74416h_desc *, uint32_t, uint16_t *)
Read the die's temperature from the diagnostic register.
Definition: ad74416h.c:561
int ad74416h_gpio_get(struct ad74416h_desc *desc, uint32_t ch, uint8_t *val)
Get the GPO value for a specific channel.
Definition: ad74416h.c:776
@ AD74416H_9K6SPS
Definition: ad74416h.h:494
#define AD74416H_DEBOUNCE_TIME_MSK
Definition: ad74416h.h:147
@ AD74416H_VOUT_RANGE_NEG12_12V
Definition: ad74416h.h:573
@ AD74416H_RNG_NEG0P3125_0P3125V
Definition: ad74416h.h:478
int ad74416h_set_adc_channel_enable(struct ad74416h_desc *desc, uint32_t ch, bool status)
Enable/disable a specific ADC channel.
Definition: ad74416h.c:327
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
@ AD74416H_MUX_VSENSEN_TO_AGND
Definition: ad74416h.h:505
#define AD74416H_SLEW_EN_MSK
Definition: ad74416h.h:162
ad74416h_diag_mode
Possible values to be loaded in the DIAG_RESULT register.
Definition: ad74416h.h:531
int ad74416h_nb_active_channels(struct ad74416h_desc *desc, uint8_t *nb_channels)
Get the number of active channels.
Definition: ad74416h.c:271
int ad74416h_dac_current_to_code(struct ad74416h_desc *desc, uint32_t uamps, uint16_t *code)
Convers a microamp value in the corresponding DAC 16 bit code.
Definition: ad74416h.c:131
@ AD74416H_MUX_LF_TO_AGND
Definition: ad74416h.h:503
#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)
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:75
int ad74416h_set_diag_channel_enable(struct ad74416h_desc *, uint32_t, bool)
Enable conversions on a diagnostic register.
Definition: ad74416h.c:349
@ AD74416H_DIAG_LVIN
Definition: ad74416h.h:540
#define AD74416H_CONV_MUX_MSK
Definition: ad74416h.h:138
#define AD74416H_SLEW_LIN_RATE_MSK
Definition: ad74416h.h:164
unsigned int no_os_hweight8(uint8_t word)
@ AD74416H_VOUT_RANGE_0_12V
Definition: ad74416h.h:572
int ad74416h_get_adc_range(struct ad74416h_desc *desc, uint32_t ch, uint16_t *val)
Get the ADC measurement range for a specific channel.
Definition: ad74416h.c:363
struct no_os_gpio_desc * reset_gpio
Definition: ad74416h.h:641
int ad74416h_get_adc_single(struct ad74416h_desc *, uint32_t, uint16_t *)
Get a single ADC raw value for a specific channel, then power down the ADC.
Definition: ad74416h.c:514
int ad74416h_set_adc_conv_mux(struct ad74416h_desc *desc, uint32_t ch, enum ad74416h_adc_conv_mux val)
Set the ADC Input Node for conversion.
Definition: ad74416h.c:466
int ad74416h_nb_active_channels(struct ad74416h_desc *, uint8_t *)
Get the number of active channels.
Definition: ad74416h.c:271
int ad74416h_get_diag(struct ad74416h_desc *desc, uint32_t ch, uint16_t *diag_code)
Get the diagnostic value for a specific channel.
Definition: ad74416h.c:717
int ad74416h_set_adc_conv_seq(struct ad74416h_desc *desc, enum ad74416h_conv_seq status)
Start or stop ADC conversions.
Definition: ad74416h.c:489
@ AD74416H_VOLTAGE_OUT
Definition: ad74416h.h:448
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:120
#define NULL
Definition: wrapper.h:64
@ AD74416H_STOP_PWR_DOWN
Definition: ad74416h.h:525
int ad74416h_set_adc_range(struct ad74416h_desc *desc, uint32_t ch, enum ad74416h_adc_range val)
Set the ADC measurement range for a specific channel.
Definition: ad74416h.c:384
#define AD74416H_DAC_CODE_MSK
Definition: ad74416h.h:190
#define AD74416H_TEMP_SCALE_DIV
Definition: ad74416h.h:420
#define AD74416H_DIN_CONFIG1(x)
Definition: ad74416h.h:72
@ AD74416H_VSENSEN_C
Definition: ad74416h.h:543
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
#define AD74416H_ADC_CONV_RANGE_MSK
Definition: ad74416h.h:137
int ad74416h_set_debounce_mode(struct ad74416h_desc *, uint32_t, enum ad74416h_debounce_mode)
Set the debounce mode for the IOx inputs when the ADC is running in digital input mode.
Definition: ad74416h.c:739
#define AD74416H_DIN_THRESH_MODE_MSK
Definition: ad74416h.h:153
Device channel state.
Definition: ad74416h.h:625
@ AD74416H_GPIO_CONFIG_DO
Definition: ad74416h.h:469
@ AD74416H_20SPS_50_60HZ_REJECTION
Definition: ad74416h.h:491
#define AD74416H_CMD_KEY_RESET_2
Definition: ad74416h.h:126
@ AD74416H_RNG_0_12_V
Definition: ad74416h.h:476
int ad74416h_get_temp(struct ad74416h_desc *desc, uint32_t ch, uint16_t *temp)
Read the die's temperature from the diagnostic register.
Definition: ad74416h.c:561
#define AD74416H_DO_DATA_MSK
Definition: ad74416h.h:178
int ad74416h_init(struct ad74416h_desc **, struct ad74416h_init_param *)
Initialize the device structure.
Definition: ad74416h.c:997
int ad74416h_set_adc_rate(struct ad74416h_desc *desc, uint32_t ch, enum ad74416h_adc_rate val)
Set the ADC Conversion Rate for a specific channel.
Definition: ad74416h.c:432
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
@ AD74416H_RNG_0_0P3125V
Definition: ad74416h.h:480
@ AD74416H_CURRENT_IN_EXT_HART
Definition: ad74416h.h:457
int ad74416h_remove(struct ad74416h_desc *desc)
Free the device descriptor.
Definition: ad74416h.c:1051
#define AD74416H_VOUT_RANGE_MSK
Definition: ad74416h.h:161
Header file of GPIO Interface.
@ AD74416H_DIAG_AVDD_LO
Definition: ad74416h.h:538
@ AD74416H_GPIO_CONFIG_COMP
Definition: ad74416h.h:468
int ad74416h_get_live(struct ad74416h_desc *, union ad74416h_live_status *)
Read the live status bits.
Definition: ad74416h.c:872
#define AD74416H_DAC_CODE(x)
Definition: ad74416h.h:78
@ AD74416H_VSENSEP_C
Definition: ad74416h.h:542
@ AD74416H_19K2SPS
Definition: ad74416h.h:495
uint8_t dev_addr
Definition: ad74416h.h:616
int ad74416h_dac_slew_disable(struct ad74416h_desc *, uint32_t)
Disable the slew rate control.
Definition: ad74416h.c:912
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
uint16_t no_os_get_unaligned_be16(uint8_t *buf)
int ad74416h_set_adc_conv_seq(struct ad74416h_desc *, enum ad74416h_conv_seq)
Start or stop ADC conversions.
Definition: ad74416h.c:489
#define AD74116H_CONV_TIME_US
Definition: ad74416h.h:429
enum ad74416h_i_limit i_limit
Definition: ad74416h.h:629
enum ad74416h_op_mode function
Definition: ad74416h.h:627
uint8_t DIN_STATUD_D
Definition: ad74416h.h:595
@ AD74416H_DIGITAL_INPUT
Definition: ad74416h.h:454
Header file of utility functions.
int ad74416h_set_adc_rate(struct ad74416h_desc *, uint32_t, enum ad74416h_adc_rate)
Set the ADC Conversion Rate for a specific channel.
Definition: ad74416h.c:432
int ad74416h_do_set(struct ad74416h_desc *desc, uint32_t ch, uint8_t val)
Set the DO value of a channel.
Definition: ad74416h.c:841
#define AD74416H_ADC_CONV_RATE_MSK
Definition: ad74416h.h:136
@ ID_AD74414H
Definition: ad74416h.h:440
struct no_os_spi_init_param spi_ip
Definition: ad74416h.h:617
int ad74416h_dac_slew_enable(struct ad74416h_desc *, uint32_t, enum ad74416h_slew_lin_step, enum ad74416h_lin_rate)
Configure and enable slew rate control for a DAC on a specific channel.
Definition: ad74416h.c:886
int ad74416h_set_channel_dac_code(struct ad74416h_desc *, uint32_t, uint16_t)
Set and load a code for the DAC on a specific channel.
Definition: ad74416h.c:680
AD74416h device descriptor.
Definition: ad74416h.h:635
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
int ad74416h_set_channel_vout_range(struct ad74416h_desc *desc, uint32_t ch, enum ad74416h_vout_range vout_range)
Set the voltage range for a specific channel.
Definition: ad74416h.c:637
@ AD74416H_RESISTANCE
Definition: ad74416h.h:453
@ AD74416H_CURRENT_IN_LOOP_HART
Definition: ad74416h.h:458
int ad74416h_reg_read(struct ad74416h_desc *, uint32_t, uint16_t *)
Read a register's value.
Definition: ad74416h.c:222
struct ad74416h_channel_config channel_configs[AD74416H_N_CHANNELS]
Definition: ad74416h.h:640
int ad74416h_reset(struct ad74416h_desc *desc)
Perform software or hardware reset and wait for device reset time.
Definition: ad74416h.c:936
ad74416h_conv_seq
ADC conversion sequence commands.
Definition: ad74416h.h:521
int ad74416h_set_channel_dac_code(struct ad74416h_desc *desc, uint32_t ch, uint16_t dac_code)
Set and load a code for the DAC on a specific channel.
Definition: ad74416h.c:680
#define AD74416H_ADC_CONV_CTRL
Definition: ad74416h.h:82
#define AD74416H_CONV_RESULT_MSK
Definition: ad74416h.h:279
Header file of CRC-8 computation.
ad74416h_slew_lin_step
The voltage step size of Full Scale DAC Voltage.
Definition: ad74416h.h:551
NO_OS_DECLARE_CRC8_TABLE(_crc_table)
int ad74416h_remove(struct ad74416h_desc *desc)
Free the device descriptor.
Definition: ad74416h.c:1051
ad74416h_op_mode
Operation modes of the device.
Definition: ad74416h.h:446
@ AD74416H_I_LIMIT1
Definition: ad74416h.h:581
int ad74416h_reg_read_raw(struct ad74416h_desc *, uint32_t, uint8_t *)
Read a raw communication frame.
Definition: ad74416h.c:176
@ AD74416H_LIN_RATE_153KHZ6
Definition: ad74416h.h:564
@ AD74416H_DEBOUNCE_MODE_0
Definition: ad74416h.h:514
struct _ad74416h_live_status status_bits
Definition: ad74416h.h:610
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:131
int ad74416h_dac_slew_enable(struct ad74416h_desc *desc, uint32_t ch, enum ad74416h_slew_lin_step step, enum ad74416h_lin_rate rate)
Configure and enable slew rate control for a DAC on a specific channel.
Definition: ad74416h.c:886
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