User`s manual

RX62N Group, RX621 Group 4. Library Reference
4) R_TMR_CreatePeriodic
Synopsis
Select periodic operation.
Prototype
bool R_TMR_CreatePeriodic(
uint8_t data1,
// 8-bit (channel) or 16-bit (unit) selection
uint32_t data2,
// Configuration selection
float data3,
// Period or frequency
float data4,
// Pulse width or duty cycle
void * func1,
// Callback function
void * func2,
// Callback function
uint8_t data5
// Interrupt priority level
);
Description (1/2)
Set up a TMR timer channel or unit for periodic 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 = 0 or 1) to be
configured.
[data2]
Configure the timer. If multiple selections are required, use "|" to separate each selection.
The default settings are shown in bold.
Period or frequency calculation
PDL_TMR_PERIOD or
PDL_TMR_FREQUENCY
The parameters data3 and data4 will contain either
period and pulse width or frequency and duty cycle.
Output pin control
PDL_TMR_OUTPUT_HIGH or
PDL_TMR_OUTPUT_LOW or
PDL_TMR_OUTPUT_OFF
Start with a high-level or
low-level output, or
no output on pin TMOn.
For 16-bit operation the pin shall be TMO2 when n = 1.
ADC trigger control
PDL_TMR_ADC_TRIGGER_OFF or
PDL_TMR_ADC_TRIGGER_ON
Disable or enable TMR-triggered ADC conversion start
requests.
Applicable only for channels TMR0 or TMR2, or either
TMR unit.
Pulse DTC trigger control
PDL_TMR_PULSE_DTC_TRIGGER_DISABLE or
PDL_TMR_PULSE_DTC_TRIGGER_ENABLE
Disable or enable activation of the DTC
at the pulse width interval.
Period DTC trigger control
PDL_TMR_PERIOD_DTC_TRIGGER_DISABLE or
PDL_TMR_PERIOD_DTC_TRIGGER_ENABLE
Disable or enable activation of the DTC
at the periodic interval.
[data3]
The period (in seconds) or frequency (in Hz).
[data4]
The pulse width (in seconds) or duty cycle (%).
[func1]
The function to be called at the pulse width interval. Use PDL_NO_FUNC if not required.
[func2]
The function to be called at the periodic interval. Use PDL_NO_FUNC if not required.
R20UT0084EE0112 Rev.1.12 Page 4-133
July. 16, 2014