RTC_Private_Functions
[RTC]

Functions

void RTC_ClearFlag (uint16_t RTC_FLAG)
 Clears the RTCís pending flags.
void RTC_ClearITPendingBit (uint16_t RTC_IT)
 Clears the RTCís interrupt pending bits.
void RTC_EnterConfigMode (void)
 Enters the RTC configuration mode.
void RTC_ExitConfigMode (void)
 Exits from the RTC configuration mode.
uint32_t RTC_GetCounter (void)
 Gets the RTC counter value.
uint32_t RTC_GetDivider (void)
 Gets the RTC divider value.
FlagStatus RTC_GetFlagStatus (uint16_t RTC_FLAG)
 Checks whether the specified RTC flag is set or not.
ITStatus RTC_GetITStatus (uint16_t RTC_IT)
 Checks whether the specified RTC interrupt has occured or not.
void RTC_ITConfig (uint16_t RTC_IT, FunctionalState NewState)
 Enables or disables the specified RTC interrupts.
void RTC_SetAlarm (uint32_t AlarmValue)
 Sets the RTC alarm value.
void RTC_SetCounter (uint32_t CounterValue)
 Sets the RTC counter value.
void RTC_SetPrescaler (uint32_t PrescalerValue)
 Sets the RTC prescaler value.
void RTC_WaitForLastTask (void)
 Waits until last write operation on RTC registers has finished.
void RTC_WaitForSynchro (void)
 Waits until the RTC registers (RTC_CNT, RTC_ALR and RTC_PRL) are synchronized with RTC APB clock.

Function Documentation

void RTC_ClearFlag ( uint16_t  RTC_FLAG  ) 

Clears the RTCís pending flags.

Parameters:
RTC_FLAG,: specifies the flag to clear. This parameter can be any combination of the following values:

  • RTC_FLAG_RSF: Registers Synchronized flag. This flag is cleared only after an APB reset or an APB Clock stop.
  • RTC_FLAG_OW: Overflow flag
  • RTC_FLAG_ALR: Alarm flag
  • RTC_FLAG_SEC: Second flag
Return values:
None 

Definition at line 272 of file stm32f10x_rtc.c.

References assert_param, IS_RTC_CLEAR_FLAG, and RTC.

Referenced by EXTI9_5_IRQHandler(), and main().

void RTC_ClearITPendingBit ( uint16_t  RTC_IT  ) 

Clears the RTCís interrupt pending bits.

Parameters:
RTC_IT,: specifies the interrupt pending bit to clear. This parameter can be any combination of the following values:

  • RTC_IT_OW: Overflow interrupt
  • RTC_IT_ALR: Alarm interrupt
  • RTC_IT_SEC: Second interrupt
Return values:
None 

Definition at line 317 of file stm32f10x_rtc.c.

References assert_param, IS_RTC_IT, and RTC.

Referenced by RTC_IRQHandler(), and RTCAlarm_IRQHandler().

void RTC_EnterConfigMode ( void   ) 

Enters the RTC configuration mode.

Parameters:
None 
Return values:
None 

Definition at line 110 of file stm32f10x_rtc.c.

References RTC, and RTC_CRL_CNF.

Referenced by RTC_SetAlarm(), RTC_SetCounter(), and RTC_SetPrescaler().

void RTC_ExitConfigMode ( void   ) 

Exits from the RTC configuration mode.

Parameters:
None 
Return values:
None 

Definition at line 121 of file stm32f10x_rtc.c.

References RTC, and RTC_CRL_CNF.

Referenced by RTC_SetAlarm(), RTC_SetCounter(), and RTC_SetPrescaler().

uint32_t RTC_GetCounter ( void   ) 

Gets the RTC counter value.

Parameters:
None 
Return values:
RTC counter value.

Definition at line 132 of file stm32f10x_rtc.c.

References RTC.

Referenced by EXTI9_5_IRQHandler(), main(), Time_Display(), and Time_Show().

uint32_t RTC_GetDivider ( void   ) 

Gets the RTC divider value.

Parameters:
None 
Return values:
RTC Divider value.

Definition at line 192 of file stm32f10x_rtc.c.

References RTC.

FlagStatus RTC_GetFlagStatus ( uint16_t  RTC_FLAG  ) 

Checks whether the specified RTC flag is set or not.

Parameters:
RTC_FLAG,: specifies the flag to check. This parameter can be one the following values:

  • RTC_FLAG_RTOFF: RTC Operation OFF flag
  • RTC_FLAG_RSF: Registers Synchronized flag
  • RTC_FLAG_OW: Overflow flag
  • RTC_FLAG_ALR: Alarm flag
  • RTC_FLAG_SEC: Second flag
Return values:
The new state of RTC_FLAG (SET or RESET).

Definition at line 243 of file stm32f10x_rtc.c.

References assert_param, IS_RTC_GET_FLAG, RESET, RTC, and SET.

Referenced by EXTI9_5_IRQHandler(), and main().

ITStatus RTC_GetITStatus ( uint16_t  RTC_IT  ) 

Checks whether the specified RTC interrupt has occured or not.

Parameters:
RTC_IT,: specifies the RTC interrupts sources to check. This parameter can be one of the following values:

  • RTC_IT_OW: Overflow interrupt
  • RTC_IT_ALR: Alarm interrupt
  • RTC_IT_SEC: Second interrupt
Return values:
The new state of the RTC_IT (SET or RESET).

Definition at line 290 of file stm32f10x_rtc.c.

References assert_param, IS_RTC_GET_IT, RESET, RTC, and SET.

Referenced by RTC_IRQHandler(), and RTCAlarm_IRQHandler().

void RTC_ITConfig ( uint16_t  RTC_IT,
FunctionalState  NewState 
)

Enables or disables the specified RTC interrupts.

Parameters:
RTC_IT,: specifies the RTC interrupts sources to be enabled or disabled. This parameter can be any combination of the following values:

  • RTC_IT_OW: Overflow interrupt
  • RTC_IT_ALR: Alarm interrupt
  • RTC_IT_SEC: Second interrupt
NewState,: new state of the specified RTC interrupts. This parameter can be: ENABLE or DISABLE.
Return values:
None 

Definition at line 89 of file stm32f10x_rtc.c.

References assert_param, DISABLE, IS_FUNCTIONAL_STATE, IS_RTC_IT, and RTC.

Referenced by main(), and RTC_Configuration().

void RTC_SetAlarm ( uint32_t  AlarmValue  ) 

Sets the RTC alarm value.

Parameters:
AlarmValue,: RTC alarm new value.
Return values:
None 

Definition at line 177 of file stm32f10x_rtc.c.

References RTC, RTC_EnterConfigMode(), RTC_ExitConfigMode(), and RTC_LSB_MASK.

Referenced by EXTI9_5_IRQHandler(), and main().

void RTC_SetCounter ( uint32_t  CounterValue  ) 

Sets the RTC counter value.

Parameters:
CounterValue,: RTC counter new value.
Return values:
None 

Definition at line 144 of file stm32f10x_rtc.c.

References RTC, RTC_EnterConfigMode(), RTC_ExitConfigMode(), and RTC_LSB_MASK.

Referenced by Time_Adjust(), and Time_Display().

void RTC_SetPrescaler ( uint32_t  PrescalerValue  ) 

Sets the RTC prescaler value.

Parameters:
PrescalerValue,: RTC prescaler new value.
Return values:
None 

Definition at line 159 of file stm32f10x_rtc.c.

References assert_param, IS_RTC_PRESCALER, PRLH_MSB_MASK, RTC, RTC_EnterConfigMode(), RTC_ExitConfigMode(), and RTC_LSB_MASK.

Referenced by main(), and RTC_Configuration().

void RTC_WaitForLastTask ( void   ) 

Waits until last write operation on RTC registers has finished.

Note:
This function must be called before any write to RTC registers.
Parameters:
None 
Return values:
None 

Definition at line 206 of file stm32f10x_rtc.c.

References RESET, RTC, and RTC_FLAG_RTOFF.

Referenced by EXTI9_5_IRQHandler(), main(), RTC_Configuration(), RTC_IRQHandler(), RTCAlarm_IRQHandler(), Time_Adjust(), and Time_Display().

void RTC_WaitForSynchro ( void   ) 

Waits until the RTC registers (RTC_CNT, RTC_ALR and RTC_PRL) are synchronized with RTC APB clock.

Note:
This function must be called before any read operation after an APB reset or an APB clock stop.
Parameters:
None 
Return values:
None 

Definition at line 222 of file stm32f10x_rtc.c.

References RESET, RTC, and RTC_FLAG_RSF.

Referenced by main(), and RTC_Configuration().

STM32F10x Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM32(CORTEX M3) 32-bit Microcontrollers platform visit  www.st.com/STM32