STM32F4xx HAL Documentation
Hardware Abstraction Layer for STM32F4 familiy
Loading...
Searching...
No Matches

RTC Alarm functions. More...

Collaboration diagram for RTC Alarm functions:

Functions

HAL_StatusTypeDef HAL_RTC_SetAlarm (RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Format)
 Sets the specified RTC Alarm.
 
HAL_StatusTypeDef HAL_RTC_SetAlarm_IT (RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Format)
 Sets the specified RTC Alarm with Interrupt.
 
HAL_StatusTypeDef HAL_RTC_DeactivateAlarm (RTC_HandleTypeDef *hrtc, uint32_t Alarm)
 Deactivates the specified RTC Alarm.
 
HAL_StatusTypeDef HAL_RTC_GetAlarm (RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Alarm, uint32_t Format)
 Gets the RTC Alarm value and masks.
 
void HAL_RTC_AlarmIRQHandler (RTC_HandleTypeDef *hrtc)
 Handles Alarm interrupt request.
 
HAL_StatusTypeDef HAL_RTC_PollForAlarmAEvent (RTC_HandleTypeDef *hrtc, uint32_t Timeout)
 Handles Alarm A Polling request.
 
void HAL_RTC_AlarmAEventCallback (RTC_HandleTypeDef *hrtc)
 Alarm A callback.
 

Detailed Description

RTC Alarm functions.

 ===============================================================================
                 ##### RTC Alarm functions #####
 ===============================================================================

 [..] This section provides functions allowing to configure Alarm feature

Function Documentation

◆ HAL_RTC_SetAlarm()

HAL_StatusTypeDef HAL_RTC_SetAlarm ( RTC_HandleTypeDef * hrtc,
RTC_AlarmTypeDef * sAlarm,
uint32_t Format )

#include <stm32f4xx_hal_rtc.h>

Sets the specified RTC Alarm.

Parameters
hrtcpointer to a RTC_HandleTypeDef structure that contains the configuration information for RTC.
sAlarmPointer to Alarm structure
FormatSpecifies the format of the entered parameters. This parameter can be one of the following values:
  • RTC_FORMAT_BIN: Binary data format
  • RTC_FORMAT_BCD: BCD data format
Note
The Alarm register can only be written when the corresponding Alarm is disabled (Use the HAL_RTC_DeactivateAlarm()).
The HAL_RTC_SetTime() must be called before enabling the Alarm feature.
Return values
HALstatus

Definition at line 1004 of file stm32f4xx_hal_rtc.c.

References __HAL_LOCK, __HAL_RTC_ALARM_CLEAR_FLAG, __HAL_RTC_ALARM_DISABLE_IT, __HAL_RTC_ALARM_GET_FLAG, __HAL_RTC_ALARMA_DISABLE, __HAL_RTC_ALARMA_ENABLE, __HAL_RTC_ALARMB_DISABLE, __HAL_RTC_ALARMB_ENABLE, __HAL_RTC_WRITEPROTECTION_DISABLE, __HAL_RTC_WRITEPROTECTION_ENABLE, __HAL_UNLOCK, RTC_AlarmTypeDef::Alarm, RTC_AlarmTypeDef::AlarmDateWeekDay, RTC_AlarmTypeDef::AlarmDateWeekDaySel, RTC_AlarmTypeDef::AlarmMask, RTC_AlarmTypeDef::AlarmSubSecondMask, RTC_AlarmTypeDef::AlarmTime, assert_param, HAL_GetTick(), HAL_OK, HAL_RTC_STATE_BUSY, HAL_RTC_STATE_READY, HAL_RTC_STATE_TIMEOUT, HAL_TIMEOUT, RTC_TimeTypeDef::Hours, RTC_HandleTypeDef::Instance, IS_RTC_ALARM, IS_RTC_ALARM_DATE_WEEKDAY_DATE, IS_RTC_ALARM_DATE_WEEKDAY_SEL, IS_RTC_ALARM_DATE_WEEKDAY_WEEKDAY, IS_RTC_ALARM_MASK, IS_RTC_ALARM_SUB_SECOND_MASK, IS_RTC_ALARM_SUB_SECOND_VALUE, IS_RTC_FORMAT, IS_RTC_HOUR12, IS_RTC_HOUR24, IS_RTC_HOURFORMAT12, IS_RTC_MINUTES, IS_RTC_SECONDS, RTC_TimeTypeDef::Minutes, RTC_ALARM_A, RTC_ALARMDATEWEEKDAYSEL_DATE, RTC_Bcd2ToByte(), RTC_ByteToBcd2(), RTC_FLAG_ALRAF, RTC_FLAG_ALRAWF, RTC_FLAG_ALRBF, RTC_FLAG_ALRBWF, RTC_FORMAT_BIN, RTC_IT_ALRA, RTC_IT_ALRB, RTC_TIMEOUT_VALUE, RTC_TimeTypeDef::Seconds, RTC_HandleTypeDef::State, RTC_TimeTypeDef::SubSeconds, and RTC_TimeTypeDef::TimeFormat.

◆ HAL_RTC_SetAlarm_IT()

HAL_StatusTypeDef HAL_RTC_SetAlarm_IT ( RTC_HandleTypeDef * hrtc,
RTC_AlarmTypeDef * sAlarm,
uint32_t Format )

#include <stm32f4xx_hal_rtc.h>

Sets the specified RTC Alarm with Interrupt.

Parameters
hrtcpointer to a RTC_HandleTypeDef structure that contains the configuration information for RTC.
sAlarmPointer to Alarm structure
FormatSpecifies the format of the entered parameters. This parameter can be one of the following values:
  • RTC_FORMAT_BIN: Binary data format
  • RTC_FORMAT_BCD: BCD data format
Note
The Alarm register can only be written when the corresponding Alarm is disabled (Use the HAL_RTC_DeactivateAlarm()).
The HAL_RTC_SetTime() must be called before enabling the Alarm feature.
Return values
HALstatus

Definition at line 1201 of file stm32f4xx_hal_rtc.c.

References __HAL_LOCK, __HAL_RTC_ALARM_CLEAR_FLAG, __HAL_RTC_ALARM_ENABLE_IT, __HAL_RTC_ALARM_EXTI_ENABLE_IT, __HAL_RTC_ALARM_EXTI_ENABLE_RISING_EDGE, __HAL_RTC_ALARM_GET_FLAG, __HAL_RTC_ALARMA_DISABLE, __HAL_RTC_ALARMA_ENABLE, __HAL_RTC_ALARMB_DISABLE, __HAL_RTC_ALARMB_ENABLE, __HAL_RTC_WRITEPROTECTION_DISABLE, __HAL_RTC_WRITEPROTECTION_ENABLE, __HAL_UNLOCK, RTC_AlarmTypeDef::Alarm, RTC_AlarmTypeDef::AlarmDateWeekDay, RTC_AlarmTypeDef::AlarmDateWeekDaySel, RTC_AlarmTypeDef::AlarmMask, RTC_AlarmTypeDef::AlarmSubSecondMask, RTC_AlarmTypeDef::AlarmTime, assert_param, HAL_OK, HAL_RTC_STATE_BUSY, HAL_RTC_STATE_READY, HAL_RTC_STATE_TIMEOUT, HAL_TIMEOUT, RTC_TimeTypeDef::Hours, RTC_HandleTypeDef::Instance, IS_RTC_ALARM, IS_RTC_ALARM_DATE_WEEKDAY_DATE, IS_RTC_ALARM_DATE_WEEKDAY_SEL, IS_RTC_ALARM_DATE_WEEKDAY_WEEKDAY, IS_RTC_ALARM_MASK, IS_RTC_ALARM_SUB_SECOND_MASK, IS_RTC_ALARM_SUB_SECOND_VALUE, IS_RTC_FORMAT, IS_RTC_HOUR12, IS_RTC_HOUR24, IS_RTC_HOURFORMAT12, IS_RTC_MINUTES, IS_RTC_SECONDS, RTC_TimeTypeDef::Minutes, RTC_ALARM_A, RTC_ALARMDATEWEEKDAYSEL_DATE, RTC_Bcd2ToByte(), RTC_ByteToBcd2(), RTC_FLAG_ALRAF, RTC_FLAG_ALRAWF, RTC_FLAG_ALRBF, RTC_FLAG_ALRBWF, RTC_FORMAT_BIN, RTC_IT_ALRA, RTC_IT_ALRB, RTC_TIMEOUT_VALUE, RTC_TimeTypeDef::Seconds, RTC_HandleTypeDef::State, RTC_TimeTypeDef::SubSeconds, and RTC_TimeTypeDef::TimeFormat.

◆ HAL_RTC_DeactivateAlarm()

HAL_StatusTypeDef HAL_RTC_DeactivateAlarm ( RTC_HandleTypeDef * hrtc,
uint32_t Alarm )

#include <stm32f4xx_hal_rtc.h>

Deactivates the specified RTC Alarm.

Parameters
hrtcpointer to a RTC_HandleTypeDef structure that contains the configuration information for RTC.
AlarmSpecifies the Alarm. This parameter can be one of the following values:
  • RTC_ALARM_A: Alarm A
  • RTC_ALARM_B: Alarm B
Return values
HALstatus

Definition at line 1395 of file stm32f4xx_hal_rtc.c.

References __HAL_LOCK, __HAL_RTC_ALARM_DISABLE_IT, __HAL_RTC_ALARM_GET_FLAG, __HAL_RTC_ALARMA_DISABLE, __HAL_RTC_ALARMB_DISABLE, __HAL_RTC_WRITEPROTECTION_DISABLE, __HAL_RTC_WRITEPROTECTION_ENABLE, __HAL_UNLOCK, assert_param, HAL_GetTick(), HAL_OK, HAL_RTC_STATE_BUSY, HAL_RTC_STATE_READY, HAL_RTC_STATE_TIMEOUT, HAL_TIMEOUT, IS_RTC_ALARM, RTC_ALARM_A, RTC_FLAG_ALRAWF, RTC_FLAG_ALRBWF, RTC_IT_ALRA, RTC_IT_ALRB, RTC_TIMEOUT_VALUE, and RTC_HandleTypeDef::State.

◆ HAL_RTC_GetAlarm()

HAL_StatusTypeDef HAL_RTC_GetAlarm ( RTC_HandleTypeDef * hrtc,
RTC_AlarmTypeDef * sAlarm,
uint32_t Alarm,
uint32_t Format )

#include <stm32f4xx_hal_rtc.h>

Gets the RTC Alarm value and masks.

Parameters
hrtcpointer to a RTC_HandleTypeDef structure that contains the configuration information for RTC.
sAlarmPointer to Date structure
AlarmSpecifies the Alarm. This parameter can be one of the following values:
  • RTC_ALARM_A: Alarm A
  • RTC_ALARM_B: Alarm B
FormatSpecifies the format of the entered parameters. This parameter can be one of the following values:
  • RTC_FORMAT_BIN: Binary data format
  • RTC_FORMAT_BCD: BCD data format
Return values
HALstatus

Definition at line 1493 of file stm32f4xx_hal_rtc.c.

References RTC_AlarmTypeDef::Alarm, RTC_AlarmTypeDef::AlarmDateWeekDay, RTC_AlarmTypeDef::AlarmDateWeekDaySel, RTC_AlarmTypeDef::AlarmMask, RTC_AlarmTypeDef::AlarmTime, assert_param, HAL_OK, RTC_TimeTypeDef::Hours, RTC_HandleTypeDef::Instance, IS_RTC_ALARM, IS_RTC_FORMAT, RTC_TimeTypeDef::Minutes, RTC_ALARM_A, RTC_ALARM_B, RTC_ALARMMASK_ALL, RTC_Bcd2ToByte(), RTC_FORMAT_BIN, RTC_TimeTypeDef::Seconds, RTC_TimeTypeDef::SubSeconds, and RTC_TimeTypeDef::TimeFormat.

◆ HAL_RTC_AlarmIRQHandler()

void HAL_RTC_AlarmIRQHandler ( RTC_HandleTypeDef * hrtc)

#include <stm32f4xx_hal_rtc.h>

Handles Alarm interrupt request.

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

Definition at line 1544 of file stm32f4xx_hal_rtc.c.

References __HAL_RTC_ALARM_CLEAR_FLAG, __HAL_RTC_ALARM_EXTI_CLEAR_FLAG, __HAL_RTC_ALARM_GET_FLAG, __HAL_RTC_ALARM_GET_IT_SOURCE, HAL_RTC_AlarmAEventCallback(), HAL_RTC_STATE_READY, HAL_RTCEx_AlarmBEventCallback(), RTC_FLAG_ALRAF, RTC_FLAG_ALRBF, RTC_IT_ALRA, RTC_IT_ALRB, and RTC_HandleTypeDef::State.

Referenced by RTC_Alarm_IRQHandler().

◆ HAL_RTC_PollForAlarmAEvent()

HAL_StatusTypeDef HAL_RTC_PollForAlarmAEvent ( RTC_HandleTypeDef * hrtc,
uint32_t Timeout )

#include <stm32f4xx_hal_rtc.h>

Handles Alarm A Polling request.

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

Definition at line 1612 of file stm32f4xx_hal_rtc.c.

References __HAL_RTC_ALARM_CLEAR_FLAG, __HAL_RTC_ALARM_GET_FLAG, HAL_GetTick(), HAL_MAX_DELAY, HAL_OK, HAL_RTC_STATE_READY, HAL_RTC_STATE_TIMEOUT, HAL_TIMEOUT, RTC_FLAG_ALRAF, and RTC_HandleTypeDef::State.

◆ HAL_RTC_AlarmAEventCallback()

__weak void HAL_RTC_AlarmAEventCallback ( RTC_HandleTypeDef * hrtc)

#include <stm32f4xx_hal_rtc.h>

Alarm A callback.

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

Definition at line 1595 of file stm32f4xx_hal_rtc.c.

References UNUSED.

Referenced by HAL_RTC_AlarmIRQHandler(), and HAL_RTC_Init().