Go to the documentation of this file.
49 #define AD74416H_N_CHANNELS 4
51 #define AD74416H_CH_A 0
52 #define AD74416H_CH_B 1
53 #define AD74416H_CH_C 2
54 #define AD74416H_CH_D 3
57 #define AD74416H_RSENSE 12
59 #define AD74416H_ADC_MAX_VALUE 16777215
62 #define AD74416H_NOP 0x00
63 #define AD74416H_CH_FUNC_SETUP(x) (0x01 + (x * 12))
64 #define AD74416H_ADC_CONFIG(x) (0x02 + (x * 12))
65 #define AD74416H_DIN_CONFIG0(x) (0x03 + (x * 12))
66 #define AD74416H_DIN_CONFIG1(x) (0x04 + (x * 12))
67 #define AD74416H_OUTPUT_CONFIG(x) (0x05 + (x * 12))
68 #define AD74416H_RTD_CONFIG(x) (0x06 + (x * 12))
69 #define AD74416H_FET_LKG_COMP(x) (0x07 + (x * 12))
70 #define AD74416H_DO_EXT_CONFIG(x) (0x08 + (x * 12))
71 #define AD74416H_I_BURNOUT_CONFIG(x) (0x09 + (x * 12))
72 #define AD74416H_DAC_CODE(x) (0x0A + (x * 12))
73 #define AD74416H_DAC_ACTIVE(x) (0x0C + (x * 12))
74 #define AD74416H_GPIO_CONFIG(x) (0x32 + x)
75 #define AD74416H_PWR_OPTIM_CONFIG 0x38
76 #define AD74416H_ADC_CONV_CTRL 0x39
77 #define AD74416H_DIAG_ASSIGN 0x3A
78 #define AD74416H_WTD_CONFIG 0x3B
79 #define AD74416H_DIN_COMP_OUT 0x3E
80 #define AD74416H_ALERT_STATUS 0x3F
81 #define AD74416H_LIVE_STATUS 0x40
82 #define AD74416H_ADC_RESULT_UPR(x) (0x41 + (x * 2))
83 #define AD74416H_ADC_RESULT(x) (0x42 + (x * 2))
84 #define AD74416H_ADC_DIAG_RESULT(x) (0x49 + x)
85 #define AD74416H_LAST_ADC_RESULT_UPR 0x4D
86 #define AD74416H_LAST_ADC_RESULT 0x4E
87 #define AD74416H_DIN_COUNTER(x) (0x50 + (x * 2))
88 #define AD74416H_SUPPLY_ALERT_STATUS 0x57
89 #define AD74416H_CHANNEL_ALERT_STATUS(x) (0x58 + x)
90 #define AD74416H_ALERT_MASK 0x5C
91 #define AD74416H_SUPPLY_ALERT_MASK 0x5D
92 #define AD74416H_CHANNEL_ALERT_MASK(x) (0x5E + x)
93 #define AD74416H_READ_SELECT 0x6E
94 #define AD74416H_BURST_READ_SEL 0x6F
95 #define AD74416H_THERM_RST 0x73
96 #define AD74416H_CMD_KEY 0x74
97 #define AD74416H_BORADCAST_CMD_KEY 0x75
98 #define AD74416H_SCRATCH(x) (0x76 + x)
99 #define AD74416H_GENERIC_ID 0x7A
100 #define AD74416H_SILICON_REV 0x7B
101 #define AD74416H_SILICON_ID0 0x7D
102 #define AD74416H_SILICON_ID1 0x7E
103 #define AD74416H_HART_ALERT_STATUS(x) (0x80 + (x * 16))
104 #define AD74416H_HART_RX(x) (0x81 + (x * 16))
105 #define AD74416H_HART_TX(x) (0x82 + (x * 16))
106 #define AD74416H_HART_FCR(x) (0x83 + (x * 16))
107 #define AD74416H_HART_MCR(x) (0x84 + (x * 16))
108 #define AD74416H_HART_RFC(x) (0x85 + (x * 16))
109 #define AD74416H_HART_TFC(x) (0x86 + (x * 16))
110 #define AD74416H_HART_ALERT_MASK(x) (0x87 + (x * 16))
111 #define AD74416H_HART_CONFIG(x) (0x88 + (x * 16))
112 #define AD74416H_HART_TX_PREM(x) (0x89 + (x * 16))
113 #define AD74416H_HART_EVDET(x) (0x8A + (x * 16))
114 #define AD74416H_HART_TX_GAIN(x) (0x8B + (x * 16))
115 #define AD74416H_HART_GPIO_IF_CONFIG 0xC0
116 #define AD74416H_HART_GPIO_MON_CONFIG(x) (0xC1 + x)
119 #define AD74416H_CMD_KEY_RESET_1 0x15FA
120 #define AD74416H_CMD_KEY_RESET_2 0xAF51
122 #define AD74416H_SPI_RD_RET_INFO_MSK NO_OS_BIT(8)
123 #define AD74416H_ERR_CLR_MSK NO_OS_GENMASK(15, 0)
124 #define AD74416H_SPI_CRC_ERR_MSK NO_OS_BIT(13)
127 #define AD74416H_CH_FUNC_SETUP_MSK NO_OS_GENMASK(3, 0)
130 #define AD74416H_ADC_CONV_RATE_MSK NO_OS_GENMASK(11, 8)
131 #define AD74416H_ADC_CONV_RANGE_MSK NO_OS_GENMASK(6, 4)
132 #define AD74416H_CONV_MUX_MSK NO_OS_GENMASK(2, 0)
135 #define AD74416H_COUNT_EN_MSK NO_OS_BIT(15)
136 #define AD74416H_DIN_INV_COMP_OUT_MSK NO_OS_BIT(14)
137 #define AD74416H_COMPARATOR_EN_MSK NO_OS_BIT(13)
138 #define AD74416H_DIN_SINK_RANGE_MSK NO_OS_BIT(12)
139 #define AD74416H_DIN_SINK_MSK NO_OS_GENMASK(11, 7)
140 #define AD74416H_DEBOUNCE_MODE_MSK NO_OS_BIT(6)
141 #define AD74416H_DEBOUNCE_TIME_MSK NO_OS_GENMASK(4, 0)
144 #define AD74416H_DIN_INPUT_SELECT_MSK NO_OS_BIT(10)
145 #define AD74416H_DIN_SC_DET_EN_MSK NO_OS_BIT(9)
146 #define AD74416H_DIN_OC_DET_EN_MSK NO_OS_BIT(8)
147 #define AD74416H_DIN_THRESH_MODE_MSK NO_OS_BIT(7)
148 #define AD74416H_COMP_THRESH_MSK NO_OS_GENMASK(6, 0)
151 #define AD74416H_AVDD_SELECT_MSK NO_OS_GENMASK(15, 14)
152 #define AD74416H_ALARM_DEG_PERIOD_MSK NO_OS_BIT(12)
153 #define AD74VOUT_4W_EN_MSK NO_OS_BIT(11)
154 #define AD74416H_WAIT_LDAC_CMD_MSK NO_OS_BIT(10)
155 #define AD74416H_VOUT_RANGE_MSK NO_OS_BIT(7)
156 #define AD74416H_SLEW_EN_MSK NO_OS_GENMASK(6, 5)
157 #define AD74416H_SLEW_LIN_STEP_MSK NO_OS_GENMASK(4, 3)
158 #define AD74416H_SLEW_LIN_RATE_MSK NO_OS_GENMASK(2, 1)
159 #define AD74416H_I_LIMIT_MSK NO_OS_BIT(0)
162 #define AD74416H_RTD_ADC_REF_MSK NO_OS_BIT(3)
163 #define AD74416H_RTD_MODE_SEL_MSK NO_OS_BIT(2)
164 #define AD74416H_RTD_EXC_SWAP_MSK NO_OS_BIT(1)
165 #define AD74416H_RTD_CURRENT_MSK NO_OS_BIT(0)
168 #define AD74416H_FET_SRC_LKG_COMP_EN_MSK NO_OS_BIT(0)
171 #define AD74416H_DO_T2_MSK NO_OS_GENMASK(12, 8)
172 #define AD74416H_DO_DATA_MSK NO_OS_BIT(7)
173 #define AD74416H_DO_T1_MSK NO_OS_GENMASK(6, 2)
174 #define AD74416H_DO_SRC_SEL_MSK NO_OS_BIT(1)
175 #define AD74416H_DO_MODE_MSK NO_OS_BIT(0)
178 #define AD74416H_BRN_SEN_VSENSEN_CURR_MSK NO_OS_GENMASK(6, 5)
179 #define AD74416H_BRN_SEN_VSENSEN_POL_MSK NO_OS_BIT(4)
180 #define AD74416H_BRN_VIOUT_CURR_MSK NO_OS_GENAMSK(2, 1)
181 #define AD74416H_BRN_VIOUT_POL_MSK NO_OS_BIT(0)
184 #define AD74416H_DAC_CODE_MSK NO_OS_GENMASK(15, 0)
187 #define AD74416H_DAC_ACTIVE_MSK NO_OS_GENMASK(15, 0)
190 #define AD74416H_ADC_RDY_CTRL_MSK NO_OS_BIT(13)
191 #define AD74416H_CONV_RATE_DIAG_MSK NO_OS_GENMASK(12, 10)
192 #define AD74416H_CONV_SEQ_MSK NO_OS_GENMASK(9, 8)
193 #define AD74416H_DIAG_EN_MSK(x) (NO_OS_BIT(x) << 4)
194 #define AD74416H_CH_EN_MSK(x) NO_OS_BIT(x)
197 #define AD74416H_DIAG_ASSIGN_MSK(x) (NO_OS_GENMASK(3, 0) << ((x) * 4))
200 #define AD74416H_DIN_DO_MSK NO_OS_BIT(7, 6)
201 #define AD74416H_GPI_DATA_MSK NO_OS_BIT(5)
202 #define AD74416H_GPO_DATA_MSK NO_OS_BIT(4)
203 #define AD74416H_GP_WK_PD_EN_MSK NO_OS_BIT(3)
204 #define AD74416H_GPIO_SELECT_MSK NO_OS_GENMASK(2, 0)
207 #define AD74416H_REF_EN_MSK NO_OS_BIT(13)
208 #define AD74416H_SENSE_AGND_OPT_MSK NO_OS_BIT(12)
209 #define AD74416H_SENSE_HF_OPT_D_MSK NO_OS_BIT(11)
210 #define AD74416H_SENSE_HF_OPT_C_MSK NO_OS_BIT(10)
211 #define AD74416H_SENSE_HF_OPT_B_MSK NO_OS_BIT(9)
212 #define AD74416H_SENSE_HF_OPT_A_MSK NO_OS_BIT(8)
213 #define AD74416H_SENSE_LF_OPT_D_MSK NO_OS_BIT(7)
214 #define AD74416H_SENSE_LF_OPT_C_MSK NO_OS_BIT(6)
215 #define AD74416H_SENSE_LF_OPT_B_MSK NO_OS_BIT(5)
216 #define AD74416H_SENSE_LF_OPT_A_MSK NO_OS_BIT(4)
217 #define AD74416H_VSENSEN_OPT_D_MSK NO_OS_BIT(3)
218 #define AD74416H_VSENSEN_OPT_C_MSK NO_OS_BIT(2)
219 #define AD74416H_VSENSEN_OPT_B_MSK NO_OS_BIT(1)
220 #define AD74416H_VSENSEN_OPT_A_MSK NO_OS_BIT(0)
223 #define AD74416H_WDT_EN_MSK NO_OS_BIT(4)
224 #define AD74416H_WDT_TIMEOUT_MSK NO_OS_GENMASK(3, 0)
227 #define AD74416H_DIN_COMP_OUT_D_MSK NO_OS_BIT(3)
228 #define AD74416H_DIN_COMP_OUT_C_MSK NO_OS_BIT(2)
229 #define AD74416H_DIN_COMP_OUT_B_MSK NO_OS_BIT(1)
230 #define AD74416H_DIN_COMP_OUT_A_MSK NO_OS_BIT(0)
233 #define AD74416H_HART_ALERT_D_MSK NO_OS_BIT(15)
234 #define AD74416H_HART_ALERT_C_MSK NO_OS_BIT(14)
235 #define AD74416H_HART_ALERT_B_MSK NO_OS_BIT(13)
236 #define AD74416H_HART_ALERT_A_MSK NO_OS_BIT(12)
237 #define AD74416H_CHANNEL_ALERT_D_MSK NO_OS_BIT(11)
238 #define AD74416H_CHANNEL_ALERT_C_MSK NO_OS_BIT(10)
239 #define AD74416H_CHANNEL_ALERT_B_MSK NO_OS_BIT(9)
240 #define AD74416H_CHANNEL_ALERT_A_MSK NO_OS_BIT(8)
241 #define AD74416H_ADC_ERR_MSK NO_OS_BIT(5)
242 #define AD74416H_TEMP_ALERT_MSK NO_OS_BIT(4)
243 #define AD74416H_SPI_ERR_MSK NO_OS_BIT(3)
244 #define AD74416H_SUPPLY_ERR_MSK NO_OS_BIT(2)
245 #define AD74416H_RESET_OCCURRED_MSK NO_OS_BIT(0)
248 #define AD74416H_ANALOG_IO_STATUS_D_MSK NO_OS_BIT(15)
249 #define AD74416H_ANALOG_IO_STATUS_C_MSK NO_OS_BIT(14)
250 #define AD74416H_ANALOG_IO_STATUS_B_MSK NO_OS_BIT(13)
251 #define AD74416H_ANALOG_IO_STATUS_A_MSK NO_OS_BIT(12)
252 #define AD74416H_DO_STATUS_D_MSK NO_OS_BIT(11)
253 #define AD74416H_DO_STATUS_C_MSK NO_OS_BIT(10)
254 #define AD74416H_DO_STATUS_B_MSK NO_OS_BIT(9)
255 #define AD74416H_DO_STATUS_A_MSK NO_OS_BIT(8)
256 #define AD74416H_DIN_STATUS_D_MSK NO_OS_BIT(7)
257 #define AD74416H_DIN_STATUS_C_MSK NO_OS_BIT(6)
258 #define AD74416H_DIN_STATUS_B_MSK NO_OS_BIT(5)
259 #define AD74416H_DIN_STATUS_A_MSK NO_OS_BIT(4)
260 #define AD74416H_TEMP_ALERT_STATUS_MSK NO_OS_BIT(3)
261 #define AD74416H_ADC_DATA_RDY_MSK NO_OS_BIT(2)
262 #define AD74416H_ADC_BUSY_MSK NO_OS_BIT(1)
263 #define AD74416H_SUPPLY_STATUS_MSK NO_OS_BIT(0)
266 #define AD74416H_CONV_RES_MUX_MSK NO_OS_GENMASK(15, 13)
267 #define AD74416H_CONV_RES_RANGE_MSK NO_OS_GENMASK(12, 10)
268 #define AD74416H_CONV_SEQ_COUNT_MSK NO_OS_GENAMSK(9. 8)
269 #define AD74416H_CONV_RES_UPR_MSK NO_OS_GENMASK(7, 0)
272 #define AD74416H_CONV_RESULT_MSK NO_OS_GENMASK(15, 0)
275 #define AD74416H_DIAG_RESULT_MSK NO_OS_GENMASK(15, 0)
278 #define AD74416H_LAST_CONV_CH_MSK NO_OS_GENAMSK(10 8)
279 #define AD74416H_LAST_CONV_RES_UPR_MSK NO_OS_GENMASK(7, 0)
282 #define AD74416H_LAST_CONV_RES_MSK NO_OS_GENMASK(15, 0)
285 #define AD74416H_DIN_CNT_UPR_MSK NO_OS_GENMASK(15, 0)
288 #define AD74416H_DIN_CNT_MSK NO_OS_GENMASK(15, 0)
291 #define AD74416H_AVDD_HI_ERR_MSK NO_OS_BIT(6)
292 #define AD74416H_AVDD_LO_ERR_MSK NO_OS_BIT(5)
293 #define AD74416H_DO_VDD_ERR_MSK NO_OS_BIT(4)
294 #define AD74416H_AVCC_ERR_MSK NO_OS_BIT(3)
295 #define AD74416H_DVCC_ERR_MSK NO_OS_BIT(2)
296 #define AD74416H_AVSS_ERR_MSK NO_OS_BIT(1)
297 #define AD74416H_CAL_MEM_ERR_MSK NO_OS_BIT(0)
300 #define AD74416H_ANALOG_IO_OC_MSK NO_OS_BIT(5)
301 #define AD74416H_ANALOG_IO_SC_MSK NO_OS_BIT(4)
302 #define AD74416H_DO_TIMEOUT_MSK NO_OS_BIT(3)
303 #define AD74416H_DO_SC_MSK NO_OS_BIT(2)
304 #define AD74416H_DIN_OC_MSK NO_OS_BIT(1)
305 #define AD74416H_DIN_SC_MSK NO_OS_BIT(0)
308 #define AD74416H_READBACK_ADDR_MSK NO_OS_GENMASK(8, 0)
311 #define AD74416H_BURST_READ_SEL_MSK NO_OS_GENMASK(15, 0)
314 #define AD74416H_THERM_RST_EN_MSK NO_OS_BIT(0)
317 #define AD74416H_CMD_KEY_MSK NO_OS_GENMASK(15, 0)
320 #define AD74416H_BROADCAST_CMD_KEY_MSK NO_OS_GENMASK(15, 0)
323 #define AD74416H_SCRATCH_BITS_MSK NO_OS_GENMASK(15, 0)
326 #define AD74416H_GENERIC_ID_MSK NO_OS_GENMASK(2, 0)
329 #define AD74416H_SILICON_REV_ID_MSK NO_OS_GENMASK(7, 0)
332 #define AD74416H_UID0_MSK NO_OS_GENMASK(6, 0)
335 #define AD74416H_UID2_MSK NO_OS_GENMASK(11, 6)
336 #define AD74416H_UID1_MSK NO_OS_GENMASK(5, 0)
339 #define AD74416H_FRM_MON_STATE_MSK NO_OS_GENMASK(15, 13)
340 #define AD74416H_EOM_MSK NO_OS_BIT(12)
341 #define AD74416H_RX_BCNT_MSK NO_OS_BIT(11)
342 #define AD74416H_RX_CMD_MSK NO_OS_BIT(10)
343 #define AD74416H_SOM_MSK NO_OS_BIT(9)
344 #define AD74416H_CD_MSK NO_OS_BIT(8)
345 #define AD74416H_CD_EDGE_DET_MSK NO_OS_BIT(7)
346 #define AD74416H_TX_COMPLETE_MSK NO_OS_BIT(6)
347 #define AD74416H_TX_FIFO_ALERT_MSK NO_OS_BIT(5)
348 #define AD74416H_RX_FIFO_ALERT_MSK NO_OS_BIT(4)
349 #define AD74416H_RX_OVERFLOW_ERR_MSK NO_OS_BIT(3)
350 #define AD74416H_FRAME_ERR_MSK NO_OS_BIT(2)
351 #define AD74416H_PARITY_ERR_MSK NO_OS_BIT(1)
352 #define AD74416H_GAP_ERR_MSK NO_OS_BIT(0)
355 #define AD74416H_RFGI_MSK NO_OS_BIT(11)
356 #define AD74416H_RFFE_MSK NO_OS_BIT(10)
357 #define AD74416H_RFPE_MSK NO_OS_BIT(9)
358 #define AD74416H_RFBI_MSK NO_OS_BIT(8)
359 #define AD74416H_RBR_MSK NO_OS_GENMASK(7, 0)
362 #define AD74416H_TDR_MSK NO_OS_GENMASK(7, 0)
365 #define AD74416H_TFTRIG_MSK NO_OS_GENMASK(11, 8)
366 #define AD74416H_RFTRIG_MSK NO_OS_GENMASK(6, 3)
367 #define AD74416H_TFCLR_MSK NO_OS_BIT(2)
368 #define AD74416H_RFCLR_MSK NO_OS_BIT(1)
369 #define AD74416H_FIFOEN_MSK NO_OS_BIT(0)
372 #define AD74416H_RTS_MSK NO_OS_BIT(0)
375 #define AD74416H_RFC_MSK NO_OS_GENMASK(4, 0)
378 #define AD74416H_TFC_MSK NO_OS_GENMASK(4, 0)
381 #define AD74416H_CD_EXTD_QUAL_MSK NO_OS_BIT(13)
382 #define AD74416H_FRM_MON_RX_PREMX2_MSK NO_OS_BIT(12)
383 #define AD74416H_FRM_MON_RST_GAP_MSK NO_OS_BIT(11)
384 #define AD74416H_FRM_MON_RST_CD_MSK NO_OS_BIT(10)
385 #define AD74416H_RX_ALL_CHARS_MSK NO_OS_BIT(9)
386 #define AD74416H_FRM_MON_EN_MSK NO_OS_BIT(8)
387 #define AD74416H_EVENT_DET_SEL_MSK NO_OS_GENMASK(7, 6)
388 #define AD74416H_TX_1B_AFTER_RST_MSK NO_OS_BIT(5)
389 #define AD74416H_AUTO_CLR_RST_MSK NO_OS_BIT(4)
390 #define AD74416H_CD_EDGE_SEL_MSK NO_OS_GENAMSK(3, 2)
391 #define AD74416H_MODEM_DUPLEX_MSK NO_OS_BIT(1)
392 #define AD74416H_MODEM_PWRUP_MSK NO_OS_BIT(0)
395 #define AD74416H_TX_PREM_CNT_MSK NO_OS_GENMASK(4, 0)
398 #define AD74416H_EVENT_DET_TIME_MSK NO_OS_GENMASK(15, 0)
401 #define AD74416H_TX_GAIN_MSK NO_OS_GENMASK(3, 0)
404 #define AD74416H_HART_GPIO_IF_CH_MSK NO_OS_GENMASK(3, 2)
405 #define AD74416H_HART_GPIO_IF_SEL_MSK NO_OS_GENMASK(1, 0)
408 #define AD74416H_HART_GPIO_MON_CH_MSK NO_OS_GENMASK(4, 3)
409 #define AD74416H_HART_GPIO_MON_SEL_MSK NO_OS_GENMASK(2, 0)
411 #define AD74416H_TEMP_OFFSET -2392
412 #define AD74416H_TEMP_SCALE 8950
413 #define AD74416H_TEMP_SCALE_DIV 1000
415 #define AD74416H_FRAME_SIZE 5
416 #define AD74416H_THRESHOLD_DAC_RANGE 98
417 #define AD74416H_THRESHOLD_RANGE 30000
418 #define AD74416H_DAC_RANGE 12000
419 #define AD74416H_DAC_CURRENT_RANGE 25000
420 #define AD74416H_DAC_RESOLUTION 16
421 #define AD74414H_DAC_RESOLUTION 14
422 #define AD74116H_CONV_TIME_US 1000000
657 uint16_t *, uint32_t);
805 #endif // _AD74416H_H
uint8_t DO_STATUS_D
Definition: ad74416h.h:606
#define AD74416H_DIAG_ASSIGN
Definition: ad74416h.h:77
int ad74416h_set_gpio_config(struct ad74416h_desc *, uint32_t, enum ad74416h_gpio_select)
Set the GPIO operation mode.
Definition: ad74416h.c:791
int ad74416h_set_therm_rst(struct ad74416h_desc *desc, bool enable)
Enable or disable the higher thermal reset.
Definition: ad74416h.c:920
@ AD74416H_START_CONT
Definition: ad74416h.h:531
@ AD74416H_STEP_1_5_PERCENT
Definition: ad74416h.h:560
@ AD74416H_START_SINGLE
Definition: ad74416h.h:530
#define AD74416H_DIN_COMP_OUT
Definition: ad74416h.h:79
void no_os_put_unaligned_be16(uint16_t val, uint8_t *buf)
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
uint8_t ANALOG_IO_STATUS_B
Definition: ad74416h.h:608
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:791
@ AD74416H_LIN_RATE_230KHZ4
Definition: ad74416h.h:572
ad74416h_gpio_select
GPO operation modes.
Definition: ad74416h.h:457
int ad74416h_get_diag(struct ad74416h_desc *, uint32_t, uint16_t *)
Get the diagnostic value for a specific channel.
Definition: ad74416h.c:711
@ AD74416H_20SPS_50_60HZ_HART_REJECTION
Definition: ad74416h.h:485
enum ad74416h_vout_range vout_range
Definition: ad74416h.h:635
@ AD74416H_DIAG_DVCC
Definition: ad74416h.h:541
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:733
@ AD74416H_4K8SPS
Definition: ad74416h.h:490
#define AD74416H_THERM_RST
Definition: ad74416h.h:95
#define NO_OS_GENMASK(h, l)
Definition: no_os_util.h:82
int ad74416h_reg_read(struct ad74416h_desc *desc, uint32_t addr, uint16_t *val)
Read a register's value.
Definition: ad74416h.c:216
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
@ AD74416H_DIGITAL_INPUT_LOOP
Definition: ad74416h.h:448
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:125
ad74416h_vout_range
Possible voltage output ranges for the DAC.
Definition: ad74416h.h:578
#define AD77416H_DEV_ADDRESS_MSK
Definition: ad74416h.c:49
@ AD74416H_RNG_NEG104_104MV
Definition: ad74416h.h:475
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:687
#define AD74416H_FRAME_SIZE
Definition: ad74416h.h:415
uint8_t SUPPLY_STATUS
Definition: ad74416h.h:595
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:508
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:631
@ AD74416H_DIAG_4K8SPS
Definition: ad74416h.h:501
@ AD74416H_AVDD_C
Definition: ad74416h.h:552
@ AD74416H_VOLTAGE_IN
Definition: ad74416h.h:443
@ AD74416H_DIAG_LDO1V8
Definition: ad74416h.h:543
uint8_t ADC_DATA_RDY
Definition: ad74416h.h:597
@ ID_AD74416H
Definition: ad74416h.h:432
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:748
bool enabled
Definition: ad74416h.h:633
@ AD74416H_10SPS_50_60HZ_HART_REJECTION
Definition: ad74416h.h:483
@ AD74416H_DIAG_20SPS_50_60HZ_HART_REJECTION
Definition: ad74416h.h:499
int ad74416h_reg_write(struct ad74416h_desc *desc, uint32_t addr, uint16_t val)
Write a register's value.
Definition: ad74416h.c:201
Header file of Delay functions.
uint8_t DIN_STATUS_B
Definition: ad74416h.h:600
@ AD74416H_DIAG_AVDD_HI
Definition: ad74416h.h:544
int ad74416h_reset(struct ad74416h_desc *)
Perform software or hardware reset and wait for device reset time.
Definition: ad74416h.c:930
#define AD74416H_DIN_DEBOUNCE_LEN
Definition: ad74416h.c:48
#define AD74416H_GPIO_SELECT_MSK
Definition: ad74416h.h:204
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:439
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:460
#define AD74416H_CONV_SEQ_MSK
Definition: ad74416h.h:192
uint8_t DIN_STATUS_C
Definition: ad74416h.h:601
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:806
ad74416h_debounce_mode
Debounce modes for the IOx inputs when using the digital input op mode.
Definition: ad74416h.h:520
#define AD74416H_I_LIMIT_MSK
Definition: ad74416h.h:159
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
struct no_os_spi_desc * spi_desc
Definition: ad74416h.h:645
struct no_os_gpio_init_param * reset_gpio_param
Definition: ad74416h.h:625
enum ad74416h_dev_id id
Definition: ad74416h.h:622
ad74416h_adc_range
Conversion range configuration values.
Definition: ad74416h.h:468
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:54
@ AD74416H_STEP_22_2_PERCENT
Definition: ad74416h.h:562
@ AD74416H_GPIO_CONFIG_DATA
Definition: ad74416h.h:459
#define AD74414H_DAC_RESOLUTION
Definition: ad74416h.h:421
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:576
#define AD74416H_COMP_THRESH_MSK
Definition: ad74416h.h:148
@ AD74416H_RNG_NEG2P5_2P5V
Definition: ad74416h.h:476
@ AD74416H_CURRENT_IN_LOOP
Definition: ad74416h.h:445
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:80
#define AD74416H_CMD_KEY_RESET_1
Definition: ad74416h.h:119
@ AD74416H_RNG_NEG0P3125_0V
Definition: ad74416h.h:472
int ad74416h_init(struct ad74416h_desc **desc, struct ad74416h_init_param *init_param)
Initialize the device structure.
Definition: ad74416h.c:991
uint8_t TEMP_ALERT_STATUS
Definition: ad74416h.h:598
#define AD74416H_GPO_DATA_MSK
Definition: ad74416h.h:202
#define AD74416H_DAC_RESOLUTION
Definition: ad74416h.h:420
@ AD74416H_DO_C
Definition: ad74416h.h:551
ad74416h_lin_rate
Possible update rates for a DAC when slew control is enabled.
Definition: ad74416h.h:568
ad74416h_adc_rate
Conversion configuration values.
Definition: ad74416h.h:482
uint16_t value
Definition: ad74416h.h:618
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:115
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:80
#define AD74416H_SLEW_LIN_STEP_MSK
Definition: ad74416h.h:157
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:404
@ AD74416H_DIAG_TEMP
Definition: ad74416h.h:540
@ AD74416H_RNG_0_0P625V
Definition: ad74416h.h:474
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:848
@ AD74416H_I_LIMIT0
Definition: ad74416h.h:587
uint8_t ANALOG_IO_STATUS_A
Definition: ad74416h.h:607
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:439
uint8_t DIN_STATUS_A
Definition: ad74416h.h:599
uint8_t comm_buff[AD74416H_FRAME_SIZE]
Definition: ad74416h.h:646
#define AD74416H_DIAG_EN_MSK(x)
Definition: ad74416h.h:193
Used to store the live status bit fields.
Definition: ad74416h.h:616
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
@ AD74416H_200SPS_SIGN_HART_REJECTION
Definition: ad74416h.h:487
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
@ AD74416H_LIN_RATE_4KHZ8
Definition: ad74416h.h:569
#define AD74416H_ADC_RESULT_UPR(x)
Definition: ad74416h.h:82
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:404
@ AD74416H_DIAG_AVCC
Definition: ad74416h.h:542
#define AD74416H_CMD_KEY
Definition: ad74416h.h:96
#define AD74416H_N_CHANNELS
Definition: ad74416h.h:49
@ AD74416H_DEBOUNCE_MODE_1
Definition: ad74416h.h:522
#define AD74416H_DEBOUNCE_MODE_MSK
Definition: ad74416h.h:140
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:806
uint8_t DO_STATUS_A
Definition: ad74416h.h:603
int ad74416h_get_adc_range(struct ad74416h_desc *, uint32_t, uint16_t *)
Get the ADC measurement range for a specific channel.
Definition: ad74416h.c:357
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:653
#define AD74416H_OUTPUT_CONFIG(x)
Definition: ad74416h.h:67
#define AD74416H_DIN_CONFIG0(x)
Definition: ad74416h.h:65
#define AD74416H_DAC_RANGE
Definition: ad74416h.h:418
enum ad74416h_dev_id id
Definition: ad74416h.h:643
#define AD74416H_ADC_RESULT(x)
Definition: ad74416h.h:83
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:687
#define AD74416H_CONV_RES_UPR_MSK
Definition: ad74416h.h:269
Bitfield struct which maps on the LIVE_STATUS register.
Definition: ad74416h.h:594
@ AD74416H_DIAG_AGND
Definition: ad74416h.h:539
@ AD74416H_200SPS_HART_REJECTION
Definition: ad74416h.h:486
#define AD74416H_DIAG_RESULT_MSK
Definition: ad74416h.h:275
@ AD74416H_1K2SPS
Definition: ad74416h.h:488
void no_os_crc8_populate_msb(uint8_t *table, const uint8_t polynomial)
@ AD74416H_STEP_0_8_PERCENT
Definition: ad74416h.h:559
#define AD74416H_TEMP_SCALE
Definition: ad74416h.h:412
uint8_t dev_addr
Definition: ad74416h.h:644
#define AD74416H_SCRATCH(x)
Definition: ad74416h.h:98
int ad74416h_gpio_set(struct ad74416h_desc *, uint32_t, uint8_t)
Set the logic value of a GPO pin.
Definition: ad74416h.c:848
@ AD74416H_LIN_RATE_76KHZ8
Definition: ad74416h.h:570
@ AD74416H_CURRENT_OUT
Definition: ad74416h.h:442
#define AD74416H_GPIO_CONFIG(x)
Definition: ad74416h.h:74
@ AD74416H_MUX_HF_TO_LF
Definition: ad74416h.h:511
#define AD74416H_CH_FUNC_SETUP(x)
Definition: ad74416h.h:63
#define AD74416H_CH_FUNC_SETUP_MSK
Definition: ad74416h.h:127
@ AD74416H_MUX_AGND_TO_AGND
Definition: ad74416h.h:514
@ AD74416H_DIAG_DO_VDD
Definition: ad74416h.h:548
@ AD74416H_STOP_PWR_UP
Definition: ad74416h.h:529
#define AD74416H_THRESHOLD_RANGE
Definition: ad74416h.h:417
#define AD74416H_ADC_CONFIG(x)
Definition: ad74416h.h:64
int ad74416h_get_live(struct ad74416h_desc *desc, union ad74416h_live_status *status)
Read the live status bits.
Definition: ad74416h.c:866
#define AD74416H_READ_SELECT
Definition: ad74416h.h:93
@ AD74416H_STEP_6_1_PERCENT
Definition: ad74416h.h:561
#define AD74416H_ADC_DIAG_RESULT(x)
Definition: ad74416h.h:84
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:378
#define AD74416H_DIAG_ASSIGN_MSK(x)
Definition: ad74416h.h:197
@ AD74416H_DIAG_20SPS_50_60HZ_REJECTION
Definition: ad74416h.h:498
#define AD74416H_DO_EXT_CONFIG(x)
Definition: ad74416h.h:70
int ad74416h_dac_slew_disable(struct ad74416h_desc *desc, uint32_t ch)
Disable the slew rate control.
Definition: ad74416h.c:906
@ AD74416H_GPIO_CONFIG_HIGH_Z
Definition: ad74416h.h:458
int ad74416h_gpio_get(struct ad74416h_desc *, uint32_t, uint8_t *)
Get the GPO value for a specific channel.
Definition: ad74416h.c:770
#define AD74416H_DAC_CURRENT_RANGE
Definition: ad74416h.h:419
uint8_t ANALOG_IO_STATUS_C
Definition: ad74416h.h:609
int ad74416h_set_diag_channel_enable(struct ad74416h_desc *desc, uint32_t ch, bool status)
Enable conversions on a diagnostic register.
Definition: ad74416h.c:343
int ad74416h_do_set(struct ad74416h_desc *, uint32_t, uint8_t)
Set the DO value of a channel.
Definition: ad74416h.c:835
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:242
#define AD74416H_CH_EN_MSK(x)
Definition: ad74416h.h:194
@ AD74416H_CURRENT_IN_EXT
Definition: ad74416h.h:444
ad74416h_dev_id
Supported device ids.
Definition: ad74416h.h:431
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:242
#define AD74416H_LIVE_STATUS
Definition: ad74416h.h:81
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:288
#define AD74416H_CRC_POLYNOMIAL
Definition: ad74416h.c:47
uint8_t DO_STATUS_C
Definition: ad74416h.h:605
#define AD74416H_TEMP_OFFSET
Definition: ad74416h.h:411
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
ad74416h_adc_conv_mux
ADC input configuration values.
Definition: ad74416h.h:509
ad74416h_i_limit
DAC Current limits in Vout mode.
Definition: ad74416h.h:586
int ad74416h_get_raw_adc_result(struct ad74416h_desc *, uint32_t, uint32_t *)
Read the raw ADC raw conversion value.
Definition: ad74416h.c:288
@ AD74416H_GPIO_CONFIG_IN
Definition: ad74416h.h:460
@ AD74416H_HIGH_Z
Definition: ad74416h.h:440
@ AD74416H_MUX_LF_TO_VSENSEN
Definition: ad74416h.h:513
@ AD74416H_CURRENT_OUT_HART
Definition: ad74416h.h:449
@ AD74416H_RNG_NEG12_12_V
Definition: ad74416h.h:470
int ad74416h_set_adc_channel_enable(struct ad74416h_desc *, uint32_t, bool)
Enable/disable a specific ADC channel.
Definition: ad74416h.c:321
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
Definition: ad74416h.h:621
uint8_t ANALOG_IO_STATUS_D
Definition: ad74416h.h:610
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:748
int ad74416h_reg_write(struct ad74416h_desc *, uint32_t, uint16_t)
Write a register's value.
Definition: ad74416h.c:201
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:653
uint8_t DO_STATUS_B
Definition: ad74416h.h:604
#define AD74416H_NOP
Definition: ad74416h.h:62
uint8_t ADC_BUSY
Definition: ad74416h.h:596
int ad74416h_reg_read_raw(struct ad74416h_desc *desc, uint32_t addr, uint8_t *val)
Read a raw communication frame.
Definition: ad74416h.c:170
int ad74416h_set_therm_rst(struct ad74416h_desc *, bool)
Enable or disable the higher thermal reset.
Definition: ad74416h.c:920
@ AD74416H_DIAG_AVSS
Definition: ad74416h.h:546
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:576
#define AD74416H_THRESHOLD_DAC_RANGE
Definition: ad74416h.h:416
int ad74416h_get_temp(struct ad74416h_desc *, uint32_t, uint16_t *)
Read the die's temperature from the diagnostic register.
Definition: ad74416h.c:555
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:770
@ AD74416H_9K6SPS
Definition: ad74416h.h:491
#define AD74416H_DEBOUNCE_TIME_MSK
Definition: ad74416h.h:141
@ AD74416H_VOUT_RANGE_NEG12_12V
Definition: ad74416h.h:580
@ AD74416H_RNG_NEG0P3125_0P3125V
Definition: ad74416h.h:471
int ad74416h_set_adc_channel_enable(struct ad74416h_desc *desc, uint32_t ch, bool status)
Enable/disable a specific ADC channel.
Definition: ad74416h.c:321
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
@ AD74416H_MUX_VSENSEN_TO_AGND
Definition: ad74416h.h:512
#define AD74416H_SLEW_EN_MSK
Definition: ad74416h.h:156
ad74416h_diag_mode
Possible values to be loaded in the DIAG_RESULT register.
Definition: ad74416h.h:538
int ad74416h_nb_active_channels(struct ad74416h_desc *desc, uint8_t *nb_channels)
Get the number of active channels.
Definition: ad74416h.c:265
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:125
@ AD74416H_MUX_LF_TO_AGND
Definition: ad74416h.h:510
#define NO_OS_BIT(x)
Definition: no_os_util.h:45
@ AD74416H_DIAG_19K2SPS
Definition: ad74416h.h:503
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:69
int ad74416h_set_diag_channel_enable(struct ad74416h_desc *, uint32_t, bool)
Enable conversions on a diagnostic register.
Definition: ad74416h.c:343
@ AD74416H_DIAG_LVIN
Definition: ad74416h.h:547
#define AD74416H_CONV_MUX_MSK
Definition: ad74416h.h:132
#define AD74416H_SLEW_LIN_RATE_MSK
Definition: ad74416h.h:158
unsigned int no_os_hweight8(uint8_t word)
@ AD74416H_VOUT_RANGE_0_12V
Definition: ad74416h.h:579
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:357
struct no_os_gpio_desc * reset_gpio
Definition: ad74416h.h:648
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:508
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:460
int ad74416h_nb_active_channels(struct ad74416h_desc *, uint8_t *)
Get the number of active channels.
Definition: ad74416h.c:265
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:711
int ad74416h_set_adc_conv_seq(struct ad74416h_desc *desc, enum ad74416h_conv_seq status)
Start or stop ADC conversions.
Definition: ad74416h.c:483
@ AD74416H_VOLTAGE_OUT
Definition: ad74416h.h:441
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
#define NULL
Definition: wrapper.h:64
@ AD74416H_STOP_PWR_DOWN
Definition: ad74416h.h:532
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:378
#define AD74416H_DAC_CODE_MSK
Definition: ad74416h.h:184
#define AD74416H_TEMP_SCALE_DIV
Definition: ad74416h.h:413
#define AD74416H_DIN_CONFIG1(x)
Definition: ad74416h.h:66
@ AD74416H_VSENSEN_C
Definition: ad74416h.h:550
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
#define AD74416H_ADC_CONV_RANGE_MSK
Definition: ad74416h.h:131
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:733
#define AD74416H_DIN_THRESH_MODE_MSK
Definition: ad74416h.h:147
Device channel state.
Definition: ad74416h.h:632
@ AD74416H_GPIO_CONFIG_DO
Definition: ad74416h.h:462
@ AD74416H_20SPS_50_60HZ_REJECTION
Definition: ad74416h.h:484
#define AD74416H_CMD_KEY_RESET_2
Definition: ad74416h.h:120
@ AD74416H_RNG_0_12_V
Definition: ad74416h.h:469
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:555
#define AD74416H_DO_DATA_MSK
Definition: ad74416h.h:172
int ad74416h_init(struct ad74416h_desc **, struct ad74416h_init_param *)
Initialize the device structure.
Definition: ad74416h.c:991
ad74416h_diag_rate
Diagnostics conversion configuration values.
Definition: ad74416h.h:497
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:426
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
@ AD74416H_RNG_0_0P3125V
Definition: ad74416h.h:473
@ AD74416H_CURRENT_IN_EXT_HART
Definition: ad74416h.h:450
int ad74416h_remove(struct ad74416h_desc *desc)
Free the device descriptor.
Definition: ad74416h.c:1045
#define AD74416H_VOUT_RANGE_MSK
Definition: ad74416h.h:155
Header file of GPIO Interface.
@ AD74416H_DIAG_AVDD_LO
Definition: ad74416h.h:545
@ AD74416H_GPIO_CONFIG_COMP
Definition: ad74416h.h:461
int ad74416h_get_live(struct ad74416h_desc *, union ad74416h_live_status *)
Read the live status bits.
Definition: ad74416h.c:866
#define AD74416H_DAC_CODE(x)
Definition: ad74416h.h:72
@ AD74416H_VSENSEP_C
Definition: ad74416h.h:549
uint8_t dev_addr
Definition: ad74416h.h:623
@ AD74416H_DIAG_9K6SPS
Definition: ad74416h.h:502
int ad74416h_dac_slew_disable(struct ad74416h_desc *, uint32_t)
Disable the slew rate control.
Definition: ad74416h.c:906
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
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:483
#define AD74116H_CONV_TIME_US
Definition: ad74416h.h:422
enum ad74416h_i_limit i_limit
Definition: ad74416h.h:636
enum ad74416h_op_mode function
Definition: ad74416h.h:634
uint8_t DIN_STATUD_D
Definition: ad74416h.h:602
@ AD74416H_DIGITAL_INPUT
Definition: ad74416h.h:447
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:426
int ad74416h_do_set(struct ad74416h_desc *desc, uint32_t ch, uint8_t val)
Set the DO value of a channel.
Definition: ad74416h.c:835
#define AD74416H_ADC_CONV_RATE_MSK
Definition: ad74416h.h:130
@ ID_AD74414H
Definition: ad74416h.h:433
struct no_os_spi_init_param spi_ip
Definition: ad74416h.h:624
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:880
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:674
AD74416h device descriptor.
Definition: ad74416h.h:642
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
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:631
@ AD74416H_RESISTANCE
Definition: ad74416h.h:446
@ AD74416H_CURRENT_IN_LOOP_HART
Definition: ad74416h.h:451
int ad74416h_reg_read(struct ad74416h_desc *, uint32_t, uint16_t *)
Read a register's value.
Definition: ad74416h.c:216
struct ad74416h_channel_config channel_configs[AD74416H_N_CHANNELS]
Definition: ad74416h.h:647
int ad74416h_reset(struct ad74416h_desc *desc)
Perform software or hardware reset and wait for device reset time.
Definition: ad74416h.c:930
ad74416h_conv_seq
ADC conversion sequence commands.
Definition: ad74416h.h:528
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:674
@ AD74416H_DIAG_1K2SPS_HART_REJECTION
Definition: ad74416h.h:500
#define AD74416H_ADC_CONV_CTRL
Definition: ad74416h.h:76
#define AD74416H_CONV_RESULT_MSK
Definition: ad74416h.h:272
Header file of CRC-8 computation.
ad74416h_slew_lin_step
The voltage step size of Full Scale DAC Voltage.
Definition: ad74416h.h:558
NO_OS_DECLARE_CRC8_TABLE(_crc_table)
int ad74416h_remove(struct ad74416h_desc *desc)
Free the device descriptor.
Definition: ad74416h.c:1045
ad74416h_op_mode
Operation modes of the device.
Definition: ad74416h.h:439
@ AD74416H_I_LIMIT1
Definition: ad74416h.h:588
int ad74416h_reg_read_raw(struct ad74416h_desc *, uint32_t, uint8_t *)
Read a raw communication frame.
Definition: ad74416h.c:170
@ AD74416H_LIN_RATE_153KHZ6
Definition: ad74416h.h:571
@ AD74416H_DEBOUNCE_MODE_0
Definition: ad74416h.h:521
@ AD74416H_1K2SPS_HART_REJECTION
Definition: ad74416h.h:489
struct _ad74416h_live_status status_bits
Definition: ad74416h.h:617
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
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:880
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