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