![]() |
NANO100_BSP V3.04.002
The Board Support Package for Nano100BN Series
|
Macros | |
#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_CLEAR_TAMPER_FLAG(u32PinNum) (RTC->RIIR = RTC_RIIR_SNOOPIF_Msk) |
Clear tamper detect pin 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_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 write initial key to let RTC start count and set current time. More... | |
void | RTC_Close (void) |
Disable RTC clock. More... | |
void | RTC_32KCalibration (int32_t i32FrequencyX100) |
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 enable tamper detection function and set tamper control register, interrupt. 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... | |
Variables | |
uint32_t | S_RTC_TIME_DATA_T::u32Year |
uint32_t | S_RTC_TIME_DATA_T::u32Month |
uint32_t | S_RTC_TIME_DATA_T::u32Day |
uint32_t | S_RTC_TIME_DATA_T::u32DayOfWeek |
uint32_t | S_RTC_TIME_DATA_T::u32Hour |
uint32_t | S_RTC_TIME_DATA_T::u32Minute |
uint32_t | S_RTC_TIME_DATA_T::u32Second |
uint32_t | S_RTC_TIME_DATA_T::u32TimeScale |
uint32_t | S_RTC_TIME_DATA_T::u32AmPm |
#define RTC_CLEAR_ALARM_INT_FLAG | ( | ) | (RTC->RIIR = RTC_RIIR_AIF_Msk) |
#define RTC_CLEAR_TAMPER_FLAG | ( | u32PinNum | ) | (RTC->RIIR = RTC_RIIR_SNOOPIF_Msk) |
#define RTC_CLEAR_TICK_INT_FLAG | ( | ) | (RTC->RIIR = RTC_RIIR_TIF_Msk) |
#define RTC_DISABLE_TICK_WAKEUP | ( | ) | (RTC->TTR &= ~RTC_TTR_TWKE_Msk); |
#define RTC_ENABLE_TICK_WAKEUP | ( | ) | (RTC->TTR |= RTC_TTR_TWKE_Msk); |
#define RTC_GET_ALARM_INT_FLAG | ( | ) | ((RTC->RIIR & RTC_RIIR_AIF_Msk) >> RTC_RIIR_AIF_Pos) |
#define RTC_GET_TAMPER_FLAG | ( | ) | ( (RTC->RIIR & RTC_RIIR_SNOOPIF_Msk) >> RTC_RIIR_SNOOPIF_Pos) |
#define RTC_GET_TICK_INT_FLAG | ( | ) | ((RTC->RIIR & RTC_RIIR_TIF_Msk) >> RTC_RIIR_TIF_Pos) |
#define RTC_IS_LEAP_YEAR | ( | ) | ((RTC->LIR & (RTC_LIR_LIR_Msk))?1:0) |
#define RTC_READ_SPARE_REGISTER | ( | u32RegNum | ) | (RTC->SPR[u32RegNum]) |
#define RTC_WRITE_SPARE_REGISTER | ( | u32RegNum, | |
u32RegValue | |||
) | (RTC->SPR[u32RegNum] = u32RegValue) |
void RTC_32KCalibration | ( | int32_t | i32FrequencyX100 | ) |
void RTC_DisableInt | ( | uint32_t | u32IntFlagMask | ) |
The function is used to disable specified interrupt.
[in] | u32IntFlagMask | The structure of interrupt source. It consists of: RTC_RIER_AIER_Msk : Alarm interrupt RTC_RIER_TIER_Msk : Tick interrupt RTC_RIER_SNOOPIER_Msk : Snooper Pin Event Detection Interrupt |
void RTC_DisableTamperDetection | ( | void | ) |
void RTC_EnableInt | ( | uint32_t | u32IntFlagMask | ) |
The function is used to enable specified interrupt.
[in] | u32IntFlagMask | The structure of interrupt source. It consists of: RTC_RIER_AIER_Msk : Alarm interrupt RTC_RIER_TIER_Msk : Tick interrupt RTC_RIER_SNOOPIER_Msk : Snooper Pin Event Detection Interrupt |
void RTC_EnableTamperDetection | ( | uint32_t | u32PinCondition | ) |
void RTC_GetAlarmDateAndTime | ( | S_RTC_TIME_DATA_T * | sPt | ) |
Read alarm date/time from RTC setting.
[out] | sPt | Specify the time property and current time. It includes: u32Year: Year value u32Month: Month value u32Day: Day value u32DayOfWeek: Day of week u32Hour: Hour value u32Minute: Minute value u32Second: Second value u32TimeScale: RTC_CLOCK_12 / RTC_CLOCK_24 u8AmPm: RTC_AM / RTC_PM |
void RTC_GetDateAndTime | ( | S_RTC_TIME_DATA_T * | sPt | ) |
Read current date/time from RTC setting.
[out] | sPt | Specify the time property and current time. It includes: u32Year: Year value u32Month: Month value u32Day: Day value u32DayOfWeek: Day of week u32Hour: Hour value u32Minute: Minute value u32Second: Second value u32TimeScale: RTC_CLOCK_12 / RTC_CLOCK_24 u8AmPm: RTC_AM / RTC_PM |
uint32_t RTC_GetDayOfWeek | ( | void | ) |
void RTC_Open | ( | S_RTC_TIME_DATA_T * | sPt | ) |
This function is used to write initial key to let RTC start count and set current time.
[in] | sPt | Specify the time property and current time. Null pointer for using default starting time. It includes: u32Year: Year value. u32Month: Month value. u32Day: Day value. u32DayOfWeek: Day of week. [ RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / RTC_SATURDAY] u32Hour: Hour value. u32Minute: Minute value. u32Second: Second value. u32TimeScale: [ RTC_CLOCK_12 / RTC_CLOCK_24] u8AmPm: [ RTC_AM / RTC_PM] |
void RTC_SetAlarmDate | ( | uint32_t | u32Year, |
uint32_t | u32Month, | ||
uint32_t | u32Day | ||
) |
void RTC_SetAlarmDateAndTime | ( | S_RTC_TIME_DATA_T * | sPt | ) |
This function is used to set alarm date/time to RTC.
[in] | sPt | Specify the time property and current time. It includes: u32Year: Year value. u32Month: Month value. u32Day: Day value. u32DayOfWeek: Day of week. [ RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / RTC_SATURDAY] u32Hour: Hour value. u32Minute: Minute value. u32Second: Second value. u32TimeScale: [ RTC_CLOCK_12 / RTC_CLOCK_24] u8AmPm: [ RTC_AM / RTC_PM] |
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.
[in] | u32Hour | The Hour Time Digit of Alarm Setting. |
[in] | u32Minute | The Month Calendar Digit of Alarm Setting |
[in] | u32Second | The Day Calendar Digit of Alarm Setting |
[in] | u32TimeMode | The 24-Hour / 12-Hour Time Scale Selection. [ RTC_CLOCK_12 / RTC_CLOCK_24] |
[in] | u32AmPm | 12-hour time scale with AM and PM indication. Only Time Scale select 12-hour used. [ RTC_AM / RTC_PM] |
void RTC_SetDate | ( | uint32_t | u32Year, |
uint32_t | u32Month, | ||
uint32_t | u32Day, | ||
uint32_t | u32DayOfWeek | ||
) |
This function is used to update date to RTC.
[in] | u32Year | The Year Calendar Digit of Alarm Setting |
[in] | u32Month | The Month Calendar Digit of Alarm Setting |
[in] | u32Day | The Day Calendar Digit of Alarm Setting |
[in] | u32DayOfWeek | The Day of Week. [ RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / RTC_SATURDAY] |
void RTC_SetDateAndTime | ( | S_RTC_TIME_DATA_T * | sPt | ) |
This function is used to update date/time to RTC.
[in] | sPt | Specify the time property and current time. It includes: u32Year: Year value. u32Month: Month value. u32Day: Day value. u32DayOfWeek: Day of week. [ RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / RTC_SATURDAY] u32Hour: Hour value. u32Minute: Minute value. u32Second: Second value. u32TimeScale: [ RTC_CLOCK_12 / RTC_CLOCK_24] u8AmPm: [ RTC_AM / RTC_PM] |
void RTC_SetTickPeriod | ( | uint32_t | u32TickSelection | ) |
The function is used to set time tick period for periodic time tick Interrupt.
[in] | u32TickSelection | It is used to set the RTC time tick period for Periodic Time Tick Interrupt request. It consists of: RTC_TICK_1_SEC : Time tick is 1 second RTC_TICK_1_2_SEC : Time tick is 1/2 second RTC_TICK_1_4_SEC : Time tick is 1/4 second RTC_TICK_1_8_SEC : Time tick is 1/8 second RTC_TICK_1_16_SEC : Time tick is 1/16 second RTC_TICK_1_32_SEC : Time tick is 1/32 second RTC_TICK_1_64_SEC : Time tick is 1/64 second RTC_TICK_1_128_SEC : Time tick is 1/128 second |
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.
[in] | u32Hour | The Hour Time Digit of Alarm Setting. |
[in] | u32Minute | The Minute Time Digit of Alarm Setting |
[in] | u32Second | The Second Time Digit of Alarm Setting |
[in] | u32TimeMode | The 24-Hour / 12-Hour Time Scale Selection. [ RTC_CLOCK_12 / RTC_CLOCK_24] |
[in] | u32AmPm | 12-hour time scale with AM and PM indication. Only Time Scale select 12-hour used. [ RTC_AM / RTC_PM] |
uint32_t S_RTC_TIME_DATA_T::u32AmPm |