Interrupts and flags management functions.
More...
Interrupts and flags management functions.
===============================================================================
Interrupts and flags management functions
===============================================================================
All RTC interrupts are connected to the EXTI controller.
- To enable the RTC Alarm interrupt, the following sequence is required:
- Configure and enable the EXTI Line 17 in interrupt mode and select the rising
edge sensitivity using the EXTI_Init() function.
- Configure and enable the RTC_Alarm IRQ channel in the NVIC using the NVIC_Init()
function.
- Configure the RTC to generate RTC alarms (Alarm A and/or Alarm B) using
the RTC_SetAlarm() and RTC_AlarmCmd() functions.
- To enable the RTC Wakeup interrupt, the following sequence is required:
- Configure and enable the EXTI Line 22 in interrupt mode and select the rising
edge sensitivity using the EXTI_Init() function.
- Configure and enable the RTC_WKUP IRQ channel in the NVIC using the NVIC_Init()
function.
- Configure the RTC to generate the RTC wakeup timer event using the
RTC_WakeUpClockConfig(), RTC_SetWakeUpCounter() and RTC_WakeUpCmd() functions.
- To enable the RTC Tamper interrupt, the following sequence is required:
- Configure and enable the EXTI Line 21 in interrupt mode and select the rising
edge sensitivity using the EXTI_Init() function.
- Configure and enable the TAMP_STAMP IRQ channel in the NVIC using the NVIC_Init()
function.
- Configure the RTC to detect the RTC tamper event using the
RTC_TamperTriggerConfig() and RTC_TamperCmd() functions.
- To enable the RTC TimeStamp interrupt, the following sequence is required:
- Configure and enable the EXTI Line 21 in interrupt mode and select the rising
edge sensitivity using the EXTI_Init() function.
- Configure and enable the TAMP_STAMP IRQ channel in the NVIC using the NVIC_Init()
function.
- Configure the RTC to detect the RTC time-stamp event using the
RTC_TimeStampCmd() functions.
void RTC_ClearFlag |
( |
uint32_t |
RTC_FLAG | ) |
|
Clears the RTC's pending flags.
- Parameters
-
RTC_FLAG,: | specifies the RTC flag to clear. This parameter can be any combination of the following values:
- RTC_FLAG_TAMP1F: Tamper 1 event flag
- RTC_FLAG_TSOVF: Time Stamp Overflow flag
- RTC_FLAG_TSF: Time Stamp event flag
- RTC_FLAG_WUTF: WakeUp Timer flag
- RTC_FLAG_ALRBF: Alarm B flag
- RTC_FLAG_ALRAF: Alarm A flag
- RTC_FLAG_RSF: Registers Synchronized flag
|
- Return values
-
void RTC_ClearITPendingBit |
( |
uint32_t |
RTC_IT | ) |
|
Clears the RTC's interrupt pending bits.
- Parameters
-
RTC_IT,: | specifies the RTC interrupt pending bit to clear. This parameter can be any combination of the following values:
- RTC_IT_TS: Time Stamp interrupt
- RTC_IT_WUT: WakeUp Timer interrupt
- RTC_IT_ALRB: Alarm B interrupt
- RTC_IT_ALRA: Alarm A interrupt
- RTC_IT_TAMP1: Tamper 1 event interrupt
|
- Return values
-
FlagStatus RTC_GetFlagStatus |
( |
uint32_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 of the following values:
- RTC_FLAG_RECALPF: RECALPF event flag.
- RTC_FLAG_TAMP1F: Tamper 1 event flag
- RTC_FLAG_TSOVF: Time Stamp OverFlow flag
- RTC_FLAG_TSF: Time Stamp event flag
- RTC_FLAG_WUTF: WakeUp Timer flag
- RTC_FLAG_ALRBF: Alarm B flag
- RTC_FLAG_ALRAF: Alarm A flag
- RTC_FLAG_INITF: Initialization mode flag
- RTC_FLAG_RSF: Registers Synchronized flag
- RTC_FLAG_INITS: Registers Configured flag
- RTC_FLAG_SHPF: Shift operation pending flag.
- RTC_FLAG_WUTWF: WakeUp Timer Write flag
- RTC_FLAG_ALRBWF: Alarm B Write flag
- RTC_FLAG_ALRAWF: Alarm A write flag
|
- Return values
-
The | new state of RTC_FLAG (SET or RESET). |
ITStatus RTC_GetITStatus |
( |
uint32_t |
RTC_IT | ) |
|
Checks whether the specified RTC interrupt has occurred or not.
- Parameters
-
RTC_IT,: | specifies the RTC interrupt source to check. This parameter can be one of the following values:
- RTC_IT_TS: Time Stamp interrupt
- RTC_IT_WUT: WakeUp Timer interrupt
- RTC_IT_ALRB: Alarm B interrupt
- RTC_IT_ALRA: Alarm A interrupt
- RTC_IT_TAMP1: Tamper 1 event interrupt
|
- Return values
-
The | new state of RTC_IT (SET or RESET). |
void RTC_ITConfig |
( |
uint32_t |
RTC_IT, |
|
|
FunctionalState |
NewState |
|
) |
| |
Enables or disables the specified RTC interrupts.
- Parameters
-
RTC_IT,: | specifies the RTC interrupt sources to be enabled or disabled. This parameter can be any combination of the following values:
- RTC_IT_TS: Time Stamp interrupt mask
- RTC_IT_WUT: WakeUp Timer interrupt mask
- RTC_IT_ALRB: Alarm B interrupt mask
- RTC_IT_ALRA: Alarm A interrupt mask
- RTC_IT_TAMP: Tamper event interrupt mask
|
NewState,: | new state of the specified RTC interrupts. This parameter can be: ENABLE or DISABLE. |
- Return values
-