EasyManuals Logo

Renesas RX110 User Manual

Renesas RX110
88 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #63 background imageLoading...
Page #63 background image
RX Family ADC Module Using Firmware Integration Technology
R01AN1666EJ0220 Rev. 2.20 Page 63 of 74
Dec 01, 2016
{
adc_cb_args_t *args;
uint16_t data3,data4,data5;
args = (adc_cb_args_t *)p_args;
/* READ RESULTS */
if (args->event == ADC_EVT_SCAN_COMPLETE)
{
R_ADC_Read(0, ADC_REG_CH3, &data3);
R_ADC_Read(0, ADC_REG_CH4, &data4);
R_ADC_Read(0, ADC_REG_CH5, &data5);
}
if (args->event == ADC_EVT_CONDITION_MET)
{
if (args->compare_flags & ADC_MASK_CH3)
{
// processing when channel 3 voltage is too low
}
else
{
// processing when channel 4 voltage is too low
}
}
}
Example 6: Multiple Channels with Interrupt Trigger and 2 Comparator Checking (RX65x)
adc_cfg_t config;
adc_ch_cfg_t ch_cfg;
adc_cmpwin_t cmpwin;
/* Clear all fields of each structure */
memset(&config, 0, sizeof(config));
memset(&ch_cfg, 0, sizeof(ch_cfg));
memset(&cmpwin, 0, sizeof(cmpwin));
/* INITIALIZE MTU HERE (USED FOR TRIGGER SOURCES) */
/* OPEN UNIT 0 */
config.resolution = ADC_RESOLUTION_12_BIT;
config.trigger = ADC_TRIG_SYNC_TRG0AN;
config.priority = 4;
config.add_cnt = ADC_ADD_OFF;
config.alignment = ADC_ALIGN_RIGHT;
config.clearing = ADC_CLEAR_AFTER_READ_OFF;
R_ADC_Open(0, ADC_MODE_SS_MULTI_CH, &config, MyCallback);
/* CONFIGURE SCAN OF CHANNELS 3-4 */
ch_cfg.scan_mask = ADC_MASK_CH3 | ADC_MASK_CH4 | ADC_MASK_CH5;
ch_cfg.diag_method = ADC_DIAG_OFF;
ch_cfg.anex_enable = false;
ch_cfg.sample_hold_mask = 0;
R_ADC_Control(0, ADC_CMD_CONFIGURE_SCAN, &ch_cfg);

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Renesas RX110 and is the answer not in the manual?

Renesas RX110 Specifications

General IconGeneral
BrandRenesas
ModelRX110
CategoryControl Unit
LanguageEnglish

Related product manuals