User`s manual
RX62N Group, RX621 Group 4. Library Reference
4) R_CMT_Control
Synopsis
Control CMT operation.
Prototype
bool R_CMT_Control(
uint8_t data1,
// Channel selection
uint16_t data2,
// Configuration selection
float data3
// Period, frequency or register data
);
Description
Modify the operation of a CMT channel.
[data1]
The channel number n (where n = 0, 1, 2 or 3).
[data2]
Configure the timer channel. To set multiple options at the same time, use "|" to separate each
value.
•
Counter stop / re-start
PDL_CMT_STOP
Disable the counter clock source.
PDL_CMT_START
Enable the counter clock source.
•
Value change request
PDL_CMT_PERIOD or
PDL_CMT_FREQUENCY or
PDL_CMT_CONSTANT or
PDL_CMT_COUNTER
The parameter data3 will contain the new period,
frequency,
constant register (CMCOR) or
counter register (CMCNT) value.
[data3]
The new period, frequency or register value. This will be ignored if a value change is not requested.
Data use
Parameter type
The timer period in seconds or
float
The timer frequency in Hz or
float
The value to be put in the selected register
uint16_t
Return value
True if all parameters are valid and exclusive; otherwise false.
Category
Compare Match Timer
Reference
R_CMT_Create
Remarks
•
R_CMT_Create must be used first to configure the channel.
•
The Stop operation is executed at the start of this function.
The Start operation is executed at the end.
Therefore, both options can be selected together with a value change in one function call.
To avoid register access conflicts or invalid calls to the callback function, use this method when
changing any value.
•
If the CMCNT register value is changed to the same value as the CMCOR register, the CMCNT
register will be set to 0.
R20UT0084EE0112 Rev.1.12 Page 4-152
July. 16, 2014