User`s manual
RX62N Group, RX621 Group 4. Library Reference
5) R_CMT_Read
Synopsis
Read CMT channel status and registers.
Prototype
bool R_CMT_Read(
uint8_t data1,
// Channel selection
uint8_t * data2,
// A pointer to the data storage location
uint16_t * data3
// A pointer to the data storage location
);
Description
Read and store the counter value and status flag.
[data1]
The channel number n (where n = 0, 1, 2 or 3).
[data2]
The compare match status flag shall be stored in the following format.
Specify PDL_NO_PTR if the flag is not to be read.
b7 – b1
b0
0
0: Idle
1: Compare match condition detected
[data3]
A pointer to where the counter value shall be stored. Specify PDL_NO_PTR if it is not required.
Return value
True if all parameters are valid; otherwise false.
Category
Compare Match Timer
Reference
R_CMT_Create
Remarks
•
If the flag is read and is set to 1, it shall be automatically cleared to 0 by this function.
Program example
/* RPDL definitions */
#include "r_pdl_cmt.h"
/* RPDL device-specific definitions */
#include "r_pdl_definitions.h"
uint8_t Flags;
uint16_t Counter;
void func(void)
{
/* Read the channel 2 values */
R_CMT_Read(
2,
&Flags,
&Counter
);
}
R20UT0084EE0112 Rev.1.12 Page 4-154
July. 16, 2014