NANO103 BSP V3.01.004
The Board Support Package for Nano103 Series
Data Structures | Macros | Functions
rtc.h File Reference

NANO103 series RTC driver header file. More...

This graph shows which files directly or indirectly include this file:

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_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_EnableSpareAccess()   (RTC->SPRCTL |= RTC_SPRCTL_SPRRWEN_Msk)
 Enable access spare register. More...
 
#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->LEAPYEAR & (RTC_LEAPYEAR_LEAPYEAR_Msk))?1:0)
 According to current time, return this year is leap year or not. More...
 
#define RTC_CLEAR_ALARM_INT_FLAG()   (RTC->INTSTS = RTC_INTSTS_ALMIF_Msk)
 Clear alarm interrupt status. More...
 
#define RTC_CLEAR_TICK_INT_FLAG()   (RTC->INTSTS = RTC_INTSTS_TICKIF_Msk)
 Clear tick interrupt status. More...
 
#define RTC_GET_ALARM_INT_FLAG()   ((RTC->INTSTS & RTC_INTSTS_ALMIF_Msk) >> RTC_INTSTS_ALMIF_Pos)
 Get alarm interrupt status. More...
 
#define RTC_CLEAR_TAMPER_FLAG(u32PinNum)   (RTC->INTSTS = RTC_INTSTS_SNPDIF_Msk)
 Clear tamper detect pin status. More...
 
#define RTC_GET_TICK_INT_FLAG()   ((RTC->INTSTS & RTC_INTSTS_TICKIF_Msk) >> RTC_INTSTS_TICKIF_Pos)
 Get alarm interrupt status. More...
 
#define RTC_GET_TAMPER_FLAG()   ( (RTC->INTSTS & RTC_INTSTS_SNPDIF_Msk) >> RTC_INTSTS_SNPDIF_Pos)
 Get tamper detect pin status. More...
 

Functions

int32_t 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

NANO103 series RTC driver header file.

Version
V1.00
Revision
4
Date
15/12/29 2:47p
Note
SPDX-License-Identifier: Apache-2.0 Copyright (C) 2015 Nuvoton Technology Corp. All rights reserved.

Definition in file rtc.h.