18#ifndef __ST_HAL_RTC_H__
19#define __ST_HAL_RTC_H__
25#if defined(HAL_RTC_MODULE_ENABLED) && VSF_HAL_USE_RTC == ENABLED
38 HAL_RTC_STATE_RESET = 0x00U,
39 HAL_RTC_STATE_READY = 0x01U,
40 HAL_RTC_STATE_BUSY = 0x02U,
41 HAL_RTC_STATE_TIMEOUT = 0x03U,
42 HAL_RTC_STATE_ERROR = 0x04U,
73 RTC_TimeTypeDef AlarmTime;
81#if (USE_HAL_RTC_REGISTER_CALLBACKS == 1)
82typedef struct __RTC_HandleTypeDef {
86 RTC_TypeDef *Instance;
89 volatile HAL_RTCStateTypeDef State;
90#if (USE_HAL_RTC_REGISTER_CALLBACKS == 1)
91 void (*AlarmAEventCallback)(
struct __RTC_HandleTypeDef *hrtc);
92 void (*AlarmBEventCallback)(
struct __RTC_HandleTypeDef *hrtc);
93 void (*TimeStampEventCallback)(
struct __RTC_HandleTypeDef *hrtc);
94 void (*WakeUpTimerEventCallback)(
struct __RTC_HandleTypeDef *hrtc);
95 void (*Tamper1EventCallback)(
struct __RTC_HandleTypeDef *hrtc);
96# if defined(RTC_TAMPER2_SUPPORT)
97 void (*Tamper2EventCallback)(
struct __RTC_HandleTypeDef *hrtc);
99 void (*MspInitCallback)(
struct __RTC_HandleTypeDef *hrtc);
100 void (*MspDeInitCallback)(
struct __RTC_HandleTypeDef *hrtc);
104#if (USE_HAL_RTC_REGISTER_CALLBACKS == 1)
106 HAL_RTC_ALARM_A_EVENT_CB_ID = 0x00U,
107 HAL_RTC_ALARM_B_EVENT_CB_ID = 0x01U,
108 HAL_RTC_TIMESTAMP_EVENT_CB_ID = 0x02U,
109 HAL_RTC_WAKEUPTIMER_EVENT_CB_ID = 0x03U,
110 HAL_RTC_TAMPER1_EVENT_CB_ID = 0x04U,
111# if defined(RTC_TAMPER2_SUPPORT)
112 HAL_RTC_TAMPER2_EVENT_CB_ID = 0x05U,
114 HAL_RTC_MSPINIT_CB_ID = 0x0EU,
115 HAL_RTC_MSPDEINIT_CB_ID = 0x0FU,
116} HAL_RTC_CallbackIDTypeDef;
118typedef void (*pRTC_CallbackTypeDef)(RTC_HandleTypeDef *hrtc);
129 uint32_t TimeStampOnTamperDetection;
140#if (USE_HAL_RTC_REGISTER_CALLBACKS == 1)
142 HAL_RTC_CallbackIDTypeDef CallbackID,
143 pRTC_CallbackTypeDef pCallback);
145 RTC_HandleTypeDef *hrtc, HAL_RTC_CallbackIDTypeDef CallbackID);
149 RTC_TimeTypeDef *sTime,
uint32_t Format);
151 RTC_TimeTypeDef *sTime,
uint32_t Format);
153 RTC_DateTypeDef *sDate,
uint32_t Format);
155 RTC_DateTypeDef *sDate,
uint32_t Format);
158 RTC_AlarmTypeDef *sAlarm,
uint32_t Format);
160 RTC_AlarmTypeDef *sAlarm,
165 RTC_AlarmTypeDef *sAlarm,
uint32_t Alarm,
195 RTC_TimeTypeDef *sTimeStamp,
196 RTC_DateTypeDef *sTimeStampDate,
200 RTC_TamperTypeDef *sTamper);
202 RTC_TamperTypeDef *sTamper);
208#if defined(RTC_TAMPER2_SUPPORT)
209void HAL_RTCEx_Tamper2EventCallback(RTC_HandleTypeDef *hrtc);
216#if defined(RTC_TAMPER2_SUPPORT)
241 RTC_HandleTypeDef *hrtc,
uint32_t SmoothCalibPeriod,
249 RTC_HandleTypeDef *hrtc);
vsf_err_t(* Init)(vsf_adc_cfg_t *pCfg)
Definition adc_interface.h:38
unsigned uint32_t
Definition stdint.h:9
unsigned char uint8_t
Definition stdint.h:5
HAL_StatusTypeDef
Definition sthal_def.h:61
HAL_LockTypeDef
Definition sthal_def.h:68
HAL_StatusTypeDef HAL_RTCEx_SetSynchroShift(RTC_HandleTypeDef *hrtc, uint32_t ShiftAdd1S, uint32_t ShiftSubFS)
Definition sthal_rtc.c:446
HAL_StatusTypeDef HAL_RTC_GetDate(RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDate, uint32_t Format)
Definition sthal_rtc.c:206
HAL_StatusTypeDef HAL_RTCEx_SetCoarseCalib(RTC_HandleTypeDef *hrtc, uint32_t CalibSign, uint32_t Value)
Definition sthal_rtc.c:426
void HAL_RTC_AlarmAEventCallback(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:240
HAL_StatusTypeDef HAL_RTCEx_PollForWakeUpTimerEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
Definition sthal_rtc.c:409
HAL_StatusTypeDef HAL_RTC_DeactivateAlarm(RTC_HandleTypeDef *hrtc, uint32_t Alarm)
Definition sthal_rtc.c:224
HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:315
HAL_StatusTypeDef HAL_RTC_DeInit(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:43
void HAL_RTC_DST_Add1Hour(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:256
uint8_t RTC_ByteToBcd2(uint8_t number)
Definition sthal_rtc.c:284
HAL_StatusTypeDef RTC_ExitInitMode(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:279
uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister)
Definition sthal_rtc.c:421
HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef *hrtc, uint32_t SmoothCalibPeriod, uint32_t SmoothCalibPlusPulses, uint32_t SmoothCalibMinusPulsesValue)
Definition sthal_rtc.c:438
HAL_StatusTypeDef HAL_RTC_GetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Alarm, uint32_t Format)
Definition sthal_rtc.c:230
HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef *sTamper)
Definition sthal_rtc.c:336
HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef *sTamper)
Definition sthal_rtc.c:329
HAL_StatusTypeDef HAL_RTCEx_DeactivateCalibrationOutPut(RTC_HandleTypeDef *hrtc)
HAL_StatusTypeDef RTC_EnterInitMode(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:274
HAL_RTCStateTypeDef HAL_RTC_GetState(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:269
HAL_StatusTypeDef HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:394
void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:405
HAL_StatusTypeDef HAL_RTC_WaitForSynchro(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:251
HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTimeStamp, RTC_DateTypeDef *sTimeStampDate, uint32_t Format)
Definition sthal_rtc.c:320
HAL_StatusTypeDef HAL_RTC_SetDate(RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDate, uint32_t Format)
Definition sthal_rtc.c:200
void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:350
HAL_StatusTypeDef HAL_RTCEx_EnableBypassShadow(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:474
HAL_StatusTypeDef HAL_RTCEx_DeactivateCoarseCalib(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:433
uint8_t RTC_Bcd2ToByte(uint8_t number)
Definition sthal_rtc.c:295
void HAL_RTC_DST_Sub1Hour(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:258
HAL_StatusTypeDef HAL_RTCEx_DeactivateRefClock(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:468
void HAL_RTC_MspDeInit(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:183
HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock)
Definition sthal_rtc.c:386
uint32_t HAL_RTC_DST_ReadStoreOperation(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:264
void HAL_RTCEx_AlarmBEventCallback(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:486
HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t RTC_TimeStampEdge, uint32_t RTC_TimeStampPin)
Definition sthal_rtc.c:302
HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t RTC_TimeStampEdge, uint32_t RTC_TimeStampPin)
Definition sthal_rtc.c:308
HAL_StatusTypeDef HAL_RTC_Init(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:33
HAL_StatusTypeDef HAL_RTCEx_DisableBypassShadow(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:480
HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock)
Definition sthal_rtc.c:378
HAL_StatusTypeDef HAL_RTC_SetAlarm_IT(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Format)
Definition sthal_rtc.c:218
void HAL_RTC_AlarmIRQHandler(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:237
void HAL_RTC_DST_ClearStoreOperation(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:262
void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:407
void HAL_RTCEx_TimeStampEventCallback(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:357
void HAL_RTC_DST_SetStoreOperation(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:260
HAL_StatusTypeDef HAL_RTCEx_SetRefClock(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:462
void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:352
HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
Definition sthal_rtc.c:365
uint32_t HAL_RTCEx_GetWakeUpTimer(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:400
HAL_StatusTypeDef HAL_RTC_GetTime(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTime, uint32_t Format)
Definition sthal_rtc.c:194
HAL_StatusTypeDef HAL_RTCEx_PollForAlarmBEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
Definition sthal_rtc.c:488
HAL_StatusTypeDef HAL_RTC_PollForAlarmAEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
Definition sthal_rtc.c:245
void HAL_RTC_MspInit(RTC_HandleTypeDef *hrtc)
Definition sthal_rtc.c:177
HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper)
Definition sthal_rtc.c:343
void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data)
Definition sthal_rtc.c:416
HAL_StatusTypeDef HAL_RTC_SetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Format)
Definition sthal_rtc.c:212
HAL_StatusTypeDef HAL_RTC_SetTime(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTime, uint32_t Format)
Definition sthal_rtc.c:188
HAL_StatusTypeDef HAL_RTCEx_SetCalibrationOutPut(RTC_HandleTypeDef *hrtc, uint32_t CalibOutput)
Definition sthal_rtc.c:453
HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout)
Definition sthal_rtc.c:359
RTC instance structure, used for RTC Multi Class support, not needed in non Multi Class mode.
Definition vsf_template_rtc.h:406