no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ad74413r.h
Go to the documentation of this file.
1/***************************************************************************/
33#ifndef _AD74413R_H
34#define _AD74413R_H
35
36#include "stdint.h"
37#include "stdbool.h"
38#include "no_os_spi.h"
39#include "no_os_gpio.h"
40
41#define AD74413R_N_CHANNELS 4
42#define AD74413R_N_DIAG_CHANNELS 4
43
44#define AD74413R_CH_A 0
45#define AD74413R_CH_B 1
46#define AD74413R_CH_C 2
47#define AD74413R_CH_D 3
48
50#define AD74413R_RSENSE 100
52#define AD74413R_ADC_MAX_VALUE 65535
53
55
56#define AD74413R_NOP 0x00
57#define AD74413R_CH_FUNC_SETUP(x) (0x01 + x)
58#define AD74413R_ADC_CONFIG(x) (0x05 + x)
59#define AD74413R_DIN_CONFIG(x) (0x09 + x)
60#define AD74413R_GPO_PARALLEL 0x0D
61#define AD74413R_GPO_CONFIG(x) (0x0E + x)
62#define AD74413R_OUTPUT_CONFIG(x) (0x12 + x)
63#define AD74413R_DAC_CODE(x) (0x16 + x)
64#define AD74413R_DAC_CLR_CODE(x) (0x1A + x)
65#define AD74413R_DAC_ACTIVE(x) (0x1E + x)
66#define AD74413R_DIN_THRESH 0x22
67#define AD74413R_ADC_CONV_CTRL 0x23
68#define AD74413R_DIAG_ASSIGN 0x24
69#define AD74413R_DIN_COMP_OUT 0x25
70#define AD74413R_ADC_RESULT(x) (0x26 + x)
71#define AD74413R_DIAG_RESULT(x) (0x2A + x)
72#define AD74413R_ALERT_STATUS 0x2E
73#define AD74413R_LIVE_STATUS 0x2F
74#define AD74413R_ALERT_MASK 0x3C
75#define AD74413R_DIN_COUNTER(x) (0x3D + x)
76#define AD74413R_READ_SELECT 0x41
77#define AD74413R_THERM_RST 0x43
78#define AD74413R_CMD_KEY 0x44
79#define AD74413R_SCRATCH 0x45
80#define AD74413R_SILICON_REV 0x46
81#define AD74413R_ALERT_STATUS_RESET NO_OS_GENMASK(15, 0)
82
84#define AD74413R_CMD_KEY_RESET_1 0x15FA
85#define AD74413R_CMD_KEY_RESET_2 0xAF51
86
88#define AD74413R_CMD_KEY_LDAC 0x953A
89
91#define AD74413R_CMD_KEY_DAC_CLEAR 0x73D1
92
93#define AD74413R_SPI_RD_RET_INFO_MASK NO_OS_BIT(8)
94#define AD74413R_ERR_CLR_MASK NO_OS_GENMASK(15, 0)
95#define AD74413R_SPI_CRC_ERR_MASK NO_OS_BIT(13)
96#define AD74413R_CH_FUNC_SETUP_MASK NO_OS_GENMASK(3, 0)
97#define AD74413R_ADC_RANGE_MASK NO_OS_GENMASK(7, 5)
98#define AD74413R_ADC_REJECTION_MASK NO_OS_GENMASK(4, 3)
99#define AD74413R_DEBOUNCE_TIME_MASK NO_OS_GENMASK(4, 0)
100#define AD74413R_DEBOUNCE_MODE_MASK NO_OS_BIT(5)
101#define AD74413R_DIAG_RESULT_MASK NO_OS_GENMASK(15, 0)
102#define AD74413R_REV_ID NO_OS_GENMASK(7, 0)
103#define AD74413R_CH_200K_TO_GND_MASK NO_OS_BIT(2)
104
106#define AD74413R_GPO_PAR_DATA_MASK(x) NO_OS_BIT(x)
107
109#define AD74413R_GPO_SELECT_MASK NO_OS_GENMASK(2, 0)
110#define AD74413R_GPO_DATA_MASK NO_OS_BIT(3)
111
113#define AD74413R_SLEW_EN_MASK NO_OS_GENMASK(7, 6)
114#define AD74413R_SLEW_LIN_STEP_MASK NO_OS_GENMASK(5, 4)
115#define AD74413R_SLEW_LIN_RATE_MASK NO_OS_GENMASK(3, 2)
116#define AD74413R_CLR_EN_MASK NO_OS_BIT(1)
117#define AD74413R_I_LIMIT_MASK NO_OS_BIT(0)
118
120#define AD74413R_DAC_CODE_MASK NO_OS_GENMASK(12, 0)
121
123#define AD74413R_CLR_CODE_MASK NO_OS_GENMASK(12, 0)
124
126#define AD74413R_DAC_ACTIVE_CODE_MASK NO_OS_GENMASK(12, 0)
127
129#define AD74413R_COMP_THRESH_MASK NO_OS_GENMASK(5, 1)
130#define AD74413R_DIN_THRESH_MODE_MASK NO_OS_BIT(0)
131
133#define AD74413R_DIN_COMP_CH(x) NO_OS_BIT(x)
134
136#define AD74413R_EN_REJ_DIAG_MASK NO_OS_BIT(10)
137#define AD74413R_CONV_SEQ_MASK NO_OS_GENMASK(9, 8)
138#define AD74413R_DIAG_EN_MASK(x) (NO_OS_BIT(x) << 4)
139#define AD74413R_CH_EN_MASK(x) NO_OS_BIT(x)
140
142#define AD74413R_DIAG_ASSIGN_MASK(x) (NO_OS_GENMASK(3, 0) << (x * 4))
143
145#define AD74413R_DAC_RANGE 11000
147#define AD74413R_DAC_RESOLUTION 13
148#define AD74413R_DAC_CODE_MAX 8191
149#define AD74413R_ADC_RESOLUTION 16
150#define AD74413R_ADC_CODE_MAX 65536
151
153#define AD74413R_THRESHOLD_DAC_RANGE 29
155#define AD74413R_THRESHOLD_RANGE 16000
156
157#define AD74413R_TEMP_OFFSET -2392
158#define AD74413R_TEMP_SCALE 8950
159#define AD74413R_TEMP_SCALE_DIV 1000
160
161#define AD74413R_RANGE_10V_SCALE 15259ULL
162#define AD74413R_RANGE_10V_SCALE_DIV 100000ULL
163#define AD74413R_RANGE_2V5_SCALE 38147ULL
164#define AD74413R_RANGE_2V5_SCALE_DIV 1000000ULL
165#define AD74413R_RANGE_5V_SCALE 76294ULL
166#define AD74413R_RANGE_5V_SCALE_DIV 1000000ULL
167#define AD74413R_RANGE_5V_OFFSET -(AD74413R_ADC_MAX_VALUE / 2)
168#define AD74413R_RTD_PULL_UP 2100000ULL
169#define AD74413R_SENSE_RESISTOR_OHMS 100
170
178
189
206
216
226
237
257
265
275
285
292
301
306 int64_t integer;
307 int32_t decimal;
308};
309
317
322 uint8_t VI_ERR_A: 1;
323 uint8_t VI_ERR_B: 1;
324 uint8_t VI_ERR_C: 1;
325 uint8_t VI_ERR_D: 1;
326 uint8_t HI_TEMP_ERR: 1;
327 uint8_t CHARGE_PUMP_ERR: 1;
328 uint8_t ALDO5V_ERR: 1;
329 uint8_t AVDD_ERR: 1;
330 uint8_t DVCC_ERR: 1;
331 uint8_t ALDO1V8_ERR: 1;
332 uint8_t ADC_CH_CURR: 3;
333 uint8_t ADC_BUSY: 1;
334 uint8_t ADC_DATA_RDY: 1;
335 uint8_t _RESERVED: 1;
336};
337
345
356
358int ad74413r_dac_voltage_to_code(uint32_t, uint32_t *);
359
362
364
366int ad74413r_reg_write(struct ad74413r_desc *, uint32_t, uint16_t);
367
369int ad74413r_reg_read_raw(struct ad74413r_desc *, uint32_t, uint8_t *);
370
372int ad74413r_reg_read(struct ad74413r_desc *, uint32_t, uint16_t *);
373
375int ad74413r_reg_update(struct ad74413r_desc *, uint32_t, uint16_t,
376 uint16_t);
377
379int ad74413r_nb_active_channels(struct ad74413r_desc *, uint8_t *);
380
383
388int ad74413r_set_info(struct ad74413r_desc *desc, uint16_t mode);
389
391int ad74413r_reset(struct ad74413r_desc *);
392
395 uint32_t, enum ad74413r_op_mode);
396
398int ad74413r_get_raw_adc_result(struct ad74413r_desc *, uint32_t,
399 uint16_t *);
400
403 bool);
404
406int ad74413r_set_diag_channel_enable(struct ad74413r_desc *, uint32_t, bool);
407
409int ad74413r_get_adc_range(struct ad74413r_desc *, uint32_t, uint16_t *);
410
412int ad74413r_get_adc_rejection(struct ad74413r_desc *, uint32_t,
413 enum ad74413r_rejection *);
414
417 enum ad74413r_rejection *);
418
420int ad74413r_set_adc_rejection(struct ad74413r_desc *, uint32_t,
421 enum ad74413r_rejection);
422
424int ad74413r_get_adc_rate(struct ad74413r_desc *, uint32_t,
425 enum ad74413r_adc_sample *);
426
428int ad74413r_set_adc_rate(struct ad74413r_desc *, uint32_t,
430
432int ad74413r_get_adc_diag_rate(struct ad74413r_desc *, uint32_t,
433 enum ad74413r_adc_sample *);
434
436int ad74413r_set_adc_diag_rate(struct ad74413r_desc *, uint32_t,
438
441
443int ad74413r_get_adc_single(struct ad74413r_desc *, uint32_t, uint16_t *, bool);
444
446int ad74413r_adc_get_value(struct ad74413r_desc *, uint32_t,
447 struct ad74413r_decimal *);
448
450int ad74413r_get_temp(struct ad74413r_desc *, uint32_t, uint16_t *);
451
453int ad74413r_set_channel_dac_code(struct ad74413r_desc *, uint32_t, uint16_t);
454
456int ad74413r_set_diag(struct ad74413r_desc *, uint32_t,
457 enum ad74413r_diag_mode);
458
460int ad74413r_get_diag(struct ad74413r_desc *, uint32_t, uint16_t *);
461
466int ad74413r_set_debounce_mode(struct ad74413r_desc *, uint32_t,
468
473int ad74413r_set_debounce_time(struct ad74413r_desc *, uint32_t, uint32_t);
474
476int ad74413r_gpo_get(struct ad74413r_desc *, uint32_t, uint8_t *);
477
479int ad74413r_set_gpo_config(struct ad74413r_desc *, uint32_t,
481
486int ad74413r_set_threshold(struct ad74413r_desc *, uint32_t, uint32_t);
487
489int ad74413r_gpo_set(struct ad74413r_desc *, uint32_t, uint8_t);
490
492int ad74413r_gpo_set_multiple(struct ad74413r_desc *, uint32_t);
493
496 union ad74413r_live_status *);
497
502int ad74413r_set_dac_clear_code(struct ad74413r_desc *, uint32_t, uint16_t);
503
505int ad74413r_clear_dac(struct ad74413r_desc *, uint32_t);
506
508int ad74413r_dac_slew_enable(struct ad74413r_desc *, uint32_t,
510 enum ad74413r_lin_rate);
511
513int ad74413r_dac_slew_disable(struct ad74413r_desc *, uint32_t);
514
516int ad74413r_set_therm_rst(struct ad74413r_desc *, bool);
517
519int ad74413r_init(struct ad74413r_desc **, struct ad74413r_init_param *);
520
522int ad74413r_remove(struct ad74413r_desc *desc);
523
524#endif // _AD74413R_H
int ad74413r_set_channel_dac_code(struct ad74413r_desc *, uint32_t, uint16_t)
Set and load a code for the DAC on a specific channel.
Definition ad74413r.c:851
int ad74413r_get_adc_rate(struct ad74413r_desc *, uint32_t, enum ad74413r_adc_sample *)
Get the ADC sample rate.
Definition ad74413r.c:581
int ad74413r_set_adc_rejection(struct ad74413r_desc *, uint32_t, enum ad74413r_rejection)
Set the rejection setting for a specific channel.
Definition ad74413r.c:567
int ad74413r_get_adc_diag_rate(struct ad74413r_desc *, uint32_t, enum ad74413r_adc_sample *)
Get the ADC sample rate for the diagnostics channels.
Definition ad74413r.c:621
int ad74413r_get_adc_range(struct ad74413r_desc *, uint32_t, uint16_t *)
Get the ADC measurement range for a specific channel.
Definition ad74413r.c:499
int ad74413r_get_diag(struct ad74413r_desc *, uint32_t, uint16_t *)
Get the diagnostic value for a specific channel.
Definition ad74413r.c:884
int ad74413r_set_debounce_mode(struct ad74413r_desc *, uint32_t, enum ad74413r_debounce_mode)
Set the debounce mode for the IOx inputs when the ADC is running in digital input mode.
Definition ad74413r.c:906
int ad74413r_reset(struct ad74413r_desc *)
Perform either a software or hardware reset and wait for device reset time.
Definition ad74413r.c:371
int ad74413r_gpo_set_multiple(struct ad74413r_desc *, uint32_t)
Set multiple GPO values at once.
Definition ad74413r.c:1028
ad74413r_adc_range
ADC ranges configurations. These are dependent on the operation mode.
Definition ad74413r.h:210
@ AD74413R_ADC_RANGE_10V
Definition ad74413r.h:211
@ AD74413R_ADC_RANGE_5V_BI_DIR
Definition ad74413r.h:214
@ AD74413R_ADC_RANGE_2P5V_INT_POW
Definition ad74413r.h:213
@ AD74413R_ADC_RANGE_2P5V_EXT_POW
Definition ad74413r.h:212
int ad74413r_range_to_voltage_offset(enum ad74413r_adc_range, int32_t *)
Convert the measuring range of the ADC from range enum values to millivolts.
Definition ad74413r.c:151
int ad74413r_set_channel_function(struct ad74413r_desc *, uint32_t, enum ad74413r_op_mode)
Set the operation mode for a specific channel.
Definition ad74413r.c:409
int ad74413r_reg_write(struct ad74413r_desc *, uint32_t, uint16_t)
Write a register's value.
Definition ad74413r.c:236
ad74413r_lin_rate
Possible update rates for a DAC when slew control is enabled.
Definition ad74413r.h:279
@ AD74413R_LIN_RATE_64KHZ
Definition ad74413r.h:281
@ AD74413R_LIN_RATE_240KHZ
Definition ad74413r.h:283
@ AD74413R_LIN_RATE_4KHZ
Definition ad74413r.h:280
@ AD74413R_LIN_RATE_150KHZ
Definition ad74413r.h:282
int ad74413r_reg_read_raw(struct ad74413r_desc *, uint32_t, uint8_t *)
Read a raw communication frame.
Definition ad74413r.c:207
int ad74413r_remove(struct ad74413r_desc *desc)
Free the device descriptor.
Definition ad74413r.c:1215
int ad74413r_nb_active_channels(struct ad74413r_desc *, uint8_t *)
Get the number of active channels.
Definition ad74413r.c:300
int ad74413r_set_therm_rst(struct ad74413r_desc *, bool)
Enable or disable the higher thermal reset.
Definition ad74413r.c:1147
int ad74413r_set_adc_conv_seq(struct ad74413r_desc *, enum ad74413r_conv_seq)
Start or stop ADC conversions.
Definition ad74413r.c:667
int ad74413r_range_to_voltage_range(enum ad74413r_adc_range, uint32_t *)
Convert the measuring range of the ADC from range enum values to millivolts.
Definition ad74413r.c:124
ad74413r_slew_lin_step
The number of increments per step a DAC does when slew control is enabled.
Definition ad74413r.h:269
@ AD74413R_STEP_64
Definition ad74413r.h:270
@ AD74413R_STEP_120
Definition ad74413r.h:271
@ AD74413R_STEP_1820
Definition ad74413r.h:273
@ AD74413R_STEP_500
Definition ad74413r.h:272
int ad74413r_set_diag(struct ad74413r_desc *, uint32_t, enum ad74413r_diag_mode)
Set which diagnostic value to be loaded in the DIAG_RESULT register.
Definition ad74413r.c:870
int ad74413r_clear_dac(struct ad74413r_desc *, uint32_t)
Clear the DAC (to the code in DAC_CLR_CODE register)
Definition ad74413r.c:1082
ad74413r_diag_mode
Possible values to be loaded in the DIAG_RESULT register.
Definition ad74413r.h:241
@ AD74413R_SENSEL_B
Definition ad74413r.h:253
@ AD74413R_SENSEL_A
Definition ad74413r.h:252
@ AD74413R_DIAG_DLDO_1V8
Definition ad74413r.h:249
@ AD74413R_DIAG_AGND
Definition ad74413r.h:242
@ AD74413R_DIAG_ALDO_5V
Definition ad74413r.h:247
@ AD74413R_DIAG_IOVDD
Definition ad74413r.h:251
@ AD74413R_DIAG_AVDD
Definition ad74413r.h:244
@ AD74413R_SENSEL_D
Definition ad74413r.h:255
@ AD74413R_SENSEL_C
Definition ad74413r.h:254
@ AD74413R_DIAG_ALDO_1V8
Definition ad74413r.h:248
@ AD74413R_DIAG_DVCC
Definition ad74413r.h:250
@ AD74413R_DIAG_REFOUT
Definition ad74413r.h:246
@ AD74413R_DIAG_AVSS
Definition ad74413r.h:245
@ AD74413R_DIAG_TEMP
Definition ad74413r.h:243
ad74413r_gpo_select
GPO operation modes.
Definition ad74413r.h:230
@ AD74413R_GPO_CONFIG_DATA
Definition ad74413r.h:232
@ AD74413R_GPO_CONFIG_100K_PD
Definition ad74413r.h:231
@ AD74413R_GPO_CONFIG_PAR_DATA
Definition ad74413r.h:233
@ AD74413R_GPO_CONFIG_COMP
Definition ad74413r.h:234
@ AD74413R_GPO_CONFIG_HIGH_Z
Definition ad74413r.h:235
int ad74413r_set_adc_rate(struct ad74413r_desc *, uint32_t, enum ad74413r_adc_sample)
Set the ADC sample rate.
Definition ad74413r.c:601
int ad74413r_reg_update(struct ad74413r_desc *, uint32_t, uint16_t, uint16_t)
Update a register's field.
Definition ad74413r.c:277
#define AD74413R_N_CHANNELS
Definition ad74413r.h:41
int ad74413r_get_adc_rejection(struct ad74413r_desc *, uint32_t, enum ad74413r_rejection *)
Get the rejection setting for a specific channel.
Definition ad74413r.c:520
int ad74413r_dac_voltage_to_code(uint32_t, uint32_t *)
Converts a millivolt value in the corresponding DAC 13 bit code.
Definition ad74413r.c:176
int ad74413r_set_threshold(struct ad74413r_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 ad74413r.c:981
int ad74413r_gpo_set(struct ad74413r_desc *, uint32_t, uint8_t)
Set the logic value of a GPO pin.
Definition ad74413r.c:1010
int ad74413r_init(struct ad74413r_desc **, struct ad74413r_init_param *)
Initialize the device structure.
Definition ad74413r.c:1158
ad74413r_conv_seq
ADC conversion sequence commands.
Definition ad74413r.h:220
@ AD74413R_START_SINGLE
Definition ad74413r.h:222
@ AD74413R_START_CONT
Definition ad74413r.h:223
@ AD74413R_STOP_PWR_UP
Definition ad74413r.h:221
@ AD74413R_STOP_PWR_DOWN
Definition ad74413r.h:224
int ad74413r_gpo_get(struct ad74413r_desc *, uint32_t, uint8_t *)
Get the GPO value for a specific channel.
Definition ad74413r.c:943
ad74413r_op_mode
Operation modes of the device.
Definition ad74413r.h:193
@ AD74413R_VOLTAGE_OUT
Definition ad74413r.h:195
@ AD74413R_RESISTANCE
Definition ad74413r.h:200
@ AD74413R_CURRENT_IN_EXT
Definition ad74413r.h:198
@ AD74413R_CURRENT_OUT
Definition ad74413r.h:196
@ AD74413R_CURRENT_IN_EXT_HART
Definition ad74413r.h:203
@ AD74413R_CURRENT_IN_LOOP_HART
Definition ad74413r.h:204
@ AD74413R_CURRENT_IN_LOOP
Definition ad74413r.h:199
@ AD74413R_DIGITAL_INPUT_LOOP
Definition ad74413r.h:202
@ AD74413R_DIGITAL_INPUT
Definition ad74413r.h:201
@ AD74413R_VOLTAGE_IN
Definition ad74413r.h:197
@ AD74413R_HIGH_Z
Definition ad74413r.h:194
int ad74413r_set_diag_channel_enable(struct ad74413r_desc *, uint32_t, bool)
Enable conversions on a diagnostic register.
Definition ad74413r.c:485
int ad74413r_set_info(struct ad74413r_desc *desc, uint16_t mode)
Select which information the device will respond with (in the readback field) when a read operation i...
Definition ad74413r.c:335
int ad74413r_set_adc_channel_enable(struct ad74413r_desc *, uint32_t, bool)
Enable/disable a specific ADC channel.
Definition ad74413r.c:463
int ad74413r_get_live(struct ad74413r_desc *, union ad74413r_live_status *)
Read the live status bits.
Definition ad74413r.c:1056
int ad74413r_dac_slew_disable(struct ad74413r_desc *, uint32_t)
Disable the slew rate control.
Definition ad74413r.c:1133
int ad74413r_dac_slew_enable(struct ad74413r_desc *, uint32_t, enum ad74413r_slew_lin_step, enum ad74413r_lin_rate)
Configure and enable slew rate control for a DAC on a specific channel.
Definition ad74413r.c:1107
int ad74413r_clear_errors(struct ad74413r_desc *)
Clear the ALERT_STATUS register.
Definition ad74413r.c:321
ad74413r_rejection
Rejection config values. The HART variants are not supported by the AD74412R device.
Definition ad74413r.h:183
@ AD74413R_REJECTION_50_60_HART
Definition ad74413r.h:186
@ AD74413R_REJECTION_HART
Definition ad74413r.h:187
@ AD74413R_REJECTION_50_60
Definition ad74413r.h:184
@ AD74413R_REJECTION_NONE
Definition ad74413r.h:185
ad74413r_chip_id
The chips supported by this driver.
Definition ad74413r.h:174
@ AD74413R
Definition ad74413r.h:175
@ AD74412R
Definition ad74413r.h:176
ad74413r_debounce_mode
Debounce modes for the IOx inputs when using the digital input op mode.
Definition ad74413r.h:261
@ AD74413R_DEBOUNCE_MODE_0
Definition ad74413r.h:262
@ AD74413R_DEBOUNCE_MODE_1
Definition ad74413r.h:263
int ad74413r_adc_get_value(struct ad74413r_desc *, uint32_t, struct ad74413r_decimal *)
Get the ADC real value, according to the operation mode.
Definition ad74413r.c:759
int ad74413r_get_temp(struct ad74413r_desc *, uint32_t, uint16_t *)
Read the die's temperature from the diagnostic register.
Definition ad74413r.c:830
int ad74413r_set_gpo_config(struct ad74413r_desc *, uint32_t, enum ad74413r_gpo_select)
Set the GPO operation mode.
Definition ad74413r.c:964
int ad74413r_set_adc_diag_rate(struct ad74413r_desc *, uint32_t, enum ad74413r_adc_sample)
Set the ADC sample rate for the diagnostics channels.
Definition ad74413r.c:641
int ad74413r_get_adc_diag_rejection(struct ad74413r_desc *, enum ad74413r_rejection *)
Get the rejection setting for a specific channel.
Definition ad74413r.c:541
int ad74413r_set_debounce_time(struct ad74413r_desc *, uint32_t, uint32_t)
Set the debounce settle time for the IOx inputs when the ADC is running in digital input mode.
Definition ad74413r.c:921
int ad74413r_get_adc_single(struct ad74413r_desc *, uint32_t, uint16_t *, bool)
Get a single ADC raw value for a specific channel, then power down the ADC.
Definition ad74413r.c:693
ad74413r_adc_sample
Definition ad74413r.h:286
@ AD74413R_ADC_SAMPLE_20HZ
Definition ad74413r.h:287
@ AD74413R_ADC_SAMPLE_10HZ
Definition ad74413r.h:289
@ AD74413R_ADC_SAMPLE_1200HZ
Definition ad74413r.h:290
@ AD74413R_ADC_SAMPLE_4800HZ
Definition ad74413r.h:288
int ad74413r_set_dac_clear_code(struct ad74413r_desc *, uint32_t, uint16_t)
The code value will be loaded into the DACs when the CLR_EN bit in the OUTPUT_CONFIGx registers is as...
Definition ad74413r.c:1070
int ad74413r_reg_read(struct ad74413r_desc *, uint32_t, uint16_t *)
Read a register's value.
Definition ad74413r.c:251
int ad74413r_get_raw_adc_result(struct ad74413r_desc *, uint32_t, uint16_t *)
Read the raw ADC raw conversion value.
Definition ad74413r.c:450
Header file of GPIO Interface.
Header file of SPI Interface.
Bitfield struct which maps on the LIVE_STATUS register.
Definition ad74413r.h:321
uint8_t AVDD_ERR
Definition ad74413r.h:329
uint8_t DVCC_ERR
Definition ad74413r.h:330
uint8_t _RESERVED
Definition ad74413r.h:335
uint8_t CHARGE_PUMP_ERR
Definition ad74413r.h:327
uint8_t HI_TEMP_ERR
Definition ad74413r.h:326
uint8_t ADC_BUSY
Definition ad74413r.h:333
uint8_t VI_ERR_B
Definition ad74413r.h:323
uint8_t ADC_CH_CURR
Definition ad74413r.h:332
uint8_t VI_ERR_C
Definition ad74413r.h:324
uint8_t ALDO1V8_ERR
Definition ad74413r.h:331
uint8_t ALDO5V_ERR
Definition ad74413r.h:328
uint8_t VI_ERR_D
Definition ad74413r.h:325
uint8_t ADC_DATA_RDY
Definition ad74413r.h:334
uint8_t VI_ERR_A
Definition ad74413r.h:322
Device channel state.
Definition ad74413r.h:313
bool enabled
Definition ad74413r.h:314
enum ad74413r_op_mode function
Definition ad74413r.h:315
ADC value format.
Definition ad74413r.h:305
int32_t decimal
Definition ad74413r.h:307
int64_t integer
Definition ad74413r.h:306
AD74413r device descriptor.
Definition ad74413r.h:349
struct no_os_gpio_desc * reset_gpio
Definition ad74413r.h:354
struct no_os_spi_desc * comm_desc
Definition ad74413r.h:351
struct ad74413r_channel_config channel_configs[AD74413R_N_CHANNELS]
Definition ad74413r.h:353
uint8_t comm_buff[4]
Definition ad74413r.h:352
enum ad74413r_chip_id chip_id
Definition ad74413r.h:350
Initialization parameter for the device descriptor.
Definition ad74413r.h:296
enum ad74413r_chip_id chip_id
Definition ad74413r.h:297
struct no_os_spi_init_param comm_param
Definition ad74413r.h:298
struct no_os_gpio_init_param * reset_gpio_param
Definition ad74413r.h:299
Structure holding the GPIO descriptor.
Definition no_os_gpio.h:84
Structure holding the parameters for GPIO initialization.
Definition no_os_gpio.h:67
Structure holding SPI descriptor.
Definition no_os_spi.h:180
Structure holding the parameters for SPI initialization.
Definition no_os_spi.h:128
Used to store the live status bit fields.
Definition ad74413r.h:341
uint16_t value
Definition ad74413r.h:343
struct _ad74413r_live_status status_bits
Definition ad74413r.h:342