|
STM32F103xB HAL User Manual
|
Header file of RTC HAL module. More...
Go to the source code of this file.
Data Structures | |
| struct | RTC_TimeTypeDef |
| RTC Time structure definition. More... | |
| struct | RTC_AlarmTypeDef |
| RTC Alarm structure definition. More... | |
| struct | RTC_InitTypeDef |
| RTC Configuration Structure definition. More... | |
| struct | RTC_DateTypeDef |
| RTC Date structure definition. More... | |
| struct | __RTC_HandleTypeDef |
| Time Handle Structure definition. More... | |
Defines | |
| #define | IS_RTC_ASYNCH_PREDIV(PREDIV) (((PREDIV) <= 0xFFFFFU) || ((PREDIV) == RTC_AUTO_1_SECOND)) |
| #define | IS_RTC_HOUR24(HOUR) ((HOUR) <= 23U) |
| #define | IS_RTC_MINUTES(MINUTES) ((MINUTES) <= 59U) |
| #define | IS_RTC_SECONDS(SECONDS) ((SECONDS) <= 59U) |
| #define | IS_RTC_FORMAT(FORMAT) (((FORMAT) == RTC_FORMAT_BIN) || ((FORMAT) == RTC_FORMAT_BCD)) |
| #define | IS_RTC_YEAR(YEAR) ((YEAR) <= 99U) |
| #define | IS_RTC_MONTH(MONTH) (((MONTH) >= 1U) && ((MONTH) <= 12U)) |
| #define | IS_RTC_DATE(DATE) (((DATE) >= 1U) && ((DATE) <= 31U)) |
| #define | IS_RTC_ALARM(ALARM) ((ALARM) == RTC_ALARM_A) |
| #define | IS_RTC_CALIB_OUTPUT(__OUTPUT__) |
| #define | RTC_TIMEOUT_VALUE 1000U |
| #define | RTC_EXTI_LINE_ALARM_EVENT ((uint32_t)EXTI_IMR_MR17) |
| #define | RTC_AUTO_1_SECOND 0xFFFFFFFFU |
| #define | RTC_FORMAT_BIN 0x000000000U |
| #define | RTC_FORMAT_BCD 0x000000001U |
| #define | RTC_MONTH_JANUARY ((uint8_t)0x01) |
| #define | RTC_MONTH_FEBRUARY ((uint8_t)0x02) |
| #define | RTC_MONTH_MARCH ((uint8_t)0x03) |
| #define | RTC_MONTH_APRIL ((uint8_t)0x04) |
| #define | RTC_MONTH_MAY ((uint8_t)0x05) |
| #define | RTC_MONTH_JUNE ((uint8_t)0x06) |
| #define | RTC_MONTH_JULY ((uint8_t)0x07) |
| #define | RTC_MONTH_AUGUST ((uint8_t)0x08) |
| #define | RTC_MONTH_SEPTEMBER ((uint8_t)0x09) |
| #define | RTC_MONTH_OCTOBER ((uint8_t)0x10) |
| #define | RTC_MONTH_NOVEMBER ((uint8_t)0x11) |
| #define | RTC_MONTH_DECEMBER ((uint8_t)0x12) |
| #define | RTC_WEEKDAY_MONDAY ((uint8_t)0x01) |
| #define | RTC_WEEKDAY_TUESDAY ((uint8_t)0x02) |
| #define | RTC_WEEKDAY_WEDNESDAY ((uint8_t)0x03) |
| #define | RTC_WEEKDAY_THURSDAY ((uint8_t)0x04) |
| #define | RTC_WEEKDAY_FRIDAY ((uint8_t)0x05) |
| #define | RTC_WEEKDAY_SATURDAY ((uint8_t)0x06) |
| #define | RTC_WEEKDAY_SUNDAY ((uint8_t)0x00) |
| #define | RTC_ALARM_A 0U |
| #define | RTC_OUTPUTSOURCE_NONE 0x00000000U |
| #define | RTC_OUTPUTSOURCE_CALIBCLOCK BKP_RTCCR_CCO |
| #define | RTC_OUTPUTSOURCE_ALARM BKP_RTCCR_ASOE |
| #define | RTC_OUTPUTSOURCE_SECOND (BKP_RTCCR_ASOS | BKP_RTCCR_ASOE) |
| #define | RTC_IT_OW RTC_CRH_OWIE |
| #define | RTC_IT_ALRA RTC_CRH_ALRIE |
| #define | RTC_IT_SEC RTC_CRH_SECIE |
| #define | RTC_IT_TAMP1 BKP_CSR_TPIE |
| #define | RTC_FLAG_RTOFF RTC_CRL_RTOFF |
| #define | RTC_FLAG_RSF RTC_CRL_RSF |
| #define | RTC_FLAG_OW RTC_CRL_OWF |
| #define | RTC_FLAG_ALRAF RTC_CRL_ALRF |
| #define | RTC_FLAG_SEC RTC_CRL_SECF |
| #define | RTC_FLAG_TAMP1F BKP_CSR_TEF |
| #define | __HAL_RTC_RESET_HANDLE_STATE(__HANDLE__) |
| Reset RTC handle state. | |
| #define | __HAL_RTC_WRITEPROTECTION_DISABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CRL, RTC_CRL_CNF) |
| Disable the write protection for RTC registers. | |
| #define | __HAL_RTC_WRITEPROTECTION_ENABLE(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->CRL, RTC_CRL_CNF) |
| Enable the write protection for RTC registers. | |
| #define | __HAL_RTC_ALARM_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BIT((__HANDLE__)->Instance->CRH, (__INTERRUPT__)) |
| Enable the RTC Alarm interrupt. | |
| #define | __HAL_RTC_ALARM_DISABLE_IT(__HANDLE__, __INTERRUPT__) CLEAR_BIT((__HANDLE__)->Instance->CRH, (__INTERRUPT__)) |
| Disable the RTC Alarm interrupt. | |
| #define | __HAL_RTC_ALARM_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((((__HANDLE__)->Instance->CRH)& ((__INTERRUPT__)))) != RESET)? SET : RESET) |
| Check whether the specified RTC Alarm interrupt has been enabled or not. | |
| #define | __HAL_RTC_ALARM_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->CRL) & (__FLAG__)) != RESET)? SET : RESET) |
| Get the selected RTC Alarm's flag status. | |
| #define | __HAL_RTC_ALARM_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CRL) & (__INTERRUPT__)) != RESET)? SET : RESET) |
| Check whether the specified RTC Alarm interrupt has occurred or not. | |
| #define | __HAL_RTC_ALARM_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->CRL) &= ~(__FLAG__) |
| Clear the RTC Alarm's pending flags. | |
| #define | __HAL_RTC_ALARM_EXTI_ENABLE_IT() SET_BIT(EXTI->IMR, RTC_EXTI_LINE_ALARM_EVENT) |
| Enable interrupt on ALARM Exti Line 17. | |
| #define | __HAL_RTC_ALARM_EXTI_DISABLE_IT() CLEAR_BIT(EXTI->IMR, RTC_EXTI_LINE_ALARM_EVENT) |
| Disable interrupt on ALARM Exti Line 17. | |
| #define | __HAL_RTC_ALARM_EXTI_ENABLE_EVENT() SET_BIT(EXTI->EMR, RTC_EXTI_LINE_ALARM_EVENT) |
| Enable event on ALARM Exti Line 17. | |
| #define | __HAL_RTC_ALARM_EXTI_DISABLE_EVENT() CLEAR_BIT(EXTI->EMR, RTC_EXTI_LINE_ALARM_EVENT) |
| Disable event on ALARM Exti Line 17. | |
| #define | __HAL_RTC_ALARM_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR, RTC_EXTI_LINE_ALARM_EVENT) |
| ALARM EXTI line configuration: set falling edge trigger. | |
| #define | __HAL_RTC_ALARM_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR, RTC_EXTI_LINE_ALARM_EVENT) |
| Disable the ALARM Extended Interrupt Falling Trigger. | |
| #define | __HAL_RTC_ALARM_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR, RTC_EXTI_LINE_ALARM_EVENT) |
| ALARM EXTI line configuration: set rising edge trigger. | |
| #define | __HAL_RTC_ALARM_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR, RTC_EXTI_LINE_ALARM_EVENT) |
| Disable the ALARM Extended Interrupt Rising Trigger. | |
| #define | __HAL_RTC_ALARM_EXTI_ENABLE_RISING_FALLING_EDGE() |
| ALARM EXTI line configuration: set rising & falling edge trigger. | |
| #define | __HAL_RTC_ALARM_EXTI_DISABLE_RISING_FALLING_EDGE() |
| Disable the ALARM Extended Interrupt Rising & Falling Trigger. | |
| #define | __HAL_RTC_ALARM_EXTI_GET_FLAG() (EXTI->PR & (RTC_EXTI_LINE_ALARM_EVENT)) |
| Check whether the specified ALARM EXTI interrupt flag is set or not. | |
| #define | __HAL_RTC_ALARM_EXTI_CLEAR_FLAG() (EXTI->PR = (RTC_EXTI_LINE_ALARM_EVENT)) |
| Clear the ALARM EXTI flag. | |
| #define | __HAL_RTC_ALARM_EXTI_GENERATE_SWIT() SET_BIT(EXTI->SWIER, RTC_EXTI_LINE_ALARM_EVENT) |
| Generate a Software interrupt on selected EXTI line. | |
Typedefs | |
| typedef struct __RTC_HandleTypeDef | RTC_HandleTypeDef |
| Time Handle Structure definition. | |
| typedef void(* | pRTC_CallbackTypeDef )(RTC_HandleTypeDef *hrtc) |
| HAL RTC Callback pointer definition. | |
Enumerations | |
| enum | HAL_RTCStateTypeDef { HAL_RTC_STATE_RESET = 0x00U, HAL_RTC_STATE_READY = 0x01U, HAL_RTC_STATE_BUSY = 0x02U, HAL_RTC_STATE_TIMEOUT = 0x03U, HAL_RTC_STATE_ERROR = 0x04U } |
| HAL State structures definition. More... | |
| enum | HAL_RTC_CallbackIDTypeDef { HAL_RTC_ALARM_A_EVENT_CB_ID = 0x00u, HAL_RTC_TAMPER1_EVENT_CB_ID = 0x04u, HAL_RTC_MSPINIT_CB_ID = 0x0Eu, HAL_RTC_MSPDEINIT_CB_ID = 0x0Fu } |
| HAL RTC Callback ID enumeration definition. More... | |
Functions | |
| HAL_StatusTypeDef | HAL_RTC_Init (RTC_HandleTypeDef *hrtc) |
| Initializes the RTC peripheral. | |
| HAL_StatusTypeDef | HAL_RTC_DeInit (RTC_HandleTypeDef *hrtc) |
| DeInitializes the RTC peripheral. | |
| __weak void | HAL_RTC_MspInit (RTC_HandleTypeDef *hrtc) |
| Initializes the RTC MSP. | |
| __weak void | HAL_RTC_MspDeInit (RTC_HandleTypeDef *hrtc) |
| DeInitializes the RTC MSP. | |
| HAL_StatusTypeDef | HAL_RTC_RegisterCallback (RTC_HandleTypeDef *hrtc, HAL_RTC_CallbackIDTypeDef CallbackID, pRTC_CallbackTypeDef pCallback) |
| Register a User RTC Callback To be used instead of the weak predefined callback. | |
| HAL_StatusTypeDef | HAL_RTC_UnRegisterCallback (RTC_HandleTypeDef *hrtc, HAL_RTC_CallbackIDTypeDef CallbackID) |
| Unregister an RTC Callback RTC callabck is redirected to the weak predefined callback. | |
| HAL_StatusTypeDef | HAL_RTC_SetTime (RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTime, uint32_t Format) |
| Sets RTC current time. | |
| HAL_StatusTypeDef | HAL_RTC_GetTime (RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTime, uint32_t Format) |
| Gets RTC current time. | |
| HAL_StatusTypeDef | HAL_RTC_SetDate (RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDate, uint32_t Format) |
| Sets RTC current date. | |
| HAL_StatusTypeDef | HAL_RTC_GetDate (RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDate, uint32_t Format) |
| Gets RTC current date. | |
| HAL_StatusTypeDef | HAL_RTC_SetAlarm (RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Format) |
| Sets the specified RTC Alarm. | |
| HAL_StatusTypeDef | HAL_RTC_SetAlarm_IT (RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Format) |
| Sets the specified RTC Alarm with Interrupt. | |
| HAL_StatusTypeDef | HAL_RTC_DeactivateAlarm (RTC_HandleTypeDef *hrtc, uint32_t Alarm) |
| Deactive the specified RTC Alarm. | |
| HAL_StatusTypeDef | HAL_RTC_GetAlarm (RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Alarm, uint32_t Format) |
| Gets the RTC Alarm value and masks. | |
| void | HAL_RTC_AlarmIRQHandler (RTC_HandleTypeDef *hrtc) |
| This function handles Alarm interrupt request. | |
| HAL_StatusTypeDef | HAL_RTC_PollForAlarmAEvent (RTC_HandleTypeDef *hrtc, uint32_t Timeout) |
| This function handles AlarmA Polling request. | |
| __weak void | HAL_RTC_AlarmAEventCallback (RTC_HandleTypeDef *hrtc) |
| Alarm A callback. | |
| HAL_RTCStateTypeDef | HAL_RTC_GetState (RTC_HandleTypeDef *hrtc) |
| Returns the RTC state. | |
| HAL_StatusTypeDef | HAL_RTC_WaitForSynchro (RTC_HandleTypeDef *hrtc) |
| Waits until the RTC registers (RTC_CNT, RTC_ALR and RTC_PRL) are synchronized with RTC APB clock. | |
Header file of RTC HAL module.
This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause
Definition in file stm32f1xx_hal_rtc.h.
1.7.6.1