You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

254 lines
12 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32f7xx_hal.h
  4. * @author MCD Application Team
  5. * @version V1.1.2
  6. * @date 23-September-2016
  7. * @brief This file contains all the functions prototypes for the HAL
  8. * module driver.
  9. ******************************************************************************
  10. * @attention
  11. *
  12. * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
  13. *
  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.
  24. *
  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.
  35. *
  36. ******************************************************************************
  37. */
  38. /* Define to prevent recursive inclusion -------------------------------------*/
  39. #ifndef __STM32F7xx_HAL_H
  40. #define __STM32F7xx_HAL_H
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif
  44. /* Includes ------------------------------------------------------------------*/
  45. #include "stm32f7xx_hal_conf.h"
  46. /** @addtogroup STM32F7xx_HAL_Driver
  47. * @{
  48. */
  49. /** @addtogroup HAL
  50. * @{
  51. */
  52. /* Exported types ------------------------------------------------------------*/
  53. /* Exported constants --------------------------------------------------------*/
  54. /** @defgroup SYSCFG_Exported_Constants SYSCFG Exported Constants
  55. * @{
  56. */
  57. /** @defgroup SYSCFG_BootMode Boot Mode
  58. * @{
  59. */
  60. #define SYSCFG_MEM_BOOT_ADD0 ((uint32_t)0x00000000U)
  61. #define SYSCFG_MEM_BOOT_ADD1 SYSCFG_MEMRMP_MEM_BOOT
  62. /**
  63. * @}
  64. */
  65. /**
  66. * @}
  67. */
  68. /* Exported macro ------------------------------------------------------------*/
  69. /** @defgroup HAL_Exported_Macros HAL Exported Macros
  70. * @{
  71. */
  72. /** @brief Freeze/Unfreeze Peripherals in Debug mode
  73. */
  74. #define __HAL_DBGMCU_FREEZE_TIM2() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM2_STOP))
  75. #define __HAL_DBGMCU_FREEZE_TIM3() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM3_STOP))
  76. #define __HAL_DBGMCU_FREEZE_TIM4() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM4_STOP))
  77. #define __HAL_DBGMCU_FREEZE_TIM5() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM5_STOP))
  78. #define __HAL_DBGMCU_FREEZE_TIM6() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM6_STOP))
  79. #define __HAL_DBGMCU_FREEZE_TIM7() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM7_STOP))
  80. #define __HAL_DBGMCU_FREEZE_TIM12() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM12_STOP))
  81. #define __HAL_DBGMCU_FREEZE_TIM13() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM13_STOP))
  82. #define __HAL_DBGMCU_FREEZE_TIM14() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM14_STOP))
  83. #define __HAL_DBGMCU_FREEZE_LPTIM1() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_LPTIM1_STOP))
  84. #define __HAL_DBGMCU_FREEZE_RTC() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_RTC_STOP))
  85. #define __HAL_DBGMCU_FREEZE_WWDG() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_WWDG_STOP))
  86. #define __HAL_DBGMCU_FREEZE_IWDG() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_IWDG_STOP))
  87. #define __HAL_DBGMCU_FREEZE_I2C1_TIMEOUT() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT))
  88. #define __HAL_DBGMCU_FREEZE_I2C2_TIMEOUT() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT))
  89. #define __HAL_DBGMCU_FREEZE_I2C3_TIMEOUT() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_I2C3_SMBUS_TIMEOUT))
  90. #define __HAL_DBGMCU_FREEZE_I2C4_TIMEOUT() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_I2C4_SMBUS_TIMEOUT))
  91. #define __HAL_DBGMCU_FREEZE_CAN1() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_CAN1_STOP))
  92. #define __HAL_DBGMCU_FREEZE_CAN2() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_CAN2_STOP))
  93. #define __HAL_DBGMCU_FREEZE_TIM1() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM1_STOP))
  94. #define __HAL_DBGMCU_FREEZE_TIM8() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM8_STOP))
  95. #define __HAL_DBGMCU_FREEZE_TIM9() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM9_STOP))
  96. #define __HAL_DBGMCU_FREEZE_TIM10() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM10_STOP))
  97. #define __HAL_DBGMCU_FREEZE_TIM11() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM11_STOP))
  98. #define __HAL_DBGMCU_UNFREEZE_TIM2() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM2_STOP))
  99. #define __HAL_DBGMCU_UNFREEZE_TIM3() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM3_STOP))
  100. #define __HAL_DBGMCU_UNFREEZE_TIM4() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM4_STOP))
  101. #define __HAL_DBGMCU_UNFREEZE_TIM5() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM5_STOP))
  102. #define __HAL_DBGMCU_UNFREEZE_TIM6() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM6_STOP))
  103. #define __HAL_DBGMCU_UNFREEZE_TIM7() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM7_STOP))
  104. #define __HAL_DBGMCU_UNFREEZE_TIM12() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM12_STOP))
  105. #define __HAL_DBGMCU_UNFREEZE_TIM13() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM13_STOP))
  106. #define __HAL_DBGMCU_UNFREEZE_TIM14() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM14_STOP))
  107. #define __HAL_DBGMCU_UNFREEZE_LPTIM1() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_LPTIM1_STOP))
  108. #define __HAL_DBGMCU_UNFREEZE_RTC() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_RTC_STOP))
  109. #define __HAL_DBGMCU_UNFREEZE_WWDG() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_WWDG_STOP))
  110. #define __HAL_DBGMCU_UNFREEZE_IWDG() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_IWDG_STOP))
  111. #define __HAL_DBGMCU_UNFREEZE_I2C1_TIMEOUT() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT))
  112. #define __HAL_DBGMCU_UNFREEZE_I2C2_TIMEOUT() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT))
  113. #define __HAL_DBGMCU_UNFREEZE_I2C3_TIMEOUT() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_I2C3_SMBUS_TIMEOUT))
  114. #define __HAL_DBGMCU_UNFREEZE_I2C4_TIMEOUT() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_I2C4_SMBUS_TIMEOUT))
  115. #define __HAL_DBGMCU_UNFREEZE_CAN1() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_CAN1_STOP))
  116. #define __HAL_DBGMCU_UNFREEZE_CAN2() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_CAN2_STOP))
  117. #define __HAL_DBGMCU_UNFREEZE_TIM1() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM1_STOP))
  118. #define __HAL_DBGMCU_UNFREEZE_TIM8() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM8_STOP))
  119. #define __HAL_DBGMCU_UNFREEZE_TIM9() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM9_STOP))
  120. #define __HAL_DBGMCU_UNFREEZE_TIM10() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM10_STOP))
  121. #define __HAL_DBGMCU_UNFREEZE_TIM11() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM11_STOP))
  122. /** @brief FMC (NOR/RAM) mapped at 0x60000000 and SDRAM mapped at 0xC0000000
  123. */
  124. #define __HAL_SYSCFG_REMAPMEMORY_FMC() (SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_SWP_FMC))
  125. /** @brief FMC/SDRAM mapped at 0x60000000 (NOR/RAM) mapped at 0xC0000000
  126. */
  127. #define __HAL_SYSCFG_REMAPMEMORY_FMC_SDRAM() do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_SWP_FMC);\
  128. SYSCFG->MEMRMP |= (SYSCFG_MEMRMP_SWP_FMC_0);\
  129. }while(0);
  130. /**
  131. * @brief Return the memory boot mapping as configured by user.
  132. * @retval The boot mode as configured by user. The returned value can be one
  133. * of the following values:
  134. * @arg @ref SYSCFG_MEM_BOOT_ADD0
  135. * @arg @ref SYSCFG_MEM_BOOT_ADD1
  136. */
  137. #define __HAL_SYSCFG_GET_BOOT_MODE() READ_BIT(SYSCFG->MEMRMP, SYSCFG_MEMRMP_MEM_BOOT)
  138. #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)
  139. /** @brief SYSCFG Break Cortex-M7 Lockup lock.
  140. * Enable and lock the connection of Cortex-M7 LOCKUP (Hardfault) output to TIM1/8 Break input.
  141. * @note The selected configuration is locked and can be unlocked only by system reset.
  142. */
  143. #define __HAL_SYSCFG_BREAK_LOCKUP_LOCK() SET_BIT(SYSCFG->CBR, SYSCFG_CBR_CLL)
  144. /** @brief SYSCFG Break PVD lock.
  145. * Enable and lock the PVD connection to Timer1/8 Break input, as well as the PVDE and PLS[2:0] in the PWR_CR1 register.
  146. * @note The selected configuration is locked and can be unlocked only by system reset.
  147. */
  148. #define __HAL_SYSCFG_BREAK_PVD_LOCK() SET_BIT(SYSCFG->CBR, SYSCFG_CBR_PVDL)
  149. #endif /* STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */
  150. /**
  151. * @}
  152. */
  153. /* Exported functions --------------------------------------------------------*/
  154. /** @addtogroup HAL_Exported_Functions
  155. * @{
  156. */
  157. /** @addtogroup HAL_Exported_Functions_Group1
  158. * @{
  159. */
  160. /* Initialization and de-initialization functions ******************************/
  161. HAL_StatusTypeDef HAL_Init(void);
  162. HAL_StatusTypeDef HAL_DeInit(void);
  163. void HAL_MspInit(void);
  164. void HAL_MspDeInit(void);
  165. HAL_StatusTypeDef HAL_InitTick (uint32_t TickPriority);
  166. /**
  167. * @}
  168. */
  169. /** @addtogroup HAL_Exported_Functions_Group2
  170. * @{
  171. */
  172. /* Peripheral Control functions ************************************************/
  173. void HAL_IncTick(void);
  174. void HAL_Delay(__IO uint32_t Delay);
  175. uint32_t HAL_GetTick(void);
  176. void HAL_SuspendTick(void);
  177. void HAL_ResumeTick(void);
  178. uint32_t HAL_GetHalVersion(void);
  179. uint32_t HAL_GetREVID(void);
  180. uint32_t HAL_GetDEVID(void);
  181. void HAL_DBGMCU_EnableDBGSleepMode(void);
  182. void HAL_DBGMCU_DisableDBGSleepMode(void);
  183. void HAL_DBGMCU_EnableDBGStopMode(void);
  184. void HAL_DBGMCU_DisableDBGStopMode(void);
  185. void HAL_DBGMCU_EnableDBGStandbyMode(void);
  186. void HAL_DBGMCU_DisableDBGStandbyMode(void);
  187. void HAL_EnableCompensationCell(void);
  188. void HAL_DisableCompensationCell(void);
  189. void HAL_EnableFMCMemorySwapping(void);
  190. void HAL_DisableFMCMemorySwapping(void);
  191. #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)
  192. void HAL_EnableMemorySwappingBank(void);
  193. void HAL_DisableMemorySwappingBank(void);
  194. #endif /* STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */
  195. /**
  196. * @}
  197. */
  198. /**
  199. * @}
  200. */
  201. /* Private types -------------------------------------------------------------*/
  202. /* Private variables ---------------------------------------------------------*/
  203. /** @defgroup HAL_Private_Variables HAL Private Variables
  204. * @{
  205. */
  206. /**
  207. * @}
  208. */
  209. /* Private constants ---------------------------------------------------------*/
  210. /** @defgroup HAL_Private_Constants HAL Private Constants
  211. * @{
  212. */
  213. /**
  214. * @}
  215. */
  216. /* Private macros ------------------------------------------------------------*/
  217. /* Private functions ---------------------------------------------------------*/
  218. /**
  219. * @}
  220. */
  221. /**
  222. * @}
  223. */
  224. #ifdef __cplusplus
  225. }
  226. #endif
  227. #endif /* __STM32F7xx_HAL_H */
  228. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/