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