STM32F4xx HAL Documentation
Hardware Abstraction Layer for STM32F4 familiy
Loading...
Searching...
No Matches
stm32f4xx_hal_timebase_rtc_wakeup_template.c File Reference

HAL time base based on the hardware RTC_WAKEUP Template. More...

#include "stm32f4xx_hal.h"
Include dependency graph for stm32f4xx_hal_timebase_rtc_wakeup_template.c:

Go to the source code of this file.

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_WKUP_IRQHandler (void)
 This function handles WAKE UP TIMER interrupt request.
 
HAL_StatusTypeDef HAL_InitTick (uint32_t TickPriority)
 This function configures the RTC_WKUP as a time base source. The time source is configured to have 1ms time base with a dedicated Tick interrupt priority. Wakeup Time base = ((RTC_ASYNCH_PREDIV + 1) * (RTC_SYNCH_PREDIV + 1)) / RTC_CLOCK = 1ms Wakeup Time = WakeupTimebase * WakeUpCounter (0 + 1) = 1 ms.
 
void HAL_SuspendTick (void)
 Suspend Tick increment.
 
void HAL_ResumeTick (void)
 Resume Tick increment.
 
void HAL_RTCEx_WakeUpTimerEventCallback (RTC_HandleTypeDef *hrtc)
 Wake Up Timer Event Callback in non blocking mode.
 

Variables

RTC_HandleTypeDef hRTC_Handle
 

Detailed Description

HAL time base based on the hardware RTC_WAKEUP Template.

Author
MCD Application Team
     This file overrides the native HAL time base functions (defined as weak)
     to use the RTC WAKEUP for the time base generation:
      + Initializes the RTC peripheral and configures the wakeup timer to be
        incremented each 1ms
      + The wakeup feature is configured to assert an interrupt each 1ms 
      + HAL_IncTick is called inside the HAL_RTCEx_WakeUpTimerEventCallback
      + HSE (default), LSE or LSI can be selected as RTC clock source
Attention

Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

 ==============================================================================
                       ##### How to use this driver #####
 ==============================================================================
   [..]
   This file must be copied to the application folder and modified as follows:
   (#) Rename it to 'stm32f4xx_hal_timebase_rtc_wakeup.c'
   (#) Add this file and the RTC HAL drivers to your project and uncomment
      HAL_RTC_MODULE_ENABLED define in stm32f4xx_hal_conf.h 

   [..]
   (@) HAL RTC alarm and HAL RTC wakeup drivers cant be used with low power modes:
       The wake up capability of the RTC may be intrusive in case of prior low power mode
       configuration requiring different wake up sources.
       Application/Example behavior is no more guaranteed 
   (@) The stm32f4xx_hal_timebase_tim use is recommended for the Applications/Examples
         requiring low power modes

Definition in file stm32f4xx_hal_timebase_rtc_wakeup_template.c.