User`s manual
RX62N Group, RX621 Group 4. Library Reference
7) R_MTU2_ReadUnit
Synopsis
Read from MTU registers.
Prototype
bool R_MTU2_ReadUnit(
uint8_t data1,
// Unit selection
uint16_t * data2,
// A pointer to the data storage location
uint8_t * data3
// A pointer to the data storage location
);
Description
Read any of the timer units’s counter registers
[data1]
The unit number n (where n = 0 to 1).
[data2]
A pointer to where the Timer Subcounter register (TCNTS) value shall be stored.
Specify PDL_NO_PTR if it is not required.
[data3]
Where the Timer Interrupt Skipping Counter register (TITCNT) value shall be stored.
Specify PDL_NO_PTR if it is not required.
Return value
True if all parameters are valid and exclusive; otherwise false.
Category
Multi-function Timer Pulse Unit
Reference
None.
Remarks
•
None.
Program example
/* RPDL definitions */
#include "r_pdl_mtu2.h"
/* RPDL device-specific definitions */
#include "r_pdl_definitions.h"
uint16_t Sub_count;
uint8_t Skip_count;
void func(void)
{
/* Read the counter registers for unit 0 */
R_MTU2_ReadUnit(
0,
&Sub_count,
&Skip_count
);
}
R20UT0084EE0112 Rev.1.12 Page 4-113
July. 16, 2014