User`s manual
RX62N Group, RX621 Group 4. Library Reference
3) R_ADC_10_Control
Synopsis
Start or stop an ADC unit.
Prototype
bool R_ADC_10_Control(
uint16_t data
// Conversion unit control
);
Description
Controls start / stop operation of the specified ADC.
[data]
To select multiple units at the same time, use "|" to separate each value.
•
On / off control
PDL_ADC_10_0_ON or
PDL_ADC_10_0_OFF
Start or stop ADC unit 0 conversion.
PDL_ADC_10_1_ON or
PDL_ADC_10_1_OFF
Start or stop ADC unit 1 conversion.
•
Control the CPU during the ADC conversion. The default setting is shown in bold.
PDL_ADC_10_CPU_ON or
Allow the CPU to run normally during the conversion.
PDL_ADC_10_CPU_OFF
Stop the CPU when the conversion starts.
The CPU will re-start when any valid interrupt occurs.
Return value
True if all parameters are valid and exclusive; otherwise false.
Category
ADC
Reference
R_ADC_10_Create
Remarks
•
Use this API function only when the software trigger option is selected.
•
For single or one-cycle scan modes, the ADC will stop automatically when the conversion is
complete.
•
The time delay between starting conversions on multiple units is minimised, but has to use
separate instructions. This function minimises the delay between starts by using an interrupt to
prevent other interrupts from occurring during the start sequence. If the user has disabled
interrupts (cleared the ‘I’ bit in the PSW register) in their own code, this function will lock up.
For true simultaneous starting of ADC units, select an appropriate hardware trigger e.g. timer
TMR.
•
Do not select CPU Off when stopping the ADC conversion, unless there is another interrupt to
wake up the CPU.
Program example
/* RPDL definitions */
#include "r_pdl_adc_10.h"
/* RPDL device-specific definitions */
#include "r_pdl_definitions.h"
void func(void)
{
/* Stop ADC unit 0 and start ADC unit 1 */
R_ADC_10_Control(
PDL_ADC_10_0_OFF | PDL_ADC_10_1_ON
);
}
R20UT0084EE0112 Rev.1.12 Page 4-226
July. 16, 2014