STM32F4xx HAL Documentation
Hardware Abstraction Layer for STM32F4 familiy
Loading...
Searching...
No Matches
HAL TimeBase RTC Alarm Template
Collaboration diagram for HAL TimeBase RTC Alarm Template:

Macros

#define RTC_CLOCK_SOURCE_HSE
 
#define RTC_ASYNCH_PREDIV   99U
 
#define RTC_SYNCH_PREDIV   9U
 
#define RCC_RTCCLKSOURCE_1MHZ   ((uint32_t)((uint32_t)RCC_BDCR_RTCSEL | (uint32_t)((HSE_VALUE/1000000U) << 16U)))
 

Functions

void RTC_Alarm_IRQHandler (void)
 This function handles RTC ALARM interrupt request.
 
HAL_StatusTypeDef HAL_InitTick (uint32_t TickPriority)
 This function configures the RTC_ALARMA as a time base source. The time source is configured to have 1ms time base with a dedicated Tick interrupt priority.
 
void HAL_SuspendTick (void)
 Suspend Tick increment.
 
void HAL_ResumeTick (void)
 Resume Tick increment.
 
void HAL_RTC_AlarmAEventCallback (RTC_HandleTypeDef *hrtc)
 ALARM A Event Callback in non blocking mode.
 

Variables

RTC_HandleTypeDef hRTC_Handle
 

Detailed Description

Macro Definition Documentation

◆ RTC_CLOCK_SOURCE_HSE

#define RTC_CLOCK_SOURCE_HSE

◆ RTC_ASYNCH_PREDIV

#define RTC_ASYNCH_PREDIV   99U

◆ RTC_SYNCH_PREDIV

#define RTC_SYNCH_PREDIV   9U

◆ RCC_RTCCLKSOURCE_1MHZ

#define RCC_RTCCLKSOURCE_1MHZ   ((uint32_t)((uint32_t)RCC_BDCR_RTCSEL | (uint32_t)((HSE_VALUE/1000000U) << 16U)))

Function Documentation

◆ RTC_Alarm_IRQHandler()

void RTC_Alarm_IRQHandler ( void )

#include <stm32f4xx_hal_timebase_rtc_alarm_template.c>

This function handles RTC ALARM interrupt request.

Return values
None

Definition at line 305 of file stm32f4xx_hal_timebase_rtc_alarm_template.c.

References HAL_RTC_AlarmIRQHandler(), and hRTC_Handle.

◆ HAL_InitTick()

HAL_StatusTypeDef HAL_InitTick ( uint32_t TickPriority)

#include <stm32f4xx_hal_timebase_rtc_alarm_template.c>

This function configures the RTC_ALARMA as a time base source. The time source is configured to have 1ms time base with a dedicated Tick interrupt priority.

Note
This function is called automatically at the beginning of program after reset by HAL_Init() or at any time when clock is configured, by HAL_RCC_ClockConfig().
Parameters
TickPriorityTick interrupt priority.
Return values
HALstatus

Definition at line 96 of file stm32f4xx_hal_timebase_rtc_alarm_template.c.

References __HAL_RCC_RTC_ENABLE, __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_WRITEPROTECTION_DISABLE, __HAL_RTC_WRITEPROTECTION_ENABLE, RTC_InitTypeDef::AsynchPrediv, HAL_ERROR, HAL_NVIC_EnableIRQ(), HAL_NVIC_SetPriority(), HAL_OK, HAL_RCC_OscConfig(), HAL_RCCEx_PeriphCLKConfig(), HAL_RTC_Init(), RTC_InitTypeDef::HourFormat, hRTC_Handle, RCC_OscInitTypeDef::HSEState, RTC_HandleTypeDef::Init, RTC_HandleTypeDef::Instance, RCC_OscInitTypeDef::LSEState, RCC_OscInitTypeDef::LSIState, RCC_OscInitTypeDef::OscillatorType, RTC_InitTypeDef::OutPut, RTC_InitTypeDef::OutPutPolarity, RTC_InitTypeDef::OutPutType, RCC_PeriphCLKInitTypeDef::PeriphClockSelection, RCC_OscInitTypeDef::PLL, RCC_PLLInitTypeDef::PLLState, RCC_HSE_ON, RCC_LSE_ON, RCC_LSI_ON, RCC_OSCILLATORTYPE_HSE, RCC_OSCILLATORTYPE_LSE, RCC_OSCILLATORTYPE_LSI, RCC_PERIPHCLK_RTC, RCC_PLL_NONE, RCC_RTCCLKSOURCE_1MHZ, RCC_RTCCLKSOURCE_LSE, RCC_RTCCLKSOURCE_LSI, RTC_ASYNCH_PREDIV, RTC_FLAG_ALRAF, RTC_FLAG_ALRAWF, RTC_HOURFORMAT_24, RTC_INIT_MASK, RTC_IT_ALRA, RTC_OUTPUT_DISABLE, RTC_OUTPUT_POLARITY_HIGH, RTC_OUTPUT_TYPE_OPENDRAIN, RTC_SYNCH_PREDIV, RCC_PeriphCLKInitTypeDef::RTCClockSelection, RTC_InitTypeDef::SynchPrediv, and uwTickPrio.

◆ HAL_SuspendTick()

void HAL_SuspendTick ( void )

#include <stm32f4xx_hal_timebase_rtc_alarm_template.c>

Suspend Tick increment.

Note
Disable the tick increment by disabling RTC ALARM interrupt.
Return values
None

Definition at line 240 of file stm32f4xx_hal_timebase_rtc_alarm_template.c.

References __HAL_RTC_ALARM_DISABLE_IT, __HAL_RTC_WRITEPROTECTION_DISABLE, __HAL_RTC_WRITEPROTECTION_ENABLE, hRTC_Handle, and RTC_IT_ALRA.

◆ HAL_ResumeTick()

void HAL_ResumeTick ( void )

#include <stm32f4xx_hal_timebase_rtc_alarm_template.c>

Resume Tick increment.

Note
Enable the tick increment by Enabling RTC ALARM interrupt.
Return values
None

Definition at line 255 of file stm32f4xx_hal_timebase_rtc_alarm_template.c.

References __HAL_RTC_ALARM_ENABLE_IT, __HAL_RTC_WRITEPROTECTION_DISABLE, __HAL_RTC_WRITEPROTECTION_ENABLE, hRTC_Handle, and RTC_IT_ALRA.

◆ HAL_RTC_AlarmAEventCallback()

void HAL_RTC_AlarmAEventCallback ( RTC_HandleTypeDef * hrtc)

#include <stm32f4xx_hal_timebase_rtc_alarm_template.c>

ALARM A Event Callback in non blocking mode.

Note
This function is called when RTC_ALARM interrupt took place, inside RTC_ALARM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment a global variable "uwTick" used as application time base.
Parameters
hrtcRTC handle
Return values
None

Definition at line 273 of file stm32f4xx_hal_timebase_rtc_alarm_template.c.

References __HAL_RTC_WRITEPROTECTION_DISABLE, __HAL_RTC_WRITEPROTECTION_ENABLE, HAL_IncTick(), RTC_HandleTypeDef::Instance, and RTC_INIT_MASK.

Variable Documentation

◆ hRTC_Handle