no-OS
ad74413r.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef _AD74413R_H
40 #define _AD74413R_H
41 
42 #include "stdint.h"
43 #include "stdbool.h"
44 #include "no_os_spi.h"
45 #include "no_os_gpio.h"
46 
47 #define AD74413R_N_CHANNELS 4
48 #define AD74413R_N_DIAG_CHANNELS 4
49 
50 #define AD74413R_CH_A 0
51 #define AD74413R_CH_B 1
52 #define AD74413R_CH_C 2
53 #define AD74413R_CH_D 3
54 
56 #define AD74413R_RSENSE 100
57 
58 #define AD74413R_ADC_MAX_VALUE 65535
59 
62 #define AD74413R_NOP 0x00
63 #define AD74413R_CH_FUNC_SETUP(x) (0x01 + x)
64 #define AD74413R_ADC_CONFIG(x) (0x05 + x)
65 #define AD74413R_DIN_CONFIG(x) (0x09 + x)
66 #define AD74413R_GPO_PARALLEL 0x0D
67 #define AD74413R_GPO_CONFIG(x) (0x0E + x)
68 #define AD74413R_OUTPUT_CONFIG(x) (0x12 + x)
69 #define AD74413R_DAC_CODE(x) (0x16 + x)
70 #define AD74413R_DAC_CLR_CODE(x) (0x1A + x)
71 #define AD74413R_DAC_ACTIVE(x) (0x1E + x)
72 #define AD74413R_DIN_THRESH 0x22
73 #define AD74413R_ADC_CONV_CTRL 0x23
74 #define AD74413R_DIAG_ASSIGN 0x24
75 #define AD74413R_DIN_COMP_OUT 0x25
76 #define AD74413R_ADC_RESULT(x) (0x26 + x)
77 #define AD74413R_DIAG_RESULT(x) (0x2A + x)
78 #define AD74413R_ALERT_STATUS 0x2E
79 #define AD74413R_LIVE_STATUS 0x2F
80 #define AD74413R_ALERT_MASK 0x3C
81 #define AD74413R_DIN_COUNTER(x) (0x3D + x)
82 #define AD74413R_READ_SELECT 0x41
83 #define AD74413R_THERM_RST 0x43
84 #define AD74413R_CMD_KEY 0x44
85 #define AD74413R_SCRATCH 0x45
86 #define AD74413R_SILICON_REV 0x46
87 #define AD74413R_ALERT_STATUS_RESET NO_OS_GENMASK(15, 0)
88 
90 #define AD74413R_CMD_KEY_RESET_1 0x15FA
91 #define AD74413R_CMD_KEY_RESET_2 0xAF51
92 
94 #define AD74413R_CMD_KEY_LDAC 0x953A
95 
97 #define AD74413R_CMD_KEY_DAC_CLEAR 0x73D1
98 
99 #define AD74413R_SPI_RD_RET_INFO_MASK NO_OS_BIT(8)
100 #define AD74413R_ERR_CLR_MASK NO_OS_GENMASK(15, 0)
101 #define AD74413R_SPI_CRC_ERR_MASK NO_OS_BIT(13)
102 #define AD74413R_CH_FUNC_SETUP_MASK NO_OS_GENMASK(3, 0)
103 #define AD74413R_ADC_RANGE_MASK NO_OS_GENMASK(7, 5)
104 #define AD74413R_ADC_REJECTION_MASK NO_OS_GENMASK(4, 3)
105 #define AD74413R_DEBOUNCE_TIME_MASK NO_OS_GENMASK(4, 0)
106 #define AD74413R_DEBOUNCE_MODE_MASK NO_OS_BIT(5)
107 #define AD74413R_DIAG_RESULT_MASK NO_OS_GENMASK(15, 0)
108 #define AD74413R_REV_ID NO_OS_GENMASK(7, 0)
109 #define AD74413R_CH_200K_TO_GND_MASK NO_OS_BIT(2)
110 
112 #define AD74413R_GPO_PAR_DATA_MASK(x) NO_OS_BIT(x)
113 
115 #define AD74413R_GPO_SELECT_MASK NO_OS_GENMASK(2, 0)
116 #define AD74413R_GPO_DATA_MASK NO_OS_BIT(3)
117 
119 #define AD74413R_SLEW_EN_MASK NO_OS_GENMASK(7, 6)
120 #define AD74413R_SLEW_LIN_STEP_MASK NO_OS_GENMASK(5, 4)
121 #define AD74413R_SLEW_LIN_RATE_MASK NO_OS_GENMASK(3, 2)
122 #define AD74413R_CLR_EN_MASK NO_OS_BIT(1)
123 #define AD74413R_I_LIMIT_MASK NO_OS_BIT(0)
124 
126 #define AD74413R_DAC_CODE_MASK NO_OS_GENMASK(12, 0)
127 
129 #define AD74413R_CLR_CODE_MASK NO_OS_GENMASK(12, 0)
130 
132 #define AD74413R_DAC_ACTIVE_CODE_MASK NO_OS_GENMASK(12, 0)
133 
135 #define AD74413R_COMP_THRESH_MASK NO_OS_GENMASK(5, 1)
136 #define AD74413R_DIN_THRESH_MODE_MASK NO_OS_BIT(0)
137 
139 #define AD74413R_DIN_COMP_CH(x) NO_OS_BIT(x)
140 
142 #define AD74413R_EN_REJ_DIAG_MASK NO_OS_BIT(10)
143 #define AD74413R_CONV_SEQ_MASK NO_OS_GENMASK(9, 8)
144 #define AD74413R_DIAG_EN_MASK(x) (NO_OS_BIT(x) << 4)
145 #define AD74413R_CH_EN_MASK(x) NO_OS_BIT(x)
146 
148 #define AD74413R_DIAG_ASSIGN_MASK(x) (NO_OS_GENMASK(3, 0) << (x * 4))
149 
151 #define AD74413R_DAC_RANGE 11000
152 
153 #define AD74413R_DAC_RESOLUTION 13
154 #define AD74413R_DAC_CODE_MAX 8191
155 #define AD74413R_ADC_RESOLUTION 16
156 #define AD74413R_ADC_CODE_MAX 65536
157 
159 #define AD74413R_THRESHOLD_DAC_RANGE 29
160 
161 #define AD74413R_THRESHOLD_RANGE 16000
162 
163 #define AD74413R_TEMP_OFFSET -2392
164 #define AD74413R_TEMP_SCALE 8950
165 #define AD74413R_TEMP_SCALE_DIV 1000
166 
167 #define AD74413R_RANGE_10V_SCALE 15259ULL
168 #define AD74413R_RANGE_10V_SCALE_DIV 100000ULL
169 #define AD74413R_RANGE_2V5_SCALE 38147ULL
170 #define AD74413R_RANGE_2V5_SCALE_DIV 1000000ULL
171 #define AD74413R_RANGE_5V_SCALE 76294ULL
172 #define AD74413R_RANGE_5V_SCALE_DIV 1000000ULL
173 #define AD74413R_RANGE_5V_OFFSET -(AD74413R_ADC_MAX_VALUE / 2)
174 #define AD74413R_RTD_PULL_UP 2100000ULL
175 #define AD74413R_SENSE_RESISTOR_OHMS 100
176 
183 };
184 
194 };
195 
211 };
212 
221 };
222 
231 };
232 
242 };
243 
262 };
263 
270 };
271 
280 };
281 
290 };
291 
297 };
298 
306 };
307 
312  int64_t integer;
313  int32_t decimal;
314 };
315 
320  bool enabled;
321  enum ad74413r_op_mode function;
322 };
323 
328  uint8_t VI_ERR_A: 1;
329  uint8_t VI_ERR_B: 1;
330  uint8_t VI_ERR_C: 1;
331  uint8_t VI_ERR_D: 1;
332  uint8_t HI_TEMP_ERR: 1;
333  uint8_t CHARGE_PUMP_ERR: 1;
334  uint8_t ALDO5V_ERR: 1;
335  uint8_t AVDD_ERR: 1;
336  uint8_t DVCC_ERR: 1;
337  uint8_t ALDO1V8_ERR: 1;
338  uint8_t ADC_CH_CURR: 3;
339  uint8_t ADC_BUSY: 1;
340  uint8_t ADC_DATA_RDY: 1;
341  uint8_t _RESERVED: 1;
342 };
343 
349  uint16_t value;
350 };
351 
358  uint8_t comm_buff[4];
361 };
362 
364 int ad74413r_dac_voltage_to_code(uint32_t, uint32_t *);
365 
368 
370 
372 int ad74413r_reg_write(struct ad74413r_desc *, uint32_t, uint16_t);
373 
375 int ad74413r_reg_read_raw(struct ad74413r_desc *, uint32_t, uint8_t *);
376 
378 int ad74413r_reg_read(struct ad74413r_desc *, uint32_t, uint16_t *);
379 
381 int ad74413r_reg_update(struct ad74413r_desc *, uint32_t, uint16_t,
382  uint16_t);
383 
385 int ad74413r_nb_active_channels(struct ad74413r_desc *, uint8_t *);
386 
389 
394 int ad74413r_set_info(struct ad74413r_desc *desc, uint16_t mode);
395 
397 int ad74413r_reset(struct ad74413r_desc *);
398 
401  uint32_t, enum ad74413r_op_mode);
402 
404 int ad74413r_get_raw_adc_result(struct ad74413r_desc *, uint32_t,
405  uint16_t *);
406 
408 int ad74413r_set_adc_channel_enable(struct ad74413r_desc *, uint32_t,
409  bool);
410 
412 int ad74413r_set_diag_channel_enable(struct ad74413r_desc *, uint32_t, bool);
413 
415 int ad74413r_get_adc_range(struct ad74413r_desc *, uint32_t, uint16_t *);
416 
418 int ad74413r_get_adc_rejection(struct ad74413r_desc *, uint32_t,
419  enum ad74413r_rejection *);
420 
423  enum ad74413r_rejection *);
424 
426 int ad74413r_set_adc_rejection(struct ad74413r_desc *, uint32_t,
427  enum ad74413r_rejection);
428 
430 int ad74413r_get_adc_rate(struct ad74413r_desc *, uint32_t,
431  enum ad74413r_adc_sample *);
432 
434 int ad74413r_set_adc_rate(struct ad74413r_desc *, uint32_t,
435  enum ad74413r_adc_sample);
436 
438 int ad74413r_get_adc_diag_rate(struct ad74413r_desc *, uint32_t,
439  enum ad74413r_adc_sample *);
440 
442 int ad74413r_set_adc_diag_rate(struct ad74413r_desc *, uint32_t,
443  enum ad74413r_adc_sample);
444 
447 
449 int ad74413r_get_adc_single(struct ad74413r_desc *, uint32_t, uint16_t *, bool);
450 
452 int ad74413r_adc_get_value(struct ad74413r_desc *, uint32_t,
453  struct ad74413r_decimal *);
454 
456 int ad74413r_get_temp(struct ad74413r_desc *, uint32_t, uint16_t *);
457 
459 int ad74413r_set_channel_dac_code(struct ad74413r_desc *, uint32_t, uint16_t);
460 
462 int ad74413r_set_diag(struct ad74413r_desc *, uint32_t,
463  enum ad74413r_diag_mode);
464 
466 int ad74413r_get_diag(struct ad74413r_desc *, uint32_t, uint16_t *);
467 
472 int ad74413r_set_debounce_mode(struct ad74413r_desc *, uint32_t,
474 
479 int ad74413r_set_debounce_time(struct ad74413r_desc *, uint32_t, uint32_t);
480 
482 int ad74413r_gpo_get(struct ad74413r_desc *, uint32_t, uint8_t *);
483 
485 int ad74413r_set_gpo_config(struct ad74413r_desc *, uint32_t,
486  enum ad74413r_gpo_select);
487 
492 int ad74413r_set_threshold(struct ad74413r_desc *, uint32_t, uint32_t);
493 
495 int ad74413r_gpo_set(struct ad74413r_desc *, uint32_t, uint8_t);
496 
498 int ad74413r_gpo_set_multiple(struct ad74413r_desc *, uint32_t);
499 
501 int ad74413r_get_live(struct ad74413r_desc *,
502  union ad74413r_live_status *);
503 
508 int ad74413r_set_dac_clear_code(struct ad74413r_desc *, uint32_t, uint16_t);
509 
511 int ad74413r_clear_dac(struct ad74413r_desc *, uint32_t);
512 
514 int ad74413r_dac_slew_enable(struct ad74413r_desc *, uint32_t,
516  enum ad74413r_lin_rate);
517 
519 int ad74413r_dac_slew_disable(struct ad74413r_desc *, uint32_t);
520 
522 int ad74413r_set_therm_rst(struct ad74413r_desc *, bool);
523 
525 int ad74413r_init(struct ad74413r_desc **, struct ad74413r_init_param *);
526 
528 int ad74413r_remove(struct ad74413r_desc *desc);
529 
530 #endif // _AD74413R_H
AD74413R_REJECTION_HART
@ AD74413R_REJECTION_HART
Definition: ad74413r.h:193
ad74413r_get_adc_single
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:711
ad74413r_decimal::decimal
int32_t decimal
Definition: ad74413r.h:313
_ad74413r_live_status::AVDD_ERR
uint8_t AVDD_ERR
Definition: ad74413r.h:335
AD74413R_ADC_CONFIG
#define AD74413R_ADC_CONFIG(x)
Definition: ad74413r.h:64
ad74413r_chip_id
ad74413r_chip_id
The chips supported by this driver.
Definition: ad74413r.h:180
ad74413r_adc_sample
ad74413r_adc_sample
Definition: ad74413r.h:292
ad74413r_op_mode
ad74413r_op_mode
Operation modes of the device.
Definition: ad74413r.h:199
AD74413R_DIN_THRESH
#define AD74413R_DIN_THRESH
Definition: ad74413r.h:72
ad74413r_set_therm_rst
int ad74413r_set_therm_rst(struct ad74413r_desc *, bool)
Enable or disable the higher thermal reset.
Definition: ad74413r.c:1165
AD74413R_DIAG_IOVDD
@ AD74413R_DIAG_IOVDD
Definition: ad74413r.h:257
no_os_put_unaligned_be16
void no_os_put_unaligned_be16(uint16_t val, uint8_t *buf)
ad74413r_set_adc_rejection
int ad74413r_set_adc_rejection(struct ad74413r_desc *, uint32_t, enum ad74413r_rejection)
Set the rejection setting for a specific channel.
Definition: ad74413r.c:585
AD74413R_STEP_500
@ AD74413R_STEP_500
Definition: ad74413r.h:278
no_os_alloc.h
AD74413R_ADC_SAMPLE_4800HZ
@ AD74413R_ADC_SAMPLE_4800HZ
Definition: ad74413r.h:294
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:85
ad74413r_range_to_voltage_range
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:142
no_os_div_s64_rem
int64_t no_os_div_s64_rem(int64_t dividend, int32_t divisor, int32_t *remainder)
ad74413r_rejection
ad74413r_rejection
Rejection config values. The HART variants are not supported by the AD74412R device.
Definition: ad74413r.h:189
ad74413r_reg_read_raw
int ad74413r_reg_read_raw(struct ad74413r_desc *desc, uint32_t addr, uint8_t *val)
Read a raw communication frame.
Definition: ad74413r.c:225
ad74413r_clear_errors
int ad74413r_clear_errors(struct ad74413r_desc *desc)
Clear the ALERT_STATUS register.
Definition: ad74413r.c:339
_ad74413r_live_status::ADC_CH_CURR
uint8_t ADC_CH_CURR
Definition: ad74413r.h:338
AD74413R_CMD_KEY_LDAC
#define AD74413R_CMD_KEY_LDAC
Definition: ad74413r.h:94
ad74413r_channel_config::enabled
bool enabled
Definition: ad74413r.h:320
ad74413r_set_dac_clear_code
int ad74413r_set_dac_clear_code(struct ad74413r_desc *desc, uint32_t ch, uint16_t code)
The code value will be loaded into the DACs when the CLR_EN bit in the OUTPUT_CONFIGx registers is as...
Definition: ad74413r.c:1088
AD74413R_ADC_MAX_VALUE
#define AD74413R_ADC_MAX_VALUE
Definition: ad74413r.h:58
AD74413R_THRESHOLD_DAC_RANGE
#define AD74413R_THRESHOLD_DAC_RANGE
Definition: ad74413r.h:159
AD74413R_GPO_CONFIG_100K_PD
@ AD74413R_GPO_CONFIG_100K_PD
Definition: ad74413r.h:237
ad74413r_get_adc_range
int ad74413r_get_adc_range(struct ad74413r_desc *desc, uint32_t ch, uint16_t *val)
Get the ADC measurement range for a specific channel.
Definition: ad74413r.c:517
NO_OS_GENMASK
#define NO_OS_GENMASK(h, l)
Definition: no_os_util.h:86
AD74413R_DIAG_RESULT_MASK
#define AD74413R_DIAG_RESULT_MASK
Definition: ad74413r.h:107
AD74413R_THRESHOLD_RANGE
#define AD74413R_THRESHOLD_RANGE
Definition: ad74413r.h:161
no_os_spi_write_and_read
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
ad74413r_desc::chip_id
enum ad74413r_chip_id chip_id
Definition: ad74413r.h:356
AD74413R_GPO_CONFIG_PAR_DATA
@ AD74413R_GPO_CONFIG_PAR_DATA
Definition: ad74413r.h:239
ad74413r_set_channel_dac_code
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:869
ad74413r_get_live
int ad74413r_get_live(struct ad74413r_desc *, union ad74413r_live_status *)
Read the live status bits.
Definition: ad74413r.c:1074
ad74413r_reset
int ad74413r_reset(struct ad74413r_desc *desc)
Perform either a software or hardware reset and wait for device reset time.
Definition: ad74413r.c:389
AD74413R_TEMP_SCALE_DIV
#define AD74413R_TEMP_SCALE_DIV
Definition: ad74413r.h:165
ad74413r_init_param
Initialization parameter for the device descriptor.
Definition: ad74413r.h:302
ad74413r_set_diag
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:888
AD74413R_STEP_120
@ AD74413R_STEP_120
Definition: ad74413r.h:277
AD74413R_ADC_SAMPLE_20HZ
@ AD74413R_ADC_SAMPLE_20HZ
Definition: ad74413r.h:293
no_os_spi.h
Header file of SPI Interface.
ad74413r_init
int ad74413r_init(struct ad74413r_desc **desc, struct ad74413r_init_param *init_param)
Initialize the device structure.
Definition: ad74413r.c:1176
AD74413R_GPO_CONFIG
#define AD74413R_GPO_CONFIG(x)
Definition: ad74413r.h:67
AD74413R_DEBOUNCE_TIME_MASK
#define AD74413R_DEBOUNCE_TIME_MASK
Definition: ad74413r.h:105
AD74413R_RANGE_5V_SCALE
#define AD74413R_RANGE_5V_SCALE
Definition: ad74413r.h:171
ad74413r_set_adc_conv_seq
int ad74413r_set_adc_conv_seq(struct ad74413r_desc *, enum ad74413r_conv_seq)
Start or stop ADC conversions.
Definition: ad74413r.c:685
AD74413R_CURRENT_OUT
@ AD74413R_CURRENT_OUT
Definition: ad74413r.h:202
ad74413r_set_threshold
int ad74413r_set_threshold(struct ad74413r_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: ad74413r.c:999
ad74413r_set_dac_clear_code
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:1088
_ad74413r_live_status::ADC_DATA_RDY
uint8_t ADC_DATA_RDY
Definition: ad74413r.h:340
ad74413r_set_debounce_time
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:939
AD74413R_GPO_SELECT_MASK
#define AD74413R_GPO_SELECT_MASK
Definition: ad74413r.h:115
ad74413r_set_adc_conv_seq
int ad74413r_set_adc_conv_seq(struct ad74413r_desc *desc, enum ad74413r_conv_seq status)
Start or stop ADC conversions.
Definition: ad74413r.c:685
ad74413r_clear_errors
int ad74413r_clear_errors(struct ad74413r_desc *)
Clear the ALERT_STATUS register.
Definition: ad74413r.c:339
ad74413r_desc::comm_buff
uint8_t comm_buff[4]
Definition: ad74413r.h:358
ad74413r_get_raw_adc_result
int ad74413r_get_raw_adc_result(struct ad74413r_desc *desc, uint32_t ch, uint16_t *val)
Read the raw ADC raw conversion value.
Definition: ad74413r.c:468
no_os_delay.h
Header file of Delay functions.
ad74413r_decimal
ADC value format.
Definition: ad74413r.h:311
ad74413r_get_live
int ad74413r_get_live(struct ad74413r_desc *desc, union ad74413r_live_status *status)
Read the live status bits.
Definition: ad74413r.c:1074
ad74413r_desc::comm_desc
struct no_os_spi_desc * comm_desc
Definition: ad74413r.h:357
AD74413R_DIN_CONFIG
#define AD74413R_DIN_CONFIG(x)
Definition: ad74413r.h:65
ad74413r_dac_slew_enable
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:1125
AD74413R_DIAG_DLDO_1V8
@ AD74413R_DIAG_DLDO_1V8
Definition: ad74413r.h:255
_ad74413r_live_status::DVCC_ERR
uint8_t DVCC_ERR
Definition: ad74413r.h:336
ad74413r_get_temp
int ad74413r_get_temp(struct ad74413r_desc *desc, uint32_t ch, uint16_t *temp)
Read the die's temperature from the diagnostic register.
Definition: ad74413r.c:848
AD74413R_RANGE_10V_SCALE_DIV
#define AD74413R_RANGE_10V_SCALE_DIV
Definition: ad74413r.h:168
AD74413R_ADC_REJECTION_MASK
#define AD74413R_ADC_REJECTION_MASK
Definition: ad74413r.h:104
ad74413r_gpo_set
int ad74413r_gpo_set(struct ad74413r_desc *desc, uint32_t ch, uint8_t val)
Set the logic value of a GPO pin.
Definition: ad74413r.c:1028
NO_OS_GPIO_HIGH
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:123
AD74413R_N_CHANNELS
#define AD74413R_N_CHANNELS
Definition: ad74413r.h:47
ad74413r_conv_seq
ad74413r_conv_seq
ADC conversion sequence commands.
Definition: ad74413r.h:226
AD74413R_CURRENT_IN_EXT_HART
@ AD74413R_CURRENT_IN_EXT_HART
Definition: ad74413r.h:209
AD74413R_DAC_RESOLUTION
#define AD74413R_DAC_RESOLUTION
Definition: ad74413r.h:153
ad74413r_set_threshold
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:999
no_os_calloc
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
ad74413r_dac_slew_disable
int ad74413r_dac_slew_disable(struct ad74413r_desc *desc, uint32_t ch)
Disable the slew rate control.
Definition: ad74413r.c:1151
AD74413R_DIAG_AVSS
@ AD74413R_DIAG_AVSS
Definition: ad74413r.h:251
ad74413r_live_status
Used to store the live status bit fields.
Definition: ad74413r.h:347
AD74413R_VOLTAGE_OUT
@ AD74413R_VOLTAGE_OUT
Definition: ad74413r.h:201
AD74413R_SLEW_EN_MASK
#define AD74413R_SLEW_EN_MASK
Definition: ad74413r.h:119
NO_OS_DECLARE_CRC8_TABLE
NO_OS_DECLARE_CRC8_TABLE(_crc_table)
ad74413r_set_info
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:353
AD74413R_DIN_COMP_OUT
#define AD74413R_DIN_COMP_OUT
Definition: ad74413r.h:75
AD74413R_ADC_RANGE_2P5V_EXT_POW
@ AD74413R_ADC_RANGE_2P5V_EXT_POW
Definition: ad74413r.h:218
AD74413R_ADC_RESULT
#define AD74413R_ADC_RESULT(x)
Definition: ad74413r.h:76
_ad74413r_live_status::VI_ERR_A
uint8_t VI_ERR_A
Definition: ad74413r.h:328
ad74413r_remove
int ad74413r_remove(struct ad74413r_desc *desc)
Free the device descriptor.
Definition: ad74413r.c:1233
ad74413r_reg_update
int ad74413r_reg_update(struct ad74413r_desc *, uint32_t, uint16_t, uint16_t)
Update a register's field.
Definition: ad74413r.c:295
ad74413r_get_adc_rejection
int ad74413r_get_adc_rejection(struct ad74413r_desc *, uint32_t, enum ad74413r_rejection *)
Get the rejection setting for a specific channel.
Definition: ad74413r.c:538
NO_OS_GPIO_LOW
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:121
ad74413r_init_param::reset_gpio_param
struct no_os_gpio_init_param * reset_gpio_param
Definition: ad74413r.h:305
AD74413R_START_CONT
@ AD74413R_START_CONT
Definition: ad74413r.h:229
ad74413r_debounce_mode
ad74413r_debounce_mode
Debounce modes for the IOx inputs when using the digital input op mode.
Definition: ad74413r.h:267
AD74413R_FRAME_SIZE
#define AD74413R_FRAME_SIZE
Definition: ad74413r.c:53
ad74413r_set_info
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:353
ad74413r_set_diag
int ad74413r_set_diag(struct ad74413r_desc *desc, uint32_t ch, enum ad74413r_diag_mode diag_code)
Set which diagnostic value to be loaded in the DIAG_RESULT register.
Definition: ad74413r.c:888
AD74413R_CH_200K_TO_GND_MASK
#define AD74413R_CH_200K_TO_GND_MASK
Definition: ad74413r.h:109
AD74413R_ADC_RANGE_MASK
#define AD74413R_ADC_RANGE_MASK
Definition: ad74413r.h:103
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:132
AD74413R_RANGE_2V5_SCALE_DIV
#define AD74413R_RANGE_2V5_SCALE_DIV
Definition: ad74413r.h:170
ad74413r_adc_get_value
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:777
no_os_field_prep
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
ad74413r_nb_active_channels
int ad74413r_nb_active_channels(struct ad74413r_desc *, uint8_t *)
Get the number of active channels.
Definition: ad74413r.c:318
AD74413R_EN_REJ_DIAG_MASK
#define AD74413R_EN_REJ_DIAG_MASK
Definition: ad74413r.h:142
AD74413R_GPO_CONFIG_DATA
@ AD74413R_GPO_CONFIG_DATA
Definition: ad74413r.h:238
_ad74413r_live_status
Bitfield struct which maps on the LIVE_STATUS register.
Definition: ad74413r.h:327
AD74413R_ALERT_STATUS
#define AD74413R_ALERT_STATUS
Definition: ad74413r.h:78
no_os_error.h
Error codes definition.
AD74413R_STEP_64
@ AD74413R_STEP_64
Definition: ad74413r.h:276
AD74413R_DAC_CLR_CODE
#define AD74413R_DAC_CLR_CODE(x)
Definition: ad74413r.h:70
AD74413R_DEBOUNCE_MODE_MASK
#define AD74413R_DEBOUNCE_MODE_MASK
Definition: ad74413r.h:106
ad74413r_reg_write
int ad74413r_reg_write(struct ad74413r_desc *, uint32_t, uint16_t)
Write a register's value.
Definition: ad74413r.c:254
AD74413R_GPO_DATA_MASK
#define AD74413R_GPO_DATA_MASK
Definition: ad74413r.h:116
ad74413r_reg_write
int ad74413r_reg_write(struct ad74413r_desc *desc, uint32_t addr, uint16_t val)
Write a register's value.
Definition: ad74413r.c:254
AD74413R_DIAG_DVCC
@ AD74413R_DIAG_DVCC
Definition: ad74413r.h:256
ad74413r_set_adc_rejection
int ad74413r_set_adc_rejection(struct ad74413r_desc *desc, uint32_t ch, enum ad74413r_rejection val)
Set the rejection setting for a specific channel.
Definition: ad74413r.c:585
ad74413r_gpo_set_multiple
int ad74413r_gpo_set_multiple(struct ad74413r_desc *desc, uint32_t mask)
Set multiple GPO values at once.
Definition: ad74413r.c:1046
_ad74413r_live_status::CHARGE_PUMP_ERR
uint8_t CHARGE_PUMP_ERR
Definition: ad74413r.h:333
AD74413R_DIAG_RESULT
#define AD74413R_DIAG_RESULT(x)
Definition: ad74413r.h:77
ad74413r_get_adc_single
int ad74413r_get_adc_single(struct ad74413r_desc *desc, uint32_t ch, uint16_t *val, bool is_diag)
Get a single ADC raw value for a specific channel, then power down the ADC.
Definition: ad74413r.c:711
ad74413r_set_therm_rst
int ad74413r_set_therm_rst(struct ad74413r_desc *desc, bool enable)
Enable or disable the higher thermal reset.
Definition: ad74413r.c:1165
_ad74413r_live_status::ADC_BUSY
uint8_t ADC_BUSY
Definition: ad74413r.h:339
no_os_crc8_populate_msb
void no_os_crc8_populate_msb(uint8_t *table, const uint8_t polynomial)
ad74413r_gpo_select
ad74413r_gpo_select
GPO operation modes.
Definition: ad74413r.h:236
AD74413R_DEBOUNCE_MODE_1
@ AD74413R_DEBOUNCE_MODE_1
Definition: ad74413r.h:269
ad74413r_get_raw_adc_result
int ad74413r_get_raw_adc_result(struct ad74413r_desc *, uint32_t, uint16_t *)
Read the raw ADC raw conversion value.
Definition: ad74413r.c:468
ad74413r_decimal::integer
int64_t integer
Definition: ad74413r.h:312
ad74413r_channel_config::function
enum ad74413r_op_mode function
Definition: ad74413r.h:321
AD74413R_CMD_KEY_RESET_2
#define AD74413R_CMD_KEY_RESET_2
Definition: ad74413r.h:91
AD74413R_DIN_THRESH_MODE_MASK
#define AD74413R_DIN_THRESH_MODE_MASK
Definition: ad74413r.h:136
AD74413R_ERR_CLR_MASK
#define AD74413R_ERR_CLR_MASK
Definition: ad74413r.h:100
AD74413R_SCRATCH
#define AD74413R_SCRATCH
Definition: ad74413r.h:85
ad74413r_get_adc_range
int ad74413r_get_adc_range(struct ad74413r_desc *, uint32_t, uint16_t *)
Get the ADC measurement range for a specific channel.
Definition: ad74413r.c:517
AD74413R_SENSEL_C
@ AD74413R_SENSEL_C
Definition: ad74413r.h:260
AD74413R_GPO_CONFIG_HIGH_Z
@ AD74413R_GPO_CONFIG_HIGH_Z
Definition: ad74413r.h:241
AD74413R_LIVE_STATUS
#define AD74413R_LIVE_STATUS
Definition: ad74413r.h:79
AD74413R_CH_FUNC_SETUP
#define AD74413R_CH_FUNC_SETUP(x)
Definition: ad74413r.h:63
AD74413R_CMD_KEY
#define AD74413R_CMD_KEY
Definition: ad74413r.h:84
AD74413R_TEMP_SCALE
#define AD74413R_TEMP_SCALE
Definition: ad74413r.h:164
ad74413r_desc
AD74413r device descriptor.
Definition: ad74413r.h:355
_ad74413r_live_status::_RESERVED
uint8_t _RESERVED
Definition: ad74413r.h:341
_ad74413r_live_status::VI_ERR_D
uint8_t VI_ERR_D
Definition: ad74413r.h:331
AD74413R_LIN_RATE_150KHZ
@ AD74413R_LIN_RATE_150KHZ
Definition: ad74413r.h:288
ad74413r_dac_slew_enable
int ad74413r_dac_slew_enable(struct ad74413r_desc *desc, uint32_t ch, enum ad74413r_slew_lin_step step, enum ad74413r_lin_rate rate)
Configure and enable slew rate control for a DAC on a specific channel.
Definition: ad74413r.c:1125
AD74413R_RANGE_5V_SCALE_DIV
#define AD74413R_RANGE_5V_SCALE_DIV
Definition: ad74413r.h:172
ad74413r_set_debounce_mode
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:924
AD74413R_SENSEL_D
@ AD74413R_SENSEL_D
Definition: ad74413r.h:261
AD74413R
@ AD74413R
Definition: ad74413r.h:181
ad74413r_get_diag
int ad74413r_get_diag(struct ad74413r_desc *, uint32_t, uint16_t *)
Get the diagnostic value for a specific channel.
Definition: ad74413r.c:902
ad74413r_lin_rate
ad74413r_lin_rate
Possible update rates for a DAC when slew control is enabled.
Definition: ad74413r.h:285
AD74413R_CMD_KEY_DAC_CLEAR
#define AD74413R_CMD_KEY_DAC_CLEAR
Definition: ad74413r.h:97
no_os_gpio_remove
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
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:177
_ad74413r_live_status::ALDO5V_ERR
uint8_t ALDO5V_ERR
Definition: ad74413r.h:334
AD74413R_SPI_RD_RET_INFO_MASK
#define AD74413R_SPI_RD_RET_INFO_MASK
Definition: ad74413r.h:99
ad74413r_get_temp
int ad74413r_get_temp(struct ad74413r_desc *, uint32_t, uint16_t *)
Read the die's temperature from the diagnostic register.
Definition: ad74413r.c:848
ad74413r_get_adc_diag_rejection
int ad74413r_get_adc_diag_rejection(struct ad74413r_desc *desc, enum ad74413r_rejection *val)
Get the rejection setting for a specific channel.
Definition: ad74413r.c:559
AD74413R_SENSEL_A
@ AD74413R_SENSEL_A
Definition: ad74413r.h:258
ad74413r.h
Header file of AD74413r Driver.
ad74413r_live_status::value
uint16_t value
Definition: ad74413r.h:349
AD74413R_DIGITAL_INPUT
@ AD74413R_DIGITAL_INPUT
Definition: ad74413r.h:207
no_os_div_u64_rem
uint64_t no_os_div_u64_rem(uint64_t dividend, uint32_t divisor, uint32_t *remainder)
AD74413R_DEBOUNCE_MODE_0
@ AD74413R_DEBOUNCE_MODE_0
Definition: ad74413r.h:268
ad74413r_get_adc_diag_rate
int ad74413r_get_adc_diag_rate(struct ad74413r_desc *desc, uint32_t ch, enum ad74413r_adc_sample *val)
Get the ADC sample rate for the diagnostics channels.
Definition: ad74413r.c:639
ad74413r_live_status::status_bits
struct _ad74413r_live_status status_bits
Definition: ad74413r.h:348
AD74413R_RANGE_5V_OFFSET
#define AD74413R_RANGE_5V_OFFSET
Definition: ad74413r.h:173
AD74413R_COMP_THRESH_MASK
#define AD74413R_COMP_THRESH_MASK
Definition: ad74413r.h:135
ad74413r_set_gpo_config
int ad74413r_set_gpo_config(struct ad74413r_desc *desc, uint32_t ch, enum ad74413r_gpo_select config)
Set the GPO operation mode.
Definition: ad74413r.c:982
ad74413r_init
int ad74413r_init(struct ad74413r_desc **, struct ad74413r_init_param *)
Initialize the device structure.
Definition: ad74413r.c:1176
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:102
AD74412R
@ AD74412R
Definition: ad74413r.h:182
AD74413R_REJECTION_NONE
@ AD74413R_REJECTION_NONE
Definition: ad74413r.h:191
ad74413r_get_diag
int ad74413r_get_diag(struct ad74413r_desc *desc, uint32_t ch, uint16_t *diag_code)
Get the diagnostic value for a specific channel.
Definition: ad74413r.c:902
ad74413r_init_param::comm_param
struct no_os_spi_init_param comm_param
Definition: ad74413r.h:304
AD74413R_TEMP_OFFSET
#define AD74413R_TEMP_OFFSET
Definition: ad74413r.h:163
ad74413r_get_adc_rate
int ad74413r_get_adc_rate(struct ad74413r_desc *desc, uint32_t ch, enum ad74413r_adc_sample *val)
Get the ADC sample rate.
Definition: ad74413r.c:599
AD74413R_CH_EN_MASK
#define AD74413R_CH_EN_MASK(x)
Definition: ad74413r.h:145
AD74413R_ADC_RANGE_10V
@ AD74413R_ADC_RANGE_10V
Definition: ad74413r.h:217
AD74413R_ADC_SAMPLE_10HZ
@ AD74413R_ADC_SAMPLE_10HZ
Definition: ad74413r.h:295
ad74413r_reg_update
int ad74413r_reg_update(struct ad74413r_desc *desc, uint32_t addr, uint16_t mask, uint16_t val)
Update a register's field.
Definition: ad74413r.c:295
ad74413r_reg_read_raw
int ad74413r_reg_read_raw(struct ad74413r_desc *, uint32_t, uint8_t *)
Read a raw communication frame.
Definition: ad74413r.c:225
ad74413r_range_to_voltage_range
int ad74413r_range_to_voltage_range(enum ad74413r_adc_range range, uint32_t *val)
Convert the measuring range of the ADC from range enum values to millivolts.
Definition: ad74413r.c:142
AD74413R_DIAG_EN_MASK
#define AD74413R_DIAG_EN_MASK(x)
Definition: ad74413r.h:144
AD74413R_GPO_PARALLEL
#define AD74413R_GPO_PARALLEL
Definition: ad74413r.h:66
AD74413R_CURRENT_IN_LOOP
@ AD74413R_CURRENT_IN_LOOP
Definition: ad74413r.h:205
ad74413r_get_adc_rate
int ad74413r_get_adc_rate(struct ad74413r_desc *, uint32_t, enum ad74413r_adc_sample *)
Get the ADC sample rate.
Definition: ad74413r.c:599
AD74413R_DIAG_AVDD
@ AD74413R_DIAG_AVDD
Definition: ad74413r.h:250
ad74413r_set_adc_rate
int ad74413r_set_adc_rate(struct ad74413r_desc *desc, uint32_t ch, enum ad74413r_adc_sample val)
Set the ADC sample rate.
Definition: ad74413r.c:619
AD74413R_RESISTANCE
@ AD74413R_RESISTANCE
Definition: ad74413r.h:206
AD74413R_RANGE_2V5_SCALE
#define AD74413R_RANGE_2V5_SCALE
Definition: ad74413r.h:169
ad74413r_adc_get_value
int ad74413r_adc_get_value(struct ad74413r_desc *desc, uint32_t ch, struct ad74413r_decimal *val)
Get the ADC real value, according to the operation mode.
Definition: ad74413r.c:777
no_os_field_get
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
ad74413r_set_channel_function
int ad74413r_set_channel_function(struct ad74413r_desc *desc, uint32_t ch, enum ad74413r_op_mode ch_func)
Set the operation mode for a specific channel.
Definition: ad74413r.c:427
ad74413r_diag_mode
ad74413r_diag_mode
Possible values to be loaded in the DIAG_RESULT register.
Definition: ad74413r.h:247
ad74413r_get_adc_diag_rejection
int ad74413r_get_adc_diag_rejection(struct ad74413r_desc *, enum ad74413r_rejection *)
Get the rejection setting for a specific channel.
Definition: ad74413r.c:559
AD74413R_CURRENT_IN_EXT
@ AD74413R_CURRENT_IN_EXT
Definition: ad74413r.h:204
ad74413r_set_channel_function
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:427
NO_OS_BIT
#define NO_OS_BIT(x)
Definition: no_os_util.h:51
AD74413R_STOP_PWR_UP
@ AD74413R_STOP_PWR_UP
Definition: ad74413r.h:227
no_os_crc8
uint8_t no_os_crc8(const uint8_t *table, const uint8_t *pdata, size_t nbytes, uint8_t crc)
no_os_free
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
ad74413r_dac_voltage_to_code
int ad74413r_dac_voltage_to_code(uint32_t, uint32_t *)
Converts a millivolt value in the corresponding DAC 13 bit code.
Definition: ad74413r.c:194
ad74413r_dac_slew_disable
int ad74413r_dac_slew_disable(struct ad74413r_desc *, uint32_t)
Disable the slew rate control.
Definition: ad74413r.c:1151
AD74413R_STOP_PWR_DOWN
@ AD74413R_STOP_PWR_DOWN
Definition: ad74413r.h:230
ad74413r_set_adc_diag_rate
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:659
no_os_hweight8
unsigned int no_os_hweight8(uint8_t word)
AD74413R_DIAG_ALDO_1V8
@ AD74413R_DIAG_ALDO_1V8
Definition: ad74413r.h:254
ad74413r_remove
int ad74413r_remove(struct ad74413r_desc *desc)
Free the device descriptor.
Definition: ad74413r.c:1233
AD74413R_ADC_CONV_CTRL
#define AD74413R_ADC_CONV_CTRL
Definition: ad74413r.h:73
ad74413r_gpo_get
int ad74413r_gpo_get(struct ad74413r_desc *, uint32_t, uint8_t *)
Get the GPO value for a specific channel.
Definition: ad74413r.c:961
ad74413r_set_channel_dac_code
int ad74413r_set_channel_dac_code(struct ad74413r_desc *desc, uint32_t ch, uint16_t dac_code)
Set and load a code for the DAC on a specific channel.
Definition: ad74413r.c:869
no_os_udelay
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:120
ad74413r_dac_voltage_to_code
int ad74413r_dac_voltage_to_code(uint32_t mvolts, uint32_t *code)
Converts a millivolt value in the corresponding DAC 13 bit code.
Definition: ad74413r.c:194
AD74413R_REJECTION_50_60_HART
@ AD74413R_REJECTION_50_60_HART
Definition: ad74413r.h:192
ad74413r_reset
int ad74413r_reset(struct ad74413r_desc *)
Perform either a software or hardware reset and wait for device reset time.
Definition: ad74413r.c:389
AD74413R_DIAG_TEMP
@ AD74413R_DIAG_TEMP
Definition: ad74413r.h:249
ad74413r_get_adc_diag_rate
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:639
ad74413r_init_param::chip_id
enum ad74413r_chip_id chip_id
Definition: ad74413r.h:303
ad74413r_range_to_voltage_offset
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:169
no_os_gpio_set_value
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
ad74413r_set_diag_channel_enable
int ad74413r_set_diag_channel_enable(struct ad74413r_desc *desc, uint32_t ch, bool status)
Enable conversions on a diagnostic register.
Definition: ad74413r.c:503
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:119
AD74413R_DAC_RANGE
#define AD74413R_DAC_RANGE
Definition: ad74413r.h:151
ad74413r_set_adc_channel_enable
int ad74413r_set_adc_channel_enable(struct ad74413r_desc *, uint32_t, bool)
Enable/disable a specific ADC channel.
Definition: ad74413r.c:481
ad74413r_set_adc_rate
int ad74413r_set_adc_rate(struct ad74413r_desc *, uint32_t, enum ad74413r_adc_sample)
Set the ADC sample rate.
Definition: ad74413r.c:619
ad74413r_channel_config
Device channel state.
Definition: ad74413r.h:319
ad74413r_desc::channel_configs
struct ad74413r_channel_config channel_configs[AD74413R_N_CHANNELS]
Definition: ad74413r.h:359
AD74413R_ADC_SAMPLE_1200HZ
@ AD74413R_ADC_SAMPLE_1200HZ
Definition: ad74413r.h:296
ad74413r_set_debounce_time
int ad74413r_set_debounce_time(struct ad74413r_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: ad74413r.c:939
_ad74413r_live_status::VI_ERR_B
uint8_t VI_ERR_B
Definition: ad74413r.h:329
AD74413R_DIGITAL_INPUT_LOOP
@ AD74413R_DIGITAL_INPUT_LOOP
Definition: ad74413r.h:208
AD74413R_NOP
#define AD74413R_NOP
Definition: ad74413r.h:62
AD74413R_DAC_CODE
#define AD74413R_DAC_CODE(x)
Definition: ad74413r.h:69
AD74413R_LIN_RATE_4KHZ
@ AD74413R_LIN_RATE_4KHZ
Definition: ad74413r.h:286
AD74413R_ADC_RANGE_5V_BI_DIR
@ AD74413R_ADC_RANGE_5V_BI_DIR
Definition: ad74413r.h:220
ad74413r_clear_dac
int ad74413r_clear_dac(struct ad74413r_desc *, uint32_t)
Clear the DAC (to the code in DAC_CLR_CODE register)
Definition: ad74413r.c:1100
AD74413R_OUTPUT_CONFIG
#define AD74413R_OUTPUT_CONFIG(x)
Definition: ad74413r.h:68
AD74413R_START_SINGLE
@ AD74413R_START_SINGLE
Definition: ad74413r.h:228
AD74413R_DIAG_AGND
@ AD74413R_DIAG_AGND
Definition: ad74413r.h:248
AD74413R_DIAG_ASSIGN_MASK
#define AD74413R_DIAG_ASSIGN_MASK(x)
Definition: ad74413r.h:148
no_os_spi_remove
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
AD74413R_HIGH_Z
@ AD74413R_HIGH_Z
Definition: ad74413r.h:200
ad74413r_range_to_voltage_offset
int ad74413r_range_to_voltage_offset(enum ad74413r_adc_range range, int32_t *val)
Convert the measuring range of the ADC from range enum values to millivolts.
Definition: ad74413r.c:169
ad74413r_gpo_set_multiple
int ad74413r_gpo_set_multiple(struct ad74413r_desc *, uint32_t)
Set multiple GPO values at once.
Definition: ad74413r.c:1046
AD74413R_CONV_SEQ_MASK
#define AD74413R_CONV_SEQ_MASK
Definition: ad74413r.h:143
no_os_gpio.h
Header file of GPIO Interface.
AD74413R_SENSEL_B
@ AD74413R_SENSEL_B
Definition: ad74413r.h:259
AD74413R_LIN_RATE_64KHZ
@ AD74413R_LIN_RATE_64KHZ
Definition: ad74413r.h:287
AD74413R_REJECTION_50_60
@ AD74413R_REJECTION_50_60
Definition: ad74413r.h:190
AD74413R_DIAG_ALDO_5V
@ AD74413R_DIAG_ALDO_5V
Definition: ad74413r.h:253
no_os_spi_init
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
no_os_get_unaligned_be16
uint16_t no_os_get_unaligned_be16(uint8_t *buf)
ad74413r_gpo_get
int ad74413r_gpo_get(struct ad74413r_desc *desc, uint32_t ch, uint8_t *val)
Get the GPO value for a specific channel.
Definition: ad74413r.c:961
AD74413R_SLEW_LIN_RATE_MASK
#define AD74413R_SLEW_LIN_RATE_MASK
Definition: ad74413r.h:121
AD74413R_STEP_1820
@ AD74413R_STEP_1820
Definition: ad74413r.h:279
AD74413R_CH_FUNC_SETUP_MASK
#define AD74413R_CH_FUNC_SETUP_MASK
Definition: ad74413r.h:102
ad74413r_reg_read
int ad74413r_reg_read(struct ad74413r_desc *, uint32_t, uint16_t *)
Read a register's value.
Definition: ad74413r.c:269
ad74413r_set_adc_channel_enable
int ad74413r_set_adc_channel_enable(struct ad74413r_desc *desc, uint32_t ch, bool status)
Enable/disable a specific ADC channel.
Definition: ad74413r.c:481
no_os_util.h
Header file of utility functions.
no_os_find_first_set_bit
uint32_t no_os_find_first_set_bit(uint32_t word)
ad74413r_set_gpo_config
int ad74413r_set_gpo_config(struct ad74413r_desc *, uint32_t, enum ad74413r_gpo_select)
Set the GPO operation mode.
Definition: ad74413r.c:982
AD74413R_LIN_RATE_240KHZ
@ AD74413R_LIN_RATE_240KHZ
Definition: ad74413r.h:289
ad74413r_nb_active_channels
int ad74413r_nb_active_channels(struct ad74413r_desc *desc, uint8_t *nb_channels)
Get the number of active channels.
Definition: ad74413r.c:318
ad74413r_set_debounce_mode
int ad74413r_set_debounce_mode(struct ad74413r_desc *desc, uint32_t ch, enum ad74413r_debounce_mode mode)
Set the debounce mode for the IOx inputs when the ADC is running in digital input mode.
Definition: ad74413r.c:924
AD74413R_DIAG_ASSIGN
#define AD74413R_DIAG_ASSIGN
Definition: ad74413r.h:74
ad74413r_get_adc_rejection
int ad74413r_get_adc_rejection(struct ad74413r_desc *desc, uint32_t ch, enum ad74413r_rejection *val)
Get the rejection setting for a specific channel.
Definition: ad74413r.c:538
AD74413R_RANGE_10V_SCALE
#define AD74413R_RANGE_10V_SCALE
Definition: ad74413r.h:167
no_os_gpio_direction_output
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
AD74413R_RSENSE
#define AD74413R_RSENSE
Definition: ad74413r.h:56
AD74413R_DIAG_REFOUT
@ AD74413R_DIAG_REFOUT
Definition: ad74413r.h:252
AD74413R_SLEW_LIN_STEP_MASK
#define AD74413R_SLEW_LIN_STEP_MASK
Definition: ad74413r.h:120
ad74413r_clear_dac
int ad74413r_clear_dac(struct ad74413r_desc *desc, uint32_t ch)
Clear the DAC (to the code in DAC_CLR_CODE register)
Definition: ad74413r.c:1100
_ad74413r_live_status::HI_TEMP_ERR
uint8_t HI_TEMP_ERR
Definition: ad74413r.h:332
AD74413R_ADC_RANGE_2P5V_INT_POW
@ AD74413R_ADC_RANGE_2P5V_INT_POW
Definition: ad74413r.h:219
AD74413R_RTD_PULL_UP
#define AD74413R_RTD_PULL_UP
Definition: ad74413r.h:174
ad74413r_reg_read
int ad74413r_reg_read(struct ad74413r_desc *desc, uint32_t addr, uint16_t *val)
Read a register's value.
Definition: ad74413r.c:269
no_os_crc8.h
Header file of CRC-8 computation.
AD74413R_GPO_CONFIG_COMP
@ AD74413R_GPO_CONFIG_COMP
Definition: ad74413r.h:240
AD74413R_CRC_POLYNOMIAL
#define AD74413R_CRC_POLYNOMIAL
Definition: ad74413r.c:54
ad74413r_gpo_set
int ad74413r_gpo_set(struct ad74413r_desc *, uint32_t, uint8_t)
Set the logic value of a GPO pin.
Definition: ad74413r.c:1028
AD74413R_CURRENT_IN_LOOP_HART
@ AD74413R_CURRENT_IN_LOOP_HART
Definition: ad74413r.h:210
ad74413r_set_diag_channel_enable
int ad74413r_set_diag_channel_enable(struct ad74413r_desc *, uint32_t, bool)
Enable conversions on a diagnostic register.
Definition: ad74413r.c:503
_ad74413r_live_status::VI_ERR_C
uint8_t VI_ERR_C
Definition: ad74413r.h:330
_ad74413r_live_status::ALDO1V8_ERR
uint8_t ALDO1V8_ERR
Definition: ad74413r.h:337
AD74413R_DIN_DEBOUNCE_LEN
#define AD74413R_DIN_DEBOUNCE_LEN
Definition: ad74413r.c:55
AD74413R_VOLTAGE_IN
@ AD74413R_VOLTAGE_IN
Definition: ad74413r.h:203
AD74413R_CMD_KEY_RESET_1
#define AD74413R_CMD_KEY_RESET_1
Definition: ad74413r.h:90
ad74413r_adc_range
ad74413r_adc_range
ADC ranges configurations. These are dependent on the operation mode.
Definition: ad74413r.h:216
ad74413r_desc::reset_gpio
struct no_os_gpio_desc * reset_gpio
Definition: ad74413r.h:360
ad74413r_slew_lin_step
ad74413r_slew_lin_step
The number of increments per step a DAC does when slew control is enabled.
Definition: ad74413r.h:275
AD74413R_THERM_RST
#define AD74413R_THERM_RST
Definition: ad74413r.h:83
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:131
ad74413r_set_adc_diag_rate
int ad74413r_set_adc_diag_rate(struct ad74413r_desc *desc, uint32_t ch, enum ad74413r_adc_sample val)
Set the ADC sample rate for the diagnostics channels.
Definition: ad74413r.c:659
AD74413R_CLR_EN_MASK
#define AD74413R_CLR_EN_MASK
Definition: ad74413r.h:122
AD74413R_READ_SELECT
#define AD74413R_READ_SELECT
Definition: ad74413r.h:82
no_os_gpio_get_optional
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