annotate Common/Drivers/STM32F4xx_HAL_DRIVER_v120/Inc/stm32f4xx_hal_rtc.h @ 40:da86a7adc4fa

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