User`s manual

RX62N Group, RX621 Group 4. Library Reference
3) R_RTC_Read
Synopsis
Read the Real-time clock status flags and counters.
Prototype
bool R_RTC_Read(
uint8_t * data1,
// A pointer to the flags storage location
uint32_t * data2,
// A pointer to the data storage location
uint32_t * data3
// A pointer to the data storage location
);
Description
Read the Clock counters registers and status flags.
[data1]
The clock status shall be stored in the following format.
Specify PDL_NO_PTR if the flags are not to be read.
b7
b6
b5
b4
0
Interrupt requests
Carry
Periodic
Alarm
0: Idle
1: Occurred
b3
b2
b1
b0
0
Status
30-second adjustment
Reset
Clock
0: Normal operation
1: Adjustment in progress
0: Normal operation
1: Reset in progress
0: Stopped
1: Running
[data2]
The current day of the week and time. Specify PDL_NO_PTR if it is not required.
[data3]
The current year, month and day. Specify PDL_NO_PTR if it is not required.
Return value
True if all parameters are valid; otherwise false.
Category
Real-time clock
Reference
R_RTC_Create
Remarks
If an interrupt request flag is set to 1, it shall be automatically cleared to 0 by this function.
Refer to R_RTC_Create for the time and date formats.
If the Carry flag is read as 1, the current time and date were updated during the read process
and should be re-read.
Program example
/* RPDL definitions */
#include "r_pdl_rtc.h"
/* RPDL device-specific definitions */
#include "r_pdl_definitions.h"
uint8_t Flags;
uint32_t CurrentTime;
void func(void)
{
/* Read the time and flags */
R_RTC_Read(
&Flags,
&CurrentTime,
PDL_NO_PTR
);
}
R20UT0084EE0112 Rev.1.12 Page 4-161
July. 16, 2014