| M480 BSP V3.05.001 The Board Support Package for M480 Series

Macros | Functions
RTC Exported Functions
Standard Driver » RTC Driver

## Macros
#define | RTC_IS_LEAP_YEAR()
| Indicate is Leap Year or not. More...
#define | RTC_CLEAR_ALARM_INT_FLAG()
| Clear RTC Alarm Interrupt Flag. More...
#define | RTC_CLEAR_TICK_INT_FLAG()
| Clear RTC Tick Interrupt Flag. More...
#define | RTC_CLEAR_TAMPER_INT_FLAG(u32TamperFlag)
| Clear RTC Tamper Interrupt Flag. More...
#define | RTC_GET_ALARM_INT_FLAG()
| Get RTC Alarm Interrupt Flag. More...
#define | RTC_GET_TICK_INT_FLAG()
| Get RTC Time Tick Interrupt Flag. More...
#define | RTC_GET_TAMPER_INT_FLAG()
| Get RTC Tamper Interrupt Flag. More...
#define | RTC_GET_TAMPER_INT_STATUS()
| Get RTC TAMPER Interrupt Status. More...
#define | RTC_READ_SPARE_REGISTER(u32RegNum)
| Read Spare Register. More...
#define | RTC_WRITE_SPARE_REGISTER(u32RegNum, u32RegValue)
| Write Spare Register. More...

## Functions
__STATIC_INLINE void | RTC_WaitAccessEnable (void)
| Wait RTC Access Enable. More...
void | RTC_Open (S_RTC_TIME_DATA_T *sPt)
| Initialize RTC module and start counting. More...
void | RTC_Close (void)
| Disable RTC Clock. More...
void | RTC_32KCalibration (int32_t i32FrequencyX10000)
| Set Frequency Compensation Data. More...
void | RTC_GetDateAndTime (S_RTC_TIME_DATA_T *sPt)
| Get Current RTC Date and Time. More...
void | RTC_GetAlarmDateAndTime (S_RTC_TIME_DATA_T *sPt)
| Get RTC Alarm Date and Time. More...
void | RTC_SetDateAndTime (S_RTC_TIME_DATA_T *sPt)
| Update Current RTC Date and Time. More...
void | RTC_SetAlarmDateAndTime (S_RTC_TIME_DATA_T *sPt)
| Update RTC Alarm Date and Time. More...
void | RTC_SetDate (uint32_t u32Year, uint32_t u32Month, uint32_t u32Day, uint32_t u32DayOfWeek)
| Update RTC Current Date. More...
void | RTC_SetTime (uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm)
| Update RTC Current Time. More...
void | RTC_SetAlarmDate (uint32_t u32Year, uint32_t u32Month, uint32_t u32Day)
| Update RTC Alarm Date. More...
void | RTC_SetAlarmTime (uint32_t u32Hour, uint32_t u32Minute, uint32_t u32Second, uint32_t u32TimeMode, uint32_t u32AmPm)
| Update RTC Alarm Time. More...
void | RTC_SetAlarmDateMask (uint8_t u8IsTenYMsk, uint8_t u8IsYMsk, uint8_t u8IsTenMMsk, uint8_t u8IsMMsk, uint8_t u8IsTenDMsk, uint8_t u8IsDMsk)
| Set RTC Alarm Date Mask Function. More...
void | RTC_SetAlarmTimeMask (uint8_t u8IsTenHMsk, uint8_t u8IsHMsk, uint8_t u8IsTenMMsk, uint8_t u8IsMMsk, uint8_t u8IsTenSMsk, uint8_t u8IsSMsk)
| Set RTC Alarm Time Mask Function. More...
uint32_t | RTC_GetDayOfWeek (void)
| Get Day of the Week. More...
void | RTC_SetTickPeriod (uint32_t u32TickSelection)
| Set RTC Tick Period Time. More...
void | RTC_EnableInt (uint32_t u32IntFlagMask)
| Enable RTC Interrupt. More...
void | RTC_DisableInt (uint32_t u32IntFlagMask)
| Disable RTC Interrupt. More...
void | RTC_EnableSpareAccess (void)
| Enable Spare Registers Access. More...
void | RTC_DisableSpareRegister (void)
| Disable Spare Register. More...
void | RTC_StaticTamperEnable (uint32_t u32TamperSelect, uint32_t u32DetecLevel, uint32_t u32DebounceEn)
| Static Tamper Detect. More...
void | RTC_StaticTamperDisable (uint32_t u32TamperSelect)
| Static Tamper Disable. More...
void | RTC_DynamicTamperEnable (uint32_t u32PairSel, uint32_t u32DebounceEn, uint32_t u32Pair1Source, uint32_t u32Pair2Source)
| Dynamic Tamper Detect. More...
void | RTC_DynamicTamperDisable (uint32_t u32PairSel)
| Dynamic Tamper Disable. More...
void | RTC_DynamicTamperConfig (uint32_t u32ChangeRate, uint32_t u32SeedReload, uint32_t u32RefPattern, uint32_t u32Seed)
| Config dynamic tamper. More...

## Detailed Description

## Macro Definition Documentation

## ◆ RTC_CLEAR_ALARM_INT_FLAG

#define RTC_CLEAR_ALARM_INT_FLAG | ( |  | ) |

Clear RTC Alarm Interrupt Flag.

Parameters

  None |

Returns
  None

This macro is used to clear RTC alarm interrupt flag.

Definition at line 158 of file rtc.h.

## ◆ RTC_CLEAR_TAMPER_INT_FLAG

#define RTC_CLEAR_TAMPER_INT_FLAG | ( |  | u32TamperFlag | ) |

Clear RTC Tamper Interrupt Flag.

Parameters

  u32TamperFlag | Tamper interrupt flag. It consists of: RTC_INTSTS_TAMP0IF_Msk RTC_INTSTS_TAMP1IF_Msk RTC_INTSTS_TAMP2IF_Msk RTC_INTSTS_TAMP3IF_Msk RTC_INTSTS_TAMP4IF_Msk RTC_INTSTS_TAMP5IF_Msk

Returns
  None

This macro is used to clear RTC snooper pin interrupt flag.

Definition at line 188 of file rtc.h.

## ◆ RTC_CLEAR_TICK_INT_FLAG

#define RTC_CLEAR_TICK_INT_FLAG | ( |  | ) |

Clear RTC Tick Interrupt Flag.

Parameters

  None |

Returns
  None

This macro is used to clear RTC tick interrupt flag.

Definition at line 170 of file rtc.h.

## ◆ RTC_GET_ALARM_INT_FLAG

#define RTC_GET_ALARM_INT_FLAG | ( |  | ) |

Get RTC Alarm Interrupt Flag.

Parameters

  None |

Return values

  0 | RTC alarm interrupt did not occur
  1 | RTC alarm interrupt occurred

This macro indicates RTC alarm interrupt occurred or not.

Definition at line 201 of file rtc.h.

## ◆ RTC_GET_TAMPER_INT_FLAG

#define RTC_GET_TAMPER_INT_FLAG | ( |  | ) |

Get RTC Tamper Interrupt Flag.

Parameters

  None |

Return values

  0 | RTC snooper pin interrupt did not occur
  1 | RTC snooper pin interrupt occurred

This macro indicates RTC snooper pin interrupt occurred or not.

Definition at line 227 of file rtc.h.

## ◆ RTC_GET_TAMPER_INT_STATUS

#define RTC_GET_TAMPER_INT_STATUS | ( |  | ) |

Get RTC TAMPER Interrupt Status.

Parameters

  None |

Return values

  RTC_INTSTS_TAMP0IF_Msk | Tamper 0 interrupt flag is generated
  RTC_INTSTS_TAMP1IF_Msk | Tamper 1 interrupt flag is generated
  RTC_INTSTS_TAMP2IF_Msk | Tamper 2 interrupt flag is generated
  RTC_INTSTS_TAMP3IF_Msk | Tamper 3 interrupt flag is generated
  RTC_INTSTS_TAMP4IF_Msk | Tamper 4 interrupt flag is generated
  RTC_INTSTS_TAMP5IF_Msk | Tamper 5 interrupt flag is generated

This macro indicates RTC snooper pin interrupt occurred or not.

Definition at line 244 of file rtc.h.

## ◆ RTC_GET_TICK_INT_FLAG

#define RTC_GET_TICK_INT_FLAG | ( |  | ) |

Get RTC Time Tick Interrupt Flag.

Parameters

  None |

Return values

  0 | RTC time tick interrupt did not occur
  1 | RTC time tick interrupt occurred

This macro indicates RTC time tick interrupt occurred or not.

Definition at line 214 of file rtc.h.

## ◆ RTC_IS_LEAP_YEAR

#define RTC_IS_LEAP_YEAR | ( |  | ) |

Indicate is Leap Year or not.

Parameters

  None |

Return values

  0 | This year is not a leap year
  1 | This year is a leap year

According to current date, return this year is leap year or not.

Definition at line 146 of file rtc.h.

## ◆ RTC_READ_SPARE_REGISTER

#define RTC_READ_SPARE_REGISTER | ( |  | u32RegNum | ) |

Read Spare Register.

Parameters

  [in] | u32RegNum | The spare register number, 0~19.

Returns
  Spare register content

Read the specify spare register content.

Note
  The returned value is valid only when SPRRDY(SPRCTL[7] SPR Register Ready) bit is set.
  And its controlled by RTC Access Enable Register.

Definition at line 258 of file rtc.h.

## ◆ RTC_WRITE_SPARE_REGISTER

#define RTC_WRITE_SPARE_REGISTER | ( |  | u32RegNum,
|  |  | u32RegValue
| ) |  |

Write Spare Register.

Parameters

  [in] | u32RegNum | The spare register number, 0~19.
  [in] | u32RegValue | The spare register value.

Returns
  None

Write specify data to spare register.

Note
  This macro is effect only when SPRRDY(SPRCTL[7] SPR Register Ready) bit is set.
  And its controlled by RTC Access Enable Register(RTC_RWEN).

Definition at line 273 of file rtc.h.

## Function Documentation

## ◆ RTC_32KCalibration()

void RTC_32KCalibration | ( | int32_t | i32FrequencyX10000 | ) |

Set Frequency Compensation Data.

Parameters

  [in] | i32FrequencyX10000 | Specify the RTC clock X10000, ex: 327736512 means 32773.6512.

Returns
  None

Definition at line 110 of file rtc.c.

## ◆ RTC_Close()

void RTC_Close | ( | void |  | ) |

Disable RTC Clock.

Parameters

  None |

Returns
  None

This API will disable RTC peripheral clock and stops RTC counting.

Definition at line 97 of file rtc.c.

## ◆ RTC_DisableInt()

void RTC_DisableInt | ( | uint32_t | u32IntFlagMask | ) |

Disable RTC Interrupt.

Parameters

  [in] | u32IntFlagMask | Specify the interrupt source. It consists of: RTC_INTEN_ALMIEN_Msk : Alarm interrupt RTC_INTEN_TICKIEN_Msk : Tick interrupt RTC_INTEN_TAMP0IEN_Msk : Tamper 0 Pin Event Detection interrupt RTC_INTEN_TAMP1IEN_Msk : Tamper 1 Pin Event Detection interrupt RTC_INTEN_TAMP2IEN_Msk : Tamper 2 Pin Event Detection interrupt RTC_INTEN_TAMP3IEN_Msk : Tamper 3 Pin Event Detection interrupt RTC_INTEN_TAMP4IEN_Msk : Tamper 4 Pin Event Detection interrupt RTC_INTEN_TAMP5IEN_Msk : Tamper 5 Pin Event Detection interrupt

Returns
  None

This API is used to disable the specify RTC interrupt function.

Definition at line 792 of file rtc.c.

## ◆ RTC_DisableSpareRegister()

void RTC_DisableSpareRegister | ( | void |  | ) |

Disable Spare Register.

Parameters

  None |

Returns
  None

This API is used to disable the spare register 0~19 cannot be accessed.

Definition at line 825 of file rtc.c.

## ◆ RTC_DynamicTamperConfig()

void RTC_DynamicTamperConfig | ( | uint32_t | u32ChangeRate,
|  | uint32_t | u32SeedReload,
|  | uint32_t | u32RefPattern,
|  | uint32_t | u32Seed
| ) |  |

Config dynamic tamper.

Parameters

  [in] | u32ChangeRate | The dynamic tamper output change rate RTC_2POW10_CLK RTC_2POW11_CLK RTC_2POW12_CLK RTC_2POW13_CLK RTC_2POW14_CLK RTC_2POW15_CLK RTC_2POW16_CLK RTC_2POW17_CLK
  [in] | u32SeedReload | Reload new seed or not 0: not reload new seed 1: reload new seed
  [in] | u32RefPattern | Reference pattern REF_RANDOM_PATTERN REF_PREVIOUS_PATTERN REF_SEED
  [in] | u32Seed | Seed Value (0x0 ~ 0xFFFFFFFF)

Returns
  None

This API is used to config dynamic tamper setting.

Definition at line 1072 of file rtc.c.

## ◆ RTC_DynamicTamperDisable()

void RTC_DynamicTamperDisable | ( | uint32_t | u32PairSel | ) |

Dynamic Tamper Disable.

Parameters

  [in] | u32PairSel | Tamper pin detection enable. Possible options are RTC_PAIR0_SELECT RTC_PAIR1_SELECT RTC_PAIR2_SELECT

Returns
  None

This API is used to disable the dynamic tamper.

Definition at line 1008 of file rtc.c.

## ◆ RTC_DynamicTamperEnable()

void RTC_DynamicTamperEnable | ( | uint32_t | u32PairSel,
|  | uint32_t | u32DebounceEn,
|  | uint32_t | u32Pair1Source,
|  | uint32_t | u32Pair2Source
| ) |  |

Dynamic Tamper Detect.

Parameters

  [in] | u32PairSel | Tamper pin detection enable. Possible options are RTC_PAIR0_SELECT RTC_PAIR1_SELECT RTC_PAIR2_SELECT
  [in] | u32DebounceEn | Tamper pin de-bounce enable RTC_TAMPER_DEBOUNCE_ENABLE RTC_TAMPER_DEBOUNCE_DISABLE
  [in] | u32Pair1Source | Dynamic Pair 1 Input Source Select 0: Pair 1 source select tamper 2 1: Pair 1 source select tamper 0
  [in] | u32Pair2Source | Dynamic Pair 2 Input Source Select 0: Pair 2 source select tamper 4 1: Pair 2 source select tamper 0

Returns
  None

This API is used to enable the dynamic tamper.

Definition at line 943 of file rtc.c.

## ◆ RTC_EnableInt()

void RTC_EnableInt | ( | uint32_t | u32IntFlagMask | ) |

Enable RTC Interrupt.

Parameters

  [in] | u32IntFlagMask | Specify the interrupt source. It consists of: RTC_INTEN_ALMIEN_Msk : Alarm interrupt RTC_INTEN_TICKIEN_Msk : Tick interrupt RTC_INTEN_TAMP0IEN_Msk : Tamper 0 Pin Event Detection interrupt RTC_INTEN_TAMP1IEN_Msk : Tamper 1 Pin Event Detection interrupt RTC_INTEN_TAMP2IEN_Msk : Tamper 2 Pin Event Detection interrupt RTC_INTEN_TAMP3IEN_Msk : Tamper 3 Pin Event Detection interrupt RTC_INTEN_TAMP4IEN_Msk : Tamper 4 Pin Event Detection interrupt RTC_INTEN_TAMP5IEN_Msk : Tamper 5 Pin Event Detection interrupt

Returns
  None

This API is used to enable the specify RTC interrupt function.

Definition at line 769 of file rtc.c.

## ◆ RTC_EnableSpareAccess()

void RTC_EnableSpareAccess | ( | void |  | ) |

Enable Spare Registers Access.

Parameters

  None |

Returns
  None

This API is used to enable the spare registers 0~19 can be accessed.

Definition at line 809 of file rtc.c.

## ◆ RTC_GetAlarmDateAndTime()

void RTC_GetAlarmDateAndTime | ( | S_RTC_TIME_DATA_T * | sPt | ) |

Get RTC Alarm Date and Time.

Parameters

  [out] | sPt | The returned pointer is specified the RTC alarm value. 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]

Returns
  None

This API is used to get the RTC alarm date and time setting.

Definition at line 265 of file rtc.c.

## ◆ RTC_GetDateAndTime()

void RTC_GetDateAndTime | ( | S_RTC_TIME_DATA_T * | sPt | ) |

Get Current RTC Date and Time.

Parameters

  [out] | sPt | The returned pointer is specified the current RTC value. 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]

Returns
  None

This API is used to get the current RTC date and time value.

Definition at line 170 of file rtc.c.

## ◆ RTC_GetDayOfWeek()

uint32_t RTC_GetDayOfWeek | ( | void |  | ) |

Get Day of the Week.

Parameters

  None |

Return values

  0 | Sunday
  1 | Monday
  2 | Tuesday
  3 | Wednesday
  4 | Thursday
  5 | Friday
  6 | Saturday

This API is used to get day of the week of current RTC date.

Definition at line 722 of file rtc.c.

## ◆ RTC_Open()

void RTC_Open | ( | S_RTC_TIME_DATA_T * | sPt | ) |

Initialize RTC module and start counting.

Parameters

  [in] | sPt | Specify the time property and current date and time. It includes: u32Year: Year value, range between 2000 ~ 2099. u32Month: Month value, range between 1 ~ 12. u32Day: Day value, range between 1 ~ 31. u32DayOfWeek: Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / RTC_SATURDAY] u32Hour: Hour value, range between 0 ~ 23. u32Minute: Minute value, range between 0 ~ 59. u32Second: Second value, range between 0 ~ 59. u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] u8AmPm: [RTC_AM / RTC_PM]

Returns
  None

This function is used to:

1. Write initial key to let RTC start count.
2. Input parameter indicates start date/time.
3. User has to make sure that parameters of RTC date/time are reasonable.
   Note
     Null pointer for using default starting date/time.

Definition at line 66 of file rtc.c.

## ◆ RTC_SetAlarmDate()

void RTC_SetAlarmDate | ( | uint32_t | u32Year,
|  | uint32_t | u32Month,
|  | uint32_t | u32Day
| ) |  |

Update RTC Alarm Date.

Parameters

  [in] | u32Year | The year calendar digit of RTC alarm setting.
  [in] | u32Month | The month calendar digit of RTC alarm setting.
  [in] | u32Day | The day calendar digit of RTC alarm setting.

Returns
  None

This API is used to update alarm date setting to RTC.

Definition at line 592 of file rtc.c.

## ◆ RTC_SetAlarmDateAndTime()

void RTC_SetAlarmDateAndTime | ( | S_RTC_TIME_DATA_T * | sPt | ) |

Update RTC Alarm Date and Time.

Parameters

  [in] | sPt | Specify the time property and alarm date and time. It includes: u32Year: Year value, range between 2000 ~ 2099. u32Month: Month value, range between 1 ~ 12. u32Day: Day value, range between 1 ~ 31. u32DayOfWeek: Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / RTC_SATURDAY] u32Hour: Hour value, range between 0 ~ 23. u32Minute: Minute value, range between 0 ~ 59. u32Second: Second value, range between 0 ~ 59. u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] u8AmPm: [RTC_AM / RTC_PM]

Returns
  None

This API is used to update alarm date and time setting to RTC.

Definition at line 446 of file rtc.c.

## ◆ RTC_SetAlarmDateMask()

void RTC_SetAlarmDateMask | ( | uint8_t | u8IsTenYMsk,
|  | uint8_t | u8IsYMsk,
|  | uint8_t | u8IsTenMMsk,
|  | uint8_t | u8IsMMsk,
|  | uint8_t | u8IsTenDMsk,
|  | uint8_t | u8IsDMsk
| ) |  |

Set RTC Alarm Date Mask Function.

Parameters

  [in] | u8IsTenYMsk | 1: enable 10-Year digit alarm mask; 0: disabled.
  [in] | u8IsYMsk | 1: enable 1-Year digit alarm mask; 0: disabled.
  [in] | u8IsTenMMsk | 1: enable 10-Mon digit alarm mask; 0: disabled.
  [in] | u8IsMMsk | 1: enable 1-Mon digit alarm mask; 0: disabled.
  [in] | u8IsTenDMsk | 1: enable 10-Day digit alarm mask; 0: disabled.
  [in] | u8IsDMsk | 1: enable 1-Day digit alarm mask; 0: disabled.

Returns
  None

This API is used to enable or disable RTC alarm date mask function.

Definition at line 671 of file rtc.c.

## ◆ RTC_SetAlarmTime()

void RTC_SetAlarmTime | ( | uint32_t | u32Hour,
|  | uint32_t | u32Minute,
|  | uint32_t | u32Second,
|  | uint32_t | u32TimeMode,
|  | uint32_t | u32AmPm
| ) |  |

Update RTC Alarm Time.

Parameters

  [in] | u32Hour | The hour time digit of RTC alarm setting.
  [in] | u32Minute | The minute time digit of RTC alarm setting.
  [in] | u32Second | The second time digit of RTC 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]

Returns
  None

This API is used to update alarm time setting to RTC.

Definition at line 622 of file rtc.c.

## ◆ RTC_SetAlarmTimeMask()

void RTC_SetAlarmTimeMask | ( | uint8_t | u8IsTenHMsk,
|  | uint8_t | u8IsHMsk,
|  | uint8_t | u8IsTenMMsk,
|  | uint8_t | u8IsMMsk,
|  | uint8_t | u8IsTenSMsk,
|  | uint8_t | u8IsSMsk
| ) |  |

Set RTC Alarm Time Mask Function.

Parameters

  [in] | u8IsTenHMsk | 1: enable 10-Hour digit alarm mask; 0: disabled.
  [in] | u8IsHMsk | 1: enable 1-Hour digit alarm mask; 0: disabled.
  [in] | u8IsTenMMsk | 1: enable 10-Min digit alarm mask; 0: disabled.
  [in] | u8IsMMsk | 1: enable 1-Min digit alarm mask; 0: disabled.
  [in] | u8IsTenSMsk | 1: enable 10-Sec digit alarm mask; 0: disabled.
  [in] | u8IsSMsk | 1: enable 1-Sec digit alarm mask; 0: disabled.

Returns
  None

This API is used to enable or disable RTC alarm time mask function.

Definition at line 696 of file rtc.c.

## ◆ RTC_SetDate()

void RTC_SetDate | ( | uint32_t | u32Year,
|  | uint32_t | u32Month,
|  | uint32_t | u32Day,
|  | uint32_t | u32DayOfWeek
| ) |  |

Update RTC Current Date.

Parameters

  [in] | u32Year | The year calendar digit of current RTC setting.
  [in] | u32Month | The month calendar digit of current RTC setting.
  [in] | u32Day | The day calendar digit of current RTC setting.
  [in] | u32DayOfWeek | The Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / RTC_SATURDAY]

Returns
  None

This API is used to update current date to RTC.

Definition at line 514 of file rtc.c.

## ◆ RTC_SetDateAndTime()

void RTC_SetDateAndTime | ( | S_RTC_TIME_DATA_T * | sPt | ) |

Update Current RTC Date and Time.

Parameters

  [in] | sPt | Specify the time property and current date and time. It includes: u32Year: Year value, range between 2000 ~ 2099. u32Month: Month value, range between 1 ~ 12. u32Day: Day value, range between 1 ~ 31. u32DayOfWeek: Day of the week. [RTC_SUNDAY / RTC_MONDAY / RTC_TUESDAY / RTC_WEDNESDAY / RTC_THURSDAY / RTC_FRIDAY / RTC_SATURDAY] u32Hour: Hour value, range between 0 ~ 23. u32Minute: Minute value, range between 0 ~ 59. u32Second: Second value, range between 0 ~ 59. u32TimeScale: [RTC_CLOCK_12 / RTC_CLOCK_24] u8AmPm: [RTC_AM / RTC_PM]

Returns
  None

This API is used to update current date and time to RTC.

Definition at line 365 of file rtc.c.

## ◆ RTC_SetTickPeriod()

void RTC_SetTickPeriod | ( | uint32_t | u32TickSelection | ) |

Set RTC Tick Period Time.

Parameters

  [in] | u32TickSelection | It is used to set the RTC tick period time for Periodic Time Tick 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

Returns
  None

This API is used to set RTC tick period time for each tick interrupt.

Definition at line 745 of file rtc.c.

## ◆ RTC_SetTime()

void RTC_SetTime | ( | uint32_t | u32Hour,
|  | uint32_t | u32Minute,
|  | uint32_t | u32Second,
|  | uint32_t | u32TimeMode,
|  | uint32_t | u32AmPm
| ) |  |

Update RTC Current Time.

Parameters

  [in] | u32Hour | The hour time digit of current RTC setting.
  [in] | u32Minute | The minute time digit of current RTC setting.
  [in] | u32Second | The second time digit of current RTC 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]

Returns
  None

This API is used to update current time to RTC.

Definition at line 547 of file rtc.c.

## ◆ RTC_StaticTamperDisable()

void RTC_StaticTamperDisable | ( | uint32_t | u32TamperSelect | ) |

Static Tamper Disable.

Parameters

  [in] | u32TamperSelect | Tamper pin select. Possible options are RTC_TAMPER5_SELECT RTC_TAMPER4_SELECT RTC_TAMPER3_SELECT RTC_TAMPER2_SELECT RTC_TAMPER1_SELECT RTC_TAMPER0_SELECT

Returns
  None

This API is used to disable the static tamper pin detect.

Definition at line 896 of file rtc.c.

## ◆ RTC_StaticTamperEnable()

void RTC_StaticTamperEnable | ( | uint32_t | u32TamperSelect,
|  | uint32_t | u32DetecLevel,
|  | uint32_t | u32DebounceEn
| ) |  |

Static Tamper Detect.

Parameters

  [in] | u32TamperSelect | Tamper pin select. Possible options are RTC_TAMPER5_SELECT RTC_TAMPER4_SELECT RTC_TAMPER3_SELECT RTC_TAMPER2_SELECT RTC_TAMPER1_SELECT RTC_TAMPER0_SELECT
  [in] | u32DetecLevel | Tamper pin detection level select. Possible options are RTC_TAMPER_HIGH_LEVEL_DETECT RTC_TAMPER_LOW_LEVEL_DETECT
  [in] | u32DebounceEn | Tamper pin de-bounce enable RTC_TAMPER_DEBOUNCE_ENABLE RTC_TAMPER_DEBOUNCE_DISABLE

Returns
  None

This API is used to enable the tamper pin detect function with specify trigger condition.

Definition at line 855 of file rtc.c.

## ◆ RTC_WaitAccessEnable()

__STATIC_INLINE void RTC_WaitAccessEnable | ( | void |  | ) |

Wait RTC Access Enable.

Parameters

  None |

Returns
  None

This function is used to enable the maximum RTC read/write accessible time.

Definition at line 287 of file rtc.h.