Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
stm32f1xx_hal.h
00001 /** 00002 ****************************************************************************** 00003 * @file stm32f1xx_hal.h 00004 * @author MCD Application Team 00005 * @version V1.0.4 00006 * @date 29-April-2016 00007 * @brief This file contains all the functions prototypes for the HAL 00008 * module driver. 00009 ****************************************************************************** 00010 * @attention 00011 * 00012 * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> 00013 * 00014 * Redistribution and use in source and binary forms, with or without modification, 00015 * are permitted provided that the following conditions are met: 00016 * 1. Redistributions of source code must retain the above copyright notice, 00017 * this list of conditions and the following disclaimer. 00018 * 2. Redistributions in binary form must reproduce the above copyright notice, 00019 * this list of conditions and the following disclaimer in the documentation 00020 * and/or other materials provided with the distribution. 00021 * 3. Neither the name of STMicroelectronics nor the names of its contributors 00022 * may be used to endorse or promote products derived from this software 00023 * without specific prior written permission. 00024 * 00025 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00026 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00027 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00028 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 00029 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00030 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00031 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00032 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00033 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00034 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00035 * 00036 ****************************************************************************** 00037 */ 00038 00039 /* Define to prevent recursive inclusion -------------------------------------*/ 00040 #ifndef __STM32F1xx_HAL_H 00041 #define __STM32F1xx_HAL_H 00042 00043 #ifdef __cplusplus 00044 extern "C" { 00045 #endif 00046 00047 /* Includes ------------------------------------------------------------------*/ 00048 #include "stm32f1xx_hal_conf.h" 00049 00050 /** @addtogroup STM32F1xx_HAL_Driver 00051 * @{ 00052 */ 00053 00054 /** @addtogroup HAL 00055 * @{ 00056 */ 00057 00058 /* Exported types ------------------------------------------------------------*/ 00059 /* Exported constants --------------------------------------------------------*/ 00060 00061 /* Exported macro ------------------------------------------------------------*/ 00062 00063 /** @defgroup HAL_Exported_Macros HAL Exported Macros 00064 * @{ 00065 */ 00066 00067 /** @defgroup DBGMCU_Freeze_Unfreeze Freeze Unfreeze Peripherals in Debug mode 00068 * @brief Freeze/Unfreeze Peripherals in Debug mode 00069 * Note: On devices STM32F10xx8 and STM32F10xxB, 00070 * STM32F101xC/D/E and STM32F103xC/D/E, 00071 * STM32F101xF/G and STM32F103xF/G 00072 * STM32F10xx4 and STM32F10xx6 00073 * Debug registers DBGMCU_IDCODE and DBGMCU_CR are accessible only in 00074 * debug mode (not accessible by the user software in normal mode). 00075 * Refer to errata sheet of these devices for more details. 00076 * @{ 00077 */ 00078 00079 /* Peripherals on APB1 */ 00080 /** 00081 * @brief TIM2 Peripherals Debug mode 00082 */ 00083 #define __HAL_DBGMCU_FREEZE_TIM2() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM2_STOP) 00084 #define __HAL_DBGMCU_UNFREEZE_TIM2() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM2_STOP) 00085 00086 /** 00087 * @brief TIM3 Peripherals Debug mode 00088 */ 00089 #define __HAL_DBGMCU_FREEZE_TIM3() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM3_STOP) 00090 #define __HAL_DBGMCU_UNFREEZE_TIM3() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM3_STOP) 00091 00092 #if defined (DBGMCU_CR_DBG_TIM4_STOP) 00093 /** 00094 * @brief TIM4 Peripherals Debug mode 00095 */ 00096 #define __HAL_DBGMCU_FREEZE_TIM4() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM4_STOP) 00097 #define __HAL_DBGMCU_UNFREEZE_TIM4() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM4_STOP) 00098 #endif 00099 00100 #if defined (DBGMCU_CR_DBG_TIM5_STOP) 00101 /** 00102 * @brief TIM5 Peripherals Debug mode 00103 */ 00104 #define __HAL_DBGMCU_FREEZE_TIM5() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM5_STOP) 00105 #define __HAL_DBGMCU_UNFREEZE_TIM5() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM5_STOP) 00106 #endif 00107 00108 #if defined (DBGMCU_CR_DBG_TIM6_STOP) 00109 /** 00110 * @brief TIM6 Peripherals Debug mode 00111 */ 00112 #define __HAL_DBGMCU_FREEZE_TIM6() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM6_STOP) 00113 #define __HAL_DBGMCU_UNFREEZE_TIM6() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM6_STOP) 00114 #endif 00115 00116 #if defined (DBGMCU_CR_DBG_TIM7_STOP) 00117 /** 00118 * @brief TIM7 Peripherals Debug mode 00119 */ 00120 #define __HAL_DBGMCU_FREEZE_TIM7() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM7_STOP) 00121 #define __HAL_DBGMCU_UNFREEZE_TIM7() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM7_STOP) 00122 #endif 00123 00124 #if defined (DBGMCU_CR_DBG_TIM12_STOP) 00125 /** 00126 * @brief TIM12 Peripherals Debug mode 00127 */ 00128 #define __HAL_DBGMCU_FREEZE_TIM12() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM12_STOP) 00129 #define __HAL_DBGMCU_UNFREEZE_TIM12() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM12_STOP) 00130 #endif 00131 00132 #if defined (DBGMCU_CR_DBG_TIM13_STOP) 00133 /** 00134 * @brief TIM13 Peripherals Debug mode 00135 */ 00136 #define __HAL_DBGMCU_FREEZE_TIM13() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM13_STOP) 00137 #define __HAL_DBGMCU_UNFREEZE_TIM13() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM13_STOP) 00138 #endif 00139 00140 #if defined (DBGMCU_CR_DBG_TIM14_STOP) 00141 /** 00142 * @brief TIM14 Peripherals Debug mode 00143 */ 00144 #define __HAL_DBGMCU_FREEZE_TIM14() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM14_STOP) 00145 #define __HAL_DBGMCU_UNFREEZE_TIM14() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM14_STOP) 00146 #endif 00147 00148 /** 00149 * @brief WWDG Peripherals Debug mode 00150 */ 00151 #define __HAL_DBGMCU_FREEZE_WWDG() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_WWDG_STOP) 00152 #define __HAL_DBGMCU_UNFREEZE_WWDG() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_WWDG_STOP) 00153 00154 /** 00155 * @brief IWDG Peripherals Debug mode 00156 */ 00157 #define __HAL_DBGMCU_FREEZE_IWDG() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_IWDG_STOP) 00158 #define __HAL_DBGMCU_UNFREEZE_IWDG() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_IWDG_STOP) 00159 00160 /** 00161 * @brief I2C1 Peripherals Debug mode 00162 */ 00163 #define __HAL_DBGMCU_FREEZE_I2C1_TIMEOUT() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_I2C1_SMBUS_TIMEOUT) 00164 #define __HAL_DBGMCU_UNFREEZE_I2C1_TIMEOUT() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_I2C1_SMBUS_TIMEOUT) 00165 00166 #if defined (DBGMCU_CR_DBG_I2C2_SMBUS_TIMEOUT) 00167 /** 00168 * @brief I2C2 Peripherals Debug mode 00169 */ 00170 #define __HAL_DBGMCU_FREEZE_I2C2_TIMEOUT() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_I2C2_SMBUS_TIMEOUT) 00171 #define __HAL_DBGMCU_UNFREEZE_I2C2_TIMEOUT() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_I2C2_SMBUS_TIMEOUT) 00172 #endif 00173 00174 #if defined (DBGMCU_CR_DBG_CAN1_STOP) 00175 /** 00176 * @brief CAN1 Peripherals Debug mode 00177 */ 00178 #define __HAL_DBGMCU_FREEZE_CAN1() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_CAN1_STOP) 00179 #define __HAL_DBGMCU_UNFREEZE_CAN1() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_CAN1_STOP) 00180 #endif 00181 00182 #if defined (DBGMCU_CR_DBG_CAN2_STOP) 00183 /** 00184 * @brief CAN2 Peripherals Debug mode 00185 */ 00186 #define __HAL_DBGMCU_FREEZE_CAN2() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_CAN2_STOP) 00187 #define __HAL_DBGMCU_UNFREEZE_CAN2() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_CAN2_STOP) 00188 #endif 00189 00190 /* Peripherals on APB2 */ 00191 #if defined (DBGMCU_CR_DBG_TIM1_STOP) 00192 /** 00193 * @brief TIM1 Peripherals Debug mode 00194 */ 00195 #define __HAL_DBGMCU_FREEZE_TIM1() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM1_STOP) 00196 #define __HAL_DBGMCU_UNFREEZE_TIM1() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM1_STOP) 00197 #endif 00198 00199 #if defined (DBGMCU_CR_DBG_TIM8_STOP) 00200 /** 00201 * @brief TIM8 Peripherals Debug mode 00202 */ 00203 #define __HAL_DBGMCU_FREEZE_TIM8() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM8_STOP) 00204 #define __HAL_DBGMCU_UNFREEZE_TIM8() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM8_STOP) 00205 #endif 00206 00207 #if defined (DBGMCU_CR_DBG_TIM9_STOP) 00208 /** 00209 * @brief TIM9 Peripherals Debug mode 00210 */ 00211 #define __HAL_DBGMCU_FREEZE_TIM9() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM9_STOP) 00212 #define __HAL_DBGMCU_UNFREEZE_TIM9() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM9_STOP) 00213 #endif 00214 00215 #if defined (DBGMCU_CR_DBG_TIM10_STOP) 00216 /** 00217 * @brief TIM10 Peripherals Debug mode 00218 */ 00219 #define __HAL_DBGMCU_FREEZE_TIM10() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM10_STOP) 00220 #define __HAL_DBGMCU_UNFREEZE_TIM10() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM10_STOP) 00221 #endif 00222 00223 #if defined (DBGMCU_CR_DBG_TIM11_STOP) 00224 /** 00225 * @brief TIM11 Peripherals Debug mode 00226 */ 00227 #define __HAL_DBGMCU_FREEZE_TIM11() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM11_STOP) 00228 #define __HAL_DBGMCU_UNFREEZE_TIM11() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM11_STOP) 00229 #endif 00230 00231 00232 #if defined (DBGMCU_CR_DBG_TIM15_STOP) 00233 /** 00234 * @brief TIM15 Peripherals Debug mode 00235 */ 00236 #define __HAL_DBGMCU_FREEZE_TIM15() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM15_STOP) 00237 #define __HAL_DBGMCU_UNFREEZE_TIM15() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM15_STOP) 00238 #endif 00239 00240 #if defined (DBGMCU_CR_DBG_TIM16_STOP) 00241 /** 00242 * @brief TIM16 Peripherals Debug mode 00243 */ 00244 #define __HAL_DBGMCU_FREEZE_TIM16() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM16_STOP) 00245 #define __HAL_DBGMCU_UNFREEZE_TIM16() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM16_STOP) 00246 #endif 00247 00248 #if defined (DBGMCU_CR_DBG_TIM17_STOP) 00249 /** 00250 * @brief TIM17 Peripherals Debug mode 00251 */ 00252 #define __HAL_DBGMCU_FREEZE_TIM17() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM17_STOP) 00253 #define __HAL_DBGMCU_UNFREEZE_TIM17() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_TIM17_STOP) 00254 #endif 00255 00256 /** 00257 * @} 00258 */ 00259 00260 /** 00261 * @} 00262 */ 00263 00264 /* Exported functions --------------------------------------------------------*/ 00265 00266 /** @addtogroup HAL_Exported_Functions 00267 * @{ 00268 */ 00269 00270 /** @addtogroup HAL_Exported_Functions_Group1 00271 * @{ 00272 */ 00273 00274 /* Initialization and de-initialization functions ******************************/ 00275 HAL_StatusTypeDef HAL_Init(void); 00276 HAL_StatusTypeDef HAL_DeInit(void); 00277 void HAL_MspInit(void); 00278 void HAL_MspDeInit(void); 00279 HAL_StatusTypeDef HAL_InitTick (uint32_t TickPriority); 00280 00281 /** 00282 * @} 00283 */ 00284 00285 /** @addtogroup HAL_Exported_Functions_Group2 00286 * @{ 00287 */ 00288 00289 /* Peripheral Control functions ************************************************/ 00290 void HAL_IncTick(void); 00291 void HAL_Delay(__IO uint32_t Delay); 00292 uint32_t HAL_GetTick(void); 00293 void HAL_SuspendTick(void); 00294 void HAL_ResumeTick(void); 00295 uint32_t HAL_GetHalVersion(void); 00296 uint32_t HAL_GetREVID(void); 00297 uint32_t HAL_GetDEVID(void); 00298 void HAL_DBGMCU_EnableDBGSleepMode(void); 00299 void HAL_DBGMCU_DisableDBGSleepMode(void); 00300 void HAL_DBGMCU_EnableDBGStopMode(void); 00301 void HAL_DBGMCU_DisableDBGStopMode(void); 00302 void HAL_DBGMCU_EnableDBGStandbyMode(void); 00303 void HAL_DBGMCU_DisableDBGStandbyMode(void); 00304 00305 /** 00306 * @} 00307 */ 00308 00309 /** 00310 * @} 00311 */ 00312 00313 00314 /** 00315 * @} 00316 */ 00317 00318 /** 00319 * @} 00320 */ 00321 00322 #ifdef __cplusplus 00323 } 00324 #endif 00325 00326 #endif /* __STM32F1xx_HAL_H */ 00327 00328 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Generated on Tue Jul 12 2022 15:37:23 by
1.7.2