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