User`s manual
RX62N Group, RX621 Group 4. Library Reference
2) R_CMT_CreateOneShot
Synopsis
Configure a CMT channel as a one-shot event.
Prototype
bool R_CMT_CreateOneShot(
uint8_t data1,
// Timer channel selection
uint16_t data2,
// Configuration selection
float data3,
// Period
void * func,
// Callback function
uint8_t data4
// Interrupt priority level
);
Description
Set up a Compare Match Timer channel and start the timer.
[data1]
The channel number n (where n = 0, 1, 2 or 3).
[data2]
Configure the timer.
The default settings are shown in bold. Specify PDL_NO_DATA to use the defaults.
•
Control the CPU during the one-shot operation.
PDL_CMT_CPU_ON or
Allow the CPU to run normally while the one-shot operates.
PDL_CMT_CPU_OFF
Stop the CPU when the one-shot timer starts.
The CPU will re-start when any valid interrupt occurs.
•
DMAC / DTC trigger control
PDL_CMT_DMAC_DTC_TRIGGER_DISABLE or
PDL_CMT_DMAC_TRIGGER_ENABLE or
PDL_CMT_DTC_TRIGGER_ENABLE
Disable or enable activation of the DMAC
or DTC when a compare match occurs.
[data3]
The one-shot time period (in seconds).
[func]
The function to be called when the one-shot period ends.
If you specify PDL_NO_FUNC, this function will wait for the timer to complete before returning.
You should always specify a function if PDL_CMT_CPU_OFF is selected to ensure that an interrupt
will re-start the CPU.
[data4]
The interrupt priority level. Select between 1 (lowest priority) and 15 (highest priority).
This parameter will be ignored if PDL_NO_FUNC is specified for parameter func.
Return value
True if all parameters are valid and exclusive; otherwise false.
Category
Compare Match Timer
Reference
R_CGC_Set
R20UT0084EE0112 Rev.1.12 Page 4-149
July. 16, 2014