mikroSDK Reference Manual
stm32f1xx_hal.h
Go to the documentation of this file.
1
21/* Define to prevent recursive inclusion -------------------------------------*/
22#ifndef __STM32F1xx_HAL_H
23#define __STM32F1xx_HAL_H
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29/* Includes ------------------------------------------------------------------*/
30#include "stm32f1xx_hal_conf.h"
31
40/* Exported constants --------------------------------------------------------*/
41
49typedef enum
50{
51 HAL_TICK_FREQ_10HZ = 100U,
52 HAL_TICK_FREQ_100HZ = 10U,
53 HAL_TICK_FREQ_1KHZ = 1U,
54 HAL_TICK_FREQ_DEFAULT = HAL_TICK_FREQ_1KHZ
55} HAL_TickFreqTypeDef;
59/* Exported types ------------------------------------------------------------*/
60extern __IO uint32_t uwTick;
61extern uint32_t uwTickPrio;
62extern HAL_TickFreqTypeDef uwTickFreq;
63
67/* Exported macro ------------------------------------------------------------*/
84/* Peripherals on APB1 */
88#define __HAL_DBGMCU_FREEZE_TIM2() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM2_STOP)
89#define __HAL_DBGMCU_UNFREEZE_TIM2() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM2_STOP)
90
94#define __HAL_DBGMCU_FREEZE_TIM3() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM3_STOP)
95#define __HAL_DBGMCU_UNFREEZE_TIM3() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM3_STOP)
96
97#if defined (DBGMCU_CR_DBG_TIM4_STOP)
101#define __HAL_DBGMCU_FREEZE_TIM4() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM4_STOP)
102#define __HAL_DBGMCU_UNFREEZE_TIM4() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM4_STOP)
103#endif
104
105#if defined (DBGMCU_CR_DBG_TIM5_STOP)
109#define __HAL_DBGMCU_FREEZE_TIM5() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM5_STOP)
110#define __HAL_DBGMCU_UNFREEZE_TIM5() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM5_STOP)
111#endif
112
113#if defined (DBGMCU_CR_DBG_TIM6_STOP)
117#define __HAL_DBGMCU_FREEZE_TIM6() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM6_STOP)
118#define __HAL_DBGMCU_UNFREEZE_TIM6() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM6_STOP)
119#endif
120
121#if defined (DBGMCU_CR_DBG_TIM7_STOP)
125#define __HAL_DBGMCU_FREEZE_TIM7() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM7_STOP)
126#define __HAL_DBGMCU_UNFREEZE_TIM7() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM7_STOP)
127#endif
128
129#if defined (DBGMCU_CR_DBG_TIM12_STOP)
133#define __HAL_DBGMCU_FREEZE_TIM12() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM12_STOP)
134#define __HAL_DBGMCU_UNFREEZE_TIM12() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM12_STOP)
135#endif
136
137#if defined (DBGMCU_CR_DBG_TIM13_STOP)
141#define __HAL_DBGMCU_FREEZE_TIM13() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM13_STOP)
142#define __HAL_DBGMCU_UNFREEZE_TIM13() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM13_STOP)
143#endif
144
145#if defined (DBGMCU_CR_DBG_TIM14_STOP)
149#define __HAL_DBGMCU_FREEZE_TIM14() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM14_STOP)
150#define __HAL_DBGMCU_UNFREEZE_TIM14() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM14_STOP)
151#endif
152
156#define __HAL_DBGMCU_FREEZE_WWDG() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_WWDG_STOP)
157#define __HAL_DBGMCU_UNFREEZE_WWDG() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_WWDG_STOP)
158
162#define __HAL_DBGMCU_FREEZE_IWDG() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_IWDG_STOP)
163#define __HAL_DBGMCU_UNFREEZE_IWDG() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_IWDG_STOP)
164
168#define __HAL_DBGMCU_FREEZE_I2C1_TIMEOUT() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_I2C1_SMBUS_TIMEOUT)
169#define __HAL_DBGMCU_UNFREEZE_I2C1_TIMEOUT() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_I2C1_SMBUS_TIMEOUT)
170
171#if defined (DBGMCU_CR_DBG_I2C2_SMBUS_TIMEOUT)
175#define __HAL_DBGMCU_FREEZE_I2C2_TIMEOUT() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_I2C2_SMBUS_TIMEOUT)
176#define __HAL_DBGMCU_UNFREEZE_I2C2_TIMEOUT() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_I2C2_SMBUS_TIMEOUT)
177#endif
178
179#if defined (DBGMCU_CR_DBG_CAN1_STOP)
183#define __HAL_DBGMCU_FREEZE_CAN1() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_CAN1_STOP)
184#define __HAL_DBGMCU_UNFREEZE_CAN1() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_CAN1_STOP)
185#endif
186
187#if defined (DBGMCU_CR_DBG_CAN2_STOP)
191#define __HAL_DBGMCU_FREEZE_CAN2() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_CAN2_STOP)
192#define __HAL_DBGMCU_UNFREEZE_CAN2() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_CAN2_STOP)
193#endif
194
195/* Peripherals on APB2 */
196#if defined (DBGMCU_CR_DBG_TIM1_STOP)
200#define __HAL_DBGMCU_FREEZE_TIM1() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM1_STOP)
201#define __HAL_DBGMCU_UNFREEZE_TIM1() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM1_STOP)
202#endif
203
204#if defined (DBGMCU_CR_DBG_TIM8_STOP)
208#define __HAL_DBGMCU_FREEZE_TIM8() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM8_STOP)
209#define __HAL_DBGMCU_UNFREEZE_TIM8() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM8_STOP)
210#endif
211
212#if defined (DBGMCU_CR_DBG_TIM9_STOP)
216#define __HAL_DBGMCU_FREEZE_TIM9() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM9_STOP)
217#define __HAL_DBGMCU_UNFREEZE_TIM9() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM9_STOP)
218#endif
219
220#if defined (DBGMCU_CR_DBG_TIM10_STOP)
224#define __HAL_DBGMCU_FREEZE_TIM10() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM10_STOP)
225#define __HAL_DBGMCU_UNFREEZE_TIM10() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM10_STOP)
226#endif
227
228#if defined (DBGMCU_CR_DBG_TIM11_STOP)
232#define __HAL_DBGMCU_FREEZE_TIM11() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM11_STOP)
233#define __HAL_DBGMCU_UNFREEZE_TIM11() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM11_STOP)
234#endif
235
236
237#if defined (DBGMCU_CR_DBG_TIM15_STOP)
241#define __HAL_DBGMCU_FREEZE_TIM15() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM15_STOP)
242#define __HAL_DBGMCU_UNFREEZE_TIM15() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM15_STOP)
243#endif
244
245#if defined (DBGMCU_CR_DBG_TIM16_STOP)
249#define __HAL_DBGMCU_FREEZE_TIM16() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM16_STOP)
250#define __HAL_DBGMCU_UNFREEZE_TIM16() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM16_STOP)
251#endif
252
253#if defined (DBGMCU_CR_DBG_TIM17_STOP)
257#define __HAL_DBGMCU_FREEZE_TIM17() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM17_STOP)
258#define __HAL_DBGMCU_UNFREEZE_TIM17() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM17_STOP)
259#endif
260
268#define IS_TICKFREQ(FREQ) (((FREQ) == HAL_TICK_FREQ_10HZ) || \
269 ((FREQ) == HAL_TICK_FREQ_100HZ) || \
270 ((FREQ) == HAL_TICK_FREQ_1KHZ))
275/* Exported functions --------------------------------------------------------*/
282/* Initialization and de-initialization functions ******************************/
283HAL_StatusTypeDef HAL_Init(void);
284HAL_StatusTypeDef HAL_DeInit(void);
285void HAL_MspInit(void);
286void HAL_MspDeInit(void);
287HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority);
295/* Peripheral Control functions ************************************************/
296void HAL_IncTick(void);
297void HAL_Delay(uint32_t Delay);
298uint32_t HAL_GetTick(void);
299uint32_t HAL_GetTickPrio(void);
300HAL_StatusTypeDef HAL_SetTickFreq(HAL_TickFreqTypeDef Freq);
301HAL_TickFreqTypeDef HAL_GetTickFreq(void);
302void HAL_SuspendTick(void);
303void HAL_ResumeTick(void);
304uint32_t HAL_GetHalVersion(void);
305uint32_t HAL_GetREVID(void);
306uint32_t HAL_GetDEVID(void);
307uint32_t HAL_GetUIDw0(void);
308uint32_t HAL_GetUIDw1(void);
309uint32_t HAL_GetUIDw2(void);
310void HAL_DBGMCU_EnableDBGSleepMode(void);
311void HAL_DBGMCU_DisableDBGSleepMode(void);
312void HAL_DBGMCU_EnableDBGStopMode(void);
313void HAL_DBGMCU_DisableDBGStopMode(void);
314void HAL_DBGMCU_EnableDBGStandbyMode(void);
315void HAL_DBGMCU_DisableDBGStandbyMode(void);
327/* Private types -------------------------------------------------------------*/
328/* Private variables ---------------------------------------------------------*/
335/* Private constants ---------------------------------------------------------*/
342/* Private macros ------------------------------------------------------------*/
343/* Private functions ---------------------------------------------------------*/
352#ifdef __cplusplus
353}
354#endif
355
356#endif /* __STM32F1xx_HAL_H */
357
358/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
#define __IO
Definition core_cm3.h:170
HAL configuration file.
HAL_StatusTypeDef
HAL Status structures definition.
Definition stm32f1xx_hal_def.h:40