STM32F103xB HAL User Manual
Functions
RTC Private Functions
RTC

Functions

static uint32_t RTC_ReadTimeCounter (RTC_HandleTypeDef *hrtc)
 Read the time counter available in RTC_CNT registers.
static HAL_StatusTypeDef RTC_WriteTimeCounter (RTC_HandleTypeDef *hrtc, uint32_t TimeCounter)
 Write the time counter in RTC_CNT registers.
static uint32_t RTC_ReadAlarmCounter (RTC_HandleTypeDef *hrtc)
 Read the time counter available in RTC_ALR registers.
static HAL_StatusTypeDef RTC_WriteAlarmCounter (RTC_HandleTypeDef *hrtc, uint32_t AlarmCounter)
 Write the time counter in RTC_ALR registers.
static HAL_StatusTypeDef RTC_EnterInitMode (RTC_HandleTypeDef *hrtc)
 Enters the RTC Initialization mode.
static HAL_StatusTypeDef RTC_ExitInitMode (RTC_HandleTypeDef *hrtc)
 Exit the RTC Initialization mode.
static uint8_t RTC_ByteToBcd2 (uint8_t Value)
 Converts a 2 digit decimal to BCD format.
static uint8_t RTC_Bcd2ToByte (uint8_t Value)
 Converts from 2 digit BCD to Binary.
static uint8_t RTC_IsLeapYear (uint16_t nYear)
 Check whether the passed year is Leap or not.
static void RTC_DateUpdate (RTC_HandleTypeDef *hrtc, uint32_t DayElapsed)
 Updates date when time is 23:59:59.
static uint8_t RTC_WeekDayNum (uint32_t nYear, uint8_t nMonth, uint8_t nDay)
 Determines the week number, the day number and the week day number.

Function Documentation

static uint8_t RTC_Bcd2ToByte ( uint8_t  Value) [static]

Converts from 2 digit BCD to Binary.

Parameters:
Value,:BCD value to be converted
Return values:
Convertedword

Definition at line 1770 of file stm32f1xx_hal_rtc.c.

Referenced by HAL_RTC_SetAlarm(), HAL_RTC_SetAlarm_IT(), HAL_RTC_SetDate(), and HAL_RTC_SetTime().

static uint8_t RTC_ByteToBcd2 ( uint8_t  Value) [static]

Converts a 2 digit decimal to BCD format.

Parameters:
Value,:Byte to be converted
Return values:
Convertedbyte

Definition at line 1752 of file stm32f1xx_hal_rtc.c.

Referenced by HAL_RTC_GetAlarm(), HAL_RTC_GetDate(), and HAL_RTC_GetTime().

static void RTC_DateUpdate ( RTC_HandleTypeDef hrtc,
uint32_t  DayElapsed 
) [static]

Updates date when time is 23:59:59.

Parameters:
hrtcpointer to a RTC_HandleTypeDef structure that contains the configuration information for RTC.
DayElapsed,:Number of days elapsed from last date update
Return values:
None

Definition at line 1784 of file stm32f1xx_hal_rtc.c.

References RTC_DateTypeDef::Date, __RTC_HandleTypeDef::DateToUpdate, RTC_DateTypeDef::Month, RTC_IsLeapYear(), RTC_WeekDayNum(), RTC_DateTypeDef::WeekDay, and RTC_DateTypeDef::Year.

Referenced by HAL_RTC_GetTime().

static HAL_StatusTypeDef RTC_EnterInitMode ( RTC_HandleTypeDef hrtc) [static]

Enters the RTC Initialization mode.

Parameters:
hrtcpointer to a RTC_HandleTypeDef structure that contains the configuration information for RTC.
Return values:
HALstatus

Definition at line 1700 of file stm32f1xx_hal_rtc.c.

References __HAL_RTC_WRITEPROTECTION_DISABLE, HAL_GetTick(), __RTC_HandleTypeDef::Instance, and RTC_TIMEOUT_VALUE.

Referenced by HAL_RTC_DeactivateAlarm(), HAL_RTC_DeInit(), HAL_RTC_Init(), RTC_WriteAlarmCounter(), and RTC_WriteTimeCounter().

static HAL_StatusTypeDef RTC_ExitInitMode ( RTC_HandleTypeDef hrtc) [static]

Exit the RTC Initialization mode.

Parameters:
hrtcpointer to a RTC_HandleTypeDef structure that contains the configuration information for RTC.
Return values:
HALstatus

Definition at line 1727 of file stm32f1xx_hal_rtc.c.

References __HAL_RTC_WRITEPROTECTION_ENABLE, HAL_GetTick(), __RTC_HandleTypeDef::Instance, and RTC_TIMEOUT_VALUE.

Referenced by HAL_RTC_DeactivateAlarm(), HAL_RTC_DeInit(), HAL_RTC_Init(), RTC_WriteAlarmCounter(), and RTC_WriteTimeCounter().

static uint8_t RTC_IsLeapYear ( uint16_t  nYear) [static]

Check whether the passed year is Leap or not.

Parameters:
nYearyear to check
Return values:
1,:leap year 0: not leap year

Definition at line 1879 of file stm32f1xx_hal_rtc.c.

Referenced by RTC_DateUpdate().

static uint32_t RTC_ReadAlarmCounter ( RTC_HandleTypeDef hrtc) [static]

Read the time counter available in RTC_ALR registers.

Parameters:
hrtcpointer to a RTC_HandleTypeDef structure that contains the configuration information for RTC.
Return values:
Timecounter

Definition at line 1651 of file stm32f1xx_hal_rtc.c.

References __RTC_HandleTypeDef::Instance.

Referenced by HAL_RTC_GetAlarm(), HAL_RTC_GetTime(), HAL_RTC_SetDate(), and HAL_RTC_SetTime().

static uint32_t RTC_ReadTimeCounter ( RTC_HandleTypeDef hrtc) [static]

Read the time counter available in RTC_CNT registers.

Parameters:
hrtcpointer to a RTC_HandleTypeDef structure that contains the configuration information for RTC.
Return values:
Timecounter

Definition at line 1587 of file stm32f1xx_hal_rtc.c.

References __RTC_HandleTypeDef::Instance.

Referenced by HAL_RTC_GetTime(), and HAL_RTC_SetDate().

static uint8_t RTC_WeekDayNum ( uint32_t  nYear,
uint8_t  nMonth,
uint8_t  nDay 
) [static]

Determines the week number, the day number and the week day number.

Parameters:
nYearyear to check
nMonthMonth to check
nDayDay to check
Note:
Day is calculated with hypothesis that year > 2000
Return values:
Valuewhich can take one of the following parameters:
  • RTC_WEEKDAY_MONDAY
  • RTC_WEEKDAY_TUESDAY
  • RTC_WEEKDAY_WEDNESDAY
  • RTC_WEEKDAY_THURSDAY
  • RTC_WEEKDAY_FRIDAY
  • RTC_WEEKDAY_SATURDAY
  • RTC_WEEKDAY_SUNDAY

Definition at line 1916 of file stm32f1xx_hal_rtc.c.

Referenced by HAL_RTC_SetDate(), and RTC_DateUpdate().

static HAL_StatusTypeDef RTC_WriteAlarmCounter ( RTC_HandleTypeDef hrtc,
uint32_t  AlarmCounter 
) [static]

Write the time counter in RTC_ALR registers.

Parameters:
hrtcpointer to a RTC_HandleTypeDef structure that contains the configuration information for RTC.
AlarmCounter,:Counter to write in RTC_ALR registers
Return values:
HALstatus

Definition at line 1668 of file stm32f1xx_hal_rtc.c.

References __RTC_HandleTypeDef::Instance, RTC_EnterInitMode(), and RTC_ExitInitMode().

Referenced by HAL_RTC_GetTime(), HAL_RTC_SetAlarm(), HAL_RTC_SetAlarm_IT(), HAL_RTC_SetDate(), and HAL_RTC_SetTime().

static HAL_StatusTypeDef RTC_WriteTimeCounter ( RTC_HandleTypeDef hrtc,
uint32_t  TimeCounter 
) [static]

Write the time counter in RTC_CNT registers.

Parameters:
hrtcpointer to a RTC_HandleTypeDef structure that contains the configuration information for RTC.
TimeCounter,:Counter to write in RTC_CNT registers
Return values:
HALstatus

Definition at line 1619 of file stm32f1xx_hal_rtc.c.

References __RTC_HandleTypeDef::Instance, RTC_EnterInitMode(), and RTC_ExitInitMode().

Referenced by HAL_RTC_GetTime(), HAL_RTC_SetDate(), and HAL_RTC_SetTime().