RX Family
ADC Module Using Firmware Integration Technology
R01AN1666EJ0220 Rev. 2.20
Page 35 of 74
Dec 01, 2016
adc_elc_t
signal_elc;
//
} adc_ch_cfg_t;
/* for ADC_CMD_EN_COMPARATOR_LEVEL and ADC_CMD_EN_COMPARATOR_WINDOW */
typedef struct
st_adc_cmpwin_cfg // bit-OR ADC_MASK_xxx to
{ // indicate channels/sensors
uint32_t compare_mask; // channels/sensors to compare
uint32_t inside_window_mask; // condition met when within range
// default=0 met when outside range
uint16_t level_lo; // Low-value of window
uint16_t level_hi; // High-value of window
bool windowa_enable; // comparison window A enable
} adc_cmpwin_t;
/* for ADC_CMD_CHECK_CONDITION_MET use uint32_t */
/***** ADC_READ() ARGUMENT DEFINITIONS *****/
typedef enum
e_adc_reg
{
ADC_REG_CH0 = 0, // Channel 0
ADC_REG_CH1,
ADC_REG_CH2,
ADC_REG_CH3,
ADC_REG_CH4,
ADC_REG_CH5,
ADC_REG_CH6,
ADC_REG_CH7, // Channel 7
ADC_REG_CH16, // Channel 16
ADC_REG_CH17,
ADC_REG_CH18,
ADC_REG_CH19,
ADC_REG_CH20,
ADC_REG_CH21,
ADC_REG_CH22,
ADC_REG_CH23,
ADC_REG_CH24,
ADC_REG_CH25,
ADC_REG_CH26,
ADC_REG_CH27,
ADC_REG_CH28,
ADC_REG_CH29,
ADC_REG_CH30,
ADC_REG_CH31, // Channel 31
ADC_REG_TEMP, // A/D Temperature sensor output
ADC_REG_VOLT, // A/D Internal Voltage Reference
ADC_REG_DBLTRIG, // Data Duplication register
ADC_REG_DBLTRIGA, // loaded when first multi-source trigger was A
ADC_REG_DBLTRIGB, // loaded when first multi-source trigger was B
ADC_REG_SELF_DIAG, // self-diagnosis register
ADC_REG_MAX = ADC_REG_SELF_DIAG
} adc_reg_t;
/* ADC_READALL() ARGUMENT DEFINITIONS */
typedef struct
st_adc_data
{
uint16_t chan[24];
uint16_t temp;
uint16_t volt;
uint16_t dbltrig;
uint16_t self_diag;