STM32F439xx HAL User Manual
Functions
RTC TimeStamp and Tamper functions
RTCEx Exported Functions

RTC TimeStamp and Tamper functions. More...

Functions

HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp (RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin)
 Sets TimeStamp.
HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT (RTC_HandleTypeDef *hrtc, uint32_t 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)
 This function handles TimeStamp interrupt request.
__weak void HAL_RTCEx_TimeStampEventCallback (RTC_HandleTypeDef *hrtc)
 TimeStamp callback.
__weak void HAL_RTCEx_Tamper1EventCallback (RTC_HandleTypeDef *hrtc)
 Tamper 1 callback.
__weak void HAL_RTCEx_Tamper2EventCallback (RTC_HandleTypeDef *hrtc)
 Tamper 2 callback.
HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent (RTC_HandleTypeDef *hrtc, uint32_t Timeout)
 This function handles TimeStamp polling request.
HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event (RTC_HandleTypeDef *hrtc, uint32_t Timeout)
 This function handles Tamper1 Polling.
HAL_StatusTypeDef HAL_RTCEx_PollForTamper2Event (RTC_HandleTypeDef *hrtc, uint32_t Timeout)
 This function handles Tamper2 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_StatusTypeDef HAL_RTCEx_DeactivateTamper ( RTC_HandleTypeDef hrtc,
uint32_t  Tamper 
)

Deactivates Tamper.

Parameters:
hrtcpointer to a RTC_HandleTypeDef structure that contains the configuration information for RTC.
TamperSelected tamper pin. This parameter can be RTC_Tamper_1 and/or RTC_TAMPER_2.
Return values:
HALstatus

Definition at line 490 of file stm32f4xx_hal_rtc_ex.c.

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

HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp ( RTC_HandleTypeDef hrtc)

Deactivates TimeStamp.

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

Definition at line 274 of file stm32f4xx_hal_rtc_ex.c.

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

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

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 318 of file stm32f4xx_hal_rtc_ex.c.

References __HAL_RTC_TIMESTAMP_CLEAR_FLAG, assert_param, RTC_DateTypeDef::Date, 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_StatusTypeDef HAL_RTCEx_PollForTamper1Event ( RTC_HandleTypeDef hrtc,
uint32_t  Timeout 
)

This function handles Tamper1 Polling.

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

Definition at line 660 of file stm32f4xx_hal_rtc_ex.c.

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

HAL_StatusTypeDef HAL_RTCEx_PollForTamper2Event ( RTC_HandleTypeDef hrtc,
uint32_t  Timeout 
)

This function handles Tamper2 Polling.

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

Definition at line 696 of file stm32f4xx_hal_rtc_ex.c.

References __HAL_RTC_TAMPER_CLEAR_FLAG, __HAL_RTC_TAMPER_GET_FLAG, HAL_GetTick(), HAL_RTC_STATE_READY, HAL_RTC_STATE_TIMEOUT, RTC_FLAG_TAMP2F, and RTC_HandleTypeDef::State.

HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent ( RTC_HandleTypeDef hrtc,
uint32_t  Timeout 
)

This function 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 617 of file stm32f4xx_hal_rtc_ex.c.

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

HAL_StatusTypeDef HAL_RTCEx_SetTamper ( RTC_HandleTypeDef hrtc,
RTC_TamperTypeDef sTamper 
)
HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT ( RTC_HandleTypeDef hrtc,
RTC_TamperTypeDef sTamper 
)
HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp ( RTC_HandleTypeDef hrtc,
uint32_t  TimeStampEdge,
uint32_t  RTC_TimeStampPin 
)

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.
TimeStampEdgeSpecifies the pin edge on which the TimeStamp is activated. This parameter can be one of the following values:
  • RTC_TIMESTAMPEDGE_RISING: the Time stamp event occurs on the rising edge of the related pin.
  • RTC_TIMESTAMPEDGE_FALLING: the Time stamp 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/PA0 is selected as RTC TimeStamp Pin. (not applicable in the case of STM32F412xx, STM32F413xx and STM32F423xx devices) (PI8 for all STM32 devices except for STM32F446xx devices the PA0 is used)
  • RTC_TIMESTAMPPIN_PA0: PA0 is selected as RTC TimeStamp Pin only for STM32F446xx devices
Return values:
HALstatus

Definition at line 157 of file stm32f4xx_hal_rtc_ex.c.

References __HAL_RTC_TIMESTAMP_ENABLE, __HAL_RTC_WRITEPROTECTION_DISABLE, __HAL_RTC_WRITEPROTECTION_ENABLE, assert_param, HAL_RTC_STATE_BUSY, HAL_RTC_STATE_READY, RTC_HandleTypeDef::Instance, IS_RTC_TIMESTAMP_PIN, IS_TIMESTAMP_EDGE, and RTC_HandleTypeDef::State.

HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT ( RTC_HandleTypeDef hrtc,
uint32_t  TimeStampEdge,
uint32_t  RTC_TimeStampPin 
)

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:
TimeStampEdgeSpecifies the pin edge on which the TimeStamp is activated. This parameter can be one of the following values:
  • RTC_TIMESTAMPEDGE_RISING: the Time stamp event occurs on the rising edge of the related pin.
  • RTC_TIMESTAMPEDGE_FALLING: the Time stamp 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_PI8: PI8 is selected as RTC TimeStamp Pin. (not applicable in the case of STM32F446xx, STM32F412xx, STM32F413xx and STM32F423xx devices)
  • RTC_TIMESTAMPPIN_PA0: PA0 is selected as RTC TimeStamp Pin only for STM32F446xx devices
Return values:
HALstatus

Definition at line 217 of file stm32f4xx_hal_rtc_ex.c.

References __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT, __HAL_RTC_TIMESTAMP_CLEAR_FLAG, __HAL_RTC_TIMESTAMP_ENABLE, __HAL_RTC_TIMESTAMP_ENABLE_IT, __HAL_RTC_WRITEPROTECTION_DISABLE, __HAL_RTC_WRITEPROTECTION_ENABLE, assert_param, HAL_RTC_STATE_BUSY, HAL_RTC_STATE_READY, RTC_HandleTypeDef::Instance, IS_RTC_TIMESTAMP_PIN, IS_TIMESTAMP_EDGE, RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT, RTC_FLAG_TSF, RTC_IT_TS, and RTC_HandleTypeDef::State.

Tamper 1 callback.

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

Definition at line 586 of file stm32f4xx_hal_rtc_ex.c.

Referenced by HAL_RTCEx_TamperTimeStampIRQHandler().

Tamper 2 callback.

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

Definition at line 601 of file stm32f4xx_hal_rtc_ex.c.

Referenced by HAL_RTCEx_TamperTimeStampIRQHandler().

TimeStamp callback.

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

Definition at line 571 of file stm32f4xx_hal_rtc_ex.c.

Referenced by HAL_RTCEx_TamperTimeStampIRQHandler().