Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.
Dependents: 1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB
Fork of mbed by
TARGET_NUCLEO_F746ZG/stm32f7xx_hal_rtc.h@115:87f2f5183dfb, 2016-03-02 (annotated)
- Committer:
- Kojto
- Date:
- Wed Mar 02 09:58:28 2016 +0100
- Revision:
- 115:87f2f5183dfb
- Child:
- 116:c0f6e94411f5
Release 115 of the mbed library
Changes:
- new targets - NUCLEO_F746ZG
- Bugfix - STM32F7 + STM32L4 - RTC init fix
- Bugfix - STM32L4 Set NVIC_RAM_VECTOR_ADDRESS to 0x10000000
- B96B_F446VE - CAN addition
- Changed target name from NZ32SC151 to NZ32_SC151
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojto | 115:87f2f5183dfb | 1 | /** |
Kojto | 115:87f2f5183dfb | 2 | ****************************************************************************** |
Kojto | 115:87f2f5183dfb | 3 | * @file stm32f7xx_hal_rtc.h |
Kojto | 115:87f2f5183dfb | 4 | * @author MCD Application Team |
Kojto | 115:87f2f5183dfb | 5 | * @version V1.0.1 |
Kojto | 115:87f2f5183dfb | 6 | * @date 25-June-2015 |
Kojto | 115:87f2f5183dfb | 7 | * @brief Header file of RTC HAL module. |
Kojto | 115:87f2f5183dfb | 8 | ****************************************************************************** |
Kojto | 115:87f2f5183dfb | 9 | * @attention |
Kojto | 115:87f2f5183dfb | 10 | * |
Kojto | 115:87f2f5183dfb | 11 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
Kojto | 115:87f2f5183dfb | 12 | * |
Kojto | 115:87f2f5183dfb | 13 | * Redistribution and use in source and binary forms, with or without modification, |
Kojto | 115:87f2f5183dfb | 14 | * are permitted provided that the following conditions are met: |
Kojto | 115:87f2f5183dfb | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
Kojto | 115:87f2f5183dfb | 16 | * this list of conditions and the following disclaimer. |
Kojto | 115:87f2f5183dfb | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
Kojto | 115:87f2f5183dfb | 18 | * this list of conditions and the following disclaimer in the documentation |
Kojto | 115:87f2f5183dfb | 19 | * and/or other materials provided with the distribution. |
Kojto | 115:87f2f5183dfb | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
Kojto | 115:87f2f5183dfb | 21 | * may be used to endorse or promote products derived from this software |
Kojto | 115:87f2f5183dfb | 22 | * without specific prior written permission. |
Kojto | 115:87f2f5183dfb | 23 | * |
Kojto | 115:87f2f5183dfb | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
Kojto | 115:87f2f5183dfb | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
Kojto | 115:87f2f5183dfb | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Kojto | 115:87f2f5183dfb | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
Kojto | 115:87f2f5183dfb | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
Kojto | 115:87f2f5183dfb | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
Kojto | 115:87f2f5183dfb | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
Kojto | 115:87f2f5183dfb | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
Kojto | 115:87f2f5183dfb | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
Kojto | 115:87f2f5183dfb | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Kojto | 115:87f2f5183dfb | 34 | * |
Kojto | 115:87f2f5183dfb | 35 | ****************************************************************************** |
Kojto | 115:87f2f5183dfb | 36 | */ |
Kojto | 115:87f2f5183dfb | 37 | |
Kojto | 115:87f2f5183dfb | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
Kojto | 115:87f2f5183dfb | 39 | #ifndef __STM32F7xx_HAL_RTC_H |
Kojto | 115:87f2f5183dfb | 40 | #define __STM32F7xx_HAL_RTC_H |
Kojto | 115:87f2f5183dfb | 41 | |
Kojto | 115:87f2f5183dfb | 42 | #ifdef __cplusplus |
Kojto | 115:87f2f5183dfb | 43 | extern "C" { |
Kojto | 115:87f2f5183dfb | 44 | #endif |
Kojto | 115:87f2f5183dfb | 45 | |
Kojto | 115:87f2f5183dfb | 46 | /* Includes ------------------------------------------------------------------*/ |
Kojto | 115:87f2f5183dfb | 47 | #include "stm32f7xx_hal_def.h" |
Kojto | 115:87f2f5183dfb | 48 | |
Kojto | 115:87f2f5183dfb | 49 | /** @addtogroup STM32F7xx_HAL_Driver |
Kojto | 115:87f2f5183dfb | 50 | * @{ |
Kojto | 115:87f2f5183dfb | 51 | */ |
Kojto | 115:87f2f5183dfb | 52 | |
Kojto | 115:87f2f5183dfb | 53 | /** @addtogroup RTC |
Kojto | 115:87f2f5183dfb | 54 | * @{ |
Kojto | 115:87f2f5183dfb | 55 | */ |
Kojto | 115:87f2f5183dfb | 56 | |
Kojto | 115:87f2f5183dfb | 57 | /* Exported types ------------------------------------------------------------*/ |
Kojto | 115:87f2f5183dfb | 58 | /** @defgroup RTC_Exported_Types RTC Exported Types |
Kojto | 115:87f2f5183dfb | 59 | * @{ |
Kojto | 115:87f2f5183dfb | 60 | */ |
Kojto | 115:87f2f5183dfb | 61 | |
Kojto | 115:87f2f5183dfb | 62 | /** |
Kojto | 115:87f2f5183dfb | 63 | * @brief HAL State structures definition |
Kojto | 115:87f2f5183dfb | 64 | */ |
Kojto | 115:87f2f5183dfb | 65 | typedef enum |
Kojto | 115:87f2f5183dfb | 66 | { |
Kojto | 115:87f2f5183dfb | 67 | HAL_RTC_STATE_RESET = 0x00, /*!< RTC not yet initialized or disabled */ |
Kojto | 115:87f2f5183dfb | 68 | HAL_RTC_STATE_READY = 0x01, /*!< RTC initialized and ready for use */ |
Kojto | 115:87f2f5183dfb | 69 | HAL_RTC_STATE_BUSY = 0x02, /*!< RTC process is ongoing */ |
Kojto | 115:87f2f5183dfb | 70 | HAL_RTC_STATE_TIMEOUT = 0x03, /*!< RTC timeout state */ |
Kojto | 115:87f2f5183dfb | 71 | HAL_RTC_STATE_ERROR = 0x04 /*!< RTC error state */ |
Kojto | 115:87f2f5183dfb | 72 | |
Kojto | 115:87f2f5183dfb | 73 | }HAL_RTCStateTypeDef; |
Kojto | 115:87f2f5183dfb | 74 | |
Kojto | 115:87f2f5183dfb | 75 | /** |
Kojto | 115:87f2f5183dfb | 76 | * @brief RTC Configuration Structure definition |
Kojto | 115:87f2f5183dfb | 77 | */ |
Kojto | 115:87f2f5183dfb | 78 | typedef struct |
Kojto | 115:87f2f5183dfb | 79 | { |
Kojto | 115:87f2f5183dfb | 80 | uint32_t HourFormat; /*!< Specifies the RTC Hour Format. |
Kojto | 115:87f2f5183dfb | 81 | This parameter can be a value of @ref RTC_Hour_Formats */ |
Kojto | 115:87f2f5183dfb | 82 | |
Kojto | 115:87f2f5183dfb | 83 | uint32_t AsynchPrediv; /*!< Specifies the RTC Asynchronous Predivider value. |
Kojto | 115:87f2f5183dfb | 84 | This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7F */ |
Kojto | 115:87f2f5183dfb | 85 | |
Kojto | 115:87f2f5183dfb | 86 | uint32_t SynchPrediv; /*!< Specifies the RTC Synchronous Predivider value. |
Kojto | 115:87f2f5183dfb | 87 | This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7FFF */ |
Kojto | 115:87f2f5183dfb | 88 | |
Kojto | 115:87f2f5183dfb | 89 | uint32_t OutPut; /*!< Specifies which signal will be routed to the RTC output. |
Kojto | 115:87f2f5183dfb | 90 | This parameter can be a value of @ref RTCEx_Output_selection_Definitions */ |
Kojto | 115:87f2f5183dfb | 91 | |
Kojto | 115:87f2f5183dfb | 92 | uint32_t OutPutPolarity; /*!< Specifies the polarity of the output signal. |
Kojto | 115:87f2f5183dfb | 93 | This parameter can be a value of @ref RTC_Output_Polarity_Definitions */ |
Kojto | 115:87f2f5183dfb | 94 | |
Kojto | 115:87f2f5183dfb | 95 | uint32_t OutPutType; /*!< Specifies the RTC Output Pin mode. |
Kojto | 115:87f2f5183dfb | 96 | This parameter can be a value of @ref RTC_Output_Type_ALARM_OUT */ |
Kojto | 115:87f2f5183dfb | 97 | }RTC_InitTypeDef; |
Kojto | 115:87f2f5183dfb | 98 | |
Kojto | 115:87f2f5183dfb | 99 | /** |
Kojto | 115:87f2f5183dfb | 100 | * @brief RTC Time structure definition |
Kojto | 115:87f2f5183dfb | 101 | */ |
Kojto | 115:87f2f5183dfb | 102 | typedef struct |
Kojto | 115:87f2f5183dfb | 103 | { |
Kojto | 115:87f2f5183dfb | 104 | uint8_t Hours; /*!< Specifies the RTC Time Hour. |
Kojto | 115:87f2f5183dfb | 105 | This parameter must be a number between Min_Data = 0 and Max_Data = 12 if the RTC_HourFormat_12 is selected. |
Kojto | 115:87f2f5183dfb | 106 | This parameter must be a number between Min_Data = 0 and Max_Data = 23 if the RTC_HourFormat_24 is selected */ |
Kojto | 115:87f2f5183dfb | 107 | |
Kojto | 115:87f2f5183dfb | 108 | uint8_t Minutes; /*!< Specifies the RTC Time Minutes. |
Kojto | 115:87f2f5183dfb | 109 | This parameter must be a number between Min_Data = 0 and Max_Data = 59 */ |
Kojto | 115:87f2f5183dfb | 110 | |
Kojto | 115:87f2f5183dfb | 111 | uint8_t Seconds; /*!< Specifies the RTC Time Seconds. |
Kojto | 115:87f2f5183dfb | 112 | This parameter must be a number between Min_Data = 0 and Max_Data = 59 */ |
Kojto | 115:87f2f5183dfb | 113 | |
Kojto | 115:87f2f5183dfb | 114 | uint32_t SubSeconds; /*!< Specifies the RTC Time SubSeconds. |
Kojto | 115:87f2f5183dfb | 115 | This parameter must be a number between Min_Data = 0 and Max_Data = 59 */ |
Kojto | 115:87f2f5183dfb | 116 | |
Kojto | 115:87f2f5183dfb | 117 | uint8_t TimeFormat; /*!< Specifies the RTC AM/PM Time. |
Kojto | 115:87f2f5183dfb | 118 | This parameter can be a value of @ref RTC_AM_PM_Definitions */ |
Kojto | 115:87f2f5183dfb | 119 | |
Kojto | 115:87f2f5183dfb | 120 | uint32_t DayLightSaving; /*!< Specifies RTC_DayLightSaveOperation: the value of hour adjustment. |
Kojto | 115:87f2f5183dfb | 121 | This parameter can be a value of @ref RTC_DayLightSaving_Definitions */ |
Kojto | 115:87f2f5183dfb | 122 | |
Kojto | 115:87f2f5183dfb | 123 | uint32_t StoreOperation; /*!< Specifies RTC_StoreOperation value to be written in the BCK bit |
Kojto | 115:87f2f5183dfb | 124 | in CR register to store the operation. |
Kojto | 115:87f2f5183dfb | 125 | This parameter can be a value of @ref RTC_StoreOperation_Definitions */ |
Kojto | 115:87f2f5183dfb | 126 | }RTC_TimeTypeDef; |
Kojto | 115:87f2f5183dfb | 127 | |
Kojto | 115:87f2f5183dfb | 128 | /** |
Kojto | 115:87f2f5183dfb | 129 | * @brief RTC Date structure definition |
Kojto | 115:87f2f5183dfb | 130 | */ |
Kojto | 115:87f2f5183dfb | 131 | typedef struct |
Kojto | 115:87f2f5183dfb | 132 | { |
Kojto | 115:87f2f5183dfb | 133 | uint8_t WeekDay; /*!< Specifies the RTC Date WeekDay. |
Kojto | 115:87f2f5183dfb | 134 | This parameter can be a value of @ref RTC_WeekDay_Definitions */ |
Kojto | 115:87f2f5183dfb | 135 | |
Kojto | 115:87f2f5183dfb | 136 | uint8_t Month; /*!< Specifies the RTC Date Month (in BCD format). |
Kojto | 115:87f2f5183dfb | 137 | This parameter can be a value of @ref RTC_Month_Date_Definitions */ |
Kojto | 115:87f2f5183dfb | 138 | |
Kojto | 115:87f2f5183dfb | 139 | uint8_t Date; /*!< Specifies the RTC Date. |
Kojto | 115:87f2f5183dfb | 140 | This parameter must be a number between Min_Data = 1 and Max_Data = 31 */ |
Kojto | 115:87f2f5183dfb | 141 | |
Kojto | 115:87f2f5183dfb | 142 | uint8_t Year; /*!< Specifies the RTC Date Year. |
Kojto | 115:87f2f5183dfb | 143 | This parameter must be a number between Min_Data = 0 and Max_Data = 99 */ |
Kojto | 115:87f2f5183dfb | 144 | |
Kojto | 115:87f2f5183dfb | 145 | }RTC_DateTypeDef; |
Kojto | 115:87f2f5183dfb | 146 | |
Kojto | 115:87f2f5183dfb | 147 | /** |
Kojto | 115:87f2f5183dfb | 148 | * @brief RTC Alarm structure definition |
Kojto | 115:87f2f5183dfb | 149 | */ |
Kojto | 115:87f2f5183dfb | 150 | typedef struct |
Kojto | 115:87f2f5183dfb | 151 | { |
Kojto | 115:87f2f5183dfb | 152 | RTC_TimeTypeDef AlarmTime; /*!< Specifies the RTC Alarm Time members */ |
Kojto | 115:87f2f5183dfb | 153 | |
Kojto | 115:87f2f5183dfb | 154 | uint32_t AlarmMask; /*!< Specifies the RTC Alarm Masks. |
Kojto | 115:87f2f5183dfb | 155 | This parameter can be a value of @ref RTC_AlarmMask_Definitions */ |
Kojto | 115:87f2f5183dfb | 156 | |
Kojto | 115:87f2f5183dfb | 157 | uint32_t AlarmSubSecondMask; /*!< Specifies the RTC Alarm SubSeconds Masks. |
Kojto | 115:87f2f5183dfb | 158 | This parameter can be a value of @ref RTC_Alarm_Sub_Seconds_Masks_Definitions */ |
Kojto | 115:87f2f5183dfb | 159 | |
Kojto | 115:87f2f5183dfb | 160 | uint32_t AlarmDateWeekDaySel; /*!< Specifies the RTC Alarm is on Date or WeekDay. |
Kojto | 115:87f2f5183dfb | 161 | This parameter can be a value of @ref RTC_AlarmDateWeekDay_Definitions */ |
Kojto | 115:87f2f5183dfb | 162 | |
Kojto | 115:87f2f5183dfb | 163 | uint8_t AlarmDateWeekDay; /*!< Specifies the RTC Alarm Date/WeekDay. |
Kojto | 115:87f2f5183dfb | 164 | If the Alarm Date is selected, this parameter must be set to a value in the 1-31 range. |
Kojto | 115:87f2f5183dfb | 165 | If the Alarm WeekDay is selected, this parameter can be a value of @ref RTC_WeekDay_Definitions */ |
Kojto | 115:87f2f5183dfb | 166 | |
Kojto | 115:87f2f5183dfb | 167 | uint32_t Alarm; /*!< Specifies the alarm . |
Kojto | 115:87f2f5183dfb | 168 | This parameter can be a value of @ref RTC_Alarms_Definitions */ |
Kojto | 115:87f2f5183dfb | 169 | }RTC_AlarmTypeDef; |
Kojto | 115:87f2f5183dfb | 170 | |
Kojto | 115:87f2f5183dfb | 171 | /** |
Kojto | 115:87f2f5183dfb | 172 | * @brief RTC Handle Structure definition |
Kojto | 115:87f2f5183dfb | 173 | */ |
Kojto | 115:87f2f5183dfb | 174 | typedef struct |
Kojto | 115:87f2f5183dfb | 175 | { |
Kojto | 115:87f2f5183dfb | 176 | RTC_TypeDef *Instance; /*!< Register base address */ |
Kojto | 115:87f2f5183dfb | 177 | |
Kojto | 115:87f2f5183dfb | 178 | RTC_InitTypeDef Init; /*!< RTC required parameters */ |
Kojto | 115:87f2f5183dfb | 179 | |
Kojto | 115:87f2f5183dfb | 180 | HAL_LockTypeDef Lock; /*!< RTC locking object */ |
Kojto | 115:87f2f5183dfb | 181 | |
Kojto | 115:87f2f5183dfb | 182 | __IO HAL_RTCStateTypeDef State; /*!< Time communication state */ |
Kojto | 115:87f2f5183dfb | 183 | |
Kojto | 115:87f2f5183dfb | 184 | }RTC_HandleTypeDef; |
Kojto | 115:87f2f5183dfb | 185 | |
Kojto | 115:87f2f5183dfb | 186 | /** |
Kojto | 115:87f2f5183dfb | 187 | * @} |
Kojto | 115:87f2f5183dfb | 188 | */ |
Kojto | 115:87f2f5183dfb | 189 | |
Kojto | 115:87f2f5183dfb | 190 | /* Exported constants --------------------------------------------------------*/ |
Kojto | 115:87f2f5183dfb | 191 | /** @defgroup RTC_Exported_Constants RTC Exported Constants |
Kojto | 115:87f2f5183dfb | 192 | * @{ |
Kojto | 115:87f2f5183dfb | 193 | */ |
Kojto | 115:87f2f5183dfb | 194 | |
Kojto | 115:87f2f5183dfb | 195 | /** @defgroup RTC_Hour_Formats RTC Hour Formats |
Kojto | 115:87f2f5183dfb | 196 | * @{ |
Kojto | 115:87f2f5183dfb | 197 | */ |
Kojto | 115:87f2f5183dfb | 198 | #define RTC_HOURFORMAT_24 ((uint32_t)0x00000000) |
Kojto | 115:87f2f5183dfb | 199 | #define RTC_HOURFORMAT_12 ((uint32_t)0x00000040) |
Kojto | 115:87f2f5183dfb | 200 | /** |
Kojto | 115:87f2f5183dfb | 201 | * @} |
Kojto | 115:87f2f5183dfb | 202 | */ |
Kojto | 115:87f2f5183dfb | 203 | |
Kojto | 115:87f2f5183dfb | 204 | |
Kojto | 115:87f2f5183dfb | 205 | /** @defgroup RTC_Output_Polarity_Definitions RTC Output Polarity Definitions |
Kojto | 115:87f2f5183dfb | 206 | * @{ |
Kojto | 115:87f2f5183dfb | 207 | */ |
Kojto | 115:87f2f5183dfb | 208 | #define RTC_OUTPUT_POLARITY_HIGH ((uint32_t)0x00000000) |
Kojto | 115:87f2f5183dfb | 209 | #define RTC_OUTPUT_POLARITY_LOW ((uint32_t)0x00100000) |
Kojto | 115:87f2f5183dfb | 210 | /** |
Kojto | 115:87f2f5183dfb | 211 | * @} |
Kojto | 115:87f2f5183dfb | 212 | */ |
Kojto | 115:87f2f5183dfb | 213 | |
Kojto | 115:87f2f5183dfb | 214 | /** @defgroup RTC_Output_Type_ALARM_OUT RTC Output Type ALARM OUT |
Kojto | 115:87f2f5183dfb | 215 | * @{ |
Kojto | 115:87f2f5183dfb | 216 | */ |
Kojto | 115:87f2f5183dfb | 217 | #define RTC_OUTPUT_TYPE_OPENDRAIN ((uint32_t)0x00000000) |
Kojto | 115:87f2f5183dfb | 218 | #define RTC_OUTPUT_TYPE_PUSHPULL ((uint32_t)RTC_OR_ALARMTYPE) /* 0x00000008 */ |
Kojto | 115:87f2f5183dfb | 219 | /** |
Kojto | 115:87f2f5183dfb | 220 | * @} |
Kojto | 115:87f2f5183dfb | 221 | */ |
Kojto | 115:87f2f5183dfb | 222 | |
Kojto | 115:87f2f5183dfb | 223 | /** @defgroup RTC_AM_PM_Definitions RTC AM PM Definitions |
Kojto | 115:87f2f5183dfb | 224 | * @{ |
Kojto | 115:87f2f5183dfb | 225 | */ |
Kojto | 115:87f2f5183dfb | 226 | #define RTC_HOURFORMAT12_AM ((uint8_t)0x00) |
Kojto | 115:87f2f5183dfb | 227 | #define RTC_HOURFORMAT12_PM ((uint8_t)0x40) |
Kojto | 115:87f2f5183dfb | 228 | /** |
Kojto | 115:87f2f5183dfb | 229 | * @} |
Kojto | 115:87f2f5183dfb | 230 | */ |
Kojto | 115:87f2f5183dfb | 231 | |
Kojto | 115:87f2f5183dfb | 232 | /** @defgroup RTC_DayLightSaving_Definitions RTC DayLight Saving Definitions |
Kojto | 115:87f2f5183dfb | 233 | * @{ |
Kojto | 115:87f2f5183dfb | 234 | */ |
Kojto | 115:87f2f5183dfb | 235 | #define RTC_DAYLIGHTSAVING_SUB1H ((uint32_t)0x00020000) |
Kojto | 115:87f2f5183dfb | 236 | #define RTC_DAYLIGHTSAVING_ADD1H ((uint32_t)0x00010000) |
Kojto | 115:87f2f5183dfb | 237 | #define RTC_DAYLIGHTSAVING_NONE ((uint32_t)0x00000000) |
Kojto | 115:87f2f5183dfb | 238 | /** |
Kojto | 115:87f2f5183dfb | 239 | * @} |
Kojto | 115:87f2f5183dfb | 240 | */ |
Kojto | 115:87f2f5183dfb | 241 | |
Kojto | 115:87f2f5183dfb | 242 | /** @defgroup RTC_StoreOperation_Definitions RTC Store Operation Definitions |
Kojto | 115:87f2f5183dfb | 243 | * @{ |
Kojto | 115:87f2f5183dfb | 244 | */ |
Kojto | 115:87f2f5183dfb | 245 | #define RTC_STOREOPERATION_RESET ((uint32_t)0x00000000) |
Kojto | 115:87f2f5183dfb | 246 | #define RTC_STOREOPERATION_SET ((uint32_t)0x00040000) |
Kojto | 115:87f2f5183dfb | 247 | /** |
Kojto | 115:87f2f5183dfb | 248 | * @} |
Kojto | 115:87f2f5183dfb | 249 | */ |
Kojto | 115:87f2f5183dfb | 250 | |
Kojto | 115:87f2f5183dfb | 251 | /** @defgroup RTC_Input_parameter_format_definitions RTC Input Parameter Format Definitions |
Kojto | 115:87f2f5183dfb | 252 | * @{ |
Kojto | 115:87f2f5183dfb | 253 | */ |
Kojto | 115:87f2f5183dfb | 254 | #define RTC_FORMAT_BIN ((uint32_t)0x000000000) |
Kojto | 115:87f2f5183dfb | 255 | #define RTC_FORMAT_BCD ((uint32_t)0x000000001) |
Kojto | 115:87f2f5183dfb | 256 | /** |
Kojto | 115:87f2f5183dfb | 257 | * @} |
Kojto | 115:87f2f5183dfb | 258 | */ |
Kojto | 115:87f2f5183dfb | 259 | |
Kojto | 115:87f2f5183dfb | 260 | /** @defgroup RTC_Month_Date_Definitions RTC Month Date Definitions |
Kojto | 115:87f2f5183dfb | 261 | * @{ |
Kojto | 115:87f2f5183dfb | 262 | */ |
Kojto | 115:87f2f5183dfb | 263 | /* Coded in BCD format */ |
Kojto | 115:87f2f5183dfb | 264 | #define RTC_MONTH_JANUARY ((uint8_t)0x01) |
Kojto | 115:87f2f5183dfb | 265 | #define RTC_MONTH_FEBRUARY ((uint8_t)0x02) |
Kojto | 115:87f2f5183dfb | 266 | #define RTC_MONTH_MARCH ((uint8_t)0x03) |
Kojto | 115:87f2f5183dfb | 267 | #define RTC_MONTH_APRIL ((uint8_t)0x04) |
Kojto | 115:87f2f5183dfb | 268 | #define RTC_MONTH_MAY ((uint8_t)0x05) |
Kojto | 115:87f2f5183dfb | 269 | #define RTC_MONTH_JUNE ((uint8_t)0x06) |
Kojto | 115:87f2f5183dfb | 270 | #define RTC_MONTH_JULY ((uint8_t)0x07) |
Kojto | 115:87f2f5183dfb | 271 | #define RTC_MONTH_AUGUST ((uint8_t)0x08) |
Kojto | 115:87f2f5183dfb | 272 | #define RTC_MONTH_SEPTEMBER ((uint8_t)0x09) |
Kojto | 115:87f2f5183dfb | 273 | #define RTC_MONTH_OCTOBER ((uint8_t)0x10) |
Kojto | 115:87f2f5183dfb | 274 | #define RTC_MONTH_NOVEMBER ((uint8_t)0x11) |
Kojto | 115:87f2f5183dfb | 275 | #define RTC_MONTH_DECEMBER ((uint8_t)0x12) |
Kojto | 115:87f2f5183dfb | 276 | /** |
Kojto | 115:87f2f5183dfb | 277 | * @} |
Kojto | 115:87f2f5183dfb | 278 | */ |
Kojto | 115:87f2f5183dfb | 279 | |
Kojto | 115:87f2f5183dfb | 280 | /** @defgroup RTC_WeekDay_Definitions RTC WeekDay Definitions |
Kojto | 115:87f2f5183dfb | 281 | * @{ |
Kojto | 115:87f2f5183dfb | 282 | */ |
Kojto | 115:87f2f5183dfb | 283 | #define RTC_WEEKDAY_MONDAY ((uint8_t)0x01) |
Kojto | 115:87f2f5183dfb | 284 | #define RTC_WEEKDAY_TUESDAY ((uint8_t)0x02) |
Kojto | 115:87f2f5183dfb | 285 | #define RTC_WEEKDAY_WEDNESDAY ((uint8_t)0x03) |
Kojto | 115:87f2f5183dfb | 286 | #define RTC_WEEKDAY_THURSDAY ((uint8_t)0x04) |
Kojto | 115:87f2f5183dfb | 287 | #define RTC_WEEKDAY_FRIDAY ((uint8_t)0x05) |
Kojto | 115:87f2f5183dfb | 288 | #define RTC_WEEKDAY_SATURDAY ((uint8_t)0x06) |
Kojto | 115:87f2f5183dfb | 289 | #define RTC_WEEKDAY_SUNDAY ((uint8_t)0x07) |
Kojto | 115:87f2f5183dfb | 290 | /** |
Kojto | 115:87f2f5183dfb | 291 | * @} |
Kojto | 115:87f2f5183dfb | 292 | */ |
Kojto | 115:87f2f5183dfb | 293 | |
Kojto | 115:87f2f5183dfb | 294 | /** @defgroup RTC_AlarmDateWeekDay_Definitions RTC Alarm Date WeekDay Definitions |
Kojto | 115:87f2f5183dfb | 295 | * @{ |
Kojto | 115:87f2f5183dfb | 296 | */ |
Kojto | 115:87f2f5183dfb | 297 | #define RTC_ALARMDATEWEEKDAYSEL_DATE ((uint32_t)0x00000000) |
Kojto | 115:87f2f5183dfb | 298 | #define RTC_ALARMDATEWEEKDAYSEL_WEEKDAY ((uint32_t)0x40000000) |
Kojto | 115:87f2f5183dfb | 299 | /** |
Kojto | 115:87f2f5183dfb | 300 | * @} |
Kojto | 115:87f2f5183dfb | 301 | */ |
Kojto | 115:87f2f5183dfb | 302 | |
Kojto | 115:87f2f5183dfb | 303 | /** @defgroup RTC_AlarmMask_Definitions RTC Alarm Mask Definitions |
Kojto | 115:87f2f5183dfb | 304 | * @{ |
Kojto | 115:87f2f5183dfb | 305 | */ |
Kojto | 115:87f2f5183dfb | 306 | #define RTC_ALARMMASK_NONE ((uint32_t)0x00000000) |
Kojto | 115:87f2f5183dfb | 307 | #define RTC_ALARMMASK_DATEWEEKDAY RTC_ALRMAR_MSK4 |
Kojto | 115:87f2f5183dfb | 308 | #define RTC_ALARMMASK_HOURS RTC_ALRMAR_MSK3 |
Kojto | 115:87f2f5183dfb | 309 | #define RTC_ALARMMASK_MINUTES RTC_ALRMAR_MSK2 |
Kojto | 115:87f2f5183dfb | 310 | #define RTC_ALARMMASK_SECONDS RTC_ALRMAR_MSK1 |
Kojto | 115:87f2f5183dfb | 311 | #define RTC_ALARMMASK_ALL ((uint32_t)0x80808080) |
Kojto | 115:87f2f5183dfb | 312 | /** |
Kojto | 115:87f2f5183dfb | 313 | * @} |
Kojto | 115:87f2f5183dfb | 314 | */ |
Kojto | 115:87f2f5183dfb | 315 | |
Kojto | 115:87f2f5183dfb | 316 | /** @defgroup RTC_Alarms_Definitions RTC Alarms Definitions |
Kojto | 115:87f2f5183dfb | 317 | * @{ |
Kojto | 115:87f2f5183dfb | 318 | */ |
Kojto | 115:87f2f5183dfb | 319 | #define RTC_ALARM_A RTC_CR_ALRAE |
Kojto | 115:87f2f5183dfb | 320 | #define RTC_ALARM_B RTC_CR_ALRBE |
Kojto | 115:87f2f5183dfb | 321 | /** |
Kojto | 115:87f2f5183dfb | 322 | * @} |
Kojto | 115:87f2f5183dfb | 323 | */ |
Kojto | 115:87f2f5183dfb | 324 | |
Kojto | 115:87f2f5183dfb | 325 | /** @defgroup RTC_Alarm_Sub_Seconds_Masks_Definitions RTC Alarm Sub Seconds Masks Definitions |
Kojto | 115:87f2f5183dfb | 326 | * @{ |
Kojto | 115:87f2f5183dfb | 327 | */ |
Kojto | 115:87f2f5183dfb | 328 | #define RTC_ALARMSUBSECONDMASK_ALL ((uint32_t)0x00000000) /*!< All Alarm SS fields are masked. |
Kojto | 115:87f2f5183dfb | 329 | There is no comparison on sub seconds |
Kojto | 115:87f2f5183dfb | 330 | for Alarm */ |
Kojto | 115:87f2f5183dfb | 331 | #define RTC_ALARMSUBSECONDMASK_SS14_1 ((uint32_t)0x01000000) /*!< SS[14:1] are don't care in Alarm |
Kojto | 115:87f2f5183dfb | 332 | comparison. Only SS[0] is compared. */ |
Kojto | 115:87f2f5183dfb | 333 | #define RTC_ALARMSUBSECONDMASK_SS14_2 ((uint32_t)0x02000000) /*!< SS[14:2] are don't care in Alarm |
Kojto | 115:87f2f5183dfb | 334 | comparison. Only SS[1:0] are compared */ |
Kojto | 115:87f2f5183dfb | 335 | #define RTC_ALARMSUBSECONDMASK_SS14_3 ((uint32_t)0x03000000) /*!< SS[14:3] are don't care in Alarm |
Kojto | 115:87f2f5183dfb | 336 | comparison. Only SS[2:0] are compared */ |
Kojto | 115:87f2f5183dfb | 337 | #define RTC_ALARMSUBSECONDMASK_SS14_4 ((uint32_t)0x04000000) /*!< SS[14:4] are don't care in Alarm |
Kojto | 115:87f2f5183dfb | 338 | comparison. Only SS[3:0] are compared */ |
Kojto | 115:87f2f5183dfb | 339 | #define RTC_ALARMSUBSECONDMASK_SS14_5 ((uint32_t)0x05000000) /*!< SS[14:5] are don't care in Alarm |
Kojto | 115:87f2f5183dfb | 340 | comparison. Only SS[4:0] are compared */ |
Kojto | 115:87f2f5183dfb | 341 | #define RTC_ALARMSUBSECONDMASK_SS14_6 ((uint32_t)0x06000000) /*!< SS[14:6] are don't care in Alarm |
Kojto | 115:87f2f5183dfb | 342 | comparison. Only SS[5:0] are compared */ |
Kojto | 115:87f2f5183dfb | 343 | #define RTC_ALARMSUBSECONDMASK_SS14_7 ((uint32_t)0x07000000) /*!< SS[14:7] are don't care in Alarm |
Kojto | 115:87f2f5183dfb | 344 | comparison. Only SS[6:0] are compared */ |
Kojto | 115:87f2f5183dfb | 345 | #define RTC_ALARMSUBSECONDMASK_SS14_8 ((uint32_t)0x08000000) /*!< SS[14:8] are don't care in Alarm |
Kojto | 115:87f2f5183dfb | 346 | comparison. Only SS[7:0] are compared */ |
Kojto | 115:87f2f5183dfb | 347 | #define RTC_ALARMSUBSECONDMASK_SS14_9 ((uint32_t)0x09000000) /*!< SS[14:9] are don't care in Alarm |
Kojto | 115:87f2f5183dfb | 348 | comparison. Only SS[8:0] are compared */ |
Kojto | 115:87f2f5183dfb | 349 | #define RTC_ALARMSUBSECONDMASK_SS14_10 ((uint32_t)0x0A000000) /*!< SS[14:10] are don't care in Alarm |
Kojto | 115:87f2f5183dfb | 350 | comparison. Only SS[9:0] are compared */ |
Kojto | 115:87f2f5183dfb | 351 | #define RTC_ALARMSUBSECONDMASK_SS14_11 ((uint32_t)0x0B000000) /*!< SS[14:11] are don't care in Alarm |
Kojto | 115:87f2f5183dfb | 352 | comparison. Only SS[10:0] are compared */ |
Kojto | 115:87f2f5183dfb | 353 | #define RTC_ALARMSUBSECONDMASK_SS14_12 ((uint32_t)0x0C000000) /*!< SS[14:12] are don't care in Alarm |
Kojto | 115:87f2f5183dfb | 354 | comparison.Only SS[11:0] are compared */ |
Kojto | 115:87f2f5183dfb | 355 | #define RTC_ALARMSUBSECONDMASK_SS14_13 ((uint32_t)0x0D000000) /*!< SS[14:13] are don't care in Alarm |
Kojto | 115:87f2f5183dfb | 356 | comparison. Only SS[12:0] are compared */ |
Kojto | 115:87f2f5183dfb | 357 | #define RTC_ALARMSUBSECONDMASK_SS14 ((uint32_t)0x0E000000) /*!< SS[14] is don't care in Alarm |
Kojto | 115:87f2f5183dfb | 358 | comparison.Only SS[13:0] are compared */ |
Kojto | 115:87f2f5183dfb | 359 | #define RTC_ALARMSUBSECONDMASK_NONE ((uint32_t)0x0F000000) /*!< SS[14:0] are compared and must match |
Kojto | 115:87f2f5183dfb | 360 | to activate alarm. */ |
Kojto | 115:87f2f5183dfb | 361 | /** |
Kojto | 115:87f2f5183dfb | 362 | * @} |
Kojto | 115:87f2f5183dfb | 363 | */ |
Kojto | 115:87f2f5183dfb | 364 | |
Kojto | 115:87f2f5183dfb | 365 | /** @defgroup RTC_Interrupts_Definitions RTC Interrupts Definitions |
Kojto | 115:87f2f5183dfb | 366 | * @{ |
Kojto | 115:87f2f5183dfb | 367 | */ |
Kojto | 115:87f2f5183dfb | 368 | #define RTC_IT_TS ((uint32_t)RTC_CR_TSIE) |
Kojto | 115:87f2f5183dfb | 369 | #define RTC_IT_WUT ((uint32_t)RTC_CR_WUTIE) |
Kojto | 115:87f2f5183dfb | 370 | #define RTC_IT_ALRA ((uint32_t)RTC_CR_ALRAIE) |
Kojto | 115:87f2f5183dfb | 371 | #define RTC_IT_ALRB ((uint32_t)RTC_CR_ALRBIE) |
Kojto | 115:87f2f5183dfb | 372 | #define RTC_IT_TAMP ((uint32_t)RTC_TAMPCR_TAMPIE) /* Used only to Enable the Tamper Interrupt */ |
Kojto | 115:87f2f5183dfb | 373 | #define RTC_IT_TAMP1 ((uint32_t)RTC_TAMPCR_TAMP1IE) |
Kojto | 115:87f2f5183dfb | 374 | #define RTC_IT_TAMP2 ((uint32_t)RTC_TAMPCR_TAMP2IE) |
Kojto | 115:87f2f5183dfb | 375 | #define RTC_IT_TAMP3 ((uint32_t)RTC_TAMPCR_TAMP3IE) |
Kojto | 115:87f2f5183dfb | 376 | /** |
Kojto | 115:87f2f5183dfb | 377 | * @} |
Kojto | 115:87f2f5183dfb | 378 | */ |
Kojto | 115:87f2f5183dfb | 379 | |
Kojto | 115:87f2f5183dfb | 380 | /** @defgroup RTC_Flags_Definitions RTC Flags Definitions |
Kojto | 115:87f2f5183dfb | 381 | * @{ |
Kojto | 115:87f2f5183dfb | 382 | */ |
Kojto | 115:87f2f5183dfb | 383 | #define RTC_FLAG_RECALPF ((uint32_t)RTC_ISR_RECALPF) |
Kojto | 115:87f2f5183dfb | 384 | #define RTC_FLAG_TAMP3F ((uint32_t)RTC_ISR_TAMP3F) |
Kojto | 115:87f2f5183dfb | 385 | #define RTC_FLAG_TAMP2F ((uint32_t)RTC_ISR_TAMP2F) |
Kojto | 115:87f2f5183dfb | 386 | #define RTC_FLAG_TAMP1F ((uint32_t)RTC_ISR_TAMP1F) |
Kojto | 115:87f2f5183dfb | 387 | #define RTC_FLAG_TSOVF ((uint32_t)RTC_ISR_TSOVF) |
Kojto | 115:87f2f5183dfb | 388 | #define RTC_FLAG_TSF ((uint32_t)RTC_ISR_TSF) |
Kojto | 115:87f2f5183dfb | 389 | #define RTC_FLAG_ITSF ((uint32_t)RTC_ISR_ITSF) |
Kojto | 115:87f2f5183dfb | 390 | #define RTC_FLAG_WUTF ((uint32_t)RTC_ISR_WUTF) |
Kojto | 115:87f2f5183dfb | 391 | #define RTC_FLAG_ALRBF ((uint32_t)RTC_ISR_ALRBF) |
Kojto | 115:87f2f5183dfb | 392 | #define RTC_FLAG_ALRAF ((uint32_t)RTC_ISR_ALRAF) |
Kojto | 115:87f2f5183dfb | 393 | #define RTC_FLAG_INITF ((uint32_t)RTC_ISR_INITF) |
Kojto | 115:87f2f5183dfb | 394 | #define RTC_FLAG_RSF ((uint32_t)RTC_ISR_RSF) |
Kojto | 115:87f2f5183dfb | 395 | #define RTC_FLAG_INITS ((uint32_t)RTC_ISR_INITS) |
Kojto | 115:87f2f5183dfb | 396 | #define RTC_FLAG_SHPF ((uint32_t)RTC_ISR_SHPF) |
Kojto | 115:87f2f5183dfb | 397 | #define RTC_FLAG_WUTWF ((uint32_t)RTC_ISR_WUTWF) |
Kojto | 115:87f2f5183dfb | 398 | #define RTC_FLAG_ALRBWF ((uint32_t)RTC_ISR_ALRBWF) |
Kojto | 115:87f2f5183dfb | 399 | #define RTC_FLAG_ALRAWF ((uint32_t)RTC_ISR_ALRAWF) |
Kojto | 115:87f2f5183dfb | 400 | /** |
Kojto | 115:87f2f5183dfb | 401 | * @} |
Kojto | 115:87f2f5183dfb | 402 | */ |
Kojto | 115:87f2f5183dfb | 403 | |
Kojto | 115:87f2f5183dfb | 404 | /** |
Kojto | 115:87f2f5183dfb | 405 | * @} |
Kojto | 115:87f2f5183dfb | 406 | */ |
Kojto | 115:87f2f5183dfb | 407 | |
Kojto | 115:87f2f5183dfb | 408 | /* Exported macro ------------------------------------------------------------*/ |
Kojto | 115:87f2f5183dfb | 409 | /** @defgroup RTC_Exported_Macros RTC Exported Macros |
Kojto | 115:87f2f5183dfb | 410 | * @{ |
Kojto | 115:87f2f5183dfb | 411 | */ |
Kojto | 115:87f2f5183dfb | 412 | |
Kojto | 115:87f2f5183dfb | 413 | /** @brief Reset RTC handle state |
Kojto | 115:87f2f5183dfb | 414 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 115:87f2f5183dfb | 415 | * @retval None |
Kojto | 115:87f2f5183dfb | 416 | */ |
Kojto | 115:87f2f5183dfb | 417 | #define __HAL_RTC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_RTC_STATE_RESET) |
Kojto | 115:87f2f5183dfb | 418 | |
Kojto | 115:87f2f5183dfb | 419 | /** |
Kojto | 115:87f2f5183dfb | 420 | * @brief Disable the write protection for RTC registers. |
Kojto | 115:87f2f5183dfb | 421 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 115:87f2f5183dfb | 422 | * @retval None |
Kojto | 115:87f2f5183dfb | 423 | */ |
Kojto | 115:87f2f5183dfb | 424 | #define __HAL_RTC_WRITEPROTECTION_DISABLE(__HANDLE__) \ |
Kojto | 115:87f2f5183dfb | 425 | do{ \ |
Kojto | 115:87f2f5183dfb | 426 | (__HANDLE__)->Instance->WPR = 0xCA; \ |
Kojto | 115:87f2f5183dfb | 427 | (__HANDLE__)->Instance->WPR = 0x53; \ |
Kojto | 115:87f2f5183dfb | 428 | } while(0) |
Kojto | 115:87f2f5183dfb | 429 | |
Kojto | 115:87f2f5183dfb | 430 | /** |
Kojto | 115:87f2f5183dfb | 431 | * @brief Enable the write protection for RTC registers. |
Kojto | 115:87f2f5183dfb | 432 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 115:87f2f5183dfb | 433 | * @retval None |
Kojto | 115:87f2f5183dfb | 434 | */ |
Kojto | 115:87f2f5183dfb | 435 | #define __HAL_RTC_WRITEPROTECTION_ENABLE(__HANDLE__) \ |
Kojto | 115:87f2f5183dfb | 436 | do{ \ |
Kojto | 115:87f2f5183dfb | 437 | (__HANDLE__)->Instance->WPR = 0xFF; \ |
Kojto | 115:87f2f5183dfb | 438 | } while(0) |
Kojto | 115:87f2f5183dfb | 439 | |
Kojto | 115:87f2f5183dfb | 440 | /** |
Kojto | 115:87f2f5183dfb | 441 | * @brief Enable the RTC ALARMA peripheral. |
Kojto | 115:87f2f5183dfb | 442 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 115:87f2f5183dfb | 443 | * @retval None |
Kojto | 115:87f2f5183dfb | 444 | */ |
Kojto | 115:87f2f5183dfb | 445 | #define __HAL_RTC_ALARMA_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_ALRAE)) |
Kojto | 115:87f2f5183dfb | 446 | |
Kojto | 115:87f2f5183dfb | 447 | /** |
Kojto | 115:87f2f5183dfb | 448 | * @brief Disable the RTC ALARMA peripheral. |
Kojto | 115:87f2f5183dfb | 449 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 115:87f2f5183dfb | 450 | * @retval None |
Kojto | 115:87f2f5183dfb | 451 | */ |
Kojto | 115:87f2f5183dfb | 452 | #define __HAL_RTC_ALARMA_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_ALRAE)) |
Kojto | 115:87f2f5183dfb | 453 | |
Kojto | 115:87f2f5183dfb | 454 | /** |
Kojto | 115:87f2f5183dfb | 455 | * @brief Enable the RTC ALARMB peripheral. |
Kojto | 115:87f2f5183dfb | 456 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 115:87f2f5183dfb | 457 | * @retval None |
Kojto | 115:87f2f5183dfb | 458 | */ |
Kojto | 115:87f2f5183dfb | 459 | #define __HAL_RTC_ALARMB_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_ALRBE)) |
Kojto | 115:87f2f5183dfb | 460 | |
Kojto | 115:87f2f5183dfb | 461 | /** |
Kojto | 115:87f2f5183dfb | 462 | * @brief Disable the RTC ALARMB peripheral. |
Kojto | 115:87f2f5183dfb | 463 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 115:87f2f5183dfb | 464 | * @retval None |
Kojto | 115:87f2f5183dfb | 465 | */ |
Kojto | 115:87f2f5183dfb | 466 | #define __HAL_RTC_ALARMB_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_ALRBE)) |
Kojto | 115:87f2f5183dfb | 467 | |
Kojto | 115:87f2f5183dfb | 468 | /** |
Kojto | 115:87f2f5183dfb | 469 | * @brief Enable the RTC Alarm interrupt. |
Kojto | 115:87f2f5183dfb | 470 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 115:87f2f5183dfb | 471 | * @param __INTERRUPT__: specifies the RTC Alarm interrupt sources to be enabled or disabled. |
Kojto | 115:87f2f5183dfb | 472 | * This parameter can be any combination of the following values: |
Kojto | 115:87f2f5183dfb | 473 | * @arg RTC_IT_ALRA: Alarm A interrupt |
Kojto | 115:87f2f5183dfb | 474 | * @arg RTC_IT_ALRB: Alarm B interrupt |
Kojto | 115:87f2f5183dfb | 475 | * @retval None |
Kojto | 115:87f2f5183dfb | 476 | */ |
Kojto | 115:87f2f5183dfb | 477 | #define __HAL_RTC_ALARM_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__)) |
Kojto | 115:87f2f5183dfb | 478 | |
Kojto | 115:87f2f5183dfb | 479 | /** |
Kojto | 115:87f2f5183dfb | 480 | * @brief Disable the RTC Alarm interrupt. |
Kojto | 115:87f2f5183dfb | 481 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 115:87f2f5183dfb | 482 | * @param __INTERRUPT__: specifies the RTC Alarm interrupt sources to be enabled or disabled. |
Kojto | 115:87f2f5183dfb | 483 | * This parameter can be any combination of the following values: |
Kojto | 115:87f2f5183dfb | 484 | * @arg RTC_IT_ALRA: Alarm A interrupt |
Kojto | 115:87f2f5183dfb | 485 | * @arg RTC_IT_ALRB: Alarm B interrupt |
Kojto | 115:87f2f5183dfb | 486 | * @retval None |
Kojto | 115:87f2f5183dfb | 487 | */ |
Kojto | 115:87f2f5183dfb | 488 | #define __HAL_RTC_ALARM_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__)) |
Kojto | 115:87f2f5183dfb | 489 | |
Kojto | 115:87f2f5183dfb | 490 | /** |
Kojto | 115:87f2f5183dfb | 491 | * @brief Check whether the specified RTC Alarm interrupt has occurred or not. |
Kojto | 115:87f2f5183dfb | 492 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 115:87f2f5183dfb | 493 | * @param __INTERRUPT__: specifies the RTC Alarm interrupt to check. |
Kojto | 115:87f2f5183dfb | 494 | * This parameter can be: |
Kojto | 115:87f2f5183dfb | 495 | * @arg RTC_IT_ALRA: Alarm A interrupt |
Kojto | 115:87f2f5183dfb | 496 | * @arg RTC_IT_ALRB: Alarm B interrupt |
Kojto | 115:87f2f5183dfb | 497 | * @retval None |
Kojto | 115:87f2f5183dfb | 498 | */ |
Kojto | 115:87f2f5183dfb | 499 | #define __HAL_RTC_ALARM_GET_IT(__HANDLE__, __INTERRUPT__) ((((((__HANDLE__)->Instance->ISR)& ((__INTERRUPT__)>> 4)) & 0x0000FFFF) != RESET)? SET : RESET) |
Kojto | 115:87f2f5183dfb | 500 | |
Kojto | 115:87f2f5183dfb | 501 | /** |
Kojto | 115:87f2f5183dfb | 502 | * @brief Get the selected RTC Alarm's flag status. |
Kojto | 115:87f2f5183dfb | 503 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 115:87f2f5183dfb | 504 | * @param __FLAG__: specifies the RTC Alarm Flag to check. |
Kojto | 115:87f2f5183dfb | 505 | * This parameter can be: |
Kojto | 115:87f2f5183dfb | 506 | * @arg RTC_FLAG_ALRAF |
Kojto | 115:87f2f5183dfb | 507 | * @arg RTC_FLAG_ALRBF |
Kojto | 115:87f2f5183dfb | 508 | * @arg RTC_FLAG_ALRAWF |
Kojto | 115:87f2f5183dfb | 509 | * @arg RTC_FLAG_ALRBWF |
Kojto | 115:87f2f5183dfb | 510 | * @retval None |
Kojto | 115:87f2f5183dfb | 511 | */ |
Kojto | 115:87f2f5183dfb | 512 | #define __HAL_RTC_ALARM_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET) |
Kojto | 115:87f2f5183dfb | 513 | |
Kojto | 115:87f2f5183dfb | 514 | /** |
Kojto | 115:87f2f5183dfb | 515 | * @brief Clear the RTC Alarm's pending flags. |
Kojto | 115:87f2f5183dfb | 516 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 115:87f2f5183dfb | 517 | * @param __FLAG__: specifies the RTC Alarm Flag sources to be enabled or disabled. |
Kojto | 115:87f2f5183dfb | 518 | * This parameter can be: |
Kojto | 115:87f2f5183dfb | 519 | * @arg RTC_FLAG_ALRAF |
Kojto | 115:87f2f5183dfb | 520 | * @arg RTC_FLAG_ALRBF |
Kojto | 115:87f2f5183dfb | 521 | * @retval None |
Kojto | 115:87f2f5183dfb | 522 | */ |
Kojto | 115:87f2f5183dfb | 523 | #define __HAL_RTC_ALARM_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~(((__FLAG__) | RTC_ISR_INIT)& 0x0000FFFF)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) |
Kojto | 115:87f2f5183dfb | 524 | |
Kojto | 115:87f2f5183dfb | 525 | /** |
Kojto | 115:87f2f5183dfb | 526 | * @brief Check whether the specified RTC Alarm interrupt has been enabled or not. |
Kojto | 115:87f2f5183dfb | 527 | * @param __HANDLE__: specifies the RTC handle. |
Kojto | 115:87f2f5183dfb | 528 | * @param __INTERRUPT__: specifies the RTC Alarm interrupt sources to check. |
Kojto | 115:87f2f5183dfb | 529 | * This parameter can be: |
Kojto | 115:87f2f5183dfb | 530 | * @arg RTC_IT_ALRA: Alarm A interrupt |
Kojto | 115:87f2f5183dfb | 531 | * @arg RTC_IT_ALRB: Alarm B interrupt |
Kojto | 115:87f2f5183dfb | 532 | * @retval None |
Kojto | 115:87f2f5183dfb | 533 | */ |
Kojto | 115:87f2f5183dfb | 534 | #define __HAL_RTC_ALARM_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET) |
Kojto | 115:87f2f5183dfb | 535 | |
Kojto | 115:87f2f5183dfb | 536 | /** |
Kojto | 115:87f2f5183dfb | 537 | * @brief Enable interrupt on the RTC Alarm associated Exti line. |
Kojto | 115:87f2f5183dfb | 538 | * @retval None |
Kojto | 115:87f2f5183dfb | 539 | */ |
Kojto | 115:87f2f5183dfb | 540 | #define __HAL_RTC_ALARM_EXTI_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_ALARM_EVENT) |
Kojto | 115:87f2f5183dfb | 541 | |
Kojto | 115:87f2f5183dfb | 542 | /** |
Kojto | 115:87f2f5183dfb | 543 | * @brief Disable interrupt on the RTC Alarm associated Exti line. |
Kojto | 115:87f2f5183dfb | 544 | * @retval None |
Kojto | 115:87f2f5183dfb | 545 | */ |
Kojto | 115:87f2f5183dfb | 546 | #define __HAL_RTC_ALARM_EXTI_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_ALARM_EVENT)) |
Kojto | 115:87f2f5183dfb | 547 | |
Kojto | 115:87f2f5183dfb | 548 | /** |
Kojto | 115:87f2f5183dfb | 549 | * @brief Enable event on the RTC Alarm associated Exti line. |
Kojto | 115:87f2f5183dfb | 550 | * @retval None. |
Kojto | 115:87f2f5183dfb | 551 | */ |
Kojto | 115:87f2f5183dfb | 552 | #define __HAL_RTC_ALARM_EXTI_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_ALARM_EVENT) |
Kojto | 115:87f2f5183dfb | 553 | |
Kojto | 115:87f2f5183dfb | 554 | /** |
Kojto | 115:87f2f5183dfb | 555 | * @brief Disable event on the RTC Alarm associated Exti line. |
Kojto | 115:87f2f5183dfb | 556 | * @retval None. |
Kojto | 115:87f2f5183dfb | 557 | */ |
Kojto | 115:87f2f5183dfb | 558 | #define __HAL_RTC_ALARM_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_ALARM_EVENT)) |
Kojto | 115:87f2f5183dfb | 559 | |
Kojto | 115:87f2f5183dfb | 560 | /** |
Kojto | 115:87f2f5183dfb | 561 | * @brief Enable falling edge trigger on the RTC Alarm associated Exti line. |
Kojto | 115:87f2f5183dfb | 562 | * @retval None. |
Kojto | 115:87f2f5183dfb | 563 | */ |
Kojto | 115:87f2f5183dfb | 564 | #define __HAL_RTC_ALARM_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_ALARM_EVENT) |
Kojto | 115:87f2f5183dfb | 565 | |
Kojto | 115:87f2f5183dfb | 566 | /** |
Kojto | 115:87f2f5183dfb | 567 | * @brief Disable falling edge trigger on the RTC Alarm associated Exti line. |
Kojto | 115:87f2f5183dfb | 568 | * @retval None. |
Kojto | 115:87f2f5183dfb | 569 | */ |
Kojto | 115:87f2f5183dfb | 570 | #define __HAL_RTC_ALARM_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_ALARM_EVENT)) |
Kojto | 115:87f2f5183dfb | 571 | |
Kojto | 115:87f2f5183dfb | 572 | /** |
Kojto | 115:87f2f5183dfb | 573 | * @brief Enable rising edge trigger on the RTC Alarm associated Exti line. |
Kojto | 115:87f2f5183dfb | 574 | * @retval None. |
Kojto | 115:87f2f5183dfb | 575 | */ |
Kojto | 115:87f2f5183dfb | 576 | #define __HAL_RTC_ALARM_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_ALARM_EVENT) |
Kojto | 115:87f2f5183dfb | 577 | |
Kojto | 115:87f2f5183dfb | 578 | /** |
Kojto | 115:87f2f5183dfb | 579 | * @brief Disable rising edge trigger on the RTC Alarm associated Exti line. |
Kojto | 115:87f2f5183dfb | 580 | * @retval None. |
Kojto | 115:87f2f5183dfb | 581 | */ |
Kojto | 115:87f2f5183dfb | 582 | #define __HAL_RTC_ALARM_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_ALARM_EVENT)) |
Kojto | 115:87f2f5183dfb | 583 | |
Kojto | 115:87f2f5183dfb | 584 | /** |
Kojto | 115:87f2f5183dfb | 585 | * @brief Enable rising & falling edge trigger on the RTC Alarm associated Exti line. |
Kojto | 115:87f2f5183dfb | 586 | * @retval None. |
Kojto | 115:87f2f5183dfb | 587 | */ |
Kojto | 115:87f2f5183dfb | 588 | #define __HAL_RTC_ALARM_EXTI_ENABLE_RISING_FALLING_EDGE() __HAL_RTC_ALARM_EXTI_ENABLE_RISING_EDGE();__HAL_RTC_ALARM_EXTI_ENABLE_FALLING_EDGE(); |
Kojto | 115:87f2f5183dfb | 589 | |
Kojto | 115:87f2f5183dfb | 590 | /** |
Kojto | 115:87f2f5183dfb | 591 | * @brief Disable rising & falling edge trigger on the RTC Alarm associated Exti line. |
Kojto | 115:87f2f5183dfb | 592 | * @retval None. |
Kojto | 115:87f2f5183dfb | 593 | */ |
Kojto | 115:87f2f5183dfb | 594 | #define __HAL_RTC_ALARM_EXTI_DISABLE_RISING_FALLING_EDGE() __HAL_RTC_ALARM_EXTI_DISABLE_RISING_EDGE();__HAL_RTC_ALARM_EXTI_DISABLE_FALLING_EDGE(); |
Kojto | 115:87f2f5183dfb | 595 | |
Kojto | 115:87f2f5183dfb | 596 | /** |
Kojto | 115:87f2f5183dfb | 597 | * @brief Check whether the RTC Alarm associated Exti line interrupt flag is set or not. |
Kojto | 115:87f2f5183dfb | 598 | * @retval Line Status. |
Kojto | 115:87f2f5183dfb | 599 | */ |
Kojto | 115:87f2f5183dfb | 600 | #define __HAL_RTC_ALARM_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_ALARM_EVENT) |
Kojto | 115:87f2f5183dfb | 601 | |
Kojto | 115:87f2f5183dfb | 602 | /** |
Kojto | 115:87f2f5183dfb | 603 | * @brief Clear the RTC Alarm associated Exti line flag. |
Kojto | 115:87f2f5183dfb | 604 | * @retval None. |
Kojto | 115:87f2f5183dfb | 605 | */ |
Kojto | 115:87f2f5183dfb | 606 | #define __HAL_RTC_ALARM_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_ALARM_EVENT) |
Kojto | 115:87f2f5183dfb | 607 | |
Kojto | 115:87f2f5183dfb | 608 | /** |
Kojto | 115:87f2f5183dfb | 609 | * @brief Generate a Software interrupt on RTC Alarm associated Exti line. |
Kojto | 115:87f2f5183dfb | 610 | * @retval None. |
Kojto | 115:87f2f5183dfb | 611 | */ |
Kojto | 115:87f2f5183dfb | 612 | #define __HAL_RTC_ALARM_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_ALARM_EVENT) |
Kojto | 115:87f2f5183dfb | 613 | /** |
Kojto | 115:87f2f5183dfb | 614 | * @} |
Kojto | 115:87f2f5183dfb | 615 | */ |
Kojto | 115:87f2f5183dfb | 616 | |
Kojto | 115:87f2f5183dfb | 617 | /* Include RTC HAL Extension module */ |
Kojto | 115:87f2f5183dfb | 618 | #include "stm32f7xx_hal_rtc_ex.h" |
Kojto | 115:87f2f5183dfb | 619 | |
Kojto | 115:87f2f5183dfb | 620 | /* Exported functions --------------------------------------------------------*/ |
Kojto | 115:87f2f5183dfb | 621 | /** @addtogroup RTC_Exported_Functions |
Kojto | 115:87f2f5183dfb | 622 | * @{ |
Kojto | 115:87f2f5183dfb | 623 | */ |
Kojto | 115:87f2f5183dfb | 624 | |
Kojto | 115:87f2f5183dfb | 625 | /** @addtogroup RTC_Exported_Functions_Group1 |
Kojto | 115:87f2f5183dfb | 626 | * @{ |
Kojto | 115:87f2f5183dfb | 627 | */ |
Kojto | 115:87f2f5183dfb | 628 | /* Initialization and de-initialization functions ****************************/ |
Kojto | 115:87f2f5183dfb | 629 | HAL_StatusTypeDef HAL_RTC_Init(RTC_HandleTypeDef *hrtc); |
Kojto | 115:87f2f5183dfb | 630 | HAL_StatusTypeDef HAL_RTC_DeInit(RTC_HandleTypeDef *hrtc); |
Kojto | 115:87f2f5183dfb | 631 | void HAL_RTC_MspInit(RTC_HandleTypeDef *hrtc); |
Kojto | 115:87f2f5183dfb | 632 | void HAL_RTC_MspDeInit(RTC_HandleTypeDef *hrtc); |
Kojto | 115:87f2f5183dfb | 633 | /** |
Kojto | 115:87f2f5183dfb | 634 | * @} |
Kojto | 115:87f2f5183dfb | 635 | */ |
Kojto | 115:87f2f5183dfb | 636 | |
Kojto | 115:87f2f5183dfb | 637 | /** @addtogroup RTC_Exported_Functions_Group2 |
Kojto | 115:87f2f5183dfb | 638 | * @{ |
Kojto | 115:87f2f5183dfb | 639 | */ |
Kojto | 115:87f2f5183dfb | 640 | /* RTC Time and Date functions ************************************************/ |
Kojto | 115:87f2f5183dfb | 641 | HAL_StatusTypeDef HAL_RTC_SetTime(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTime, uint32_t Format); |
Kojto | 115:87f2f5183dfb | 642 | HAL_StatusTypeDef HAL_RTC_GetTime(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTime, uint32_t Format); |
Kojto | 115:87f2f5183dfb | 643 | HAL_StatusTypeDef HAL_RTC_SetDate(RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDate, uint32_t Format); |
Kojto | 115:87f2f5183dfb | 644 | HAL_StatusTypeDef HAL_RTC_GetDate(RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDate, uint32_t Format); |
Kojto | 115:87f2f5183dfb | 645 | /** |
Kojto | 115:87f2f5183dfb | 646 | * @} |
Kojto | 115:87f2f5183dfb | 647 | */ |
Kojto | 115:87f2f5183dfb | 648 | |
Kojto | 115:87f2f5183dfb | 649 | /** @addtogroup RTC_Exported_Functions_Group3 |
Kojto | 115:87f2f5183dfb | 650 | * @{ |
Kojto | 115:87f2f5183dfb | 651 | */ |
Kojto | 115:87f2f5183dfb | 652 | /* RTC Alarm functions ********************************************************/ |
Kojto | 115:87f2f5183dfb | 653 | HAL_StatusTypeDef HAL_RTC_SetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Format); |
Kojto | 115:87f2f5183dfb | 654 | HAL_StatusTypeDef HAL_RTC_SetAlarm_IT(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Format); |
Kojto | 115:87f2f5183dfb | 655 | HAL_StatusTypeDef HAL_RTC_DeactivateAlarm(RTC_HandleTypeDef *hrtc, uint32_t Alarm); |
Kojto | 115:87f2f5183dfb | 656 | HAL_StatusTypeDef HAL_RTC_GetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Alarm, uint32_t Format); |
Kojto | 115:87f2f5183dfb | 657 | void HAL_RTC_AlarmIRQHandler(RTC_HandleTypeDef *hrtc); |
Kojto | 115:87f2f5183dfb | 658 | HAL_StatusTypeDef HAL_RTC_PollForAlarmAEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout); |
Kojto | 115:87f2f5183dfb | 659 | void HAL_RTC_AlarmAEventCallback(RTC_HandleTypeDef *hrtc); |
Kojto | 115:87f2f5183dfb | 660 | /** |
Kojto | 115:87f2f5183dfb | 661 | * @} |
Kojto | 115:87f2f5183dfb | 662 | */ |
Kojto | 115:87f2f5183dfb | 663 | |
Kojto | 115:87f2f5183dfb | 664 | /** @addtogroup RTC_Exported_Functions_Group4 |
Kojto | 115:87f2f5183dfb | 665 | * @{ |
Kojto | 115:87f2f5183dfb | 666 | */ |
Kojto | 115:87f2f5183dfb | 667 | /* Peripheral Control functions ***********************************************/ |
Kojto | 115:87f2f5183dfb | 668 | HAL_StatusTypeDef HAL_RTC_WaitForSynchro(RTC_HandleTypeDef* hrtc); |
Kojto | 115:87f2f5183dfb | 669 | /** |
Kojto | 115:87f2f5183dfb | 670 | * @} |
Kojto | 115:87f2f5183dfb | 671 | */ |
Kojto | 115:87f2f5183dfb | 672 | |
Kojto | 115:87f2f5183dfb | 673 | /** @addtogroup RTC_Exported_Functions_Group5 |
Kojto | 115:87f2f5183dfb | 674 | * @{ |
Kojto | 115:87f2f5183dfb | 675 | */ |
Kojto | 115:87f2f5183dfb | 676 | /* Peripheral State functions *************************************************/ |
Kojto | 115:87f2f5183dfb | 677 | HAL_RTCStateTypeDef HAL_RTC_GetState(RTC_HandleTypeDef *hrtc); |
Kojto | 115:87f2f5183dfb | 678 | /** |
Kojto | 115:87f2f5183dfb | 679 | * @} |
Kojto | 115:87f2f5183dfb | 680 | */ |
Kojto | 115:87f2f5183dfb | 681 | |
Kojto | 115:87f2f5183dfb | 682 | /** |
Kojto | 115:87f2f5183dfb | 683 | * @} |
Kojto | 115:87f2f5183dfb | 684 | */ |
Kojto | 115:87f2f5183dfb | 685 | |
Kojto | 115:87f2f5183dfb | 686 | /* Private types -------------------------------------------------------------*/ |
Kojto | 115:87f2f5183dfb | 687 | /* Private variables ---------------------------------------------------------*/ |
Kojto | 115:87f2f5183dfb | 688 | /* Private constants ---------------------------------------------------------*/ |
Kojto | 115:87f2f5183dfb | 689 | /** @defgroup RTC_Private_Constants RTC Private Constants |
Kojto | 115:87f2f5183dfb | 690 | * @{ |
Kojto | 115:87f2f5183dfb | 691 | */ |
Kojto | 115:87f2f5183dfb | 692 | /* Masks Definition */ |
Kojto | 115:87f2f5183dfb | 693 | #define RTC_TR_RESERVED_MASK ((uint32_t)0x007F7F7F) |
Kojto | 115:87f2f5183dfb | 694 | #define RTC_DR_RESERVED_MASK ((uint32_t)0x00FFFF3F) |
Kojto | 115:87f2f5183dfb | 695 | #define RTC_INIT_MASK ((uint32_t)0xFFFFFFFF) |
Kojto | 115:87f2f5183dfb | 696 | #define RTC_RSF_MASK ((uint32_t)0xFFFFFF5F) |
Kojto | 115:87f2f5183dfb | 697 | |
Kojto | 115:87f2f5183dfb | 698 | #define RTC_TIMEOUT_VALUE 1000 |
Kojto | 115:87f2f5183dfb | 699 | |
Kojto | 115:87f2f5183dfb | 700 | #define RTC_EXTI_LINE_ALARM_EVENT ((uint32_t)EXTI_IMR_MR17) /*!< External interrupt line 17 Connected to the RTC Alarm event */ |
Kojto | 115:87f2f5183dfb | 701 | /** |
Kojto | 115:87f2f5183dfb | 702 | * @} |
Kojto | 115:87f2f5183dfb | 703 | */ |
Kojto | 115:87f2f5183dfb | 704 | |
Kojto | 115:87f2f5183dfb | 705 | /* Private macros ------------------------------------------------------------*/ |
Kojto | 115:87f2f5183dfb | 706 | /** @defgroup RTC_Private_Macros RTC Private Macros |
Kojto | 115:87f2f5183dfb | 707 | * @{ |
Kojto | 115:87f2f5183dfb | 708 | */ |
Kojto | 115:87f2f5183dfb | 709 | |
Kojto | 115:87f2f5183dfb | 710 | /** @defgroup RTC_IS_RTC_Definitions RTC Private macros to check input parameters |
Kojto | 115:87f2f5183dfb | 711 | * @{ |
Kojto | 115:87f2f5183dfb | 712 | */ |
Kojto | 115:87f2f5183dfb | 713 | #define IS_RTC_HOUR_FORMAT(__FORMAT__) (((__FORMAT__) == RTC_HOURFORMAT_12) || \ |
Kojto | 115:87f2f5183dfb | 714 | ((__FORMAT__) == RTC_HOURFORMAT_24)) |
Kojto | 115:87f2f5183dfb | 715 | #define IS_RTC_OUTPUT_POL(__POL__) (((__POL__) == RTC_OUTPUT_POLARITY_HIGH) || \ |
Kojto | 115:87f2f5183dfb | 716 | ((__POL__) == RTC_OUTPUT_POLARITY_LOW)) |
Kojto | 115:87f2f5183dfb | 717 | #define IS_RTC_OUTPUT_TYPE(__TYPE__) (((__TYPE__) == RTC_OUTPUT_TYPE_OPENDRAIN) || \ |
Kojto | 115:87f2f5183dfb | 718 | ((__TYPE__) == RTC_OUTPUT_TYPE_PUSHPULL)) |
Kojto | 115:87f2f5183dfb | 719 | #define IS_RTC_ASYNCH_PREDIV(__PREDIV__) ((__PREDIV__) <= (uint32_t)0x7F) |
Kojto | 115:87f2f5183dfb | 720 | #define IS_RTC_SYNCH_PREDIV(__PREDIV__) ((__PREDIV__) <= (uint32_t)0x7FFF) |
Kojto | 115:87f2f5183dfb | 721 | #define IS_RTC_HOUR12(__HOUR__) (((__HOUR__) > (uint32_t)0) && ((__HOUR__) <= (uint32_t)12)) |
Kojto | 115:87f2f5183dfb | 722 | #define IS_RTC_HOUR24(__HOUR__) ((__HOUR__) <= (uint32_t)23) |
Kojto | 115:87f2f5183dfb | 723 | #define IS_RTC_MINUTES(__MINUTES__) ((__MINUTES__) <= (uint32_t)59) |
Kojto | 115:87f2f5183dfb | 724 | #define IS_RTC_SECONDS(__SECONDS__) ((__SECONDS__) <= (uint32_t)59) |
Kojto | 115:87f2f5183dfb | 725 | #define IS_RTC_HOURFORMAT12(__PM__) (((__PM__) == RTC_HOURFORMAT12_AM) || ((__PM__) == RTC_HOURFORMAT12_PM)) |
Kojto | 115:87f2f5183dfb | 726 | #define IS_RTC_DAYLIGHT_SAVING(__SAVE__) (((__SAVE__) == RTC_DAYLIGHTSAVING_SUB1H) || \ |
Kojto | 115:87f2f5183dfb | 727 | ((__SAVE__) == RTC_DAYLIGHTSAVING_ADD1H) || \ |
Kojto | 115:87f2f5183dfb | 728 | ((__SAVE__) == RTC_DAYLIGHTSAVING_NONE)) |
Kojto | 115:87f2f5183dfb | 729 | #define IS_RTC_STORE_OPERATION(__OPERATION__) (((__OPERATION__) == RTC_STOREOPERATION_RESET) || \ |
Kojto | 115:87f2f5183dfb | 730 | ((__OPERATION__) == RTC_STOREOPERATION_SET)) |
Kojto | 115:87f2f5183dfb | 731 | #define IS_RTC_FORMAT(__FORMAT__) (((__FORMAT__) == RTC_FORMAT_BIN) || ((__FORMAT__) == RTC_FORMAT_BCD)) |
Kojto | 115:87f2f5183dfb | 732 | #define IS_RTC_YEAR(__YEAR__) ((__YEAR__) <= (uint32_t)99) |
Kojto | 115:87f2f5183dfb | 733 | #define IS_RTC_MONTH(__MONTH__) (((__MONTH__) >= (uint32_t)1) && ((__MONTH__) <= (uint32_t)12)) |
Kojto | 115:87f2f5183dfb | 734 | #define IS_RTC_DATE(__DATE__) (((__DATE__) >= (uint32_t)1) && ((__DATE__) <= (uint32_t)31)) |
Kojto | 115:87f2f5183dfb | 735 | #define IS_RTC_WEEKDAY(__WEEKDAY__) (((__WEEKDAY__) == RTC_WEEKDAY_MONDAY) || \ |
Kojto | 115:87f2f5183dfb | 736 | ((__WEEKDAY__) == RTC_WEEKDAY_TUESDAY) || \ |
Kojto | 115:87f2f5183dfb | 737 | ((__WEEKDAY__) == RTC_WEEKDAY_WEDNESDAY) || \ |
Kojto | 115:87f2f5183dfb | 738 | ((__WEEKDAY__) == RTC_WEEKDAY_THURSDAY) || \ |
Kojto | 115:87f2f5183dfb | 739 | ((__WEEKDAY__) == RTC_WEEKDAY_FRIDAY) || \ |
Kojto | 115:87f2f5183dfb | 740 | ((__WEEKDAY__) == RTC_WEEKDAY_SATURDAY) || \ |
Kojto | 115:87f2f5183dfb | 741 | ((__WEEKDAY__) == RTC_WEEKDAY_SUNDAY)) |
Kojto | 115:87f2f5183dfb | 742 | |
Kojto | 115:87f2f5183dfb | 743 | #define IS_RTC_ALARM_DATE_WEEKDAY_DATE(__DATE__) (((__DATE__) >(uint32_t) 0) && ((__DATE__) <= (uint32_t)31)) |
Kojto | 115:87f2f5183dfb | 744 | #define IS_RTC_ALARM_DATE_WEEKDAY_WEEKDAY(__WEEKDAY__) (((__WEEKDAY__) == RTC_WEEKDAY_MONDAY) || \ |
Kojto | 115:87f2f5183dfb | 745 | ((__WEEKDAY__) == RTC_WEEKDAY_TUESDAY) || \ |
Kojto | 115:87f2f5183dfb | 746 | ((__WEEKDAY__) == RTC_WEEKDAY_WEDNESDAY) || \ |
Kojto | 115:87f2f5183dfb | 747 | ((__WEEKDAY__) == RTC_WEEKDAY_THURSDAY) || \ |
Kojto | 115:87f2f5183dfb | 748 | ((__WEEKDAY__) == RTC_WEEKDAY_FRIDAY) || \ |
Kojto | 115:87f2f5183dfb | 749 | ((__WEEKDAY__) == RTC_WEEKDAY_SATURDAY) || \ |
Kojto | 115:87f2f5183dfb | 750 | ((__WEEKDAY__) == RTC_WEEKDAY_SUNDAY)) |
Kojto | 115:87f2f5183dfb | 751 | #define IS_RTC_ALARM_DATE_WEEKDAY_SEL(__SEL__) (((__SEL__) == RTC_ALARMDATEWEEKDAYSEL_DATE) || \ |
Kojto | 115:87f2f5183dfb | 752 | ((__SEL__) == RTC_ALARMDATEWEEKDAYSEL_WEEKDAY)) |
Kojto | 115:87f2f5183dfb | 753 | #define IS_RTC_ALARM_MASK(__MASK__) (((__MASK__) & 0x7F7F7F7F) == (uint32_t)RESET) |
Kojto | 115:87f2f5183dfb | 754 | #define IS_RTC_ALARM(__ALARM__) (((__ALARM__) == RTC_ALARM_A) || ((__ALARM__) == RTC_ALARM_B)) |
Kojto | 115:87f2f5183dfb | 755 | #define IS_RTC_ALARM_SUB_SECOND_VALUE(__VALUE__) ((__VALUE__) <= (uint32_t)0x00007FFF) |
Kojto | 115:87f2f5183dfb | 756 | #define IS_RTC_ALARM_SUB_SECOND_MASK(__MASK__) (((__MASK__) == RTC_ALARMSUBSECONDMASK_ALL) || \ |
Kojto | 115:87f2f5183dfb | 757 | ((__MASK__) == RTC_ALARMSUBSECONDMASK_SS14_1) || \ |
Kojto | 115:87f2f5183dfb | 758 | ((__MASK__) == RTC_ALARMSUBSECONDMASK_SS14_2) || \ |
Kojto | 115:87f2f5183dfb | 759 | ((__MASK__) == RTC_ALARMSUBSECONDMASK_SS14_3) || \ |
Kojto | 115:87f2f5183dfb | 760 | ((__MASK__) == RTC_ALARMSUBSECONDMASK_SS14_4) || \ |
Kojto | 115:87f2f5183dfb | 761 | ((__MASK__) == RTC_ALARMSUBSECONDMASK_SS14_5) || \ |
Kojto | 115:87f2f5183dfb | 762 | ((__MASK__) == RTC_ALARMSUBSECONDMASK_SS14_6) || \ |
Kojto | 115:87f2f5183dfb | 763 | ((__MASK__) == RTC_ALARMSUBSECONDMASK_SS14_7) || \ |
Kojto | 115:87f2f5183dfb | 764 | ((__MASK__) == RTC_ALARMSUBSECONDMASK_SS14_8) || \ |
Kojto | 115:87f2f5183dfb | 765 | ((__MASK__) == RTC_ALARMSUBSECONDMASK_SS14_9) || \ |
Kojto | 115:87f2f5183dfb | 766 | ((__MASK__) == RTC_ALARMSUBSECONDMASK_SS14_10) || \ |
Kojto | 115:87f2f5183dfb | 767 | ((__MASK__) == RTC_ALARMSUBSECONDMASK_SS14_11) || \ |
Kojto | 115:87f2f5183dfb | 768 | ((__MASK__) == RTC_ALARMSUBSECONDMASK_SS14_12) || \ |
Kojto | 115:87f2f5183dfb | 769 | ((__MASK__) == RTC_ALARMSUBSECONDMASK_SS14_13) || \ |
Kojto | 115:87f2f5183dfb | 770 | ((__MASK__) == RTC_ALARMSUBSECONDMASK_SS14) || \ |
Kojto | 115:87f2f5183dfb | 771 | ((__MASK__) == RTC_ALARMSUBSECONDMASK_NONE)) |
Kojto | 115:87f2f5183dfb | 772 | |
Kojto | 115:87f2f5183dfb | 773 | /** |
Kojto | 115:87f2f5183dfb | 774 | * @} |
Kojto | 115:87f2f5183dfb | 775 | */ |
Kojto | 115:87f2f5183dfb | 776 | |
Kojto | 115:87f2f5183dfb | 777 | /** |
Kojto | 115:87f2f5183dfb | 778 | * @} |
Kojto | 115:87f2f5183dfb | 779 | */ |
Kojto | 115:87f2f5183dfb | 780 | |
Kojto | 115:87f2f5183dfb | 781 | /* Private functions ---------------------------------------------------------*/ |
Kojto | 115:87f2f5183dfb | 782 | /** @defgroup RTC_Private_Functions RTC Private Functions |
Kojto | 115:87f2f5183dfb | 783 | * @{ |
Kojto | 115:87f2f5183dfb | 784 | */ |
Kojto | 115:87f2f5183dfb | 785 | HAL_StatusTypeDef RTC_EnterInitMode(RTC_HandleTypeDef* hrtc); |
Kojto | 115:87f2f5183dfb | 786 | uint8_t RTC_ByteToBcd2(uint8_t Value); |
Kojto | 115:87f2f5183dfb | 787 | uint8_t RTC_Bcd2ToByte(uint8_t Value); |
Kojto | 115:87f2f5183dfb | 788 | /** |
Kojto | 115:87f2f5183dfb | 789 | * @} |
Kojto | 115:87f2f5183dfb | 790 | */ |
Kojto | 115:87f2f5183dfb | 791 | |
Kojto | 115:87f2f5183dfb | 792 | /** |
Kojto | 115:87f2f5183dfb | 793 | * @} |
Kojto | 115:87f2f5183dfb | 794 | */ |
Kojto | 115:87f2f5183dfb | 795 | |
Kojto | 115:87f2f5183dfb | 796 | /** |
Kojto | 115:87f2f5183dfb | 797 | * @} |
Kojto | 115:87f2f5183dfb | 798 | */ |
Kojto | 115:87f2f5183dfb | 799 | |
Kojto | 115:87f2f5183dfb | 800 | #ifdef __cplusplus |
Kojto | 115:87f2f5183dfb | 801 | } |
Kojto | 115:87f2f5183dfb | 802 | #endif |
Kojto | 115:87f2f5183dfb | 803 | |
Kojto | 115:87f2f5183dfb | 804 | #endif /* __STM32F7xx_HAL_RTC_H */ |
Kojto | 115:87f2f5183dfb | 805 | |
Kojto | 115:87f2f5183dfb | 806 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |