RX Family ADC Module Using Firmware Integration Technology
R01AN1666EJ0220 Rev. 2.20 Page 13 of 74
Dec 01, 2016
#define ADC_MASK_CH13 (1<<13)
#define ADC_MASK_CH14 (1<<14)
#define ADC_MASK_CH15 (1<<15)
#define ADC_MASK_GROUPB_OFF (0)
#define ADC_MASK_ADD_OFF (0)
typedef struct st_adc_ch_cfg // bit 0 is ch0; bit 15 is ch15
{
uint32_t chan_mask; // channels/bits 0-15
uint32_t chan_mask_groupb; // valid for group modes
uint32_t add_mask; // valid if add enabled in Open()
} adc_ch_cfg_t;
/* ADC_READ() ARGUMENT DEFINITIONS */
typedef enum e_adc_reg
{
ADC_REG_CH0 = 0,
ADC_REG_CH1 = 1,
ADC_REG_CH2 = 2,
ADC_REG_CH3 = 3,
ADC_REG_CH4 = 4,
ADC_REG_CH6 = 6,
ADC_REG_CH8 = 8,
ADC_REG_CH9 = 9,
ADC_REG_CH10 = 10,
ADC_REG_CH11 = 11,
ADC_REG_CH12 = 12,
ADC_REG_CH13 = 13,
ADC_REG_CH14 = 14,
ADC_REG_CH15 = 15,
ADC_REG_TEMP = 16,
ADC_REG_VOLT = 17,
ADC_REG_DBLTRIG = 18,
ADC_REG_MAX
} adc_reg_t;
#define ADC_REG_ARRAY_MAX (16)
/* ADC_READALL() ARGUMENT DEFINITIONS */
typedef struct st_adc_data
{
uint16_t chan[ADC_REG_ARRAY_MAX]; // chns/indexes used depends upon MCU
uint16_t temp;
uint16_t volt;
uint16_t dbltrig;
} adc_data_t;
2.10.4 RX113 Interface Types (r_s12ad_rx113_if.h)
/* ADC_OPEN() ARGUMENT DEFINITIONS */
typedef enum e_adc_mode
{
ADC_MODE_SS_TEMPERATURE, // single scan temperature sensor
ADC_MODE_SS_INT_REF_VOLT, // single scan internal ref voltage sensor
ADC_MODE_SS_ONE_CH, // single scan one channel
ADC_MODE_SS_MULTI_CH, // 1 trigger source, scan multiple channels
ADC_MODE_CONT_ONE_CH, // continuous scan one channel
ADC_MODE_CONT_MULTI_CH, // continuous scan multiple channels
ADC_MODE_SS_ONE_CH_DBLTRIG, // on even trig save to ADDBLDR & interrupt
ADC_MODE_SS_MULTI_CH_GROUPED, // 2 trigger sources, scan multiple channels