User`s manual
RX62N Group, RX621 Group 4. Library Reference
5) R_TMR_CreateOneShot
Synopsis
Configure and use a one-shot timer.
Prototype
bool R_TMR_CreateOneShot(
uint8_t data1,
// 8-bit (channel) or 16-bit (unit) timer selection
uint32_t data2,
// Configuration selection
float data3,
// Period
void * func,
// Callback function
uint8_t data4
// Interrupt priority level
);
Description
Set up a TMR timer channel or unit for one-shot operation and start the timer.
[data1]
PDL_TMR_TMR0 or
PDL_TMR_TMR1 or
PDL_TMR_TMR2 or
PDL_TMR_TMR3 or
PDL_TMR_UNIT0 or
PDL_TMR_UNIT1
The channel n (n = 0, 1, 2 or 3) or unit n (n = 0 or 1) to be
configured.
[data2]
Configure the timer. Use "|" to separate each selection. The default settings are shown in bold.
Specify PDL_NO_DATA to use the defaults.
•
Output pin control
PDL_TMR_OUTPUT_HIGH or
PDL_TMR_OUTPUT_LOW or
PDL_TMR_OUTPUT_OFF
For the duration of the one-shot period, generate a high-level
output,
low-level output or
no output on pin TMOn.
For 16-bit operation the pin shall be TMO2 when n = 1.
•
DTC trigger control
PDL_TMR_PULSE_DTC_TRIGGER_DISABLE or
PDL_TMR_PULSE_DTC_TRIGGER_ENABLE
Disable or enable activation of the DTC
when the one-shot period ends.
•
Control the CPU during the one-shot operation.
PDL_TMR_CPU_ON or
Allow the CPU to run normally while the one-shot operates.
PDL_TMR_CPU_OFF
Stop the CPU when the one-shot timer starts.
The CPU will re-start when any valid interrupt occurs.
[data3]
The one-shot time period (in seconds).
[func]
The function to be called when the one-shot period ends.
Specify PDL_NO_FUNC for this function to wait for the timer to complete before returning.
You should always specify a function if PDL_TMR_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
Timer TMR
Reference
R_CGC_Set, R_TMR_CreateChannel, R_TMR_CreateUnit
R20UT0084EE0112 Rev.1.12 Page 4-136
July. 16, 2014