STM CMSIS
stm32f4xx_hal.h
Go to the documentation of this file.
1 
39 /* Define to prevent recursive inclusion -------------------------------------*/
40 #ifndef __STM32F4xx_HAL_H
41 #define __STM32F4xx_HAL_H
42 
43 #ifdef __cplusplus
44  extern "C" {
45 #endif
46 
47 /* Includes ------------------------------------------------------------------*/
48 #include "stm32f4xx_hal_conf.h"
49 
58 /* Exported types ------------------------------------------------------------*/
59 /* Exported constants --------------------------------------------------------*/
60 /* Exported macro ------------------------------------------------------------*/
67 #define __HAL_DBGMCU_FREEZE_TIM2() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM2_STOP))
68 #define __HAL_DBGMCU_FREEZE_TIM3() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM3_STOP))
69 #define __HAL_DBGMCU_FREEZE_TIM4() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM4_STOP))
70 #define __HAL_DBGMCU_FREEZE_TIM5() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM5_STOP))
71 #define __HAL_DBGMCU_FREEZE_TIM6() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM6_STOP))
72 #define __HAL_DBGMCU_FREEZE_TIM7() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM7_STOP))
73 #define __HAL_DBGMCU_FREEZE_TIM12() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM12_STOP))
74 #define __HAL_DBGMCU_FREEZE_TIM13() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM13_STOP))
75 #define __HAL_DBGMCU_FREEZE_TIM14() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM14_STOP))
76 #define __HAL_DBGMCU_FREEZE_RTC() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_RTC_STOP))
77 #define __HAL_DBGMCU_FREEZE_WWDG() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_WWDG_STOP))
78 #define __HAL_DBGMCU_FREEZE_IWDG() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_IWDG_STOP))
79 #define __HAL_DBGMCU_FREEZE_I2C1_TIMEOUT() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT))
80 #define __HAL_DBGMCU_FREEZE_I2C2_TIMEOUT() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT))
81 #define __HAL_DBGMCU_FREEZE_I2C3_TIMEOUT() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_I2C3_SMBUS_TIMEOUT))
82 #define __HAL_DBGMCU_FREEZE_CAN1() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_CAN1_STOP))
83 #define __HAL_DBGMCU_FREEZE_CAN2() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_CAN2_STOP))
84 #define __HAL_DBGMCU_FREEZE_TIM1() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM1_STOP))
85 #define __HAL_DBGMCU_FREEZE_TIM8() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM8_STOP))
86 #define __HAL_DBGMCU_FREEZE_TIM9() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM9_STOP))
87 #define __HAL_DBGMCU_FREEZE_TIM10() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM10_STOP))
88 #define __HAL_DBGMCU_FREEZE_TIM11() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM11_STOP))
89 
90 #define __HAL_DBGMCU_UNFREEZE_TIM2() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM2_STOP))
91 #define __HAL_DBGMCU_UNFREEZE_TIM3() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM3_STOP))
92 #define __HAL_DBGMCU_UNFREEZE_TIM4() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM4_STOP))
93 #define __HAL_DBGMCU_UNFREEZE_TIM5() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM5_STOP))
94 #define __HAL_DBGMCU_UNFREEZE_TIM6() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM6_STOP))
95 #define __HAL_DBGMCU_UNFREEZE_TIM7() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM7_STOP))
96 #define __HAL_DBGMCU_UNFREEZE_TIM12() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM12_STOP))
97 #define __HAL_DBGMCU_UNFREEZE_TIM13() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM13_STOP))
98 #define __HAL_DBGMCU_UNFREEZE_TIM14() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM14_STOP))
99 #define __HAL_DBGMCU_UNFREEZE_RTC() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_RTC_STOP))
100 #define __HAL_DBGMCU_UNFREEZE_WWDG() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_WWDG_STOP))
101 #define __HAL_DBGMCU_UNFREEZE_IWDG() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_IWDG_STOP))
102 #define __HAL_DBGMCU_UNFREEZE_I2C1_TIMEOUT() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT))
103 #define __HAL_DBGMCU_UNFREEZE_I2C2_TIMEOUT() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT))
104 #define __HAL_DBGMCU_UNFREEZE_I2C3_TIMEOUT() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_I2C3_SMBUS_TIMEOUT))
105 #define __HAL_DBGMCU_UNFREEZE_CAN1() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_CAN1_STOP))
106 #define __HAL_DBGMCU_UNFREEZE_CAN2() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_CAN2_STOP))
107 #define __HAL_DBGMCU_UNFREEZE_TIM1() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM1_STOP))
108 #define __HAL_DBGMCU_UNFREEZE_TIM8() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM8_STOP))
109 #define __HAL_DBGMCU_UNFREEZE_TIM9() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM9_STOP))
110 #define __HAL_DBGMCU_UNFREEZE_TIM10() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM10_STOP))
111 #define __HAL_DBGMCU_UNFREEZE_TIM11() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM11_STOP))
112 
115 #define __HAL_SYSCFG_REMAPMEMORY_FLASH() (SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE))
116 
119 #define __HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH() do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\
120  SYSCFG->MEMRMP |= SYSCFG_MEMRMP_MEM_MODE_0;\
121  }while(0);
122 
125 #define __HAL_SYSCFG_REMAPMEMORY_SRAM() do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\
126  SYSCFG->MEMRMP |= (SYSCFG_MEMRMP_MEM_MODE_0 | SYSCFG_MEMRMP_MEM_MODE_1);\
127  }while(0);
128 
129 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx)|| defined(STM32F417xx)
130 
132 #define __HAL_SYSCFG_REMAPMEMORY_FSMC() do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\
133  SYSCFG->MEMRMP |= (SYSCFG_MEMRMP_MEM_MODE_1);\
134  }while(0);
135 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */
136 
137 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) ||\
138  defined(STM32F469xx) || defined(STM32F479xx)
139 
141 #define __HAL_SYSCFG_REMAPMEMORY_FMC() do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\
142  SYSCFG->MEMRMP |= (SYSCFG_MEMRMP_MEM_MODE_1);\
143  }while(0);
144 
147 #define __HAL_SYSCFG_REMAPMEMORY_FMC_SDRAM() do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\
148  SYSCFG->MEMRMP |= (SYSCFG_MEMRMP_MEM_MODE_2);\
149  }while(0);
150 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */
151 
152 #if defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx)
153 
160 #define __HAL_SYSCFG_BREAK_PVD_LOCK() do {SYSCFG->CFGR2 &= ~(SYSCFG_CFGR2_PVD_LOCK); \
161  SYSCFG->CFGR2 |= SYSCFG_CFGR2_PVD_LOCK; \
162  }while(0)
163 
174 #define __HAL_SYSCFG_BREAK_LOCKUP_LOCK() do {SYSCFG->CFGR2 &= ~(SYSCFG_CFGR2_LOCKUP_LOCK); \
175  SYSCFG->CFGR2 |= SYSCFG_CFGR2_LOCKUP_LOCK; \
176  }while(0)
177 
180 #endif /* STM32F410Tx || STM32F410Cx || STM32F410Rx */
181 
185 /* Exported functions --------------------------------------------------------*/
192 /* Initialization and de-initialization functions ******************************/
195 void HAL_MspInit(void);
196 void HAL_MspDeInit(void);
197 HAL_StatusTypeDef HAL_InitTick (uint32_t TickPriority);
205 /* Peripheral Control functions ************************************************/
206 void HAL_IncTick(void);
207 void HAL_Delay(__IO uint32_t Delay);
208 uint32_t HAL_GetTick(void);
209 void HAL_SuspendTick(void);
210 void HAL_ResumeTick(void);
211 uint32_t HAL_GetHalVersion(void);
212 uint32_t HAL_GetREVID(void);
213 uint32_t HAL_GetDEVID(void);
220 void HAL_EnableCompensationCell(void);
221 void HAL_DisableCompensationCell(void);
222 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) ||\
223  defined(STM32F469xx) || defined(STM32F479xx)
224 void HAL_EnableMemorySwappingBank(void);
225 void HAL_DisableMemorySwappingBank(void);
226 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */
227 
234 /* Private types -------------------------------------------------------------*/
235 /* Private variables ---------------------------------------------------------*/
242 /* Private constants ---------------------------------------------------------*/
249 /* Private macros ------------------------------------------------------------*/
250 /* Private functions ---------------------------------------------------------*/
259 #ifdef __cplusplus
260 }
261 #endif
262 
263 #endif /* __STM32F4xx_HAL_H */
264 
265 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
void HAL_DisableCompensationCell(void)
Power-down the I/O Compensation Cell.
Definition: stm32f4xx_hal.c:477
uint32_t HAL_GetHalVersion(void)
Returns the HAL revision.
Definition: stm32f4xx_hal.c:383
void HAL_DBGMCU_DisableDBGStopMode(void)
Disable the Debug Module during STOP mode.
Definition: stm32f4xx_hal.c:437
void HAL_Delay(__IO uint32_t Delay)
This function provides accurate delay (in milliseconds) based on variable incremented.
Definition: stm32f4xx_hal.c:338
uint32_t HAL_GetDEVID(void)
Returns the device identifier.
Definition: stm32f4xx_hal.c:401
void HAL_DBGMCU_DisableDBGStandbyMode(void)
Disable the Debug Module during STANDBY mode.
Definition: stm32f4xx_hal.c:455
void HAL_DBGMCU_EnableDBGStopMode(void)
Enable the Debug Module during STOP mode.
Definition: stm32f4xx_hal.c:428
HAL_StatusTypeDef
HAL Status structures definition.
Definition: stm32f4xx_hal_def.h:57
#define __IO
Definition: core_cm0.h:213
HAL_StatusTypeDef HAL_Init(void)
This function is used to initialize the HAL Library; it must be the first instruction to be executed ...
Definition: stm32f4xx_hal.c:167
void HAL_IncTick(void)
This function is called to increment a global variable "uwTick" used as application time base...
Definition: stm32f4xx_hal.c:311
void HAL_EnableCompensationCell(void)
Enables the I/O Compensation Cell.
Definition: stm32f4xx_hal.c:466
void HAL_MspInit(void)
Initializes the MSP.
Definition: stm32f4xx_hal.c:229
void HAL_SuspendTick(void)
Suspend Tick increment.
Definition: stm32f4xx_hal.c:357
HAL_StatusTypeDef HAL_DeInit(void)
This function de-Initializes common part of the HAL and stops the systick. This function is optional...
Definition: stm32f4xx_hal.c:200
void HAL_DBGMCU_EnableDBGSleepMode(void)
Enable the Debug Module during SLEEP mode.
Definition: stm32f4xx_hal.c:410
void HAL_MspDeInit(void)
DeInitializes the MSP.
Definition: stm32f4xx_hal.c:240
void HAL_DBGMCU_EnableDBGStandbyMode(void)
Enable the Debug Module during STANDBY mode.
Definition: stm32f4xx_hal.c:446
void HAL_ResumeTick(void)
Resume Tick increment.
Definition: stm32f4xx_hal.c:373
uint32_t HAL_GetTick(void)
Provides a tick value in millisecond.
Definition: stm32f4xx_hal.c:322
void HAL_DBGMCU_DisableDBGSleepMode(void)
Disable the Debug Module during SLEEP mode.
Definition: stm32f4xx_hal.c:419
HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
This function configures the source of the time base. The time source is configured to have 1ms time ...
Definition: stm32f4xx_hal.c:263
uint32_t HAL_GetREVID(void)
Returns the device revision identifier.
Definition: stm32f4xx_hal.c:392