User`s manual

RX62N Group, RX621 Group 4. Library Reference
4.2.16. Compare Match Timer
1) R_CMT_Create
Synopsis
Configure a CMT channel.
Prototype
bool R_CMT_Create(
uint8_t data1,
// Timer channel selection
uint16_t data2,
// Configuration selection
float data3,
// Period, frequency or register data
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. To set multiple options at the same time, use "|" to separate each value.
The default settings are shown in bold.
Clock calculation
PDL_CMT_PERIOD or
The parameter data3 will specify the timer period.
The counter clock source and compare match value will be
calculated by this function.
PDL_CMT_FREQUENCY or
The parameter data3 will specify the timer frequency.
The counter clock source and compare match value will be
calculated by this function.
PDL_CMT_PCLK_DIV_8 or
PDL_CMT_PCLK_DIV_32 or
PDL_CMT_PCLK_DIV_128 or
PDL_CMT_PCLK_DIV_512
Select the internal clock signal PCLK ÷ 8, 32, 128 or 512 as the
counter clock source.
The parameter data3 will be the register CMCOR value.
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 data to be used for the register value calculations.
Data use
Parameter type
The timer period in seconds or
float
The timer frequency in Hz or
float
The value to be put in register CMCOR
uint16_t
[func]
The function to be called at the periodic interval. Specify PDL_NO_FUNC if not required.
[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-147
July. 16, 2014