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