no-OS
Classes | Macros | Enumerations | Functions
ad74416h.h File Reference

Header file of AD74416h Driver. More...

#include "stdint.h"
#include "stdbool.h"
#include "no_os_spi.h"
#include "no_os_gpio.h"
Include dependency graph for ad74416h.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _ad74416h_live_status
 Bitfield struct which maps on the LIVE_STATUS register. More...
 
union  ad74416h_live_status
 Used to store the live status bit fields. More...
 
struct  ad74416h_init_param
 
struct  ad74416h_channel_config
 Device channel state. More...
 
struct  ad74416h_desc
 AD74416h device descriptor. More...
 

Macros

#define AD74416H_N_CHANNELS   4
 
#define AD74416H_CH_A   0
 
#define AD74416H_CH_B   1
 
#define AD74416H_CH_C   2
 
#define AD74416H_CH_D   3
 
#define AD74416H_RSENSE   12
 
#define AD74416H_ADC_MAX_VALUE   16777215
 
#define AD74416H_NOP   0x00
 
#define AD74416H_CH_FUNC_SETUP(x)   (0x01 + (x * 12))
 
#define AD74416H_ADC_CONFIG(x)   (0x02 + (x * 12))
 
#define AD74416H_DIN_CONFIG0(x)   (0x03 + (x * 12))
 
#define AD74416H_DIN_CONFIG1(x)   (0x04 + (x * 12))
 
#define AD74416H_OUTPUT_CONFIG(x)   (0x05 + (x * 12))
 
#define AD74416H_RTD_CONFIG(x)   (0x06 + (x * 12))
 
#define AD74416H_FET_LKG_COMP(x)   (0x07 + (x * 12))
 
#define AD74416H_DO_EXT_CONFIG(x)   (0x08 + (x * 12))
 
#define AD74416H_I_BURNOUT_CONFIG(x)   (0x09 + (x * 12))
 
#define AD74416H_DAC_CODE(x)   (0x0A + (x * 12))
 
#define AD74416H_DAC_ACTIVE(x)   (0x0C + (x * 12))
 
#define AD74416H_GPIO_CONFIG(x)   (0x32 + x)
 
#define AD74416H_PWR_OPTIM_CONFIG   0x38
 
#define AD74416H_ADC_CONV_CTRL   0x39
 
#define AD74416H_DIAG_ASSIGN   0x3A
 
#define AD74416H_WTD_CONFIG   0x3B
 
#define AD74416H_DIN_COMP_OUT   0x3E
 
#define AD74416H_ALERT_STATUS   0x3F
 
#define AD74416H_LIVE_STATUS   0x40
 
#define AD74416H_ADC_RESULT_UPR(x)   (0x41 + (x * 2))
 
#define AD74416H_ADC_RESULT(x)   (0x42 + (x * 2))
 
#define AD74416H_ADC_DIAG_RESULT(x)   (0x49 + x)
 
#define AD74416H_LAST_ADC_RESULT_UPR   0x4D
 
#define AD74416H_LAST_ADC_RESULT   0x4E
 
#define AD74416H_DIN_COUNTER(x)   (0x50 + (x * 2))
 
#define AD74416H_SUPPLY_ALERT_STATUS   0x57
 
#define AD74416H_CHANNEL_ALERT_STATUS(x)   (0x58 + x)
 
#define AD74416H_ALERT_MASK   0x5C
 
#define AD74416H_SUPPLY_ALERT_MASK   0x5D
 
#define AD74416H_CHANNEL_ALERT_MASK(x)   (0x5E + x)
 
#define AD74416H_READ_SELECT   0x6E
 
#define AD74416H_BURST_READ_SEL   0x6F
 
#define AD74416H_THERM_RST   0x73
 
#define AD74416H_CMD_KEY   0x74
 
#define AD74416H_BORADCAST_CMD_KEY   0x75
 
#define AD74416H_SCRATCH(x)   (0x76 + x)
 
#define AD74416H_GENERIC_ID   0x7A
 
#define AD74416H_SILICON_REV   0x7B
 
#define AD74416H_SILICON_ID0   0x7D
 
#define AD74416H_SILICON_ID1   0x7E
 
#define AD74416H_HART_ALERT_STATUS(x)   (0x80 + (x * 16))
 
#define AD74416H_HART_RX(x)   (0x81 + (x * 16))
 
#define AD74416H_HART_TX(x)   (0x82 + (x * 16))
 
#define AD74416H_HART_FCR(x)   (0x83 + (x * 16))
 
#define AD74416H_HART_MCR(x)   (0x84 + (x * 16))
 
#define AD74416H_HART_RFC(x)   (0x85 + (x * 16))
 
#define AD74416H_HART_TFC(x)   (0x86 + (x * 16))
 
#define AD74416H_HART_ALERT_MASK(x)   (0x87 + (x * 16))
 
#define AD74416H_HART_CONFIG(x)   (0x88 + (x * 16))
 
#define AD74416H_HART_TX_PREM(x)   (0x89 + (x * 16))
 
#define AD74416H_HART_EVDET(x)   (0x8A + (x * 16))
 
#define AD74416H_HART_TX_GAIN(x)   (0x8B + (x * 16))
 
#define AD74416H_HART_GPIO_IF_CONFIG   0xC0
 
#define AD74416H_HART_GPIO_MON_CONFIG(x)   (0xC1 + x)
 
#define AD74416H_CMD_KEY_RESET_1   0x15FA
 
#define AD74416H_CMD_KEY_RESET_2   0xAF51
 
#define AD74416H_SPI_RD_RET_INFO_MSK   NO_OS_BIT(8)
 
#define AD74416H_ERR_CLR_MSK   NO_OS_GENMASK(15, 0)
 
#define AD74416H_SPI_CRC_ERR_MSK   NO_OS_BIT(13)
 
#define AD74416H_CH_FUNC_SETUP_MSK   NO_OS_GENMASK(3, 0)
 
#define AD74416H_ADC_CONV_RATE_MSK   NO_OS_GENMASK(10, 8)
 
#define AD74416H_ADC_CONV_RANGE_MSK   NO_OS_GENMASK(6, 4)
 
#define AD74416H_CONV_MUX_MSK   NO_OS_GENMASK(2, 0)
 
#define AD74416H_COUNT_EN_MSK   NO_OS_BIT(15)
 
#define AD74416H_DIN_INV_COMP_OUT_MSK   NO_OS_BIT(14)
 
#define AD74416H_COMPARATOR_EN_MSK   NO_OS_BIT(13)
 
#define AD74416H_DIN_SINK_RANGE_MSK   NO_OS_BIT(12)
 
#define AD74416H_DIN_SINK_MSK   NO_OS_GENMASK(11, 7)
 
#define AD74416H_DEBOUNCE_MODE_MSK   NO_OS_BIT(6)
 
#define AD74416H_DEBOUNCE_TIME_MSK   NO_OS_GENMASK(4, 0)
 
#define AD74416H_DIN_INPUT_SELECT_MSK   NO_OS_BIT(10)
 
#define AD74416H_DIN_SC_DET_EN_MSK   NO_OS_BIT(9)
 
#define AD74416H_DIN_OC_DET_EN_MSK   NO_OS_BIT(8)
 
#define AD74416H_DIN_THRESH_MODE_MSK   NO_OS_BIT(7)
 
#define AD74416H_COMP_THRESH_MSK   NO_OS_GENMASK(6, 0)
 
#define AD74416H_AVDD_SELECT_MSK   NO_OS_GENMASK(15, 14)
 
#define AD74416H_ALARM_DEG_PERIOD_MSK   NO_OS_BIT(12)
 
#define AD74VOUT_4W_EN_MSK   NO_OS_BIT(11)
 
#define AD74416H_WAIT_LDAC_CMD_MSK   NO_OS_BIT(10)
 
#define AD74416H_VOUT_RANGE_MSK   NO_OS_BIT(7)
 
#define AD74416H_SLEW_EN_MSK   NO_OS_GENMASK(6, 5)
 
#define AD74416H_SLEW_LIN_STEP_MSK   NO_OS_GENMASK(4, 3)
 
#define AD74416H_SLEW_LIN_RATE_MSK   NO_OS_GENMASK(2, 1)
 
#define AD74416H_I_LIMIT_MSK   NO_OS_BIT(0)
 
#define AD74416H_RTD_ADC_REF_MSK   NO_OS_BIT(3)
 
#define AD74416H_RTD_MODE_SEL_MSK   NO_OS_BIT(2)
 
#define AD74416H_RTD_EXC_SWAP_MSK   NO_OS_BIT(1)
 
#define AD74416H_RTD_CURRENT_MSK   NO_OS_BIT(0)
 
#define AD74416H_FET_SRC_LKG_COMP_EN_MSK   NO_OS_BIT(0)
 
#define AD74416H_DO_T2_MSK   NO_OS_GENMASK(12, 8)
 
#define AD74416H_DO_DATA_MSK   NO_OS_BIT(7)
 
#define AD74416H_DO_T1_MSK   NO_OS_GENMASK(6, 2)
 
#define AD74416H_DO_SRC_SEL_MSK   NO_OS_BIT(1)
 
#define AD74416H_DO_MODE_MSK   NO_OS_BIT(0)
 
#define AD74416H_BRN_SEN_VSENSEN_CURR_MSK   NO_OS_GENMASK(6, 5)
 
#define AD74416H_BRN_SEN_VSENSEN_POL_MSK   NO_OS_BIT(4)
 
#define AD74416H_BRN_VIOUT_CURR_MSK   NO_OS_GENAMSK(2, 1)
 
#define AD74416H_BRN_VIOUT_POL_MSK   NO_OS_BIT(0)
 
#define AD74416H_DAC_CODE_MSK   NO_OS_GENMASK(15, 0)
 
#define AD74416H_DAC_ACTIVE_MSK   NO_OS_GENMASK(15, 0)
 
#define AD74416H_ADC_RDY_CTRL_MSK   NO_OS_BIT(12)
 
#define AD74416H_CONV_RATE_DIAG_MSK   NO_OS_GENMASK(11, 10)
 
#define AD74416H_CONV_SEQ_MSK   NO_OS_GENMASK(9, 8)
 
#define AD74416H_DIAG_EN_MSK(x)   (NO_OS_BIT(x) << 4)
 
#define AD74416H_CH_EN_MSK(x)   NO_OS_BIT(x)
 
#define AD74416H_DIAG_ASSIGN_MSK(x)   (NO_OS_GENMASK(3, 0) << ((x) * 4))
 
#define AD74416H_DIN_DO_MSK   NO_OS_BIT(7, 6)
 
#define AD74416H_GPI_DATA_MSK   NO_OS_BIT(5)
 
#define AD74416H_GPO_DATA_MSK   NO_OS_BIT(4)
 
#define AD74416H_GP_WK_PD_EN_MSK   NO_OS_BIT(3)
 
#define AD74416H_GPIO_SELECT_MSK   NO_OS_GENMASK(2, 0)
 
#define AD74416H_REF_EN_MSK   NO_OS_BIT(13)
 
#define AD74416H_SENSE_AGND_OPT_MSK   NO_OS_BIT(12)
 
#define AD74416H_SENSE_HF_OPT_D_MSK   NO_OS_BIT(11)
 
#define AD74416H_SENSE_HF_OPT_C_MSK   NO_OS_BIT(10)
 
#define AD74416H_SENSE_HF_OPT_B_MSK   NO_OS_BIT(9)
 
#define AD74416H_SENSE_HF_OPT_A_MSK   NO_OS_BIT(8)
 
#define AD74416H_SENSE_LF_OPT_D_MSK   NO_OS_BIT(7)
 
#define AD74416H_SENSE_LF_OPT_C_MSK   NO_OS_BIT(6)
 
#define AD74416H_SENSE_LF_OPT_B_MSK   NO_OS_BIT(5)
 
#define AD74416H_SENSE_LF_OPT_A_MSK   NO_OS_BIT(4)
 
#define AD74416H_VSENSEN_OPT_D_MSK   NO_OS_BIT(3)
 
#define AD74416H_VSENSEN_OPT_C_MSK   NO_OS_BIT(2)
 
#define AD74416H_VSENSEN_OPT_B_MSK   NO_OS_BIT(1)
 
#define AD74416H_VSENSEN_OPT_A_MSK   NO_OS_BIT(0)
 
#define AD74416H_WDT_EN_MSK   NO_OS_BIT(4)
 
#define AD74416H_WDT_TIMEOUT_MSK   NO_OS_GENMASK(3, 0)
 
#define AD74416H_DIN_COMP_OUT_D_MSK   NO_OS_BIT(3)
 
#define AD74416H_DIN_COMP_OUT_C_MSK   NO_OS_BIT(2)
 
#define AD74416H_DIN_COMP_OUT_B_MSK   NO_OS_BIT(1)
 
#define AD74416H_DIN_COMP_OUT_A_MSK   NO_OS_BIT(0)
 
#define AD74416H_HART_ALERT_D_MSK   NO_OS_BIT(15)
 
#define AD74416H_HART_ALERT_C_MSK   NO_OS_BIT(14)
 
#define AD74416H_HART_ALERT_B_MSK   NO_OS_BIT(13)
 
#define AD74416H_HART_ALERT_A_MSK   NO_OS_BIT(12)
 
#define AD74416H_CHANNEL_ALERT_D_MSK   NO_OS_BIT(11)
 
#define AD74416H_CHANNEL_ALERT_C_MSK   NO_OS_BIT(10)
 
#define AD74416H_CHANNEL_ALERT_B_MSK   NO_OS_BIT(9)
 
#define AD74416H_CHANNEL_ALERT_A_MSK   NO_OS_BIT(8)
 
#define AD74416H_ADC_ERR_MSK   NO_OS_BIT(5)
 
#define AD74416H_TEMP_ALERT_MSK   NO_OS_BIT(4)
 
#define AD74416H_SPI_ERR_MSK   NO_OS_BIT(3)
 
#define AD74416H_SUPPLY_ERR_MSK   NO_OS_BIT(2)
 
#define AD74416H_WDT_RESET_OCCURRED_MSK   NO_OS_BIT(1)
 
#define AD74416H_RESET_OCCURRED_MSK   NO_OS_BIT(0)
 
#define AD74416H_ANALOG_IO_STATUS_D_MSK   NO_OS_BIT(15)
 
#define AD74416H_ANALOG_IO_STATUS_C_MSK   NO_OS_BIT(14)
 
#define AD74416H_ANALOG_IO_STATUS_B_MSK   NO_OS_BIT(13)
 
#define AD74416H_ANALOG_IO_STATUS_A_MSK   NO_OS_BIT(12)
 
#define AD74416H_DO_STATUS_D_MSK   NO_OS_BIT(11)
 
#define AD74416H_DO_STATUS_C_MSK   NO_OS_BIT(10)
 
#define AD74416H_DO_STATUS_B_MSK   NO_OS_BIT(9)
 
#define AD74416H_DO_STATUS_A_MSK   NO_OS_BIT(8)
 
#define AD74416H_DIN_STATUS_D_MSK   NO_OS_BIT(7)
 
#define AD74416H_DIN_STATUS_C_MSK   NO_OS_BIT(6)
 
#define AD74416H_DIN_STATUS_B_MSK   NO_OS_BIT(5)
 
#define AD74416H_DIN_STATUS_A_MSK   NO_OS_BIT(4)
 
#define AD74416H_TEMP_ALERT_STATUS_MSK   NO_OS_BIT(3)
 
#define AD74416H_ADC_DATA_RDY_MSK   NO_OS_BIT(2)
 
#define AD74416H_ADC_BUSY_MSK   NO_OS_BIT(1)
 
#define AD74416H_SUPPLY_STATUS_MSK   NO_OS_BIT(0)
 
#define AD74416H_CONV_RES_MUX_MSK   NO_OS_GENMASK(15, 13)
 
#define AD74416H_CONV_RES_RANGE_MSK   NO_OS_GENMASK(12, 10)
 
#define AD74416H_CONV_SEQ_COUNT_MSK   NO_OS_GENAMSK(9. 8)
 
#define AD74416H_CONV_RES_UPR_MSK   NO_OS_GENMASK(7, 0)
 
#define AD74416H_CONV_RESULT_MSK   NO_OS_GENMASK(15, 0)
 
#define AD74416H_DIAG_RESULT_MSK   NO_OS_GENMASK(15, 0)
 
#define AD74416H_LAST_CONV_CH_MSK   NO_OS_GENAMSK(10 8)
 
#define AD74416H_LAST_CONV_RES_UPR_MSK   NO_OS_GENMASK(7, 0)
 
#define AD74416H_LAST_CONV_RES_MSK   NO_OS_GENMASK(15, 0)
 
#define AD74416H_DIN_CNT_UPR_MSK   NO_OS_GENMASK(15, 0)
 
#define AD74416H_DIN_CNT_MSK   NO_OS_GENMASK(15, 0)
 
#define AD74416H_AVDD_HI_ERR_MSK   NO_OS_BIT(6)
 
#define AD74416H_AVDD_LO_ERR_MSK   NO_OS_BIT(5)
 
#define AD74416H_DO_VDD_ERR_MSK   NO_OS_BIT(4)
 
#define AD74416H_AVCC_ERR_MSK   NO_OS_BIT(3)
 
#define AD74416H_DVCC_ERR_MSK   NO_OS_BIT(2)
 
#define AD74416H_AVSS_ERR_MSK   NO_OS_BIT(1)
 
#define AD74416H_CAL_MEM_ERR_MSK   NO_OS_BIT(0)
 
#define AD74416H_ANALOG_IO_OC_MSK   NO_OS_BIT(5)
 
#define AD74416H_ANALOG_IO_SC_MSK   NO_OS_BIT(4)
 
#define AD74416H_DO_TIMEOUT_MSK   NO_OS_BIT(3)
 
#define AD74416H_DO_SC_MSK   NO_OS_BIT(2)
 
#define AD74416H_DIN_OC_MSK   NO_OS_BIT(1)
 
#define AD74416H_DIN_SC_MSK   NO_OS_BIT(0)
 
#define AD74416H_READBACK_ADDR_MSK   NO_OS_GENMASK(8, 0)
 
#define AD74416H_BURST_READ_SEL_MSK   NO_OS_GENMASK(15, 0)
 
#define AD74416H_THERM_RST_EN_MSK   NO_OS_BIT(0)
 
#define AD74416H_CMD_KEY_MSK   NO_OS_GENMASK(15, 0)
 
#define AD74416H_BROADCAST_CMD_KEY_MSK   NO_OS_GENMASK(15, 0)
 
#define AD74416H_SCRATCH_BITS_MSK   NO_OS_GENMASK(15, 0)
 
#define AD74416H_GENERIC_ID_MSK   NO_OS_GENMASK(2, 0)
 
#define AD74416H_SILICON_REV_ID_MSK   NO_OS_GENMASK(7, 0)
 
#define AD74416H_UID0_MSK   NO_OS_GENMASK(6, 0)
 
#define AD74416H_UID2_MSK   NO_OS_GENMASK(11, 6)
 
#define AD74416H_UID1_MSK   NO_OS_GENMASK(5, 0)
 
#define AD74416H_FRM_MON_STATE_MSK   NO_OS_GENMASK(15, 13)
 
#define AD74416H_EOM_MSK   NO_OS_BIT(12)
 
#define AD74416H_RX_BCNT_MSK   NO_OS_BIT(11)
 
#define AD74416H_RX_CMD_MSK   NO_OS_BIT(10)
 
#define AD74416H_SOM_MSK   NO_OS_BIT(9)
 
#define AD74416H_CD_MSK   NO_OS_BIT(8)
 
#define AD74416H_CD_EDGE_DET_MSK   NO_OS_BIT(7)
 
#define AD74416H_TX_COMPLETE_MSK   NO_OS_BIT(6)
 
#define AD74416H_TX_FIFO_ALERT_MSK   NO_OS_BIT(5)
 
#define AD74416H_RX_FIFO_ALERT_MSK   NO_OS_BIT(4)
 
#define AD74416H_RX_OVERFLOW_ERR_MSK   NO_OS_BIT(3)
 
#define AD74416H_FRAME_ERR_MSK   NO_OS_BIT(2)
 
#define AD74416H_PARITY_ERR_MSK   NO_OS_BIT(1)
 
#define AD74416H_GAP_ERR_MSK   NO_OS_BIT(0)
 
#define AD74416H_RFGI_MSK   NO_OS_BIT(11)
 
#define AD74416H_RFFE_MSK   NO_OS_BIT(10)
 
#define AD74416H_RFPE_MSK   NO_OS_BIT(9)
 
#define AD74416H_RFBI_MSK   NO_OS_BIT(8)
 
#define AD74416H_RBR_MSK   NO_OS_GENMASK(7, 0)
 
#define AD74416H_TDR_MSK   NO_OS_GENMASK(7, 0)
 
#define AD74416H_TFTRIG_MSK   NO_OS_GENMASK(11, 8)
 
#define AD74416H_RFTRIG_MSK   NO_OS_GENMASK(6, 3)
 
#define AD74416H_TFCLR_MSK   NO_OS_BIT(2)
 
#define AD74416H_RFCLR_MSK   NO_OS_BIT(1)
 
#define AD74416H_FIFOEN_MSK   NO_OS_BIT(0)
 
#define AD74416H_RTS_MSK   NO_OS_BIT(0)
 
#define AD74416H_RFC_MSK   NO_OS_GENMASK(4, 0)
 
#define AD74416H_TFC_MSK   NO_OS_GENMASK(4, 0)
 
#define AD74416H_CD_EXTD_QUAL_MSK   NO_OS_BIT(13)
 
#define AD74416H_FRM_MON_RX_PREMX2_MSK   NO_OS_BIT(12)
 
#define AD74416H_FRM_MON_RST_GAP_MSK   NO_OS_BIT(11)
 
#define AD74416H_FRM_MON_RST_CD_MSK   NO_OS_BIT(10)
 
#define AD74416H_RX_ALL_CHARS_MSK   NO_OS_BIT(9)
 
#define AD74416H_FRM_MON_EN_MSK   NO_OS_BIT(8)
 
#define AD74416H_EVENT_DET_SEL_MSK   NO_OS_GENMASK(7, 6)
 
#define AD74416H_TX_1B_AFTER_RST_MSK   NO_OS_BIT(5)
 
#define AD74416H_AUTO_CLR_RST_MSK   NO_OS_BIT(4)
 
#define AD74416H_CD_EDGE_SEL_MSK   NO_OS_GENAMSK(3, 2)
 
#define AD74416H_MODEM_DUPLEX_MSK   NO_OS_BIT(1)
 
#define AD74416H_MODEM_PWRUP_MSK   NO_OS_BIT(0)
 
#define AD74416H_TX_PREM_CNT_MSK   NO_OS_GENMASK(4, 0)
 
#define AD74416H_EVENT_DET_TIME_MSK   NO_OS_GENMASK(15, 0)
 
#define AD74416H_TX_GAIN_MSK   NO_OS_GENMASK(3, 0)
 
#define AD74416H_HART_GPIO_IF_CH_MSK   NO_OS_GENMASK(3, 2)
 
#define AD74416H_HART_GPIO_IF_SEL_MSK   NO_OS_GENMASK(1, 0)
 
#define AD74416H_HART_GPIO_MON_CH_MSK   NO_OS_GENMASK(4, 3)
 
#define AD74416H_HART_GPIO_MON_SEL_MSK   NO_OS_GENMASK(2, 0)
 
#define AD74416H_TEMP_OFFSET   -2392
 
#define AD74416H_TEMP_SCALE   8950
 
#define AD74416H_TEMP_SCALE_DIV   1000
 
#define AD74416H_FRAME_SIZE   5
 
#define AD74416H_THRESHOLD_DAC_RANGE   98
 
#define AD74416H_THRESHOLD_RANGE   30000
 
#define AD74416H_DAC_RANGE   12000
 
#define AD74416H_DAC_CURRENT_RANGE   25000
 
#define AD74416H_DAC_RESOLUTION   16
 
#define AD74414H_DAC_RESOLUTION   14
 
#define AD74116H_CONV_TIME_US   1000000
 

Enumerations

enum  ad74416h_dev_id {
  ID_AD74416H,
  ID_AD74414H
}
 Supported device ids. More...
 
enum  ad74416h_op_mode {
  AD74416H_HIGH_Z = 0x0,
  AD74416H_VOLTAGE_OUT = 0x1,
  AD74416H_CURRENT_OUT = 0x2,
  AD74416H_VOLTAGE_IN = 0x3,
  AD74416H_CURRENT_IN_EXT = 0x4,
  AD74416H_CURRENT_IN_LOOP = 0x5,
  AD74416H_RESISTANCE = 0x7,
  AD74416H_DIGITAL_INPUT = 0x8,
  AD74416H_DIGITAL_INPUT_LOOP = 0x9,
  AD74416H_CURRENT_OUT_HART = 0x10,
  AD74416H_CURRENT_IN_EXT_HART = 0x11,
  AD74416H_CURRENT_IN_LOOP_HART = 0x12
}
 Operation modes of the device. More...
 
enum  ad74416h_gpio_select {
  AD74416H_GPIO_CONFIG_HIGH_Z,
  AD74416H_GPIO_CONFIG_DATA,
  AD74416H_GPIO_CONFIG_IN,
  AD74416H_GPIO_CONFIG_COMP,
  AD74416H_GPIO_CONFIG_DO
}
 GPO operation modes. More...
 
enum  ad74416h_adc_range {
  AD74416H_RNG_0_12_V,
  AD74416H_RNG_NEG12_12_V,
  AD74416H_RNG_NEG0P3125_0P3125V,
  AD74416H_RNG_NEG0P3125_0V,
  AD74416H_RNG_0_0P3125V,
  AD74416H_RNG_0_0P625V,
  AD74416H_RNG_NEG104_104MV,
  AD74416H_RNG_NEG2P5_2P5V
}
 Conversion range configuration values. More...
 
enum  ad74416h_adc_rate {
  AD74416H_10SPS_50_60HZ_HART_REJECTION,
  AD74416H_20SPS_50_60HZ_REJECTION,
  AD74416H_1K2SPS,
  AD74416H_4K8SPS,
  AD74416H_9K6SPS,
  AD74416H_19K2SPS,
  AD74416H_200SPS_HART_REJECTION
}
 Conversion configuration values. More...
 
enum  ad74416h_adc_conv_mux {
  AD74416H_MUX_LF_TO_AGND,
  AD74416H_MUX_HF_TO_LF,
  AD74416H_MUX_VSENSEN_TO_AGND,
  AD74416H_MUX_LF_TO_VSENSEN,
  AD74416H_MUX_AGND_TO_AGND
}
 ADC input configuration values. More...
 
enum  ad74416h_debounce_mode {
  AD74416H_DEBOUNCE_MODE_0,
  AD74416H_DEBOUNCE_MODE_1
}
 Debounce modes for the IOx inputs when using the digital input op mode. More...
 
enum  ad74416h_conv_seq {
  AD74416H_STOP_PWR_UP,
  AD74416H_START_SINGLE,
  AD74416H_START_CONT,
  AD74416H_STOP_PWR_DOWN
}
 ADC conversion sequence commands. More...
 
enum  ad74416h_diag_mode {
  AD74416H_DIAG_AGND,
  AD74416H_DIAG_TEMP,
  AD74416H_DIAG_DVCC,
  AD74416H_DIAG_AVCC,
  AD74416H_DIAG_LDO1V8,
  AD74416H_DIAG_AVDD_HI,
  AD74416H_DIAG_AVDD_LO,
  AD74416H_DIAG_AVSS,
  AD74416H_DIAG_LVIN,
  AD74416H_DIAG_DO_VDD,
  AD74416H_VSENSEP_C,
  AD74416H_VSENSEN_C,
  AD74416H_DO_C,
  AD74416H_AVDD_C
}
 Possible values to be loaded in the DIAG_RESULT register. More...
 
enum  ad74416h_slew_lin_step {
  AD74416H_STEP_0_8_PERCENT,
  AD74416H_STEP_1_5_PERCENT,
  AD74416H_STEP_6_1_PERCENT,
  AD74416H_STEP_22_2_PERCENT
}
 The voltage step size of Full Scale DAC Voltage. More...
 
enum  ad74416h_lin_rate {
  AD74416H_LIN_RATE_4KHZ8,
  AD74416H_LIN_RATE_76KHZ8,
  AD74416H_LIN_RATE_153KHZ6,
  AD74416H_LIN_RATE_230KHZ4
}
 Possible update rates for a DAC when slew control is enabled. More...
 
enum  ad74416h_vout_range {
  AD74416H_VOUT_RANGE_0_12V,
  AD74416H_VOUT_RANGE_NEG12_12V
}
 Possible voltage output ranges for the DAC. More...
 
enum  ad74416h_i_limit {
  AD74416H_I_LIMIT0,
  AD74416H_I_LIMIT1
}
 DAC Current limits in Vout mode. More...
 

Functions

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. More...
 
int ad74416h_dac_current_to_code (struct ad74416h_desc *, uint32_t, uint16_t *)
 Convers a microamp value in the corresponding DAC 16 bit code. More...
 
int ad74416h_reg_write (struct ad74416h_desc *, uint32_t, uint16_t)
 Write a register's value. More...
 
int ad74416h_reg_read_raw (struct ad74416h_desc *, uint32_t, uint8_t *)
 Read a raw communication frame. More...
 
int ad74416h_reg_read (struct ad74416h_desc *, uint32_t, uint16_t *)
 Read a register's value. More...
 
int ad74416h_reg_update (struct ad74416h_desc *, uint32_t, uint16_t, uint16_t)
 Update a register's field. More...
 
int ad74416h_nb_active_channels (struct ad74416h_desc *, uint8_t *)
 Get the number of active channels. More...
 
int ad74416h_set_info (struct ad74416h_desc *desc, uint16_t mode)
 
int ad74416h_set_channel_function (struct ad74416h_desc *, uint32_t, enum ad74416h_op_mode)
 Set the operation mode for a specific channel. More...
 
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. More...
 
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. More...
 
int ad74416h_get_raw_adc_result (struct ad74416h_desc *, uint32_t, uint32_t *)
 Read the raw ADC raw conversion value. More...
 
int ad74416h_set_adc_channel_enable (struct ad74416h_desc *, uint32_t, bool)
 Enable/disable a specific ADC channel. More...
 
int ad74416h_set_diag_channel_enable (struct ad74416h_desc *, uint32_t, bool)
 Enable conversions on a diagnostic register. More...
 
int ad74416h_get_adc_range (struct ad74416h_desc *, uint32_t, uint16_t *)
 Get the ADC measurement range for a specific channel. More...
 
int ad74416h_set_adc_range (struct ad74416h_desc *, uint32_t, enum ad74416h_adc_range)
 Set the ADC measurement range for a specific channel. More...
 
int ad74416h_get_adc_rate (struct ad74416h_desc *, uint32_t, enum ad74416h_adc_rate *)
 Get the ADC Conversion Rate for a specific channel. More...
 
int ad74416h_set_adc_rate (struct ad74416h_desc *, uint32_t, enum ad74416h_adc_rate)
 Set the ADC Conversion Rate for a specific channel. More...
 
int ad74416h_get_adc_conv_mux (struct ad74416h_desc *, uint32_t, enum ad74416h_adc_conv_mux *)
 Get the ADC Input Node for conversion. More...
 
int ad74416h_set_adc_conv_mux (struct ad74416h_desc *, uint32_t, enum ad74416h_adc_conv_mux)
 Set the ADC Input Node for conversion. More...
 
int ad74416h_set_adc_conv_seq (struct ad74416h_desc *, enum ad74416h_conv_seq)
 Start or stop ADC conversions. More...
 
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. More...
 
int ad74416h_get_temp (struct ad74416h_desc *, uint32_t, uint16_t *)
 Read the die's temperature from the diagnostic register. More...
 
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. More...
 
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. More...
 
int ad74416h_get_diag (struct ad74416h_desc *, uint32_t, uint16_t *)
 Get the diagnostic value for a specific channel. More...
 
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. More...
 
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. More...
 
int ad74416h_gpio_get (struct ad74416h_desc *, uint32_t, uint8_t *)
 Get the GPO value for a specific channel. More...
 
int ad74416h_set_gpio_config (struct ad74416h_desc *, uint32_t, enum ad74416h_gpio_select)
 Set the GPIO operation mode. More...
 
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 input mode. More...
 
int ad74416h_do_set (struct ad74416h_desc *, uint32_t, uint8_t)
 Set the DO value of a channel. More...
 
int ad74416h_gpio_set (struct ad74416h_desc *, uint32_t, uint8_t)
 Set the logic value of a GPO pin. More...
 
int ad74416h_get_live (struct ad74416h_desc *, union ad74416h_live_status *)
 Read the live status bits. More...
 
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. More...
 
int ad74416h_dac_slew_disable (struct ad74416h_desc *, uint32_t)
 Disable the slew rate control. More...
 
int ad74416h_set_therm_rst (struct ad74416h_desc *, bool)
 Enable or disable the higher thermal reset. More...
 
int ad74416h_reset (struct ad74416h_desc *)
 Perform software or hardware reset and wait for device reset time. More...
 
int ad74416h_init (struct ad74416h_desc **, struct ad74416h_init_param *)
 Initialize the device structure. More...
 
int ad74416h_remove (struct ad74416h_desc *desc)
 Free the device descriptor. More...
 

Detailed Description

Header file of AD74416h Driver.

Author
Antoniu Miclaus (anton.nosp@m.iu.m.nosp@m.iclau.nosp@m.s@an.nosp@m.alog..nosp@m.com)

Copyright 2023(c) Analog Devices, Inc.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Macro Definition Documentation

◆ AD74116H_CONV_TIME_US

#define AD74116H_CONV_TIME_US   1000000

◆ AD74414H_DAC_RESOLUTION

#define AD74414H_DAC_RESOLUTION   14

◆ AD74416H_ADC_BUSY_MSK

#define AD74416H_ADC_BUSY_MSK   NO_OS_BIT(1)

◆ AD74416H_ADC_CONFIG

#define AD74416H_ADC_CONFIG (   x)    (0x02 + (x * 12))

◆ AD74416H_ADC_CONV_CTRL

#define AD74416H_ADC_CONV_CTRL   0x39

◆ AD74416H_ADC_CONV_RANGE_MSK

#define AD74416H_ADC_CONV_RANGE_MSK   NO_OS_GENMASK(6, 4)

◆ AD74416H_ADC_CONV_RATE_MSK

#define AD74416H_ADC_CONV_RATE_MSK   NO_OS_GENMASK(10, 8)

◆ AD74416H_ADC_DATA_RDY_MSK

#define AD74416H_ADC_DATA_RDY_MSK   NO_OS_BIT(2)

◆ AD74416H_ADC_DIAG_RESULT

#define AD74416H_ADC_DIAG_RESULT (   x)    (0x49 + x)

◆ AD74416H_ADC_ERR_MSK

#define AD74416H_ADC_ERR_MSK   NO_OS_BIT(5)

◆ AD74416H_ADC_MAX_VALUE

#define AD74416H_ADC_MAX_VALUE   16777215

16 bit ADC

◆ AD74416H_ADC_RDY_CTRL_MSK

#define AD74416H_ADC_RDY_CTRL_MSK   NO_OS_BIT(12)

ADC_CONV_CTRL Register

◆ AD74416H_ADC_RESULT

#define AD74416H_ADC_RESULT (   x)    (0x42 + (x * 2))

◆ AD74416H_ADC_RESULT_UPR

#define AD74416H_ADC_RESULT_UPR (   x)    (0x41 + (x * 2))

◆ AD74416H_ALARM_DEG_PERIOD_MSK

#define AD74416H_ALARM_DEG_PERIOD_MSK   NO_OS_BIT(12)

◆ AD74416H_ALERT_MASK

#define AD74416H_ALERT_MASK   0x5C

◆ AD74416H_ALERT_STATUS

#define AD74416H_ALERT_STATUS   0x3F

◆ AD74416H_ANALOG_IO_OC_MSK

#define AD74416H_ANALOG_IO_OC_MSK   NO_OS_BIT(5)

◆ AD74416H_ANALOG_IO_SC_MSK

#define AD74416H_ANALOG_IO_SC_MSK   NO_OS_BIT(4)

◆ AD74416H_ANALOG_IO_STATUS_A_MSK

#define AD74416H_ANALOG_IO_STATUS_A_MSK   NO_OS_BIT(12)

◆ AD74416H_ANALOG_IO_STATUS_B_MSK

#define AD74416H_ANALOG_IO_STATUS_B_MSK   NO_OS_BIT(13)

◆ AD74416H_ANALOG_IO_STATUS_C_MSK

#define AD74416H_ANALOG_IO_STATUS_C_MSK   NO_OS_BIT(14)

◆ AD74416H_ANALOG_IO_STATUS_D_MSK

#define AD74416H_ANALOG_IO_STATUS_D_MSK   NO_OS_BIT(15)

LIVE_STATUS Register

◆ AD74416H_AUTO_CLR_RST_MSK

#define AD74416H_AUTO_CLR_RST_MSK   NO_OS_BIT(4)

◆ AD74416H_AVCC_ERR_MSK

#define AD74416H_AVCC_ERR_MSK   NO_OS_BIT(3)

◆ AD74416H_AVDD_HI_ERR_MSK

#define AD74416H_AVDD_HI_ERR_MSK   NO_OS_BIT(6)

◆ AD74416H_AVDD_LO_ERR_MSK

#define AD74416H_AVDD_LO_ERR_MSK   NO_OS_BIT(5)

◆ AD74416H_AVDD_SELECT_MSK

#define AD74416H_AVDD_SELECT_MSK   NO_OS_GENMASK(15, 14)

OUTPUT_CONFIGx Register

◆ AD74416H_AVSS_ERR_MSK

#define AD74416H_AVSS_ERR_MSK   NO_OS_BIT(1)

◆ AD74416H_BORADCAST_CMD_KEY

#define AD74416H_BORADCAST_CMD_KEY   0x75

◆ AD74416H_BRN_SEN_VSENSEN_CURR_MSK

#define AD74416H_BRN_SEN_VSENSEN_CURR_MSK   NO_OS_GENMASK(6, 5)

I_BURNOUT_CONFIG Register

◆ AD74416H_BRN_SEN_VSENSEN_POL_MSK

#define AD74416H_BRN_SEN_VSENSEN_POL_MSK   NO_OS_BIT(4)

◆ AD74416H_BRN_VIOUT_CURR_MSK

#define AD74416H_BRN_VIOUT_CURR_MSK   NO_OS_GENAMSK(2, 1)

◆ AD74416H_BRN_VIOUT_POL_MSK

#define AD74416H_BRN_VIOUT_POL_MSK   NO_OS_BIT(0)

◆ AD74416H_BROADCAST_CMD_KEY_MSK

#define AD74416H_BROADCAST_CMD_KEY_MSK   NO_OS_GENMASK(15, 0)

◆ AD74416H_BURST_READ_SEL

#define AD74416H_BURST_READ_SEL   0x6F

◆ AD74416H_BURST_READ_SEL_MSK

#define AD74416H_BURST_READ_SEL_MSK   NO_OS_GENMASK(15, 0)

◆ AD74416H_CAL_MEM_ERR_MSK

#define AD74416H_CAL_MEM_ERR_MSK   NO_OS_BIT(0)

◆ AD74416H_CD_EDGE_DET_MSK

#define AD74416H_CD_EDGE_DET_MSK   NO_OS_BIT(7)

◆ AD74416H_CD_EDGE_SEL_MSK

#define AD74416H_CD_EDGE_SEL_MSK   NO_OS_GENAMSK(3, 2)

◆ AD74416H_CD_EXTD_QUAL_MSK

#define AD74416H_CD_EXTD_QUAL_MSK   NO_OS_BIT(13)

◆ AD74416H_CD_MSK

#define AD74416H_CD_MSK   NO_OS_BIT(8)

◆ AD74416H_CH_A

#define AD74416H_CH_A   0

◆ AD74416H_CH_B

#define AD74416H_CH_B   1

◆ AD74416H_CH_C

#define AD74416H_CH_C   2

◆ AD74416H_CH_D

#define AD74416H_CH_D   3

◆ AD74416H_CH_EN_MSK

#define AD74416H_CH_EN_MSK (   x)    NO_OS_BIT(x)

◆ AD74416H_CH_FUNC_SETUP

#define AD74416H_CH_FUNC_SETUP (   x)    (0x01 + (x * 12))

◆ AD74416H_CH_FUNC_SETUP_MSK

#define AD74416H_CH_FUNC_SETUP_MSK   NO_OS_GENMASK(3, 0)

◆ AD74416H_CHANNEL_ALERT_A_MSK

#define AD74416H_CHANNEL_ALERT_A_MSK   NO_OS_BIT(8)

◆ AD74416H_CHANNEL_ALERT_B_MSK

#define AD74416H_CHANNEL_ALERT_B_MSK   NO_OS_BIT(9)

◆ AD74416H_CHANNEL_ALERT_C_MSK

#define AD74416H_CHANNEL_ALERT_C_MSK   NO_OS_BIT(10)

◆ AD74416H_CHANNEL_ALERT_D_MSK

#define AD74416H_CHANNEL_ALERT_D_MSK   NO_OS_BIT(11)

◆ AD74416H_CHANNEL_ALERT_MASK

#define AD74416H_CHANNEL_ALERT_MASK (   x)    (0x5E + x)

◆ AD74416H_CHANNEL_ALERT_STATUS

#define AD74416H_CHANNEL_ALERT_STATUS (   x)    (0x58 + x)

◆ AD74416H_CMD_KEY

#define AD74416H_CMD_KEY   0x74

◆ AD74416H_CMD_KEY_MSK

#define AD74416H_CMD_KEY_MSK   NO_OS_GENMASK(15, 0)

◆ AD74416H_CMD_KEY_RESET_1

#define AD74416H_CMD_KEY_RESET_1   0x15FA

Software reset sequence

◆ AD74416H_CMD_KEY_RESET_2

#define AD74416H_CMD_KEY_RESET_2   0xAF51

◆ AD74416H_COMP_THRESH_MSK

#define AD74416H_COMP_THRESH_MSK   NO_OS_GENMASK(6, 0)

◆ AD74416H_COMPARATOR_EN_MSK

#define AD74416H_COMPARATOR_EN_MSK   NO_OS_BIT(13)

◆ AD74416H_CONV_MUX_MSK

#define AD74416H_CONV_MUX_MSK   NO_OS_GENMASK(2, 0)

◆ AD74416H_CONV_RATE_DIAG_MSK

#define AD74416H_CONV_RATE_DIAG_MSK   NO_OS_GENMASK(11, 10)

◆ AD74416H_CONV_RES_MUX_MSK

#define AD74416H_CONV_RES_MUX_MSK   NO_OS_GENMASK(15, 13)

◆ AD74416H_CONV_RES_RANGE_MSK

#define AD74416H_CONV_RES_RANGE_MSK   NO_OS_GENMASK(12, 10)

◆ AD74416H_CONV_RES_UPR_MSK

#define AD74416H_CONV_RES_UPR_MSK   NO_OS_GENMASK(7, 0)

◆ AD74416H_CONV_RESULT_MSK

#define AD74416H_CONV_RESULT_MSK   NO_OS_GENMASK(15, 0)

◆ AD74416H_CONV_SEQ_COUNT_MSK

#define AD74416H_CONV_SEQ_COUNT_MSK   NO_OS_GENAMSK(9. 8)

◆ AD74416H_CONV_SEQ_MSK

#define AD74416H_CONV_SEQ_MSK   NO_OS_GENMASK(9, 8)

◆ AD74416H_COUNT_EN_MSK

#define AD74416H_COUNT_EN_MSK   NO_OS_BIT(15)

◆ AD74416H_DAC_ACTIVE

#define AD74416H_DAC_ACTIVE (   x)    (0x0C + (x * 12))

◆ AD74416H_DAC_ACTIVE_MSK

#define AD74416H_DAC_ACTIVE_MSK   NO_OS_GENMASK(15, 0)

DAC_ACTIVE Register

◆ AD74416H_DAC_CODE

#define AD74416H_DAC_CODE (   x)    (0x0A + (x * 12))

◆ AD74416H_DAC_CODE_MSK

#define AD74416H_DAC_CODE_MSK   NO_OS_GENMASK(15, 0)

DAC_CODE Register

◆ AD74416H_DAC_CURRENT_RANGE

#define AD74416H_DAC_CURRENT_RANGE   25000

◆ AD74416H_DAC_RANGE

#define AD74416H_DAC_RANGE   12000

◆ AD74416H_DAC_RESOLUTION

#define AD74416H_DAC_RESOLUTION   16

◆ AD74416H_DEBOUNCE_MODE_MSK

#define AD74416H_DEBOUNCE_MODE_MSK   NO_OS_BIT(6)

◆ AD74416H_DEBOUNCE_TIME_MSK

#define AD74416H_DEBOUNCE_TIME_MSK   NO_OS_GENMASK(4, 0)

◆ AD74416H_DIAG_ASSIGN

#define AD74416H_DIAG_ASSIGN   0x3A

◆ AD74416H_DIAG_ASSIGN_MSK

#define AD74416H_DIAG_ASSIGN_MSK (   x)    (NO_OS_GENMASK(3, 0) << ((x) * 4))

DIAG_ASSIGN register

◆ AD74416H_DIAG_EN_MSK

#define AD74416H_DIAG_EN_MSK (   x)    (NO_OS_BIT(x) << 4)

◆ AD74416H_DIAG_RESULT_MSK

#define AD74416H_DIAG_RESULT_MSK   NO_OS_GENMASK(15, 0)

◆ AD74416H_DIN_CNT_MSK

#define AD74416H_DIN_CNT_MSK   NO_OS_GENMASK(15, 0)

◆ AD74416H_DIN_CNT_UPR_MSK

#define AD74416H_DIN_CNT_UPR_MSK   NO_OS_GENMASK(15, 0)

◆ AD74416H_DIN_COMP_OUT

#define AD74416H_DIN_COMP_OUT   0x3E

◆ AD74416H_DIN_COMP_OUT_A_MSK

#define AD74416H_DIN_COMP_OUT_A_MSK   NO_OS_BIT(0)

◆ AD74416H_DIN_COMP_OUT_B_MSK

#define AD74416H_DIN_COMP_OUT_B_MSK   NO_OS_BIT(1)

◆ AD74416H_DIN_COMP_OUT_C_MSK

#define AD74416H_DIN_COMP_OUT_C_MSK   NO_OS_BIT(2)

◆ AD74416H_DIN_COMP_OUT_D_MSK

#define AD74416H_DIN_COMP_OUT_D_MSK   NO_OS_BIT(3)

DIN_COMP_OUT Register

◆ AD74416H_DIN_CONFIG0

#define AD74416H_DIN_CONFIG0 (   x)    (0x03 + (x * 12))

◆ AD74416H_DIN_CONFIG1

#define AD74416H_DIN_CONFIG1 (   x)    (0x04 + (x * 12))

◆ AD74416H_DIN_COUNTER

#define AD74416H_DIN_COUNTER (   x)    (0x50 + (x * 2))

◆ AD74416H_DIN_DO_MSK

#define AD74416H_DIN_DO_MSK   NO_OS_BIT(7, 6)

GPIO_CONFIGx register

◆ AD74416H_DIN_INPUT_SELECT_MSK

#define AD74416H_DIN_INPUT_SELECT_MSK   NO_OS_BIT(10)

◆ AD74416H_DIN_INV_COMP_OUT_MSK

#define AD74416H_DIN_INV_COMP_OUT_MSK   NO_OS_BIT(14)

◆ AD74416H_DIN_OC_DET_EN_MSK

#define AD74416H_DIN_OC_DET_EN_MSK   NO_OS_BIT(8)

◆ AD74416H_DIN_OC_MSK

#define AD74416H_DIN_OC_MSK   NO_OS_BIT(1)

◆ AD74416H_DIN_SC_DET_EN_MSK

#define AD74416H_DIN_SC_DET_EN_MSK   NO_OS_BIT(9)

◆ AD74416H_DIN_SC_MSK

#define AD74416H_DIN_SC_MSK   NO_OS_BIT(0)

◆ AD74416H_DIN_SINK_MSK

#define AD74416H_DIN_SINK_MSK   NO_OS_GENMASK(11, 7)

◆ AD74416H_DIN_SINK_RANGE_MSK

#define AD74416H_DIN_SINK_RANGE_MSK   NO_OS_BIT(12)

◆ AD74416H_DIN_STATUS_A_MSK

#define AD74416H_DIN_STATUS_A_MSK   NO_OS_BIT(4)

◆ AD74416H_DIN_STATUS_B_MSK

#define AD74416H_DIN_STATUS_B_MSK   NO_OS_BIT(5)

◆ AD74416H_DIN_STATUS_C_MSK

#define AD74416H_DIN_STATUS_C_MSK   NO_OS_BIT(6)

◆ AD74416H_DIN_STATUS_D_MSK

#define AD74416H_DIN_STATUS_D_MSK   NO_OS_BIT(7)

◆ AD74416H_DIN_THRESH_MODE_MSK

#define AD74416H_DIN_THRESH_MODE_MSK   NO_OS_BIT(7)

◆ AD74416H_DO_DATA_MSK

#define AD74416H_DO_DATA_MSK   NO_OS_BIT(7)

◆ AD74416H_DO_EXT_CONFIG

#define AD74416H_DO_EXT_CONFIG (   x)    (0x08 + (x * 12))

◆ AD74416H_DO_MODE_MSK

#define AD74416H_DO_MODE_MSK   NO_OS_BIT(0)

◆ AD74416H_DO_SC_MSK

#define AD74416H_DO_SC_MSK   NO_OS_BIT(2)

◆ AD74416H_DO_SRC_SEL_MSK

#define AD74416H_DO_SRC_SEL_MSK   NO_OS_BIT(1)

◆ AD74416H_DO_STATUS_A_MSK

#define AD74416H_DO_STATUS_A_MSK   NO_OS_BIT(8)

◆ AD74416H_DO_STATUS_B_MSK

#define AD74416H_DO_STATUS_B_MSK   NO_OS_BIT(9)

◆ AD74416H_DO_STATUS_C_MSK

#define AD74416H_DO_STATUS_C_MSK   NO_OS_BIT(10)

◆ AD74416H_DO_STATUS_D_MSK

#define AD74416H_DO_STATUS_D_MSK   NO_OS_BIT(11)

◆ AD74416H_DO_T1_MSK

#define AD74416H_DO_T1_MSK   NO_OS_GENMASK(6, 2)

◆ AD74416H_DO_T2_MSK

#define AD74416H_DO_T2_MSK   NO_OS_GENMASK(12, 8)

DO_EXT_CONFIG Register

◆ AD74416H_DO_TIMEOUT_MSK

#define AD74416H_DO_TIMEOUT_MSK   NO_OS_BIT(3)

◆ AD74416H_DO_VDD_ERR_MSK

#define AD74416H_DO_VDD_ERR_MSK   NO_OS_BIT(4)

◆ AD74416H_DVCC_ERR_MSK

#define AD74416H_DVCC_ERR_MSK   NO_OS_BIT(2)

◆ AD74416H_EOM_MSK

#define AD74416H_EOM_MSK   NO_OS_BIT(12)

◆ AD74416H_ERR_CLR_MSK

#define AD74416H_ERR_CLR_MSK   NO_OS_GENMASK(15, 0)

◆ AD74416H_EVENT_DET_SEL_MSK

#define AD74416H_EVENT_DET_SEL_MSK   NO_OS_GENMASK(7, 6)

◆ AD74416H_EVENT_DET_TIME_MSK

#define AD74416H_EVENT_DET_TIME_MSK   NO_OS_GENMASK(15, 0)

◆ AD74416H_FET_LKG_COMP

#define AD74416H_FET_LKG_COMP (   x)    (0x07 + (x * 12))

◆ AD74416H_FET_SRC_LKG_COMP_EN_MSK

#define AD74416H_FET_SRC_LKG_COMP_EN_MSK   NO_OS_BIT(0)

FET_LKG_COMP Register

◆ AD74416H_FIFOEN_MSK

#define AD74416H_FIFOEN_MSK   NO_OS_BIT(0)

◆ AD74416H_FRAME_ERR_MSK

#define AD74416H_FRAME_ERR_MSK   NO_OS_BIT(2)

◆ AD74416H_FRAME_SIZE

#define AD74416H_FRAME_SIZE   5

◆ AD74416H_FRM_MON_EN_MSK

#define AD74416H_FRM_MON_EN_MSK   NO_OS_BIT(8)

◆ AD74416H_FRM_MON_RST_CD_MSK

#define AD74416H_FRM_MON_RST_CD_MSK   NO_OS_BIT(10)

◆ AD74416H_FRM_MON_RST_GAP_MSK

#define AD74416H_FRM_MON_RST_GAP_MSK   NO_OS_BIT(11)

◆ AD74416H_FRM_MON_RX_PREMX2_MSK

#define AD74416H_FRM_MON_RX_PREMX2_MSK   NO_OS_BIT(12)

◆ AD74416H_FRM_MON_STATE_MSK

#define AD74416H_FRM_MON_STATE_MSK   NO_OS_GENMASK(15, 13)

◆ AD74416H_GAP_ERR_MSK

#define AD74416H_GAP_ERR_MSK   NO_OS_BIT(0)

◆ AD74416H_GENERIC_ID

#define AD74416H_GENERIC_ID   0x7A

◆ AD74416H_GENERIC_ID_MSK

#define AD74416H_GENERIC_ID_MSK   NO_OS_GENMASK(2, 0)

◆ AD74416H_GP_WK_PD_EN_MSK

#define AD74416H_GP_WK_PD_EN_MSK   NO_OS_BIT(3)

◆ AD74416H_GPI_DATA_MSK

#define AD74416H_GPI_DATA_MSK   NO_OS_BIT(5)

◆ AD74416H_GPIO_CONFIG

#define AD74416H_GPIO_CONFIG (   x)    (0x32 + x)

◆ AD74416H_GPIO_SELECT_MSK

#define AD74416H_GPIO_SELECT_MSK   NO_OS_GENMASK(2, 0)

◆ AD74416H_GPO_DATA_MSK

#define AD74416H_GPO_DATA_MSK   NO_OS_BIT(4)

◆ AD74416H_HART_ALERT_A_MSK

#define AD74416H_HART_ALERT_A_MSK   NO_OS_BIT(12)

◆ AD74416H_HART_ALERT_B_MSK

#define AD74416H_HART_ALERT_B_MSK   NO_OS_BIT(13)

◆ AD74416H_HART_ALERT_C_MSK

#define AD74416H_HART_ALERT_C_MSK   NO_OS_BIT(14)

◆ AD74416H_HART_ALERT_D_MSK

#define AD74416H_HART_ALERT_D_MSK   NO_OS_BIT(15)

ALERT_STATUS Register

◆ AD74416H_HART_ALERT_MASK

#define AD74416H_HART_ALERT_MASK (   x)    (0x87 + (x * 16))

◆ AD74416H_HART_ALERT_STATUS

#define AD74416H_HART_ALERT_STATUS (   x)    (0x80 + (x * 16))

◆ AD74416H_HART_CONFIG

#define AD74416H_HART_CONFIG (   x)    (0x88 + (x * 16))

◆ AD74416H_HART_EVDET

#define AD74416H_HART_EVDET (   x)    (0x8A + (x * 16))

◆ AD74416H_HART_FCR

#define AD74416H_HART_FCR (   x)    (0x83 + (x * 16))

◆ AD74416H_HART_GPIO_IF_CH_MSK

#define AD74416H_HART_GPIO_IF_CH_MSK   NO_OS_GENMASK(3, 2)

◆ AD74416H_HART_GPIO_IF_CONFIG

#define AD74416H_HART_GPIO_IF_CONFIG   0xC0

◆ AD74416H_HART_GPIO_IF_SEL_MSK

#define AD74416H_HART_GPIO_IF_SEL_MSK   NO_OS_GENMASK(1, 0)

◆ AD74416H_HART_GPIO_MON_CH_MSK

#define AD74416H_HART_GPIO_MON_CH_MSK   NO_OS_GENMASK(4, 3)

◆ AD74416H_HART_GPIO_MON_CONFIG

#define AD74416H_HART_GPIO_MON_CONFIG (   x)    (0xC1 + x)

◆ AD74416H_HART_GPIO_MON_SEL_MSK

#define AD74416H_HART_GPIO_MON_SEL_MSK   NO_OS_GENMASK(2, 0)

◆ AD74416H_HART_MCR

#define AD74416H_HART_MCR (   x)    (0x84 + (x * 16))

◆ AD74416H_HART_RFC

#define AD74416H_HART_RFC (   x)    (0x85 + (x * 16))

◆ AD74416H_HART_RX

#define AD74416H_HART_RX (   x)    (0x81 + (x * 16))

◆ AD74416H_HART_TFC

#define AD74416H_HART_TFC (   x)    (0x86 + (x * 16))

◆ AD74416H_HART_TX

#define AD74416H_HART_TX (   x)    (0x82 + (x * 16))

◆ AD74416H_HART_TX_GAIN

#define AD74416H_HART_TX_GAIN (   x)    (0x8B + (x * 16))

◆ AD74416H_HART_TX_PREM

#define AD74416H_HART_TX_PREM (   x)    (0x89 + (x * 16))

◆ AD74416H_I_BURNOUT_CONFIG

#define AD74416H_I_BURNOUT_CONFIG (   x)    (0x09 + (x * 12))

◆ AD74416H_I_LIMIT_MSK

#define AD74416H_I_LIMIT_MSK   NO_OS_BIT(0)

◆ AD74416H_LAST_ADC_RESULT

#define AD74416H_LAST_ADC_RESULT   0x4E

◆ AD74416H_LAST_ADC_RESULT_UPR

#define AD74416H_LAST_ADC_RESULT_UPR   0x4D

◆ AD74416H_LAST_CONV_CH_MSK

#define AD74416H_LAST_CONV_CH_MSK   NO_OS_GENAMSK(10 8)

◆ AD74416H_LAST_CONV_RES_MSK

#define AD74416H_LAST_CONV_RES_MSK   NO_OS_GENMASK(15, 0)

◆ AD74416H_LAST_CONV_RES_UPR_MSK

#define AD74416H_LAST_CONV_RES_UPR_MSK   NO_OS_GENMASK(7, 0)

◆ AD74416H_LIVE_STATUS

#define AD74416H_LIVE_STATUS   0x40

◆ AD74416H_MODEM_DUPLEX_MSK

#define AD74416H_MODEM_DUPLEX_MSK   NO_OS_BIT(1)

◆ AD74416H_MODEM_PWRUP_MSK

#define AD74416H_MODEM_PWRUP_MSK   NO_OS_BIT(0)

◆ AD74416H_N_CHANNELS

#define AD74416H_N_CHANNELS   4

◆ AD74416H_NOP

#define AD74416H_NOP   0x00

Register map

◆ AD74416H_OUTPUT_CONFIG

#define AD74416H_OUTPUT_CONFIG (   x)    (0x05 + (x * 12))

◆ AD74416H_PARITY_ERR_MSK

#define AD74416H_PARITY_ERR_MSK   NO_OS_BIT(1)

◆ AD74416H_PWR_OPTIM_CONFIG

#define AD74416H_PWR_OPTIM_CONFIG   0x38

◆ AD74416H_RBR_MSK

#define AD74416H_RBR_MSK   NO_OS_GENMASK(7, 0)

◆ AD74416H_READ_SELECT

#define AD74416H_READ_SELECT   0x6E

◆ AD74416H_READBACK_ADDR_MSK

#define AD74416H_READBACK_ADDR_MSK   NO_OS_GENMASK(8, 0)

◆ AD74416H_REF_EN_MSK

#define AD74416H_REF_EN_MSK   NO_OS_BIT(13)

PWR_OPTIM_CONFIG Register

◆ AD74416H_RESET_OCCURRED_MSK

#define AD74416H_RESET_OCCURRED_MSK   NO_OS_BIT(0)

◆ AD74416H_RFBI_MSK

#define AD74416H_RFBI_MSK   NO_OS_BIT(8)

◆ AD74416H_RFC_MSK

#define AD74416H_RFC_MSK   NO_OS_GENMASK(4, 0)

◆ AD74416H_RFCLR_MSK

#define AD74416H_RFCLR_MSK   NO_OS_BIT(1)

◆ AD74416H_RFFE_MSK

#define AD74416H_RFFE_MSK   NO_OS_BIT(10)

◆ AD74416H_RFGI_MSK

#define AD74416H_RFGI_MSK   NO_OS_BIT(11)

◆ AD74416H_RFPE_MSK

#define AD74416H_RFPE_MSK   NO_OS_BIT(9)

◆ AD74416H_RFTRIG_MSK

#define AD74416H_RFTRIG_MSK   NO_OS_GENMASK(6, 3)

◆ AD74416H_RSENSE

#define AD74416H_RSENSE   12

The value of the sense resistor in ohms

◆ AD74416H_RTD_ADC_REF_MSK

#define AD74416H_RTD_ADC_REF_MSK   NO_OS_BIT(3)

RTD_CONFIG Register

◆ AD74416H_RTD_CONFIG

#define AD74416H_RTD_CONFIG (   x)    (0x06 + (x * 12))

◆ AD74416H_RTD_CURRENT_MSK

#define AD74416H_RTD_CURRENT_MSK   NO_OS_BIT(0)

◆ AD74416H_RTD_EXC_SWAP_MSK

#define AD74416H_RTD_EXC_SWAP_MSK   NO_OS_BIT(1)

◆ AD74416H_RTD_MODE_SEL_MSK

#define AD74416H_RTD_MODE_SEL_MSK   NO_OS_BIT(2)

◆ AD74416H_RTS_MSK

#define AD74416H_RTS_MSK   NO_OS_BIT(0)

◆ AD74416H_RX_ALL_CHARS_MSK

#define AD74416H_RX_ALL_CHARS_MSK   NO_OS_BIT(9)

◆ AD74416H_RX_BCNT_MSK

#define AD74416H_RX_BCNT_MSK   NO_OS_BIT(11)

◆ AD74416H_RX_CMD_MSK

#define AD74416H_RX_CMD_MSK   NO_OS_BIT(10)

◆ AD74416H_RX_FIFO_ALERT_MSK

#define AD74416H_RX_FIFO_ALERT_MSK   NO_OS_BIT(4)

◆ AD74416H_RX_OVERFLOW_ERR_MSK

#define AD74416H_RX_OVERFLOW_ERR_MSK   NO_OS_BIT(3)

◆ AD74416H_SCRATCH

#define AD74416H_SCRATCH (   x)    (0x76 + x)

◆ AD74416H_SCRATCH_BITS_MSK

#define AD74416H_SCRATCH_BITS_MSK   NO_OS_GENMASK(15, 0)

◆ AD74416H_SENSE_AGND_OPT_MSK

#define AD74416H_SENSE_AGND_OPT_MSK   NO_OS_BIT(12)

◆ AD74416H_SENSE_HF_OPT_A_MSK

#define AD74416H_SENSE_HF_OPT_A_MSK   NO_OS_BIT(8)

◆ AD74416H_SENSE_HF_OPT_B_MSK

#define AD74416H_SENSE_HF_OPT_B_MSK   NO_OS_BIT(9)

◆ AD74416H_SENSE_HF_OPT_C_MSK

#define AD74416H_SENSE_HF_OPT_C_MSK   NO_OS_BIT(10)

◆ AD74416H_SENSE_HF_OPT_D_MSK

#define AD74416H_SENSE_HF_OPT_D_MSK   NO_OS_BIT(11)

◆ AD74416H_SENSE_LF_OPT_A_MSK

#define AD74416H_SENSE_LF_OPT_A_MSK   NO_OS_BIT(4)

◆ AD74416H_SENSE_LF_OPT_B_MSK

#define AD74416H_SENSE_LF_OPT_B_MSK   NO_OS_BIT(5)

◆ AD74416H_SENSE_LF_OPT_C_MSK

#define AD74416H_SENSE_LF_OPT_C_MSK   NO_OS_BIT(6)

◆ AD74416H_SENSE_LF_OPT_D_MSK

#define AD74416H_SENSE_LF_OPT_D_MSK   NO_OS_BIT(7)

◆ AD74416H_SILICON_ID0

#define AD74416H_SILICON_ID0   0x7D

◆ AD74416H_SILICON_ID1

#define AD74416H_SILICON_ID1   0x7E

◆ AD74416H_SILICON_REV

#define AD74416H_SILICON_REV   0x7B

◆ AD74416H_SILICON_REV_ID_MSK

#define AD74416H_SILICON_REV_ID_MSK   NO_OS_GENMASK(7, 0)

◆ AD74416H_SLEW_EN_MSK

#define AD74416H_SLEW_EN_MSK   NO_OS_GENMASK(6, 5)

◆ AD74416H_SLEW_LIN_RATE_MSK

#define AD74416H_SLEW_LIN_RATE_MSK   NO_OS_GENMASK(2, 1)

◆ AD74416H_SLEW_LIN_STEP_MSK

#define AD74416H_SLEW_LIN_STEP_MSK   NO_OS_GENMASK(4, 3)

◆ AD74416H_SOM_MSK

#define AD74416H_SOM_MSK   NO_OS_BIT(9)

◆ AD74416H_SPI_CRC_ERR_MSK

#define AD74416H_SPI_CRC_ERR_MSK   NO_OS_BIT(13)

◆ AD74416H_SPI_ERR_MSK

#define AD74416H_SPI_ERR_MSK   NO_OS_BIT(3)

◆ AD74416H_SPI_RD_RET_INFO_MSK

#define AD74416H_SPI_RD_RET_INFO_MSK   NO_OS_BIT(8)

◆ AD74416H_SUPPLY_ALERT_MASK

#define AD74416H_SUPPLY_ALERT_MASK   0x5D

◆ AD74416H_SUPPLY_ALERT_STATUS

#define AD74416H_SUPPLY_ALERT_STATUS   0x57

◆ AD74416H_SUPPLY_ERR_MSK

#define AD74416H_SUPPLY_ERR_MSK   NO_OS_BIT(2)

◆ AD74416H_SUPPLY_STATUS_MSK

#define AD74416H_SUPPLY_STATUS_MSK   NO_OS_BIT(0)

◆ AD74416H_TDR_MSK

#define AD74416H_TDR_MSK   NO_OS_GENMASK(7, 0)

◆ AD74416H_TEMP_ALERT_MSK

#define AD74416H_TEMP_ALERT_MSK   NO_OS_BIT(4)

◆ AD74416H_TEMP_ALERT_STATUS_MSK

#define AD74416H_TEMP_ALERT_STATUS_MSK   NO_OS_BIT(3)

◆ AD74416H_TEMP_OFFSET

#define AD74416H_TEMP_OFFSET   -2392

◆ AD74416H_TEMP_SCALE

#define AD74416H_TEMP_SCALE   8950

◆ AD74416H_TEMP_SCALE_DIV

#define AD74416H_TEMP_SCALE_DIV   1000

◆ AD74416H_TFC_MSK

#define AD74416H_TFC_MSK   NO_OS_GENMASK(4, 0)

◆ AD74416H_TFCLR_MSK

#define AD74416H_TFCLR_MSK   NO_OS_BIT(2)

◆ AD74416H_TFTRIG_MSK

#define AD74416H_TFTRIG_MSK   NO_OS_GENMASK(11, 8)

◆ AD74416H_THERM_RST

#define AD74416H_THERM_RST   0x73

◆ AD74416H_THERM_RST_EN_MSK

#define AD74416H_THERM_RST_EN_MSK   NO_OS_BIT(0)

◆ AD74416H_THRESHOLD_DAC_RANGE

#define AD74416H_THRESHOLD_DAC_RANGE   98

◆ AD74416H_THRESHOLD_RANGE

#define AD74416H_THRESHOLD_RANGE   30000

◆ AD74416H_TX_1B_AFTER_RST_MSK

#define AD74416H_TX_1B_AFTER_RST_MSK   NO_OS_BIT(5)

◆ AD74416H_TX_COMPLETE_MSK

#define AD74416H_TX_COMPLETE_MSK   NO_OS_BIT(6)

◆ AD74416H_TX_FIFO_ALERT_MSK

#define AD74416H_TX_FIFO_ALERT_MSK   NO_OS_BIT(5)

◆ AD74416H_TX_GAIN_MSK

#define AD74416H_TX_GAIN_MSK   NO_OS_GENMASK(3, 0)

◆ AD74416H_TX_PREM_CNT_MSK

#define AD74416H_TX_PREM_CNT_MSK   NO_OS_GENMASK(4, 0)

◆ AD74416H_UID0_MSK

#define AD74416H_UID0_MSK   NO_OS_GENMASK(6, 0)

◆ AD74416H_UID1_MSK

#define AD74416H_UID1_MSK   NO_OS_GENMASK(5, 0)

◆ AD74416H_UID2_MSK

#define AD74416H_UID2_MSK   NO_OS_GENMASK(11, 6)

◆ AD74416H_VOUT_RANGE_MSK

#define AD74416H_VOUT_RANGE_MSK   NO_OS_BIT(7)

◆ AD74416H_VSENSEN_OPT_A_MSK

#define AD74416H_VSENSEN_OPT_A_MSK   NO_OS_BIT(0)

◆ AD74416H_VSENSEN_OPT_B_MSK

#define AD74416H_VSENSEN_OPT_B_MSK   NO_OS_BIT(1)

◆ AD74416H_VSENSEN_OPT_C_MSK

#define AD74416H_VSENSEN_OPT_C_MSK   NO_OS_BIT(2)

◆ AD74416H_VSENSEN_OPT_D_MSK

#define AD74416H_VSENSEN_OPT_D_MSK   NO_OS_BIT(3)

◆ AD74416H_WAIT_LDAC_CMD_MSK

#define AD74416H_WAIT_LDAC_CMD_MSK   NO_OS_BIT(10)

◆ AD74416H_WDT_EN_MSK

#define AD74416H_WDT_EN_MSK   NO_OS_BIT(4)

WDT_CONFIG Register

◆ AD74416H_WDT_RESET_OCCURRED_MSK

#define AD74416H_WDT_RESET_OCCURRED_MSK   NO_OS_BIT(1)

◆ AD74416H_WDT_TIMEOUT_MSK

#define AD74416H_WDT_TIMEOUT_MSK   NO_OS_GENMASK(3, 0)

◆ AD74416H_WTD_CONFIG

#define AD74416H_WTD_CONFIG   0x3B

◆ AD74VOUT_4W_EN_MSK

#define AD74VOUT_4W_EN_MSK   NO_OS_BIT(11)

Enumeration Type Documentation

◆ ad74416h_adc_conv_mux

ADC input configuration values.

Enumerator
AD74416H_MUX_LF_TO_AGND 
AD74416H_MUX_HF_TO_LF 
AD74416H_MUX_VSENSEN_TO_AGND 
AD74416H_MUX_LF_TO_VSENSEN 
AD74416H_MUX_AGND_TO_AGND 

◆ ad74416h_adc_range

Conversion range configuration values.

Enumerator
AD74416H_RNG_0_12_V 
AD74416H_RNG_NEG12_12_V 
AD74416H_RNG_NEG0P3125_0P3125V 
AD74416H_RNG_NEG0P3125_0V 
AD74416H_RNG_0_0P3125V 
AD74416H_RNG_0_0P625V 
AD74416H_RNG_NEG104_104MV 
AD74416H_RNG_NEG2P5_2P5V 

◆ ad74416h_adc_rate

Conversion configuration values.

Enumerator
AD74416H_10SPS_50_60HZ_HART_REJECTION 
AD74416H_20SPS_50_60HZ_REJECTION 
AD74416H_1K2SPS 
AD74416H_4K8SPS 
AD74416H_9K6SPS 
AD74416H_19K2SPS 
AD74416H_200SPS_HART_REJECTION 

◆ ad74416h_conv_seq

ADC conversion sequence commands.

Enumerator
AD74416H_STOP_PWR_UP 
AD74416H_START_SINGLE 
AD74416H_START_CONT 
AD74416H_STOP_PWR_DOWN 

◆ ad74416h_debounce_mode

Debounce modes for the IOx inputs when using the digital input op mode.

Enumerator
AD74416H_DEBOUNCE_MODE_0 
AD74416H_DEBOUNCE_MODE_1 

◆ ad74416h_dev_id

Supported device ids.

Enumerator
ID_AD74416H 
ID_AD74414H 

◆ ad74416h_diag_mode

Possible values to be loaded in the DIAG_RESULT register.

Enumerator
AD74416H_DIAG_AGND 
AD74416H_DIAG_TEMP 
AD74416H_DIAG_DVCC 
AD74416H_DIAG_AVCC 
AD74416H_DIAG_LDO1V8 
AD74416H_DIAG_AVDD_HI 
AD74416H_DIAG_AVDD_LO 
AD74416H_DIAG_AVSS 
AD74416H_DIAG_LVIN 
AD74416H_DIAG_DO_VDD 
AD74416H_VSENSEP_C 
AD74416H_VSENSEN_C 
AD74416H_DO_C 
AD74416H_AVDD_C 

◆ ad74416h_gpio_select

GPO operation modes.

Enumerator
AD74416H_GPIO_CONFIG_HIGH_Z 
AD74416H_GPIO_CONFIG_DATA 
AD74416H_GPIO_CONFIG_IN 
AD74416H_GPIO_CONFIG_COMP 
AD74416H_GPIO_CONFIG_DO 

◆ ad74416h_i_limit

DAC Current limits in Vout mode.

Enumerator
AD74416H_I_LIMIT0 
AD74416H_I_LIMIT1 

◆ ad74416h_lin_rate

Possible update rates for a DAC when slew control is enabled.

Enumerator
AD74416H_LIN_RATE_4KHZ8 
AD74416H_LIN_RATE_76KHZ8 
AD74416H_LIN_RATE_153KHZ6 
AD74416H_LIN_RATE_230KHZ4 

◆ ad74416h_op_mode

Operation modes of the device.

Enumerator
AD74416H_HIGH_Z 
AD74416H_VOLTAGE_OUT 
AD74416H_CURRENT_OUT 
AD74416H_VOLTAGE_IN 
AD74416H_CURRENT_IN_EXT 
AD74416H_CURRENT_IN_LOOP 
AD74416H_RESISTANCE 
AD74416H_DIGITAL_INPUT 
AD74416H_DIGITAL_INPUT_LOOP 
AD74416H_CURRENT_OUT_HART 
AD74416H_CURRENT_IN_EXT_HART 
AD74416H_CURRENT_IN_LOOP_HART 

◆ ad74416h_slew_lin_step

The voltage step size of Full Scale DAC Voltage.

Enumerator
AD74416H_STEP_0_8_PERCENT 
AD74416H_STEP_1_5_PERCENT 
AD74416H_STEP_6_1_PERCENT 
AD74416H_STEP_22_2_PERCENT 

◆ ad74416h_vout_range

Possible voltage output ranges for the DAC.

Enumerator
AD74416H_VOUT_RANGE_0_12V 
AD74416H_VOUT_RANGE_NEG12_12V 

Function Documentation

◆ ad74416h_dac_current_to_code()

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.

Converts a microamp value in the corresponding DAC 16 bit code

Parameters
desc- The device structure.
uamps- The microamps value
code- The resulting DAC code
Returns
0 in case of success, -EINVAL otherwise

◆ ad74416h_dac_slew_disable()

int ad74416h_dac_slew_disable ( struct ad74416h_desc desc,
uint32_t  ch 
)

Disable the slew rate control.

Disable the slew rate control

Parameters
desc- The device structure.
ch- The channel index.
Returns
0 in case of success, negative error code otherwise.

◆ ad74416h_dac_slew_enable()

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.

Configure and enable slew rate control for a DAC on a specific channel

Parameters
desc- The device structure.
ch- The channel index.
step- Number of codes per increment.
rate- Number of increments per second.
Returns
0 in case of success, negative error code otherwise.

◆ ad74416h_dac_voltage_to_code()

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.

Converts a millivolt value in the corresponding DAC 13 bit code

Parameters
desc- The device structure.
mvolts- The millivolts value.
code- The resulting DAC code.
ch- The channel index.
Returns
0 in case of success, -EINVAL otherwise
Here is the caller graph for this function:

◆ ad74416h_do_set()

int ad74416h_do_set ( struct ad74416h_desc desc,
uint32_t  ch,
uint8_t  val 
)

Set the DO value of a channel.

Set the DO value of a channel

Parameters
desc- The device structure
ch- The channel index
val- the output logic state. 0-low 1-high
Returns
0 in case of success, negative error code otherwise

◆ ad74416h_get_adc_conv_mux()

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.

Get the ADC input node

Parameters
desc- The device structure.
ch- The channel index.
val- The ADC input node setting.

◆ ad74416h_get_adc_range()

int ad74416h_get_adc_range ( struct ad74416h_desc desc,
uint32_t  ch,
uint16_t *  val 
)

Get the ADC measurement range for a specific channel.

Get the ADC measurement range for a specific channel

Parameters
desc- The device structure.
ch- The channel index.
val- The ADC range value.
Returns
0 in case of success, negative error code otherwise.

◆ ad74416h_get_adc_rate()

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.

Get the ADC sample rate.

Parameters
desc- The device structure.
ch- The channel index.
val- The ADC rejection setting.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ ad74416h_get_adc_single()

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.

Get a single ADC raw value for a specific channel, then power down the ADC

Parameters
desc- The device structure.
ch- The channel index.
val- The ADC raw result.
Returns
0 in case of success, negative error code otherwise.

◆ ad74416h_get_diag()

int ad74416h_get_diag ( struct ad74416h_desc desc,
uint32_t  ch,
uint16_t *  diag_code 
)

Get the diagnostic value for a specific channel.

Get the diagnostic value for a specific channel

Parameters
desc- The device structure.
ch- The channel index.
diag_code- The diagnostic setting.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ ad74416h_get_live()

int ad74416h_get_live ( struct ad74416h_desc desc,
union ad74416h_live_status status 
)

Read the live status bits.

Read the live status bits

Parameters
desc- The device structure.
status- The register's value.
Returns
0 in case of success, negative error code otherwise.

◆ ad74416h_get_raw_adc_result()

int ad74416h_get_raw_adc_result ( struct ad74416h_desc desc,
uint32_t  ch,
uint32_t *  val 
)

Read the raw ADC raw conversion value.

Read the raw ADC raw conversion value

Parameters
desc- The device structure.
ch- The channel index.
val- The ADC raw conversion value.
Returns
0 in case of success, negative error code otherwise.

◆ ad74416h_get_temp()

int ad74416h_get_temp ( struct ad74416h_desc desc,
uint32_t  ch,
uint16_t *  temp 
)

Read the die's temperature from the diagnostic register.

Read the die's temperature from the diagnostic register

Parameters
desc- The device structure.
ch- The diagnostic channel on which the temperature reading is assigned and enabled.
temp- The measured temperature (in degrees Celsius).
Returns
0 in case of success, -EINVAL otherwise.

◆ ad74416h_gpio_get()

int ad74416h_gpio_get ( struct ad74416h_desc desc,
uint32_t  ch,
uint8_t *  val 
)

Get the GPO value for a specific channel.

Get the GPIO value for a specific channel

Parameters
desc- The device structure.
ch- The channel index.
val- The debounce time.
Returns
0 in case of success, negative error code otherwise.

◆ ad74416h_gpio_set()

int ad74416h_gpio_set ( struct ad74416h_desc desc,
uint32_t  ch,
uint8_t  val 
)

Set the logic value of a GPO pin.

Set the logic value of a GPO pin

Parameters
desc- The device structure.
ch- The channel index.
val- The output logic state.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ ad74416h_init()

int ad74416h_init ( struct ad74416h_desc **  desc,
struct ad74416h_init_param init_param 
)

Initialize the device structure.

Initialize the device structure

Parameters
desc- The device structure to be initialized.
init_param- Initialization parameter for the device descriptor.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ ad74416h_nb_active_channels()

int ad74416h_nb_active_channels ( struct ad74416h_desc desc,
uint8_t *  nb_channels 
)

Get the number of active channels.

Get the number of active channels

Parameters
desc- The device structure.
nb_channels- The number of active channels
Returns
0 in case of success, negative error otherwise.
Here is the caller graph for this function:

◆ ad74416h_reg_read()

int ad74416h_reg_read ( struct ad74416h_desc desc,
uint32_t  addr,
uint16_t *  val 
)

Read a register's value.

Read a register's value

Parameters
desc- The device structure.
addr- The register's address.
val- The register's read value.
Returns
0 in case of success, negative error otherwise
Here is the caller graph for this function:

◆ ad74416h_reg_read_raw()

int ad74416h_reg_read_raw ( struct ad74416h_desc desc,
uint32_t  addr,
uint8_t *  val 
)

Read a raw communication frame.

Read a raw communication frame

Parameters
desc- The device structure.
addr- The register's address.
val- A raw comm frame.
Returns
0 in case of success, negative error otherwise.

Reading a register on AD74416H requires writing the address to the READ_SELECT register first and then doing another spi read, which will contain the requested register value.

Here is the caller graph for this function:

◆ ad74416h_reg_update()

int ad74416h_reg_update ( struct ad74416h_desc desc,
uint32_t  addr,
uint16_t  mask,
uint16_t  val 
)

Update a register's field.

Update a register's field

Parameters
desc- The device structure.
addr- The register's address.
val- The register's value.
mask- The mask for a specific register field.
Returns
0 in case of success, negative error otherwise.
Here is the caller graph for this function:

◆ ad74416h_reg_write()

int ad74416h_reg_write ( struct ad74416h_desc desc,
uint32_t  addr,
uint16_t  val 
)

Write a register's value.

Write a register's value

Parameters
desc- The device structure.
addr- The register's address.
val- The register's value.
Returns
0 in case of success, negative error otherwise
Here is the caller graph for this function:

◆ ad74416h_remove()

int ad74416h_remove ( struct ad74416h_desc desc)

Free the device descriptor.

Free the device descriptor

Parameters
desc- The device structure.
Returns
0 in case of success, -EINVAL otherwise.
Here is the caller graph for this function:

◆ ad74416h_reset()

int ad74416h_reset ( struct ad74416h_desc desc)

Perform software or hardware reset and wait for device reset time.

Perform a soft reset

Parameters
desc- The device structure.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ ad74416h_set_adc_channel_enable()

int ad74416h_set_adc_channel_enable ( struct ad74416h_desc desc,
uint32_t  ch,
bool  status 
)

Enable/disable a specific ADC channel.

Enable/disable a specific ADC channel

Parameters
desc- The device structure.
ch- The channel index.
status- Enabled or disabled status.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ ad74416h_set_adc_conv_mux()

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.

Set the ADC input node

Parameters
desc- The device structure
ch- The channel index.
val- The ADC input node setting.

◆ ad74416h_set_adc_conv_seq()

int ad74416h_set_adc_conv_seq ( struct ad74416h_desc desc,
enum ad74416h_conv_seq  status 
)

Start or stop ADC conversions.

Start or stop ADC conversions

Parameters
desc- The device structure.
status- The ADC conversion sequence.
Returns
0 in case of success, negative error code otherwise.

If the ADC was powered down, wait for 100us before the ADC starts doing conversions.

Here is the caller graph for this function:

◆ ad74416h_set_adc_range()

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.

Set the ADC measurement range for a specific channel

Parameters
desc- The device structure.
ch- The channel index.
val- The ADC range value.
Returns
0 in case of success, negative error code otherwise.

◆ ad74416h_set_adc_rate()

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.

Set the ADC sample rate.

Parameters
desc- The device structure.
ch- The channel index.
val- The ADC rejection setting.
Returns
0 in case of success, negative error code otherwise.

◆ ad74416h_set_channel_dac_code()

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.

Set and load a code for the DAC on a specific channel

Parameters
desc- The device structure.
ch- The channel index.
dac_code- The code for the DAC.
Returns
0 in case of success, negative error code otherwise.

◆ ad74416h_set_channel_function()

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.

Set the operation mode for a specific channel

Parameters
desc- The device structure.
ch- The channel index.
ch_func- The operation mode.
Returns
0 in case of success, negative error code otherwise.

◆ ad74416h_set_channel_i_limit()

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.

Set the current limit for a specific DAC channel in vout mode

Parameters
desc- The devices structure
ch- The channel index
i_limit- The current limit
Returns
0 in case of success, negative error otherwise

◆ ad74416h_set_channel_vout_range()

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.

Set the voltage range for a specific channel

Parameters
desc- The device structure.
ch- The channel index.
vout_range- The voltage range.
Returns
0 in case of success, negative error code otherwise.

◆ ad74416h_set_debounce_mode()

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.

Set the debounce mode for the IOx inputs when the ADC is running in digital input mode.

Parameters
desc- The device structure.
ch- The channel index.
mode- The debounce mode.
Returns
0 in case of success, negative error code otherwise.

◆ ad74416h_set_debounce_time()

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.

Set the debounce settle time for the IOx inputs when the ADC is running in digital input mode

Parameters
desc- The device structure.
ch- The channel index.
time- The debounce time.
Returns
0 in case of success, negative error code otherwise.

◆ ad74416h_set_diag()

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.

Set which diagnostic value to be loaded in the DIAG_RESULT register

Parameters
desc- The device structure.
ch- The channel index.
diag_code- The diagnostic setting.
Returns
0 in case of success, negative error code otherwise.

◆ ad74416h_set_diag_channel_enable()

int ad74416h_set_diag_channel_enable ( struct ad74416h_desc desc,
uint32_t  ch,
bool  status 
)

Enable conversions on a diagnostic register.

Enable conversions on a diagnostic register

Parameters
desc- The device structure.
ch- Diagnostic channel index.
status- Enabled or disabled status.
Returns
0 in case of success, negative error code otherwise.

◆ ad74416h_set_gpio_config()

int ad74416h_set_gpio_config ( struct ad74416h_desc desc,
uint32_t  ch,
enum ad74416h_gpio_select  config 
)

Set the GPIO operation mode.

Set the GPIO operation mode

Parameters
desc- The device structure.
ch- The channel index.
config- The configuration setting.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ ad74416h_set_info()

int ad74416h_set_info ( struct ad74416h_desc desc,
uint16_t  mode 
)

Select which information the device will respond with (in the readback field) when a read operation is performed

◆ ad74416h_set_therm_rst()

int ad74416h_set_therm_rst ( struct ad74416h_desc desc,
bool  enable 
)

Enable or disable the higher thermal reset.

Enable or disable the higher thermal reset

Parameters
desc- The device structure.
enable- The thermal reset status. false: reset at 110 deg. Celsius. true: reset at 140 deg. Celsius.
Returns
0 in case of success, negative error code otherwise.

◆ ad74416h_set_threshold()

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 input mode.

Set the threshold, for which a signal would be considered high, when the ADC is running in digital input mode

Parameters
desc- The device structure.
ch- The channel index.
threshold- The threshold value (in millivolts).
Returns
0 in case of success, negative error code otherwise.

Set a fixed range (0 - 16 V) for the threshold, so it would not depend on Vadd.