RX230 Group, RX231 Group
Initial Settings and Usage Procedure of RTC Battery Backup Function
R01AN4831EJ0100 Rev.1.00
Page 13 of 23
Aug.20.19
Table 3.4 Option-Setting Memory Settings
Bit
Symbol
Bit Name
Function
Setting Value
b1, b0
VDSEL[1:0] Voltage detection 0 level
select bits
2.51 V is selected.
10b
b2
LVDAS
Voltage detection 0 circuit
start bit
Voltage monitoring 0 reset is
enabled after a reset.
0
3.5 Constants
None.
3.6 Variables
Table 3.5, Global Variables, lists the global variables used by the sample program.
Table 3.5 Global Variables
Type
Variable Name
Description
struct
rtc_calendarcounter_value_t
Year/month/day/hour/minute/second structure
uint8_t
batty_err
Battery state
sw_counter
Switch push count
g_rtc_interrupt
RTC interrupt generated indication
3.7 Functions Used
Table 3.6, User Functions, lists the functions referenced in the user file (main.c).
Table 3.6 User Functions
Function Name
Outline
main()
System main function
display_time ()
Display time information.
display_info ()
Display battery and switch states.
backup_time()
Write time information to the data flash.
flash_Init()
Erase the data flash and perform blank checking.
The functions used in the sample code of each FIT/SC modules are listed below.
Table 3.7 SC Module Functions
Function Name
Outline
Contained
in File
R_VBATT_Open ()
Initialize battery backup.
r_vbatt_rx.c
R_VBATT_GetStatus ()
Get battery backup status.
r_vbatt_rx.c
R_Config_RTC_Create ()
Initialize RTC.
Config_RTC.c
R_Config_RTC_Start
Start RTC.
Config_RTC.c
R_Config_RTC_Set_CalendarCounterValue ()
Set RTC information.
Config_RTC.c
R_Config_RTC_Get_CalendarCounterValue ()
Get RTC information.
Config_RTC.c
R_Config_RTC_Get_CalendarTimeCaptureValue1()
Get RTC capture value.
Config_RTC.c
R_Config_LVD1_Start()
Start LVD1.
Config_LVD1.c
R_Config_LVD1_Stop()
Stop LVD1
Config_LVD1.c
R_FLASH_Open()
Initialize flash.
r_flash_rx.c
R_FLASH_Write()
Program flash.
r_flash_rx.c
R_FLASH_Erase()
Erase flash.
r_flash_rx.c
R_FLASH_BlankCheck()
Run flash blank check.
r_flash_rx.c