User`s manual
RX62N Group, RX621 Group 4. Library Reference
4.2.17. Real-time Clock
1) R_RTC_Create
Synopsis
Configure the Real-time clock.
Prototype
bool R_RTC_Create(
uint32_t data1,
// Configuration selection
uint32_t data2,
// Current time
uint32_t data3,
// Current date
uint32_t data4,
// Alarm time
uint32_t data5,
// Alarm date
void * func1,
// Callback function
uint8_t data6,
// Interrupt priority level
void * func2,
// Callback function
uint8_t data7
// Interrupt priority level
);
Description (1/2)
Set up and start the Real-time clock.
[data1]
Configure the clock options.
To set multiple options at the same time, use "|" to separate each value.
The default settings are shown in bold.
•
Alarm enabling
PDL_RTC_ALARM_HOUR_ENABLE
All three can be enabled using:
PDL_RTC_ALARM_TIME_ENABLE
PDL_RTC_ALARM_MINUTE_ENABLE
PDL_RTC_ALARM_SECOND_ENABLE
PDL_RTC_ALARM_YEAR_ENABLE
All four can be enabled using:
PDL_RTC_ALARM_DATE_ENABLE
PDL_RTC_ALARM_MONTH_ENABLE
PDL_RTC_ALARM_DAY_ENABLE
PDL_RTC_ALARM_DOW_ENABLE
•
Periodic interrupt selection
PDL_RTC_PERIODIC_DISABLE or
PDL_RTC_PERIODIC_256_HZ or
PDL_RTC_PERIODIC_64_HZ or
PDL_RTC_PERIODIC_16_HZ or
PDL_RTC_PERIODIC_4_HZ or
PDL_RTC_PERIODIC_2_HZ or
PDL_RTC_PERIODIC_1_HZ or
PDL_RTC_PERIODIC_2S
The frequency or interval for periodic interrupt
requests.
•
Clock output control
PDL_RTC_OUTPUT_DISABLE or
PDL_RTC_OUTPUT_ENABLE
Disable or enable the 1 Hz clock output on the
RTCOUT pin.
[data2]
The current day of the week (DOW) and time in hours, minutes and seconds.
BCD format is used.
b31 – b24
b23 – b16
b15 – b8
b7 – b0
Day of week
Valid from 0 to 6. 0 = Sunday. Specify 0xFF for
automatic calculation using the values in data3.
Hours
Valid from 0
to 23.
Minutes
Valid from 0
to 59.
Seconds
Valid from 0
to 59.
[data3]
The current year, month and day. BCD format is used. If not required, specify PDL_NO_DATA.
b31 – b16
b15 – b8
b7 – b0
Year
Valid from 0 to 9999.
Month
Valid from 1 to 12.
Day
Valid from 1 to the number of days in the month.
R20UT0084EE0112 Rev.1.12 Page 4-155
July. 16, 2014