STM32F4xx HAL Documentation
Hardware Abstraction Layer for STM32F4 familiy
Loading...
Searching...
No Matches
RTC Timestamp and Tamper functions

RTC Timestamp and Tamper functions. More...

Collaboration diagram for RTC Timestamp and Tamper functions:

Functions

HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp (RTC_HandleTypeDef *hrtc, uint32_t RTC_TimeStampEdge, uint32_t RTC_TimeStampPin)
 Sets Timestamp.
 
HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT (RTC_HandleTypeDef *hrtc, uint32_t RTC_TimeStampEdge, uint32_t RTC_TimeStampPin)
 Sets Timestamp with Interrupt.
 
HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp (RTC_HandleTypeDef *hrtc)
 Deactivates Timestamp.
 
HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp (RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTimeStamp, RTC_DateTypeDef *sTimeStampDate, uint32_t Format)
 Gets the RTC Timestamp value.
 
HAL_StatusTypeDef HAL_RTCEx_SetTamper (RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef *sTamper)
 Sets Tamper.
 
HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT (RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef *sTamper)
 Sets Tamper with interrupt.
 
HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper (RTC_HandleTypeDef *hrtc, uint32_t Tamper)
 Deactivates Tamper.
 
void HAL_RTCEx_TamperTimeStampIRQHandler (RTC_HandleTypeDef *hrtc)
 Handles Timestamp and Tamper interrupt request.
 
void HAL_RTCEx_Tamper1EventCallback (RTC_HandleTypeDef *hrtc)
 Tamper 1 callback.
 
void HAL_RTCEx_TimeStampEventCallback (RTC_HandleTypeDef *hrtc)
 Timestamp callback.
 
HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent (RTC_HandleTypeDef *hrtc, uint32_t Timeout)
 Handles Timestamp polling request.
 
HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event (RTC_HandleTypeDef *hrtc, uint32_t Timeout)
 Handles Tamper 1 Polling.
 

Detailed Description

RTC Timestamp and Tamper functions.

 ===============================================================================
                 ##### RTC Timestamp and Tamper functions #####
 ===============================================================================

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

Function Documentation

◆ HAL_RTCEx_SetTimeStamp()

HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp ( RTC_HandleTypeDef * hrtc,
uint32_t RTC_TimeStampEdge,
uint32_t RTC_TimeStampPin )

#include <stm32f4xx_hal_rtc_ex.h>

Sets Timestamp.

Note
This API must be called before enabling the Timestamp feature.
Parameters
hrtcpointer to a RTC_HandleTypeDef structure that contains the configuration information for RTC.
RTC_TimeStampEdgeSpecifies the pin edge on which the Timestamp is activated. This parameter can be one of the following values:
  • RTC_TIMESTAMPEDGE_RISING: the Timestamp event occurs on the rising edge of the related pin.
  • RTC_TIMESTAMPEDGE_FALLING: the Timestamp event occurs on the falling edge of the related pin.
RTC_TimeStampPinSpecifies the RTC Timestamp Pin. This parameter can be one of the following values:
  • RTC_TIMESTAMPPIN_DEFAULT: PC13 is selected as RTC Timestamp Pin.
  • RTC_TIMESTAMPPIN_POS1: PI8 is selected as RTC Timestamp Pin.
Note
RTC_TIMESTAMPPIN_POS1 corresponds to pin PA0 in the case of STM32F446xx devices.
RTC_TIMESTAMPPIN_POS1 is not applicable to the following list of devices: STM32F412xx, STM32F413xx and STM32F423xx.
Return values
HALstatus

Definition at line 186 of file stm32f4xx_hal_rtc_ex.c.

References __HAL_LOCK, __HAL_RTC_TIMESTAMP_CLEAR_FLAG, __HAL_RTC_TIMESTAMP_ENABLE, __HAL_RTC_WRITEPROTECTION_DISABLE, __HAL_RTC_WRITEPROTECTION_ENABLE, __HAL_UNLOCK, assert_param, HAL_OK, HAL_RTC_STATE_BUSY, HAL_RTC_STATE_READY, RTC_HandleTypeDef::Instance, IS_RTC_TIMESTAMP_PIN, IS_TIMESTAMP_EDGE, RTC_FLAG_TSF, RTC_FLAG_TSOVF, and RTC_HandleTypeDef::State.

◆ HAL_RTCEx_SetTimeStamp_IT()

HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT ( RTC_HandleTypeDef * hrtc,
uint32_t RTC_TimeStampEdge,
uint32_t RTC_TimeStampPin )

#include <stm32f4xx_hal_rtc_ex.h>

Sets Timestamp with Interrupt.

Parameters
hrtcpointer to a RTC_HandleTypeDef structure that contains the configuration information for RTC.
Note
This API must be called before enabling the Timestamp feature.
Parameters
RTC_TimeStampEdgeSpecifies the pin edge on which the Timestamp is activated. This parameter can be one of the following values:
  • RTC_TIMESTAMPEDGE_RISING: the Timestamp event occurs on the rising edge of the related pin.
  • RTC_TIMESTAMPEDGE_FALLING: the Timestamp event occurs on the falling edge of the related pin.
RTC_TimeStampPinSpecifies the RTC Timestamp Pin. This parameter can be one of the following values:
  • RTC_TIMESTAMPPIN_DEFAULT: PC13 is selected as RTC Timestamp Pin.
  • RTC_TIMESTAMPPIN_POS1: PI8 is selected as RTC Timestamp Pin.
Note
RTC_TIMESTAMPPIN_POS1 corresponds to pin PA0 in the case of STM32F446xx devices.
RTC_TIMESTAMPPIN_POS1 is not applicable to the following list of devices: STM32F412xx, STM32F413xx and STM32F423xx.
Return values
HALstatus

Definition at line 258 of file stm32f4xx_hal_rtc_ex.c.

References __HAL_LOCK, __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT, __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE, __HAL_RTC_TIMESTAMP_CLEAR_FLAG, __HAL_RTC_TIMESTAMP_ENABLE, __HAL_RTC_TIMESTAMP_ENABLE_IT, __HAL_RTC_WRITEPROTECTION_DISABLE, __HAL_RTC_WRITEPROTECTION_ENABLE, __HAL_UNLOCK, assert_param, HAL_OK, HAL_RTC_STATE_BUSY, HAL_RTC_STATE_READY, RTC_HandleTypeDef::Instance, IS_RTC_TIMESTAMP_PIN, IS_TIMESTAMP_EDGE, RTC_FLAG_TSF, RTC_FLAG_TSOVF, RTC_IT_TS, and RTC_HandleTypeDef::State.

◆ HAL_RTCEx_DeactivateTimeStamp()

HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp ( RTC_HandleTypeDef * hrtc)

#include <stm32f4xx_hal_rtc_ex.h>

Deactivates Timestamp.

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

Definition at line 321 of file stm32f4xx_hal_rtc_ex.c.

References __HAL_LOCK, __HAL_RTC_TIMESTAMP_DISABLE_IT, __HAL_RTC_WRITEPROTECTION_DISABLE, __HAL_RTC_WRITEPROTECTION_ENABLE, __HAL_UNLOCK, HAL_OK, HAL_RTC_STATE_BUSY, HAL_RTC_STATE_READY, RTC_HandleTypeDef::Instance, RTC_IT_TS, and RTC_HandleTypeDef::State.

◆ HAL_RTCEx_GetTimeStamp()

HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp ( RTC_HandleTypeDef * hrtc,
RTC_TimeTypeDef * sTimeStamp,
RTC_DateTypeDef * sTimeStampDate,
uint32_t Format )

#include <stm32f4xx_hal_rtc_ex.h>

Gets the RTC Timestamp value.

Parameters
hrtcpointer to a RTC_HandleTypeDef structure that contains the configuration information for RTC.
sTimeStampPointer to Time structure
sTimeStampDatePointer to Date 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
Return values
HALstatus

Definition at line 365 of file stm32f4xx_hal_rtc_ex.c.

References __HAL_RTC_TIMESTAMP_CLEAR_FLAG, assert_param, RTC_DateTypeDef::Date, HAL_OK, RTC_TimeTypeDef::Hours, RTC_HandleTypeDef::Instance, IS_RTC_FORMAT, RTC_TimeTypeDef::Minutes, RTC_DateTypeDef::Month, RTC_Bcd2ToByte(), RTC_DR_RESERVED_MASK, RTC_FLAG_TSF, RTC_FORMAT_BIN, RTC_TR_RESERVED_MASK, RTC_TimeTypeDef::Seconds, RTC_TimeTypeDef::SubSeconds, RTC_TimeTypeDef::TimeFormat, RTC_DateTypeDef::WeekDay, and RTC_DateTypeDef::Year.

◆ HAL_RTCEx_SetTamper()

◆ HAL_RTCEx_SetTamper_IT()

◆ HAL_RTCEx_DeactivateTamper()

HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper ( RTC_HandleTypeDef * hrtc,
uint32_t Tamper )

#include <stm32f4xx_hal_rtc_ex.h>

Deactivates Tamper.

Note
The tamper global interrupt bit will remain unchanged.
Parameters
hrtcpointer to a RTC_HandleTypeDef structure that contains the configuration information for RTC.
TamperSelected tamper pin. This parameter can be any combination of the following values:
  • RTC_TAMPER_1: Tamper 1
  • RTC_TAMPER_2: Tamper 2
Note
RTC_TAMPER_2 is not applicable to all devices.
Return values
HALstatus

Definition at line 580 of file stm32f4xx_hal_rtc_ex.c.

References __HAL_LOCK, __HAL_UNLOCK, assert_param, HAL_OK, HAL_RTC_STATE_BUSY, HAL_RTC_STATE_READY, RTC_HandleTypeDef::Instance, IS_RTC_TAMPER, and RTC_HandleTypeDef::State.

◆ HAL_RTCEx_TamperTimeStampIRQHandler()

◆ HAL_RTCEx_Tamper1EventCallback()

__weak void HAL_RTCEx_Tamper1EventCallback ( RTC_HandleTypeDef * hrtc)

#include <stm32f4xx_hal_rtc_ex.h>

Tamper 1 callback.

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

Definition at line 694 of file stm32f4xx_hal_rtc_ex.c.

References UNUSED.

Referenced by HAL_RTC_Init(), and HAL_RTCEx_TamperTimeStampIRQHandler().

◆ HAL_RTCEx_TimeStampEventCallback()

__weak void HAL_RTCEx_TimeStampEventCallback ( RTC_HandleTypeDef * hrtc)

#include <stm32f4xx_hal_rtc_ex.h>

Timestamp callback.

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

Definition at line 678 of file stm32f4xx_hal_rtc_ex.c.

References UNUSED.

Referenced by HAL_RTC_Init(), and HAL_RTCEx_TamperTimeStampIRQHandler().

◆ HAL_RTCEx_PollForTimeStampEvent()

HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent ( RTC_HandleTypeDef * hrtc,
uint32_t Timeout )

#include <stm32f4xx_hal_rtc_ex.h>

Handles Timestamp polling request.

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

Definition at line 729 of file stm32f4xx_hal_rtc_ex.c.

References __HAL_RTC_TIMESTAMP_CLEAR_FLAG, __HAL_RTC_TIMESTAMP_GET_FLAG, HAL_ERROR, HAL_GetTick(), HAL_MAX_DELAY, HAL_OK, HAL_RTC_STATE_ERROR, HAL_RTC_STATE_READY, HAL_RTC_STATE_TIMEOUT, HAL_TIMEOUT, RTC_FLAG_TSF, RTC_FLAG_TSOVF, and RTC_HandleTypeDef::State.

◆ HAL_RTCEx_PollForTamper1Event()

HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event ( RTC_HandleTypeDef * hrtc,
uint32_t Timeout )

#include <stm32f4xx_hal_rtc_ex.h>

Handles Tamper 1 Polling.

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

Definition at line 772 of file stm32f4xx_hal_rtc_ex.c.

References __HAL_RTC_TAMPER_CLEAR_FLAG, __HAL_RTC_TAMPER_GET_FLAG, HAL_GetTick(), HAL_MAX_DELAY, HAL_OK, HAL_RTC_STATE_READY, HAL_RTC_STATE_TIMEOUT, HAL_TIMEOUT, RTC_FLAG_TAMP1F, and RTC_HandleTypeDef::State.