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 #60 background imageLoading...
Page #60 background image
RX Family ADC Module Using Firmware Integration Technology
R01AN1666EJ0220 Rev. 2.20 Page 60 of 74
Dec 01, 2016
args = (adc_cb_args_t *)p_args;
/* READ RESULTS */
if (args->event == ADC_EVT_SCAN_COMPLETE)
{
/* From S12ADIO interrupt, Group A scan complete, read registers */
R_ADC_Read(1, ADC_REG_CH8, &data8);
R_ADC_Read(1, ADC_REG_DBLTRIG, &dbltrg);
}
else if (args->event == ADC_EVT_SCAN_COMPLETE_GROUPB)
{
/* From GBADI interrupt, Group B scan complete, read registers */
R_ADC_Read(1, ADC_REG_CH2, &data2);
R_ADC_Read(1, ADC_REG_CH3, &data3);
R_ADC_Read(1, ADC_REG_CH9, &data9);
}
/* process data, or set flag for application level to do so */
}
Example 4: 3 Grouped Channels with Interrupt Triggers (RX65x)
adc_cfg_t config;
adc_ch_cfg_t ch_cfg;
/* INITIALIZE MTU HERE (USED FOR TRIGGER SOURCES) */
/* OPEN ADC */
/* Clear all fields of each structure */
memset(&config, 0, sizeof(config));
memset(&ch_cfg, 0, sizeof(ch_cfg));
/* INITIALIZE ADC FOR GROUP SCANNING WITH DOUBLE TRIGGER
* - use synchronous trigger TRGA0N to start Group A scan; int priority 4
* - use synchronous trigger TRGA1N to start Group B scan; int priority 5
* - use synchronous trigger TRGA2N to start Group C scan; int priority 6
* - allow each channel to be scanned four times and averaged before continuing
* - do not clear registers after reading
*/
config.resolution = ADC_RESOLUTION_8_BIT;
config.trigger = ADC_TRIG_SYNC_TRG0AN;
config.priority = 4;
config.trigger_groupb = ADC_TRIG_SYNC_TRG1AN;
config.priority_groupb= 5;
config.trigger_groupc = ADC_TRIG_SYNC_TRG2AN;
config.priority_groupc= 6;
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_GROUPED_GROUPC, &config, MyCallback);
/* CONFIGURE SCAN */
/* Clear all fields of the adc_ch_cfg_t structure */
memset(&ch_cfg, 0, sizeof(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