User`s manual

RX62N Group, RX621 Group 4. Library Reference
7) R_TMR_ControlChannel
Synopsis
Write to timer channel registers.
Prototype
bool R_TMR_ControlChannel(
uint8_t data1,
// Channel selection
uint32_t data2,
// Configuration selection
uint8_t data3,
// Register value
uint8_t data4,
// Register value
uint8_t data5
// Register value
);
Description
Modify a timer channel’s operation, counter and compare registers.
[data1]
The channel number n (where n = 0, 1, 2 or 3).
[data2]
The channel settings to be modified.
If multiple selections are required, use "|" to separate each selection.
Counter stop / re-start
PDL_TMR_STOP or
PDL_TMR_START
Disable or re-enable the counter clock source.
The counter or compare registers to be modified.
PDL_TMR_COUNTER
Update the timer counter register (TCNT).
PDL_TMR_TIME_CONSTANT_A
Update the timer compare match A register (TCORA).
PDL_TMR_TIME_CONSTANT_B
Update the timer compare match B register (TCORB).
[data3]
The counter value. This will be ignored if the register is not selected.
[data4]
The compare match A value. This will be ignored if the register is not selected.
[data5]
The compare match B value. This will be ignored if the register is not selected.
Return value
True if all parameters are valid and exclusive; otherwise false.
Category
Timer TMR
Reference
R_TMR_CreateChannel
Remarks
None.
Program example
/* RPDL definitions */
#include "r_pdl_tmr.h"
/* RPDL device-specific definitions */
#include "r_pdl_definitions.h"
void func(void)
{
/* Load the counter on channel TMR0 */
R_TMR_ControlChannel(
0,
PDL_TMR_COUNTER,
0xFF,
PDL_NO_DATA,
PDL_NO_DATA
);
}
R20UT0084EE0112 Rev.1.12 Page 4-139
July. 16, 2014