User`s manual
RX62N Group, RX621 Group 4. Library Reference
10) R_TMR_ReadChannel
Synopsis
Read from timer channel registers.
Prototype
bool R_TMR_ReadChannel(
uint8_t data1,
// Channel selection
uint8_t * data2,
// A pointer to the data storage location
uint8_t * data3,
// A pointer to the data storage location
uint8_t * data4,
// A pointer to the data storage location
uint8_t * data5
// A pointer to the data storage location
);
Description
Read any of the timer’s counter, compare or status flag registers.
[data1]
The channel number n (where n = 0, 1, 2 or 3).
[data2]
The status flags shall be stored in the format below.
The flag will be set to 1 if the condition has been detected.
Specify PDL_NO_PTR if the flags are not to be read.
b7 – b3
b2
b1
b0
-
Overflow
Compare match B
Compare match A
[data3]
A pointer to where the counter value shall be stored. Specify PDL_NO_PTR if it is not required.
[data4]
Where the compare match A value shall be stored. Specify PDL_NO_PTR if it is not required.
[data5]
Where the compare match B 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
Timer TMR
Reference
R_TMR_CreateChannel
Remarks
•
If the status flags are read, any flag that has been set to 1 shall be automatically cleared to 0 by
this function.
Program example
#include "r_pdl_tmr.h"
/* RPDL device-specific definitions */
#include "r_pdl_definitions.h"
uint8_t Flags;
uint8_t Counter;
uint8_t CompareMatchA;
uint8_t CompareMatchB;
void func(void)
{
/* Read the status flags and registers for TMR0 */
R_TMR_ReadChannel(
0,
&Flags,
&Counter,
&CompareMatchA,
&CompareMatchB
);
}
R20UT0084EE0112 Rev.1.12 Page 4-144
July. 16, 2014