22 ******************************************************************************
33 * @file stm32f1xx_hal.h
44 * @author MCD Application Team
5- * @version V1.1.1
6- * @date 12-May-2017
7- * @brief This file contains all the functions prototypes for the HAL
5+ * @brief This file contains all the functions prototypes for the HAL
86 * module driver.
97 ******************************************************************************
108 * @attention
3432 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3533 *
3634 ******************************************************************************
37- */
35+ */
3836
3937/* Define to prevent recursive inclusion -------------------------------------*/
4038#ifndef __STM32F1xx_HAL_H
4139#define __STM32F1xx_HAL_H
4240
4341#ifdef __cplusplus
44- extern "C" {
42+ extern "C" {
4543#endif
4644
4745/* Includes ------------------------------------------------------------------*/
5351
5452/** @addtogroup HAL
5553 * @{
56- */
54+ */
5755
5856/* Exported types ------------------------------------------------------------*/
5957/* Exported constants --------------------------------------------------------*/
6058
59+ /** @defgroup HAL_Exported_Constants HAL Exported Constants
60+ * @{
61+ */
62+
63+ /** @defgroup HAL_TICK_FREQ Tick Frequency
64+ * @{
65+ */
66+ typedef enum
67+ {
68+ HAL_TICK_FREQ_10HZ = 100U ,
69+ HAL_TICK_FREQ_100HZ = 10U ,
70+ HAL_TICK_FREQ_1KHZ = 1U ,
71+ HAL_TICK_FREQ_DEFAULT = HAL_TICK_FREQ_1KHZ
72+ } HAL_TickFreqTypeDef ;
73+ /**
74+ * @}
75+ */
76+
77+ /**
78+ * @}
79+ */
6180/* Exported macro ------------------------------------------------------------*/
6281/** @defgroup HAL_Exported_Macros HAL Exported Macros
6382 * @{
6483 */
6584
6685/** @defgroup DBGMCU_Freeze_Unfreeze Freeze Unfreeze Peripherals in Debug mode
67- * @brief Freeze/Unfreeze Peripherals in Debug mode
86+ * @brief Freeze/Unfreeze Peripherals in Debug mode
6887 * Note: On devices STM32F10xx8 and STM32F10xxB,
6988 * STM32F101xC/D/E and STM32F103xC/D/E,
7089 * STM32F101xF/G and STM32F103xF/G
7190 * STM32F10xx4 and STM32F10xx6
72- * Debug registers DBGMCU_IDCODE and DBGMCU_CR are accessible only in
91+ * Debug registers DBGMCU_IDCODE and DBGMCU_CR are accessible only in
7392 * debug mode (not accessible by the user software in normal mode).
7493 * Refer to errata sheet of these devices for more details.
7594 * @{
7695 */
77-
96+
7897/* Peripherals on APB1 */
7998/**
80- * @brief TIM2 Peripherals Debug mode
99+ * @brief TIM2 Peripherals Debug mode
81100 */
82101#define __HAL_DBGMCU_FREEZE_TIM2 () SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM2_STOP)
83102#define __HAL_DBGMCU_UNFREEZE_TIM2 () CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM2_STOP)
84103
85104/**
86- * @brief TIM3 Peripherals Debug mode
105+ * @brief TIM3 Peripherals Debug mode
87106 */
88107#define __HAL_DBGMCU_FREEZE_TIM3 () SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM3_STOP)
89108#define __HAL_DBGMCU_UNFREEZE_TIM3 () CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM3_STOP)
90109
91110#if defined (DBGMCU_CR_DBG_TIM4_STOP )
92111/**
93- * @brief TIM4 Peripherals Debug mode
112+ * @brief TIM4 Peripherals Debug mode
94113 */
95114#define __HAL_DBGMCU_FREEZE_TIM4 () SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM4_STOP)
96115#define __HAL_DBGMCU_UNFREEZE_TIM4 () CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM4_STOP)
97116#endif
98117
99118#if defined (DBGMCU_CR_DBG_TIM5_STOP )
100119/**
101- * @brief TIM5 Peripherals Debug mode
120+ * @brief TIM5 Peripherals Debug mode
102121 */
103122#define __HAL_DBGMCU_FREEZE_TIM5 () SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM5_STOP)
104123#define __HAL_DBGMCU_UNFREEZE_TIM5 () CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM5_STOP)
105124#endif
106125
107126#if defined (DBGMCU_CR_DBG_TIM6_STOP )
108127/**
109- * @brief TIM6 Peripherals Debug mode
128+ * @brief TIM6 Peripherals Debug mode
110129 */
111130#define __HAL_DBGMCU_FREEZE_TIM6 () SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM6_STOP)
112131#define __HAL_DBGMCU_UNFREEZE_TIM6 () CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM6_STOP)
113132#endif
114133
115134#if defined (DBGMCU_CR_DBG_TIM7_STOP )
116135/**
117- * @brief TIM7 Peripherals Debug mode
136+ * @brief TIM7 Peripherals Debug mode
118137 */
119138#define __HAL_DBGMCU_FREEZE_TIM7 () SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM7_STOP)
120139#define __HAL_DBGMCU_UNFREEZE_TIM7 () CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM7_STOP)
121140#endif
122141
123142#if defined (DBGMCU_CR_DBG_TIM12_STOP )
124143/**
125- * @brief TIM12 Peripherals Debug mode
144+ * @brief TIM12 Peripherals Debug mode
126145 */
127146#define __HAL_DBGMCU_FREEZE_TIM12 () SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM12_STOP)
128147#define __HAL_DBGMCU_UNFREEZE_TIM12 () CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM12_STOP)
129148#endif
130149
131150#if defined (DBGMCU_CR_DBG_TIM13_STOP )
132151/**
133- * @brief TIM13 Peripherals Debug mode
152+ * @brief TIM13 Peripherals Debug mode
134153 */
135154#define __HAL_DBGMCU_FREEZE_TIM13 () SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM13_STOP)
136155#define __HAL_DBGMCU_UNFREEZE_TIM13 () CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM13_STOP)
137156#endif
138157
139158#if defined (DBGMCU_CR_DBG_TIM14_STOP )
140159/**
141- * @brief TIM14 Peripherals Debug mode
160+ * @brief TIM14 Peripherals Debug mode
142161 */
143162#define __HAL_DBGMCU_FREEZE_TIM14 () SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM14_STOP)
144163#define __HAL_DBGMCU_UNFREEZE_TIM14 () CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM14_STOP)
145164#endif
146165
147166/**
148- * @brief WWDG Peripherals Debug mode
167+ * @brief WWDG Peripherals Debug mode
149168 */
150169#define __HAL_DBGMCU_FREEZE_WWDG () SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_WWDG_STOP)
151170#define __HAL_DBGMCU_UNFREEZE_WWDG () CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_WWDG_STOP)
152171
153172/**
154- * @brief IWDG Peripherals Debug mode
173+ * @brief IWDG Peripherals Debug mode
155174 */
156175#define __HAL_DBGMCU_FREEZE_IWDG () SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_IWDG_STOP)
157176#define __HAL_DBGMCU_UNFREEZE_IWDG () CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_IWDG_STOP)
158177
159178/**
160- * @brief I2C1 Peripherals Debug mode
179+ * @brief I2C1 Peripherals Debug mode
161180 */
162181#define __HAL_DBGMCU_FREEZE_I2C1_TIMEOUT () SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_I2C1_SMBUS_TIMEOUT)
163182#define __HAL_DBGMCU_UNFREEZE_I2C1_TIMEOUT () CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_I2C1_SMBUS_TIMEOUT)
164183
165184#if defined (DBGMCU_CR_DBG_I2C2_SMBUS_TIMEOUT )
166185/**
167- * @brief I2C2 Peripherals Debug mode
186+ * @brief I2C2 Peripherals Debug mode
168187 */
169188#define __HAL_DBGMCU_FREEZE_I2C2_TIMEOUT () SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_I2C2_SMBUS_TIMEOUT)
170189#define __HAL_DBGMCU_UNFREEZE_I2C2_TIMEOUT () CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_I2C2_SMBUS_TIMEOUT)
171190#endif
172191
173192#if defined (DBGMCU_CR_DBG_CAN1_STOP )
174193/**
175- * @brief CAN1 Peripherals Debug mode
194+ * @brief CAN1 Peripherals Debug mode
176195 */
177196#define __HAL_DBGMCU_FREEZE_CAN1 () SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_CAN1_STOP)
178197#define __HAL_DBGMCU_UNFREEZE_CAN1 () CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_CAN1_STOP)
179198#endif
180199
181200#if defined (DBGMCU_CR_DBG_CAN2_STOP )
182201/**
183- * @brief CAN2 Peripherals Debug mode
202+ * @brief CAN2 Peripherals Debug mode
184203 */
185204#define __HAL_DBGMCU_FREEZE_CAN2 () SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_CAN2_STOP)
186205#define __HAL_DBGMCU_UNFREEZE_CAN2 () CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_CAN2_STOP)
187- #endif
188-
206+ #endif
207+
189208/* Peripherals on APB2 */
190209#if defined (DBGMCU_CR_DBG_TIM1_STOP )
191210/**
192- * @brief TIM1 Peripherals Debug mode
211+ * @brief TIM1 Peripherals Debug mode
193212 */
194213#define __HAL_DBGMCU_FREEZE_TIM1 () SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM1_STOP)
195214#define __HAL_DBGMCU_UNFREEZE_TIM1 () CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM1_STOP)
196215#endif
197216
198217#if defined (DBGMCU_CR_DBG_TIM8_STOP )
199218/**
200- * @brief TIM8 Peripherals Debug mode
219+ * @brief TIM8 Peripherals Debug mode
201220 */
202221#define __HAL_DBGMCU_FREEZE_TIM8 () SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM8_STOP)
203222#define __HAL_DBGMCU_UNFREEZE_TIM8 () CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM8_STOP)
204223#endif
205224
206225#if defined (DBGMCU_CR_DBG_TIM9_STOP )
207226/**
208- * @brief TIM9 Peripherals Debug mode
227+ * @brief TIM9 Peripherals Debug mode
209228 */
210229#define __HAL_DBGMCU_FREEZE_TIM9 () SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM9_STOP)
211230#define __HAL_DBGMCU_UNFREEZE_TIM9 () CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM9_STOP)
212231#endif
213232
214233#if defined (DBGMCU_CR_DBG_TIM10_STOP )
215234/**
216- * @brief TIM10 Peripherals Debug mode
235+ * @brief TIM10 Peripherals Debug mode
217236 */
218237#define __HAL_DBGMCU_FREEZE_TIM10 () SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM10_STOP)
219238#define __HAL_DBGMCU_UNFREEZE_TIM10 () CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM10_STOP)
220239#endif
221240
222241#if defined (DBGMCU_CR_DBG_TIM11_STOP )
223242/**
224- * @brief TIM11 Peripherals Debug mode
243+ * @brief TIM11 Peripherals Debug mode
225244 */
226245#define __HAL_DBGMCU_FREEZE_TIM11 () SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM11_STOP)
227246#define __HAL_DBGMCU_UNFREEZE_TIM11 () CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM11_STOP)
230249
231250#if defined (DBGMCU_CR_DBG_TIM15_STOP )
232251/**
233- * @brief TIM15 Peripherals Debug mode
252+ * @brief TIM15 Peripherals Debug mode
234253 */
235254#define __HAL_DBGMCU_FREEZE_TIM15 () SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM15_STOP)
236255#define __HAL_DBGMCU_UNFREEZE_TIM15 () CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM15_STOP)
237256#endif
238257
239258#if defined (DBGMCU_CR_DBG_TIM16_STOP )
240259/**
241- * @brief TIM16 Peripherals Debug mode
260+ * @brief TIM16 Peripherals Debug mode
242261 */
243262#define __HAL_DBGMCU_FREEZE_TIM16 () SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM16_STOP)
244263#define __HAL_DBGMCU_UNFREEZE_TIM16 () CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM16_STOP)
245264#endif
246265
247266#if defined (DBGMCU_CR_DBG_TIM17_STOP )
248267/**
249- * @brief TIM17 Peripherals Debug mode
268+ * @brief TIM17 Peripherals Debug mode
250269 */
251270#define __HAL_DBGMCU_FREEZE_TIM17 () SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM17_STOP)
252271#define __HAL_DBGMCU_UNFREEZE_TIM17 () CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM17_STOP)
256275 * @}
257276 */
258277
278+ /** @defgroup HAL_Private_Macros HAL Private Macros
279+ * @{
280+ */
281+ #define IS_TICKFREQ (FREQ ) (((FREQ) == HAL_TICK_FREQ_10HZ) || \
282+ ((FREQ) == HAL_TICK_FREQ_100HZ) || \
283+ ((FREQ) == HAL_TICK_FREQ_1KHZ))
259284/**
260285 * @}
261286 */
@@ -272,7 +297,7 @@ HAL_StatusTypeDef HAL_Init(void);
272297HAL_StatusTypeDef HAL_DeInit (void );
273298void HAL_MspInit (void );
274299void HAL_MspDeInit (void );
275- HAL_StatusTypeDef HAL_InitTick (uint32_t TickPriority );
300+ HAL_StatusTypeDef HAL_InitTick (uint32_t TickPriority );
276301/**
277302 * @}
278303 */
@@ -282,8 +307,11 @@ HAL_StatusTypeDef HAL_InitTick (uint32_t TickPriority);
282307 */
283308/* Peripheral Control functions ************************************************/
284309void HAL_IncTick (void );
285- void HAL_Delay (__IO uint32_t Delay );
310+ void HAL_Delay (uint32_t Delay );
286311uint32_t HAL_GetTick (void );
312+ uint32_t HAL_GetTickPrio (void );
313+ HAL_StatusTypeDef HAL_SetTickFreq (HAL_TickFreqTypeDef Freq );
314+ HAL_TickFreqTypeDef HAL_GetTickFreq (void );
287315void HAL_SuspendTick (void );
288316void HAL_ResumeTick (void );
289317uint32_t HAL_GetHalVersion (void );
@@ -326,8 +354,8 @@ void HAL_GetUID(uint32_t *UID);
326354
327355/**
328356 * @}
329- */
330-
357+ */
358+
331359#ifdef __cplusplus
332360}
333361#endif
0 commit comments