Nano102_112 Series BSP  V3.03.002
The Board Support Package for Nano102_112 Series
Data Structures | Macros | Functions
rtc.h File Reference

Nano102/112 series RTC driver header file. More...

Go to the source code of this file.

Data Structures

struct  S_RTC_TIME_DATA_T
 RTC define Time Data Struct. More...
 

Macros

#define RTC_INIT_KEY   0xA5EB1357
 
#define RTC_WRITE_KEY   0xA965
 
#define RTC_WAIT_COUNT   0xFFFFFFFF
 
#define RTC_YEAR2000   2000
 
#define RTC_FCR_REFERENCE   32761
 
#define RTC_CLOCK_12   0
 
#define RTC_CLOCK_24   1
 
#define RTC_AM   1
 
#define RTC_PM   2
 
#define RTC_TICK_1_SEC   ((uint32_t) 0x00000000)
 
#define RTC_TICK_1_2_SEC   ((uint32_t) 0x00000001)
 
#define RTC_TICK_1_4_SEC   ((uint32_t) 0x00000002)
 
#define RTC_TICK_1_8_SEC   ((uint32_t) 0x00000003)
 
#define RTC_TICK_1_16_SEC   ((uint32_t) 0x00000004)
 
#define RTC_TICK_1_32_SEC   ((uint32_t) 0x00000005)
 
#define RTC_TICK_1_64_SEC   ((uint32_t) 0x00000006)
 
#define RTC_TICK_1_128_SEC   ((uint32_t) 0x00000007)
 
#define RTC_SUNDAY   ((uint32_t) 0x00000000)
 
#define RTC_MONDAY   ((uint32_t) 0x00000001)
 
#define RTC_TUESDAY   ((uint32_t) 0x00000002)
 
#define RTC_WEDNESDAY   ((uint32_t) 0x00000003)
 
#define RTC_THURSDAY   ((uint32_t) 0x00000004)
 
#define RTC_FRIDAY   ((uint32_t) 0x00000005)
 
#define RTC_SATURDAY   ((uint32_t) 0x00000006)
 
#define RTC_SNOOPER_RISING   0
 
#define RTC_SNOOPER_FALLING   1
 
#define RTC_READ_SPARE_REGISTER(u32RegNum)   (RTC->SPR[u32RegNum])
 Read spare register. More...
 
#define RTC_WRITE_SPARE_REGISTER(u32RegNum, u32RegValue)   (RTC->SPR[u32RegNum] = u32RegValue)
 Write spare register. More...
 
#define RTC_IS_LEAP_YEAR()   ((RTC->LIR & (RTC_LIR_LIR_Msk))?1:0)
 According to current time, return this year is leap year or not. More...
 
#define RTC_CLEAR_ALARM_INT_FLAG()   (RTC->RIIR = RTC_RIIR_AIF_Msk)
 Clear alarm interrupt status. More...
 
#define RTC_CLEAR_TICK_INT_FLAG()   (RTC->RIIR = RTC_RIIR_TIF_Msk)
 Clear tick interrupt status. More...
 
#define RTC_GET_ALARM_INT_FLAG()   ((RTC->RIIR & RTC_RIIR_AIF_Msk) >> RTC_RIIR_AIF_Pos)
 Get alarm interrupt status. More...
 
#define RTC_CLEAR_TAMPER_FLAG(u32PinNum)   (RTC->RIIR = RTC_RIIR_SNOOPIF_Msk)
 Clear tamper detect pin status. More...
 
#define RTC_GET_TICK_INT_FLAG()   ((RTC->RIIR & RTC_RIIR_TIF_Msk) >> RTC_RIIR_TIF_Pos)
 Get alarm interrupt status. More...
 
#define RTC_GET_TAMPER_FLAG()   ( (RTC->RIIR & RTC_RIIR_SNOOPIF_Msk) >> RTC_RIIR_SNOOPIF_Pos)
 Get tamper detect pin status. More...
 
#define RTC_ENABLE_TICK_WAKEUP()   (RTC->TTR |= RTC_TTR_TWKE_Msk);
 Enable Timer tick wakeup function. More...
 
#define RTC_DISABLE_TICK_WAKEUP()   (RTC->TTR &= ~RTC_TTR_TWKE_Msk);
 Disable Timer tick wakeup function. More...
 

Functions

void RTC_Open (S_RTC_TIME_DATA_T *sPt)
 This function is used to:
. More...
 
void RTC_Close (void)
 Disable RTC clock. More...
 
void RTC_32KCalibration (int32_t i32FrequencyX10000)
 Set Frequency Compensation Data. More...
 
void RTC_SetTickPeriod (uint32_t u32TickSelection)
 The function is used to set time tick period for periodic time tick Interrupt. More...
 
void RTC_EnableInt (uint32_t u32IntFlagMask)
 The function is used to enable specified interrupt. More...
 
void RTC_DisableInt (uint32_t u32IntFlagMask)
 The function is used to disable specified interrupt. More...
 
uint32_t RTC_GetDayOfWeek (void)
 This function is used to get day of week. More...
 
void RTC_DisableTamperDetection (void)
 This function is used to disable tamper detection function. More...
 
void RTC_EnableTamperDetection (uint32_t u32PinCondition)
 This function is used to:
. More...
 
void RTC_SetAlarmTime (uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm)
 This function is used to set alarm date to RTC. More...
 
void RTC_SetAlarmDate (uint32_t u32Year, uint32_t u32Month, uint32_t u32Day)
 This function is used to set alarm date to RTC. More...
 
void RTC_SetTime (uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm)
 This function is used to update time to RTC. More...
 
void RTC_SetDate (uint32_t u32Year, uint32_t u32Month, uint32_t u32Day, uint32_t u32DayOfWeek)
 This function is used to update date to RTC. More...
 
void RTC_SetAlarmDateAndTime (S_RTC_TIME_DATA_T *sPt)
 This function is used to set alarm date/time to RTC. More...
 
void RTC_SetDateAndTime (S_RTC_TIME_DATA_T *sPt)
 This function is used to update date/time to RTC. More...
 
void RTC_GetAlarmDateAndTime (S_RTC_TIME_DATA_T *sPt)
 Read alarm date/time from RTC setting. More...
 
void RTC_GetDateAndTime (S_RTC_TIME_DATA_T *sPt)
 Read current date/time from RTC setting. More...
 

Detailed Description

Nano102/112 series RTC driver header file.

Version
V1.00
Revision
15
Date
15/06/17 1:44p
Note
SPDX-License-Identifier: Apache-2.0 Copyright (C) 2013~2014 Nuvoton Technology Corp. All rights reserved.

Definition in file rtc.h.