2 ******************************************************************************
3 * @file stm32f1xx_hal.h
4 * @author MCD Application Team
6 * @date 15-December-2014
7 * @brief This file contains all the functions prototypes for the HAL
9 ******************************************************************************
12 * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
14 * Redistribution and use in source and binary forms, with or without modification,
15 * are permitted provided that the following conditions are met:
16 * 1. Redistributions of source code must retain the above copyright notice,
17 * this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright notice,
19 * this list of conditions and the following disclaimer in the documentation
20 * and/or other materials provided with the distribution.
21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 ******************************************************************************
39 /* Define to prevent recursive inclusion -------------------------------------*/
40 #ifndef __STM32F1xx_HAL_H
41 #define __STM32F1xx_HAL_H
47 /* Includes ------------------------------------------------------------------*/
48 #include "stm32f1xx_hal_conf.h"
50 /** @addtogroup STM32F1xx_HAL_Driver
58 /* Exported types ------------------------------------------------------------*/
59 /* Exported constants --------------------------------------------------------*/
61 /* Exported macro ------------------------------------------------------------*/
63 /** @defgroup HAL_Exported_Macros HAL Exported Macros
67 /** @defgroup DBGMCU_Freeze_Unfreeze Freeze Unfreeze Peripherals in Debug mode
68 * @brief Freeze/Unfreeze Peripherals in Debug mode
69 * Note: On devices STM32F10xx8 and STM32F10xxB,
70 * STM32F101xC/D/E and STM32F103xC/D/E,
71 * STM32F101xF/G and STM32F103xF/G
72 * STM32F10xx4 and STM32F10xx6
73 * Debug registers DBGMCU_IDCODE and DBGMCU_CR are accessible only in
74 * debug mode (not accessible by the user software in normal mode).
75 * Refer to errata sheet of these devices for more details.
79 /* Peripherals on APB1 */
81 * @brief TIM2 Peripherals Debug mode
83 #define __HAL_DBGMCU_FREEZE_TIM2() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM2_STOP)
84 #define __HAL_DBGMCU_UNFREEZE_TIM2() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM2_STOP)
87 * @brief TIM3 Peripherals Debug mode
89 #define __HAL_DBGMCU_FREEZE_TIM3() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM3_STOP)
90 #define __HAL_DBGMCU_UNFREEZE_TIM3() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM3_STOP)
92 #if defined (DBGMCU_CR_DBG_TIM4_STOP)
94 * @brief TIM4 Peripherals Debug mode
96 #define __HAL_DBGMCU_FREEZE_TIM4() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM4_STOP)
97 #define __HAL_DBGMCU_UNFREEZE_TIM4() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM4_STOP)
100 #if defined (DBGMCU_CR_DBG_TIM5_STOP)
102 * @brief TIM5 Peripherals Debug mode
104 #define __HAL_DBGMCU_FREEZE_TIM5() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM5_STOP)
105 #define __HAL_DBGMCU_UNFREEZE_TIM5() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM5_STOP)
108 #if defined (DBGMCU_CR_DBG_TIM6_STOP)
110 * @brief TIM6 Peripherals Debug mode
112 #define __HAL_DBGMCU_FREEZE_TIM6() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM6_STOP)
113 #define __HAL_DBGMCU_UNFREEZE_TIM6() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM6_STOP)
116 #if defined (DBGMCU_CR_DBG_TIM7_STOP)
118 * @brief TIM7 Peripherals Debug mode
120 #define __HAL_DBGMCU_FREEZE_TIM7() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM7_STOP)
121 #define __HAL_DBGMCU_UNFREEZE_TIM7() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM7_STOP)
124 #if defined (DBGMCU_CR_DBG_TIM12_STOP)
126 * @brief TIM12 Peripherals Debug mode
128 #define __HAL_DBGMCU_FREEZE_TIM12() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM12_STOP)
129 #define __HAL_DBGMCU_UNFREEZE_TIM12() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM12_STOP)
132 #if defined (DBGMCU_CR_DBG_TIM13_STOP)
134 * @brief TIM13 Peripherals Debug mode
136 #define __HAL_DBGMCU_FREEZE_TIM13() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM13_STOP)
137 #define __HAL_DBGMCU_UNFREEZE_TIM13() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM13_STOP)
140 #if defined (DBGMCU_CR_DBG_TIM14_STOP)
142 * @brief TIM14 Peripherals Debug mode
144 #define __HAL_DBGMCU_FREEZE_TIM14() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM14_STOP)
145 #define __HAL_DBGMCU_UNFREEZE_TIM14() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM14_STOP)
149 * @brief WWDG Peripherals Debug mode
151 #define __HAL_DBGMCU_FREEZE_WWDG() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_WWDG_STOP)
152 #define __HAL_DBGMCU_UNFREEZE_WWDG() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_WWDG_STOP)
155 * @brief IWDG Peripherals Debug mode
157 #define __HAL_DBGMCU_FREEZE_IWDG() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_IWDG_STOP)
158 #define __HAL_DBGMCU_UNFREEZE_IWDG() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_IWDG_STOP)
161 * @brief I2C1 Peripherals Debug mode
163 #define __HAL_DBGMCU_FREEZE_I2C1_TIMEOUT() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_I2C1_SMBUS_TIMEOUT)
164 #define __HAL_DBGMCU_UNFREEZE_I2C1_TIMEOUT() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_I2C1_SMBUS_TIMEOUT)
166 #if defined (DBGMCU_CR_DBG_I2C2_SMBUS_TIMEOUT)
168 * @brief I2C2 Peripherals Debug mode
170 #define __HAL_DBGMCU_FREEZE_I2C2_TIMEOUT() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_I2C2_SMBUS_TIMEOUT)
171 #define __HAL_DBGMCU_UNFREEZE_I2C2_TIMEOUT() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_I2C2_SMBUS_TIMEOUT)
174 #if defined (DBGMCU_CR_DBG_CAN1_STOP)
176 * @brief CAN1 Peripherals Debug mode
178 #define __HAL_DBGMCU_FREEZE_CAN1() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_CAN1_STOP)
179 #define __HAL_DBGMCU_UNFREEZE_CAN1() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_CAN1_STOP)
182 #if defined (DBGMCU_CR_DBG_CAN2_STOP)
184 * @brief CAN2 Peripherals Debug mode
186 #define __HAL_DBGMCU_FREEZE_CAN2() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_CAN2_STOP)
187 #define __HAL_DBGMCU_UNFREEZE_CAN2() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_CAN2_STOP)
190 /* Peripherals on APB2 */
191 #if defined (DBGMCU_CR_DBG_TIM1_STOP)
193 * @brief TIM1 Peripherals Debug mode
195 #define __HAL_DBGMCU_FREEZE_TIM1() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM1_STOP)
196 #define __HAL_DBGMCU_UNFREEZE_TIM1() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM1_STOP)
199 #if defined (DBGMCU_CR_DBG_TIM8_STOP)
201 * @brief TIM8 Peripherals Debug mode
203 #define __HAL_DBGMCU_FREEZE_TIM8() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM8_STOP)
204 #define __HAL_DBGMCU_UNFREEZE_TIM8() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM8_STOP)
207 #if defined (DBGMCU_CR_DBG_TIM9_STOP)
209 * @brief TIM9 Peripherals Debug mode
211 #define __HAL_DBGMCU_FREEZE_TIM9() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM9_STOP)
212 #define __HAL_DBGMCU_UNFREEZE_TIM9() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM9_STOP)
215 #if defined (DBGMCU_CR_DBG_TIM10_STOP)
217 * @brief TIM10 Peripherals Debug mode
219 #define __HAL_DBGMCU_FREEZE_TIM10() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM10_STOP)
220 #define __HAL_DBGMCU_UNFREEZE_TIM10() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM10_STOP)
223 #if defined (DBGMCU_CR_DBG_TIM11_STOP)
225 * @brief TIM11 Peripherals Debug mode
227 #define __HAL_DBGMCU_FREEZE_TIM11() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM11_STOP)
228 #define __HAL_DBGMCU_UNFREEZE_TIM11() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM11_STOP)
232 #if defined (DBGMCU_CR_DBG_TIM15_STOP)
234 * @brief TIM15 Peripherals Debug mode
236 #define __HAL_DBGMCU_FREEZE_TIM15() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM15_STOP)
237 #define __HAL_DBGMCU_UNFREEZE_TIM15() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM15_STOP)
240 #if defined (DBGMCU_CR_DBG_TIM16_STOP)
242 * @brief TIM16 Peripherals Debug mode
244 #define __HAL_DBGMCU_FREEZE_TIM16() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM16_STOP)
245 #define __HAL_DBGMCU_UNFREEZE_TIM16() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM16_STOP)
248 #if defined (DBGMCU_CR_DBG_TIM17_STOP)
250 * @brief TIM17 Peripherals Debug mode
252 #define __HAL_DBGMCU_FREEZE_TIM17() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM17_STOP)
253 #define __HAL_DBGMCU_UNFREEZE_TIM17() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM17_STOP)
264 /* Exported functions --------------------------------------------------------*/
266 /** @addtogroup HAL_Exported_Functions
270 /** @addtogroup HAL_Exported_Functions_Group1
274 /* Initialization and de-initialization functions ******************************/
275 HAL_StatusTypeDef HAL_Init(void);
276 HAL_StatusTypeDef HAL_DeInit(void);
277 void HAL_MspInit(void);
278 void HAL_MspDeInit(void);
279 HAL_StatusTypeDef HAL_InitTick (uint32_t TickPriority);
285 /** @addtogroup HAL_Exported_Functions_Group2
289 /* Peripheral Control functions ************************************************/
290 void HAL_IncTick(void);
291 void HAL_Delay(__IO uint32_t Delay);
292 uint32_t HAL_GetTick(void);
293 void HAL_SuspendTick(void);
294 void HAL_ResumeTick(void);
295 uint32_t HAL_GetHalVersion(void);
296 uint32_t HAL_GetREVID(void);
297 uint32_t HAL_GetDEVID(void);
298 void HAL_DBGMCU_EnableDBGSleepMode(void);
299 void HAL_DBGMCU_DisableDBGSleepMode(void);
300 void HAL_DBGMCU_EnableDBGStopMode(void);
301 void HAL_DBGMCU_DisableDBGStopMode(void);
302 void HAL_DBGMCU_EnableDBGStandbyMode(void);
303 void HAL_DBGMCU_DisableDBGStandbyMode(void);
326 #endif /* __STM32F1xx_HAL_H */
328 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/