stm32f7xx_ll_system.h 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018
  1. /**
  2. ******************************************************************************
  3. * @file stm32f7xx_ll_system.h
  4. * @author MCD Application Team
  5. * @brief Header file of SYSTEM LL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * Copyright (c) 2017 STMicroelectronics.
  10. * All rights reserved.
  11. *
  12. * This software is licensed under terms that can be found in the LICENSE file
  13. * in the root directory of this software component.
  14. * If no LICENSE file comes with this software, it is provided AS-IS.
  15. *
  16. ******************************************************************************
  17. @verbatim
  18. ==============================================================================
  19. ##### How to use this driver #####
  20. ==============================================================================
  21. [..]
  22. The LL SYSTEM driver contains a set of generic APIs that can be
  23. used by user:
  24. (+) Some of the FLASH features need to be handled in the SYSTEM file.
  25. (+) Access to DBGCMU registers
  26. (+) Access to SYSCFG registers
  27. @endverbatim
  28. ******************************************************************************
  29. */
  30. /* Define to prevent recursive inclusion -------------------------------------*/
  31. #ifndef __STM32F7xx_LL_SYSTEM_H
  32. #define __STM32F7xx_LL_SYSTEM_H
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36. /* Includes ------------------------------------------------------------------*/
  37. #include "stm32f7xx.h"
  38. /** @addtogroup STM32F7xx_LL_Driver
  39. * @{
  40. */
  41. #if defined (FLASH) || defined (SYSCFG) || defined (DBGMCU)
  42. /** @defgroup SYSTEM_LL SYSTEM
  43. * @{
  44. */
  45. /* Private types -------------------------------------------------------------*/
  46. /* Private variables ---------------------------------------------------------*/
  47. /* Private constants ---------------------------------------------------------*/
  48. /** @defgroup SYSTEM_LL_Private_Constants SYSTEM Private Constants
  49. * @{
  50. */
  51. /**
  52. * @}
  53. */
  54. /* Private macros ------------------------------------------------------------*/
  55. /* Exported types ------------------------------------------------------------*/
  56. /* Exported constants --------------------------------------------------------*/
  57. /** @defgroup SYSTEM_LL_Exported_Constants SYSTEM Exported Constants
  58. * @{
  59. */
  60. /** @defgroup SYSTEM_LL_EC_REMAP SYSCFG REMAP
  61. * @{
  62. */
  63. #define LL_SYSCFG_REMAP_BOOT0 0x00000000U /*!< Boot information after Reset */
  64. #define LL_SYSCFG_REMAP_BOOT1 SYSCFG_MEMRMP_MEM_BOOT /*!< Boot information after Reset */
  65. /**
  66. * @}
  67. */
  68. #if defined(SYSCFG_MEMRMP_SWP_FB)
  69. /** @defgroup SYSTEM_LL_EC_BANKMODE SYSCFG BANK MODE
  70. * @{
  71. */
  72. #define LL_SYSCFG_BANKMODE_BANK1 0x00000000U /*!< Flash Bank 1 base address mapped at 0x0800 0000 (AXI) and 0x0020 0000 (TCM)
  73. and Flash Bank 2 base address mapped at 0x0810 0000 (AXI) and 0x0030 0000 (TCM)*/
  74. #define LL_SYSCFG_BANKMODE_BANK2 SYSCFG_MEMRMP_SWP_FB /*!< Flash Bank 2 base address mapped at 0x0800 0000 (AXI) and 0x0020 0000(TCM)
  75. and Flash Bank 1 base address mapped at 0x0810 0000 (AXI) and 0x0030 0000(TCM) */
  76. /**
  77. * @}
  78. */
  79. #endif /* SYSCFG_MEMRMP_SWP_FB */
  80. #if defined(SYSCFG_PMC_MII_RMII_SEL)
  81. /** @defgroup SYSTEM_LL_EC_PMC SYSCFG PMC
  82. * @{
  83. */
  84. #define LL_SYSCFG_PMC_ETHMII 0x00000000U /*!< ETH Media MII interface */
  85. #define LL_SYSCFG_PMC_ETHRMII (uint32_t)SYSCFG_PMC_MII_RMII_SEL /*!< ETH Media RMII interface */
  86. /**
  87. * @}
  88. */
  89. #endif /* SYSCFG_PMC_MII_RMII_SEL */
  90. /** @defgroup SYSTEM_LL_EC_I2C_FASTMODEPLUS SYSCFG I2C FASTMODEPLUS
  91. * @{
  92. */
  93. #if defined(SYSCFG_PMC_I2C1_FMP)
  94. #define LL_SYSCFG_I2C_FASTMODEPLUS_I2C1 SYSCFG_PMC_I2C1_FMP /*!< Enable Fast Mode Plus for I2C1 */
  95. #define LL_SYSCFG_I2C_FASTMODEPLUS_I2C2 SYSCFG_PMC_I2C2_FMP /*!< Enable Fast Mode Plus for I2C2 */
  96. #define LL_SYSCFG_I2C_FASTMODEPLUS_I2C3 SYSCFG_PMC_I2C3_FMP /*!< Enable Fast Mode Plus for I2C3 */
  97. #endif /* SYSCFG_PMC_I2C1_FMP */
  98. #if defined(SYSCFG_PMC_I2C4_FMP)
  99. #define LL_SYSCFG_I2C_FASTMODEPLUS_I2C4 SYSCFG_PMC_I2C4_FMP /*!< Enable Fast Mode Plus for I2C4 */
  100. #endif /* SYSCFG_PMC_I2C4_FMP */
  101. #if defined(SYSCFG_PMC_I2C_PB6_FMP)
  102. #define LL_SYSCFG_I2C_FASTMODEPLUS_PB6 SYSCFG_PMC_I2C_PB6_FMP /*!< Enable Fast Mode Plus on PB6 */
  103. #define LL_SYSCFG_I2C_FASTMODEPLUS_PB7 SYSCFG_PMC_I2C_PB7_FMP /*!< Enable Fast Mode Plus on PB7 */
  104. #define LL_SYSCFG_I2C_FASTMODEPLUS_PB8 SYSCFG_PMC_I2C_PB8_FMP /*!< Enable Fast Mode Plus on PB8 */
  105. #define LL_SYSCFG_I2C_FASTMODEPLUS_PB9 SYSCFG_PMC_I2C_PB9_FMP /*!< Enable Fast Mode Plus on PB9 */
  106. #endif /* SYSCFG_PMC_I2C_PB6_FMP */
  107. /**
  108. * @}
  109. */
  110. /** @defgroup SYSTEM_LL_EC_EXTI_PORT SYSCFG EXTI PORT
  111. * @{
  112. */
  113. #define LL_SYSCFG_EXTI_PORTA 0U /*!< EXTI PORT A */
  114. #define LL_SYSCFG_EXTI_PORTB 1U /*!< EXTI PORT B */
  115. #define LL_SYSCFG_EXTI_PORTC 2U /*!< EXTI PORT C */
  116. #define LL_SYSCFG_EXTI_PORTD 3U /*!< EXTI PORT D */
  117. #define LL_SYSCFG_EXTI_PORTE 4U /*!< EXTI PORT E */
  118. #if defined(GPIOF)
  119. #define LL_SYSCFG_EXTI_PORTF 5U /*!< EXTI PORT F */
  120. #endif /* GPIOF */
  121. #if defined(GPIOG)
  122. #define LL_SYSCFG_EXTI_PORTG 6U /*!< EXTI PORT G */
  123. #endif /* GPIOG */
  124. #define LL_SYSCFG_EXTI_PORTH 7U /*!< EXTI PORT H */
  125. #if defined(GPIOI)
  126. #define LL_SYSCFG_EXTI_PORTI 8U /*!< EXTI PORT I */
  127. #endif /* GPIOI */
  128. #if defined(GPIOJ)
  129. #define LL_SYSCFG_EXTI_PORTJ 9U /*!< EXTI PORT J */
  130. #endif /* GPIOJ */
  131. #if defined(GPIOK)
  132. #define LL_SYSCFG_EXTI_PORTK 10U /*!< EXTI PORT k */
  133. #endif /* GPIOK */
  134. /**
  135. * @}
  136. */
  137. /** @defgroup SYSTEM_LL_EC_EXTI_LINE SYSCFG EXTI LINE
  138. * @{
  139. */
  140. #define LL_SYSCFG_EXTI_LINE0 (0x000FU << 16U | 0U) /*!< EXTI_POSITION_0 | EXTICR[0] */
  141. #define LL_SYSCFG_EXTI_LINE1 (0x00F0U << 16U | 0U) /*!< EXTI_POSITION_4 | EXTICR[0] */
  142. #define LL_SYSCFG_EXTI_LINE2 (0x0F00U << 16U | 0U) /*!< EXTI_POSITION_8 | EXTICR[0] */
  143. #define LL_SYSCFG_EXTI_LINE3 (0xF000U << 16U | 0U) /*!< EXTI_POSITION_12 | EXTICR[0] */
  144. #define LL_SYSCFG_EXTI_LINE4 (0x000FU << 16U | 1U) /*!< EXTI_POSITION_0 | EXTICR[1] */
  145. #define LL_SYSCFG_EXTI_LINE5 (0x00F0U << 16U | 1U) /*!< EXTI_POSITION_4 | EXTICR[1] */
  146. #define LL_SYSCFG_EXTI_LINE6 (0x0F00U << 16U | 1U) /*!< EXTI_POSITION_8 | EXTICR[1] */
  147. #define LL_SYSCFG_EXTI_LINE7 (0xF000U << 16U | 1U) /*!< EXTI_POSITION_12 | EXTICR[1] */
  148. #define LL_SYSCFG_EXTI_LINE8 (0x000FU << 16U | 2U) /*!< EXTI_POSITION_0 | EXTICR[2] */
  149. #define LL_SYSCFG_EXTI_LINE9 (0x00F0U << 16U | 2U) /*!< EXTI_POSITION_4 | EXTICR[2] */
  150. #define LL_SYSCFG_EXTI_LINE10 (0x0F00U << 16U | 2U) /*!< EXTI_POSITION_8 | EXTICR[2] */
  151. #define LL_SYSCFG_EXTI_LINE11 (0xF000U << 16U | 2U) /*!< EXTI_POSITION_12 | EXTICR[2] */
  152. #define LL_SYSCFG_EXTI_LINE12 (0x000FU << 16U | 3U) /*!< EXTI_POSITION_0 | EXTICR[3] */
  153. #define LL_SYSCFG_EXTI_LINE13 (0x00F0U << 16U | 3U) /*!< EXTI_POSITION_4 | EXTICR[3] */
  154. #define LL_SYSCFG_EXTI_LINE14 (0x0F00U << 16U | 3U) /*!< EXTI_POSITION_8 | EXTICR[3] */
  155. #define LL_SYSCFG_EXTI_LINE15 (0xF000U << 16U | 3U) /*!< EXTI_POSITION_12 | EXTICR[3] */
  156. /**
  157. * @}
  158. */
  159. /** @defgroup SYSTEM_LL_EC_TIMBREAK SYSCFG TIMER BREAK
  160. * @{
  161. */
  162. #if defined(SYSCFG_CBR_CLL)
  163. #define LL_SYSCFG_TIMBREAK_LOCKUP SYSCFG_CBR_CLL /*!< Enables and locks the Lockup output (raised during core
  164. lockup state) of Cortex-M7 with Break Input of TIMER1, TIMER8 */
  165. #define LL_SYSCFG_TIMBREAK_PVD SYSCFG_CBR_PVDL /*!< Enables and locks the PVD connection with TIMER1, TIMER8 Break input.
  166. It also locks (write protect) the PVD_EN and PVDSEL[2:0] bits
  167. of the power controller */
  168. #endif /* SYSCFG_CBR_CLL */
  169. /**
  170. * @}
  171. */
  172. /** @defgroup SYSTEM_LL_EC_CMP_PD SYSCFG CMP PD
  173. * @{
  174. */
  175. #define LL_SYSCFG_DISABLE_CMP_PD 0x00000000U /*!< I/O compensation cell power-down mode */
  176. #define LL_SYSCFG_ENABLE_CMP_PD SYSCFG_CMPCR_CMP_PD /*!< I/O compensation cell enabled */
  177. /**
  178. * @}
  179. */
  180. /** @defgroup SYSTEM_LL_EC_TRACE DBGMCU TRACE Pin Assignment
  181. * @{
  182. */
  183. #define LL_DBGMCU_TRACE_NONE 0x00000000U /*!< TRACE pins not assigned (default state) */
  184. #define LL_DBGMCU_TRACE_ASYNCH DBGMCU_CR_TRACE_IOEN /*!< TRACE pin assignment for Asynchronous Mode */
  185. #define LL_DBGMCU_TRACE_SYNCH_SIZE1 (DBGMCU_CR_TRACE_IOEN | DBGMCU_CR_TRACE_MODE_0) /*!< TRACE pin assignment for Synchronous Mode with a TRACEDATA size of 1 */
  186. #define LL_DBGMCU_TRACE_SYNCH_SIZE2 (DBGMCU_CR_TRACE_IOEN | DBGMCU_CR_TRACE_MODE_1) /*!< TRACE pin assignment for Synchronous Mode with a TRACEDATA size of 2 */
  187. #define LL_DBGMCU_TRACE_SYNCH_SIZE4 (DBGMCU_CR_TRACE_IOEN | DBGMCU_CR_TRACE_MODE) /*!< TRACE pin assignment for Synchronous Mode with a TRACEDATA size of 4 */
  188. /**
  189. * @}
  190. */
  191. /** @defgroup SYSTEM_LL_EC_APB1_GRP1_STOP_IP DBGMCU APB1 GRP1 STOP IP
  192. * @{
  193. */
  194. #define LL_DBGMCU_APB1_GRP1_TIM2_STOP DBGMCU_APB1_FZ_DBG_TIM2_STOP /*!< TIM2 counter stopped when core is halted */
  195. #define LL_DBGMCU_APB1_GRP1_TIM3_STOP DBGMCU_APB1_FZ_DBG_TIM3_STOP /*!< TIM3 counter stopped when core is halted */
  196. #define LL_DBGMCU_APB1_GRP1_TIM4_STOP DBGMCU_APB1_FZ_DBG_TIM4_STOP /*!< TIM4 counter stopped when core is halted */
  197. #define LL_DBGMCU_APB1_GRP1_TIM5_STOP DBGMCU_APB1_FZ_DBG_TIM5_STOP /*!< TIM5 counter stopped when core is halted */
  198. #define LL_DBGMCU_APB1_GRP1_TIM6_STOP DBGMCU_APB1_FZ_DBG_TIM6_STOP /*!< TIM6 counter stopped when core is halted */
  199. #define LL_DBGMCU_APB1_GRP1_TIM7_STOP DBGMCU_APB1_FZ_DBG_TIM7_STOP /*!< TIM7 counter stopped when core is halted */
  200. #define LL_DBGMCU_APB1_GRP1_TIM12_STOP DBGMCU_APB1_FZ_DBG_TIM12_STOP /*!< TIM12 counter stopped when core is halted */
  201. #define LL_DBGMCU_APB1_GRP1_TIM13_STOP DBGMCU_APB1_FZ_DBG_TIM13_STOP /*!< TIM13 counter stopped when core is halted */
  202. #define LL_DBGMCU_APB1_GRP1_TIM14_STOP DBGMCU_APB1_FZ_DBG_TIM14_STOP /*!< TIM14 counter stopped when core is halted */
  203. #define LL_DBGMCU_APB1_GRP1_LPTIM1_STOP DBGMCU_APB1_FZ_DBG_LPTIM1_STOP /*!< LPTIIM1 counter stopped when core is halted */
  204. #define LL_DBGMCU_APB1_GRP1_RTC_STOP DBGMCU_APB1_FZ_DBG_RTC_STOP /*!< RTC counter stopped when core is halted */
  205. #define LL_DBGMCU_APB1_GRP1_WWDG_STOP DBGMCU_APB1_FZ_DBG_WWDG_STOP /*!< Debug Window Watchdog stopped when Core is halted */
  206. #define LL_DBGMCU_APB1_GRP1_IWDG_STOP DBGMCU_APB1_FZ_DBG_IWDG_STOP /*!< Debug Independent Watchdog stopped when Core is halted */
  207. #define LL_DBGMCU_APB1_GRP1_I2C1_STOP DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT /*!< I2C1 SMBUS timeout mode stopped when Core is halted */
  208. #define LL_DBGMCU_APB1_GRP1_I2C2_STOP DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT /*!< I2C2 SMBUS timeout mode stopped when Core is halted */
  209. #define LL_DBGMCU_APB1_GRP1_I2C3_STOP DBGMCU_APB1_FZ_DBG_I2C3_SMBUS_TIMEOUT /*!< I2C3 SMBUS timeout mode stopped when Core is halted */
  210. #if defined(DBGMCU_APB1_FZ_DBG_I2C4_SMBUS_TIMEOUT)
  211. #define LL_DBGMCU_APB1_GRP1_I2C4_STOP DBGMCU_APB1_FZ_DBG_I2C4_SMBUS_TIMEOUT /*!< I2C4 SMBUS timeout mode stopped when core is halted */
  212. #endif /* DBGMCU_APB1_FZ_DBG_I2C4_SMBUS_TIMEOUT */
  213. #define LL_DBGMCU_APB1_GRP1_CAN1_STOP DBGMCU_APB1_FZ_DBG_CAN1_STOP /*!< CAN1 debug stopped when Core is halted */
  214. #if defined(DBGMCU_APB1_FZ_DBG_CAN2_STOP)
  215. #define LL_DBGMCU_APB1_GRP1_CAN2_STOP DBGMCU_APB1_FZ_DBG_CAN2_STOP /*!< CAN2 debug stopped when Core is halted */
  216. #endif /* DBGMCU_APB1_FZ_DBG_CAN2_STOP */
  217. #if defined(DBGMCU_APB1_FZ_DBG_CAN3_STOP)
  218. #define LL_DBGMCU_APB1_GRP1_CAN3_STOP DBGMCU_APB1_FZ_DBG_CAN3_STOP /*!< CAN3 debug stopped when Core is halted */
  219. #endif /*DBGMCU_APB1_FZ_DBG_CAN3_STOP*/
  220. /**
  221. * @}
  222. */
  223. /** @defgroup SYSTEM_LL_EC_APB2_GRP1_STOP_IP DBGMCU APB2 GRP1 STOP IP
  224. * @{
  225. */
  226. #define LL_DBGMCU_APB2_GRP1_TIM1_STOP DBGMCU_APB2_FZ_DBG_TIM1_STOP /*!< TIM1 counter stopped when core is halted */
  227. #define LL_DBGMCU_APB2_GRP1_TIM8_STOP DBGMCU_APB2_FZ_DBG_TIM8_STOP /*!< TIM8 counter stopped when core is halted */
  228. #define LL_DBGMCU_APB2_GRP1_TIM9_STOP DBGMCU_APB2_FZ_DBG_TIM9_STOP /*!< TIM9 counter stopped when core is halted */
  229. #define LL_DBGMCU_APB2_GRP1_TIM10_STOP DBGMCU_APB2_FZ_DBG_TIM10_STOP /*!< TIM10 counter stopped when core is halted */
  230. #define LL_DBGMCU_APB2_GRP1_TIM11_STOP DBGMCU_APB2_FZ_DBG_TIM11_STOP /*!< TIM11 counter stopped when core is halted */
  231. /**
  232. * @}
  233. */
  234. /** @defgroup SYSTEM_LL_EC_LATENCY FLASH LATENCY
  235. * @{
  236. */
  237. #define LL_FLASH_LATENCY_0 FLASH_ACR_LATENCY_0WS /*!< FLASH Zero wait state */
  238. #define LL_FLASH_LATENCY_1 FLASH_ACR_LATENCY_1WS /*!< FLASH One wait state */
  239. #define LL_FLASH_LATENCY_2 FLASH_ACR_LATENCY_2WS /*!< FLASH Two wait states */
  240. #define LL_FLASH_LATENCY_3 FLASH_ACR_LATENCY_3WS /*!< FLASH Three wait states */
  241. #define LL_FLASH_LATENCY_4 FLASH_ACR_LATENCY_4WS /*!< FLASH Four wait states */
  242. #define LL_FLASH_LATENCY_5 FLASH_ACR_LATENCY_5WS /*!< FLASH five wait state */
  243. #define LL_FLASH_LATENCY_6 FLASH_ACR_LATENCY_6WS /*!< FLASH six wait state */
  244. #define LL_FLASH_LATENCY_7 FLASH_ACR_LATENCY_7WS /*!< FLASH seven wait states */
  245. #define LL_FLASH_LATENCY_8 FLASH_ACR_LATENCY_8WS /*!< FLASH eight wait states */
  246. #define LL_FLASH_LATENCY_9 FLASH_ACR_LATENCY_9WS /*!< FLASH nine wait states */
  247. #define LL_FLASH_LATENCY_10 FLASH_ACR_LATENCY_10WS /*!< FLASH ten wait states */
  248. #define LL_FLASH_LATENCY_11 FLASH_ACR_LATENCY_11WS /*!< FLASH eleven wait states */
  249. #define LL_FLASH_LATENCY_12 FLASH_ACR_LATENCY_12WS /*!< FLASH twelve wait states */
  250. #define LL_FLASH_LATENCY_13 FLASH_ACR_LATENCY_13WS /*!< FLASH thirteen wait states */
  251. #define LL_FLASH_LATENCY_14 FLASH_ACR_LATENCY_14WS /*!< FLASH fourteen wait states */
  252. #define LL_FLASH_LATENCY_15 FLASH_ACR_LATENCY_15WS /*!< FLASH fifteen wait states */
  253. /**
  254. * @}
  255. */
  256. /**
  257. * @}
  258. */
  259. /* Exported macro ------------------------------------------------------------*/
  260. /* Exported functions --------------------------------------------------------*/
  261. /** @defgroup SYSTEM_LL_Exported_Functions SYSTEM Exported Functions
  262. * @{
  263. */
  264. /** @defgroup SYSTEM_LL_EF_SYSCFG SYSCFG
  265. * @{
  266. */
  267. /**
  268. * @brief Enables the FMC Memory Mapping Swapping
  269. * @rmtoll SYSCFG_MEMRMP SWP_FMC LL_SYSCFG_EnableFMCMemorySwapping
  270. * @note SDRAM is accessible at 0x60000000 and NOR/RAM
  271. * is accessible at 0xC0000000
  272. * @retval None
  273. */
  274. __STATIC_INLINE void LL_SYSCFG_EnableFMCMemorySwapping(void)
  275. {
  276. SET_BIT(SYSCFG->MEMRMP, SYSCFG_MEMRMP_SWP_FMC_0);
  277. }
  278. /**
  279. * @brief Disables the FMC Memory Mapping Swapping
  280. * @rmtoll SYSCFG_MEMRMP SWP_FMC LL_SYSCFG_DisableFMCMemorySwapping
  281. * @note SDRAM is accessible at 0xC0000000 (default mapping)
  282. * and NOR/RAM is accessible at 0x60000000 (default mapping)
  283. * @retval None
  284. */
  285. __STATIC_INLINE void LL_SYSCFG_DisableFMCMemorySwapping(void)
  286. {
  287. CLEAR_BIT(SYSCFG->MEMRMP, SYSCFG_MEMRMP_SWP_FMC);
  288. }
  289. /**
  290. * @brief Enables the Compensation Cell
  291. * @rmtoll SYSCFG_CMPCR CMP_PD LL_SYSCFG_EnableCompensationCell
  292. * @note The I/O compensation cell can be used only when the device supply
  293. * voltage ranges from 2.4 to 3.6 V
  294. * @retval None
  295. */
  296. __STATIC_INLINE void LL_SYSCFG_EnableCompensationCell(void)
  297. {
  298. SET_BIT(SYSCFG->CMPCR, SYSCFG_CMPCR_CMP_PD);
  299. }
  300. /**
  301. * @brief Disables the Compensation Cell
  302. * @rmtoll SYSCFG_CMPCR CMP_PD LL_SYSCFG_DisableCompensationCell
  303. * @note The I/O compensation cell can be used only when the device supply
  304. * voltage ranges from 2.4 to 3.6 V
  305. * @retval None
  306. */
  307. __STATIC_INLINE void LL_SYSCFG_DisableCompensationCell(void)
  308. {
  309. CLEAR_BIT(SYSCFG->CMPCR, SYSCFG_CMPCR_CMP_PD);
  310. }
  311. /**
  312. * @brief Get Compensation Cell ready Flag
  313. * @rmtoll SYSCFG_CMPCR READY LL_SYSCFG_IsActiveFlag_CMPCR
  314. * @retval State of bit (1 or 0).
  315. */
  316. __STATIC_INLINE uint32_t LL_SYSCFG_IsActiveFlag_CMPCR(void)
  317. {
  318. return (READ_BIT(SYSCFG->CMPCR, SYSCFG_CMPCR_READY) == (SYSCFG_CMPCR_READY));
  319. }
  320. /**
  321. * @brief Get the memory boot mapping as configured by user
  322. * @rmtoll SYSCFG_MEMRMP MEM_BOOT LL_SYSCFG_GetRemapMemoryBoot
  323. * @retval Returned value can be one of the following values:
  324. * @arg @ref LL_SYSCFG_REMAP_BOOT0
  325. * @arg @ref LL_SYSCFG_REMAP_BOOT1
  326. *
  327. * (*) value not defined in all devices
  328. */
  329. __STATIC_INLINE uint32_t LL_SYSCFG_GetRemapMemoryBoot(void)
  330. {
  331. return (uint32_t)(READ_BIT(SYSCFG->MEMRMP, SYSCFG_MEMRMP_MEM_BOOT));
  332. }
  333. #if defined(SYSCFG_PMC_MII_RMII_SEL)
  334. /**
  335. * @brief Select Ethernet PHY interface
  336. * @rmtoll SYSCFG_PMC MII_RMII_SEL LL_SYSCFG_SetPHYInterface
  337. * @param Interface This parameter can be one of the following values:
  338. * @arg @ref LL_SYSCFG_PMC_ETHMII
  339. * @arg @ref LL_SYSCFG_PMC_ETHRMII
  340. * @retval None
  341. */
  342. __STATIC_INLINE void LL_SYSCFG_SetPHYInterface(uint32_t Interface)
  343. {
  344. MODIFY_REG(SYSCFG->PMC, SYSCFG_PMC_MII_RMII_SEL, Interface);
  345. }
  346. /**
  347. * @brief Get Ethernet PHY interface
  348. * @rmtoll SYSCFG_PMC MII_RMII_SEL LL_SYSCFG_GetPHYInterface
  349. * @retval Returned value can be one of the following values:
  350. * @arg @ref LL_SYSCFG_PMC_ETHMII
  351. * @arg @ref LL_SYSCFG_PMC_ETHRMII
  352. * @retval None
  353. */
  354. __STATIC_INLINE uint32_t LL_SYSCFG_GetPHYInterface(void)
  355. {
  356. return (uint32_t)(READ_BIT(SYSCFG->PMC, SYSCFG_PMC_MII_RMII_SEL));
  357. }
  358. #endif /* SYSCFG_PMC_MII_RMII_SEL */
  359. #if defined(SYSCFG_MEMRMP_SWP_FB)
  360. /**
  361. * @brief Select Flash bank mode (Bank flashed at 0x08000000)
  362. * @rmtoll SYSCFG_MEMRMP FB_MODE LL_SYSCFG_SetFlashBankMode
  363. * @param Bank This parameter can be one of the following values:
  364. * @arg @ref LL_SYSCFG_BANKMODE_BANK1
  365. * @arg @ref LL_SYSCFG_BANKMODE_BANK2
  366. * @retval None
  367. */
  368. __STATIC_INLINE void LL_SYSCFG_SetFlashBankMode(uint32_t Bank)
  369. {
  370. MODIFY_REG(SYSCFG->MEMRMP, SYSCFG_MEMRMP_SWP_FB, Bank);
  371. }
  372. /**
  373. * @brief Get Flash bank mode (Bank flashed at 0x08000000)
  374. * @rmtoll SYSCFG_MEMRMP FB_MODE LL_SYSCFG_GetFlashBankMode
  375. * @retval Returned value can be one of the following values:
  376. * @arg @ref LL_SYSCFG_BANKMODE_BANK1
  377. * @arg @ref LL_SYSCFG_BANKMODE_BANK2
  378. */
  379. __STATIC_INLINE uint32_t LL_SYSCFG_GetFlashBankMode(void)
  380. {
  381. return (uint32_t)(READ_BIT(SYSCFG->MEMRMP, SYSCFG_MEMRMP_SWP_FB));
  382. }
  383. #endif /* SYSCFG_MEMRMP_SWP_FB */
  384. #if defined(SYSCFG_PMC_I2C1_FMP)
  385. /**
  386. * @brief Enable the I2C fast mode plus driving capability.
  387. * @rmtoll SYSCFG_PMC I2C_PBx_FMP LL_SYSCFG_EnableFastModePlus\n
  388. * SYSCFG_PMC I2Cx_FMP LL_SYSCFG_EnableFastModePlus
  389. * @param ConfigFastModePlus This parameter can be a combination of the following values:
  390. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB6
  391. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB7
  392. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB8 (*)
  393. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB9 (*)
  394. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C1
  395. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C2 (*)
  396. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C3
  397. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C4(*)
  398. *
  399. * (*) value not defined in all devices
  400. * @retval None
  401. */
  402. __STATIC_INLINE void LL_SYSCFG_EnableFastModePlus(uint32_t ConfigFastModePlus)
  403. {
  404. SET_BIT(SYSCFG->PMC, ConfigFastModePlus);
  405. }
  406. /**
  407. * @brief Disable the I2C fast mode plus driving capability.
  408. * @rmtoll SYSCFG_PMC I2C_PBx_FMP LL_SYSCFG_DisableFastModePlus\n
  409. * SYSCFG_PMC I2Cx_FMP LL_SYSCFG_DisableFastModePlus
  410. * @param ConfigFastModePlus This parameter can be a combination of the following values:
  411. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB6
  412. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB7
  413. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB8 (*)
  414. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB9 (*)
  415. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C1
  416. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C2 (*)
  417. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C3
  418. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C4
  419. * (*) value not defined in all devices
  420. * @retval None
  421. */
  422. __STATIC_INLINE void LL_SYSCFG_DisableFastModePlus(uint32_t ConfigFastModePlus)
  423. {
  424. CLEAR_BIT(SYSCFG->PMC, ConfigFastModePlus);
  425. }
  426. #endif /* SYSCFG_PMC_I2C1_FMP */
  427. /**
  428. * @brief Configure source input for the EXTI external interrupt.
  429. * @rmtoll SYSCFG_EXTICR1 EXTIx LL_SYSCFG_SetEXTISource\n
  430. * SYSCFG_EXTICR2 EXTIx LL_SYSCFG_SetEXTISource\n
  431. * SYSCFG_EXTICR3 EXTIx LL_SYSCFG_SetEXTISource\n
  432. * SYSCFG_EXTICR4 EXTIx LL_SYSCFG_SetEXTISource
  433. * @param Port This parameter can be one of the following values:
  434. * @arg @ref LL_SYSCFG_EXTI_PORTA
  435. * @arg @ref LL_SYSCFG_EXTI_PORTB
  436. * @arg @ref LL_SYSCFG_EXTI_PORTC
  437. * @arg @ref LL_SYSCFG_EXTI_PORTD
  438. * @arg @ref LL_SYSCFG_EXTI_PORTE
  439. * @arg @ref LL_SYSCFG_EXTI_PORTF
  440. * @arg @ref LL_SYSCFG_EXTI_PORTG
  441. * @arg @ref LL_SYSCFG_EXTI_PORTH
  442. * @arg @ref LL_SYSCFG_EXTI_PORTI
  443. * @arg @ref LL_SYSCFG_EXTI_PORTJ
  444. * @arg @ref LL_SYSCFG_EXTI_PORTK
  445. *
  446. * (*) value not defined in all devices
  447. * @param Line This parameter can be one of the following values:
  448. * @arg @ref LL_SYSCFG_EXTI_LINE0
  449. * @arg @ref LL_SYSCFG_EXTI_LINE1
  450. * @arg @ref LL_SYSCFG_EXTI_LINE2
  451. * @arg @ref LL_SYSCFG_EXTI_LINE3
  452. * @arg @ref LL_SYSCFG_EXTI_LINE4
  453. * @arg @ref LL_SYSCFG_EXTI_LINE5
  454. * @arg @ref LL_SYSCFG_EXTI_LINE6
  455. * @arg @ref LL_SYSCFG_EXTI_LINE7
  456. * @arg @ref LL_SYSCFG_EXTI_LINE8
  457. * @arg @ref LL_SYSCFG_EXTI_LINE9
  458. * @arg @ref LL_SYSCFG_EXTI_LINE10
  459. * @arg @ref LL_SYSCFG_EXTI_LINE11
  460. * @arg @ref LL_SYSCFG_EXTI_LINE12
  461. * @arg @ref LL_SYSCFG_EXTI_LINE13
  462. * @arg @ref LL_SYSCFG_EXTI_LINE14
  463. * @arg @ref LL_SYSCFG_EXTI_LINE15
  464. * @retval None
  465. */
  466. __STATIC_INLINE void LL_SYSCFG_SetEXTISource(uint32_t Port, uint32_t Line)
  467. {
  468. MODIFY_REG(SYSCFG->EXTICR[Line & 0xFFU], (Line >> 16U), Port << POSITION_VAL((Line >> 16U)));
  469. }
  470. /**
  471. * @brief Get the configured defined for specific EXTI Line
  472. * @rmtoll SYSCFG_EXTICR1 EXTIx LL_SYSCFG_GetEXTISource\n
  473. * SYSCFG_EXTICR2 EXTIx LL_SYSCFG_GetEXTISource\n
  474. * SYSCFG_EXTICR3 EXTIx LL_SYSCFG_GetEXTISource\n
  475. * SYSCFG_EXTICR4 EXTIx LL_SYSCFG_GetEXTISource
  476. * @param Line This parameter can be one of the following values:
  477. * @arg @ref LL_SYSCFG_EXTI_LINE0
  478. * @arg @ref LL_SYSCFG_EXTI_LINE1
  479. * @arg @ref LL_SYSCFG_EXTI_LINE2
  480. * @arg @ref LL_SYSCFG_EXTI_LINE3
  481. * @arg @ref LL_SYSCFG_EXTI_LINE4
  482. * @arg @ref LL_SYSCFG_EXTI_LINE5
  483. * @arg @ref LL_SYSCFG_EXTI_LINE6
  484. * @arg @ref LL_SYSCFG_EXTI_LINE7
  485. * @arg @ref LL_SYSCFG_EXTI_LINE8
  486. * @arg @ref LL_SYSCFG_EXTI_LINE9
  487. * @arg @ref LL_SYSCFG_EXTI_LINE10
  488. * @arg @ref LL_SYSCFG_EXTI_LINE11
  489. * @arg @ref LL_SYSCFG_EXTI_LINE12
  490. * @arg @ref LL_SYSCFG_EXTI_LINE13
  491. * @arg @ref LL_SYSCFG_EXTI_LINE14
  492. * @arg @ref LL_SYSCFG_EXTI_LINE15
  493. * @retval Returned value can be one of the following values:
  494. * @arg @ref LL_SYSCFG_EXTI_PORTA
  495. * @arg @ref LL_SYSCFG_EXTI_PORTB
  496. * @arg @ref LL_SYSCFG_EXTI_PORTC
  497. * @arg @ref LL_SYSCFG_EXTI_PORTD
  498. * @arg @ref LL_SYSCFG_EXTI_PORTE
  499. * @arg @ref LL_SYSCFG_EXTI_PORTF
  500. * @arg @ref LL_SYSCFG_EXTI_PORTG
  501. * @arg @ref LL_SYSCFG_EXTI_PORTH
  502. * @arg @ref LL_SYSCFG_EXTI_PORTI
  503. * @arg @ref LL_SYSCFG_EXTI_PORTJ
  504. * @arg @ref LL_SYSCFG_EXTI_PORTK
  505. * (*) value not defined in all devices
  506. */
  507. __STATIC_INLINE uint32_t LL_SYSCFG_GetEXTISource(uint32_t Line)
  508. {
  509. return (uint32_t)(READ_BIT(SYSCFG->EXTICR[Line & 0xFFU], (Line >> 16U)) >> POSITION_VAL(Line >> 16U));
  510. }
  511. #if defined(SYSCFG_CBR_CLL)
  512. /**
  513. * @brief Set connections to TIM1/8/15/16/17 Break inputs
  514. * SYSCFG_CBR CLL LL_SYSCFG_SetTIMBreakInputs\n
  515. * SYSCFG_CBR PVDL LL_SYSCFG_SetTIMBreakInputs
  516. * @param Break This parameter can be a combination of the following values:
  517. * @arg @ref LL_SYSCFG_TIMBREAK_LOCKUP
  518. * @arg @ref LL_SYSCFG_TIMBREAK_PVD
  519. * @retval None
  520. */
  521. __STATIC_INLINE void LL_SYSCFG_SetTIMBreakInputs(uint32_t Break)
  522. {
  523. MODIFY_REG(SYSCFG->CBR, SYSCFG_CBR_CLL | SYSCFG_CBR_PVDL, Break);
  524. }
  525. /**
  526. * @brief Get connections to TIM1/8/15/16/17 Break inputs
  527. * SYSCFG_CBR CLL LL_SYSCFG_GetTIMBreakInputs\n
  528. * SYSCFG_CBR PVDL LL_SYSCFG_GetTIMBreakInputs
  529. * @retval Returned value can be can be a combination of the following values:
  530. * @arg @ref LL_SYSCFG_TIMBREAK_LOCKUP
  531. * @arg @ref LL_SYSCFG_TIMBREAK_PVD
  532. */
  533. __STATIC_INLINE uint32_t LL_SYSCFG_GetTIMBreakInputs(void)
  534. {
  535. return (uint32_t)(READ_BIT(SYSCFG->CBR, SYSCFG_CBR_CLL | SYSCFG_CBR_PVDL));
  536. }
  537. #endif /* SYSCFG_CBR_CLL */
  538. /**
  539. * @}
  540. */
  541. /** @defgroup SYSTEM_LL_EF_DBGMCU DBGMCU
  542. * @{
  543. */
  544. /**
  545. * @brief Return the device identifier
  546. * @note For STM32F75xxx and STM32F74xxx devices, the device ID is 0x449
  547. * @note For STM32F77xxx and STM32F76xxx devices, the device ID is 0x451
  548. * @note For STM32F72xxx and STM32F73xxx devices, the device ID is 0x452
  549. * @rmtoll DBGMCU_IDCODE DEV_ID LL_DBGMCU_GetDeviceID
  550. * @retval Values between Min_Data=0x00 and Max_Data=0xFFF
  551. */
  552. __STATIC_INLINE uint32_t LL_DBGMCU_GetDeviceID(void)
  553. {
  554. return (uint32_t)(READ_BIT(DBGMCU->IDCODE, DBGMCU_IDCODE_DEV_ID));
  555. }
  556. /**
  557. * @brief Return the device revision identifier
  558. * @note This field indicates the revision of the device.
  559. For example, it is read as RevA -> 0x1000, Cat 2 revZ -> 0x1001
  560. * @rmtoll DBGMCU_IDCODE REV_ID LL_DBGMCU_GetRevisionID
  561. * @retval Values between Min_Data=0x00 and Max_Data=0xFFFF
  562. */
  563. __STATIC_INLINE uint32_t LL_DBGMCU_GetRevisionID(void)
  564. {
  565. return (uint32_t)(READ_BIT(DBGMCU->IDCODE, DBGMCU_IDCODE_REV_ID) >> DBGMCU_IDCODE_REV_ID_Pos);
  566. }
  567. /**
  568. * @brief Enable the Debug Module during SLEEP mode
  569. * @rmtoll DBGMCU_CR DBG_SLEEP LL_DBGMCU_EnableDBGSleepMode
  570. * @retval None
  571. */
  572. __STATIC_INLINE void LL_DBGMCU_EnableDBGSleepMode(void)
  573. {
  574. SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP);
  575. }
  576. /**
  577. * @brief Disable the Debug Module during SLEEP mode
  578. * @rmtoll DBGMCU_CR DBG_SLEEP LL_DBGMCU_DisableDBGSleepMode
  579. * @retval None
  580. */
  581. __STATIC_INLINE void LL_DBGMCU_DisableDBGSleepMode(void)
  582. {
  583. CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP);
  584. }
  585. /**
  586. * @brief Enable the Debug Module during STOP mode
  587. * @rmtoll DBGMCU_CR DBG_STOP LL_DBGMCU_EnableDBGStopMode
  588. * @retval None
  589. */
  590. __STATIC_INLINE void LL_DBGMCU_EnableDBGStopMode(void)
  591. {
  592. SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOP);
  593. }
  594. /**
  595. * @brief Disable the Debug Module during STOP mode
  596. * @rmtoll DBGMCU_CR DBG_STOP LL_DBGMCU_DisableDBGStopMode
  597. * @retval None
  598. */
  599. __STATIC_INLINE void LL_DBGMCU_DisableDBGStopMode(void)
  600. {
  601. CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOP);
  602. }
  603. /**
  604. * @brief Enable the Debug Module during STANDBY mode
  605. * @rmtoll DBGMCU_CR DBG_STANDBY LL_DBGMCU_EnableDBGStandbyMode
  606. * @retval None
  607. */
  608. __STATIC_INLINE void LL_DBGMCU_EnableDBGStandbyMode(void)
  609. {
  610. SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY);
  611. }
  612. /**
  613. * @brief Disable the Debug Module during STANDBY mode
  614. * @rmtoll DBGMCU_CR DBG_STANDBY LL_DBGMCU_DisableDBGStandbyMode
  615. * @retval None
  616. */
  617. __STATIC_INLINE void LL_DBGMCU_DisableDBGStandbyMode(void)
  618. {
  619. CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY);
  620. }
  621. /**
  622. * @brief Set Trace pin assignment control
  623. * @rmtoll DBGMCU_CR TRACE_IOEN LL_DBGMCU_SetTracePinAssignment\n
  624. * DBGMCU_CR TRACE_MODE LL_DBGMCU_SetTracePinAssignment
  625. * @param PinAssignment This parameter can be one of the following values:
  626. * @arg @ref LL_DBGMCU_TRACE_NONE
  627. * @arg @ref LL_DBGMCU_TRACE_ASYNCH
  628. * @arg @ref LL_DBGMCU_TRACE_SYNCH_SIZE1
  629. * @arg @ref LL_DBGMCU_TRACE_SYNCH_SIZE2
  630. * @arg @ref LL_DBGMCU_TRACE_SYNCH_SIZE4
  631. * @retval None
  632. */
  633. __STATIC_INLINE void LL_DBGMCU_SetTracePinAssignment(uint32_t PinAssignment)
  634. {
  635. MODIFY_REG(DBGMCU->CR, DBGMCU_CR_TRACE_IOEN | DBGMCU_CR_TRACE_MODE, PinAssignment);
  636. }
  637. /**
  638. * @brief Get Trace pin assignment control
  639. * @rmtoll DBGMCU_CR TRACE_IOEN LL_DBGMCU_GetTracePinAssignment\n
  640. * DBGMCU_CR TRACE_MODE LL_DBGMCU_GetTracePinAssignment
  641. * @retval Returned value can be one of the following values:
  642. * @arg @ref LL_DBGMCU_TRACE_NONE
  643. * @arg @ref LL_DBGMCU_TRACE_ASYNCH
  644. * @arg @ref LL_DBGMCU_TRACE_SYNCH_SIZE1
  645. * @arg @ref LL_DBGMCU_TRACE_SYNCH_SIZE2
  646. * @arg @ref LL_DBGMCU_TRACE_SYNCH_SIZE4
  647. */
  648. __STATIC_INLINE uint32_t LL_DBGMCU_GetTracePinAssignment(void)
  649. {
  650. return (uint32_t)(READ_BIT(DBGMCU->CR, DBGMCU_CR_TRACE_IOEN | DBGMCU_CR_TRACE_MODE));
  651. }
  652. /**
  653. * @brief Freeze APB1 peripherals (group1 peripherals)
  654. * @rmtoll DBGMCU_APB1_FZ DBG_TIM2_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  655. * DBGMCU_APB1_FZ DBG_TIM3_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  656. * DBGMCU_APB1_FZ DBG_TIM4_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  657. * DBGMCU_APB1_FZ DBG_TIM5_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  658. * DBGMCU_APB1_FZ DBG_TIM6_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  659. * DBGMCU_APB1_FZ DBG_TIM7_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  660. * DBGMCU_APB1_FZ DBG_TIM12_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  661. * DBGMCU_APB1_FZ DBG_TIM13_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  662. * DBGMCU_APB1_FZ DBG_TIM14_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  663. * DBGMCU_APB1_FZ DBG_LPTIM1_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  664. * DBGMCU_APB1_FZ DBG_RTC_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  665. * DBGMCU_APB1_FZ DBG_WWDG_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  666. * DBGMCU_APB1_FZ DBG_IWDG_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  667. * DBGMCU_APB1_FZ DBG_I2C1_SMBUS_TIMEOUT LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  668. * DBGMCU_APB1_FZ DBG_I2C2_SMBUS_TIMEOUT LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  669. * DBGMCU_APB1_FZ DBG_I2C3_SMBUS_TIMEOUT LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  670. * DBGMCU_APB1_FZ DBG_I2C4_SMBUS_TIMEOUT LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  671. * DBGMCU_APB1_FZ DBG_CAN1_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  672. * DBGMCU_APB1_FZ DBG_CAN2_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  673. * DBGMCU_APB1_FZ DBG_CAN3_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph
  674. * @param Periphs This parameter can be a combination of the following values:
  675. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM2_STOP
  676. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM3_STOP
  677. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM4_STOP
  678. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM5_STOP
  679. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM6_STOP
  680. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM7_STOP
  681. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM12_STOP
  682. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM13_STOP
  683. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM14_STOP
  684. * @arg @ref LL_DBGMCU_APB1_GRP1_LPTIM1_STOP
  685. * @arg @ref LL_DBGMCU_APB1_GRP1_RTC_STOP
  686. * @arg @ref LL_DBGMCU_APB1_GRP1_WWDG_STOP
  687. * @arg @ref LL_DBGMCU_APB1_GRP1_IWDG_STOP
  688. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C1_STOP
  689. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C2_STOP
  690. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C3_STOP
  691. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C4_STOP (*)
  692. * @arg @ref LL_DBGMCU_APB1_GRP1_CAN1_STOP
  693. * @arg @ref LL_DBGMCU_APB1_GRP1_CAN2_STOP (*)
  694. * @arg @ref LL_DBGMCU_APB1_GRP1_CAN3_STOP (*)
  695. *
  696. * (*) value not defined in all devices.
  697. * @retval None
  698. */
  699. __STATIC_INLINE void LL_DBGMCU_APB1_GRP1_FreezePeriph(uint32_t Periphs)
  700. {
  701. SET_BIT(DBGMCU->APB1FZ, Periphs);
  702. }
  703. /**
  704. * @brief Unfreeze APB1 peripherals (group1 peripherals)
  705. * @rmtoll DBGMCU_APB1_FZ DBG_TIM2_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  706. * DBGMCU_APB1_FZ DBG_TIM3_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  707. * DBGMCU_APB1_FZ DBG_TIM4_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  708. * DBGMCU_APB1_FZ DBG_TIM5_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  709. * DBGMCU_APB1_FZ DBG_TIM6_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  710. * DBGMCU_APB1_FZ DBG_TIM7_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  711. * DBGMCU_APB1_FZ DBG_TIM12_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  712. * DBGMCU_APB1_FZ DBG_TIM13_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  713. * DBGMCU_APB1_FZ DBG_TIM14_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  714. * DBGMCU_APB1_FZ DBG_LPTIM1_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  715. * DBGMCU_APB1_FZ DBG_RTC_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  716. * DBGMCU_APB1_FZ DBG_WWDG_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  717. * DBGMCU_APB1_FZ DBG_IWDG_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  718. * DBGMCU_APB1_FZ DBG_I2C1_SMBUS_TIMEOUT LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  719. * DBGMCU_APB1_FZ DBG_I2C2_SMBUS_TIMEOUT LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  720. * DBGMCU_APB1_FZ DBG_I2C3_SMBUS_TIMEOUT LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  721. * DBGMCU_APB1_FZ DBG_I2C4_SMBUS_TIMEOUT LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  722. * DBGMCU_APB1_FZ DBG_CAN1_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  723. * DBGMCU_APB1_FZ DBG_CAN2_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  724. * DBGMCU_APB1_FZ DBG_CAN3_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph
  725. * @param Periphs This parameter can be a combination of the following values:
  726. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM2_STOP
  727. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM3_STOP
  728. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM4_STOP
  729. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM5_STOP
  730. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM6_STOP
  731. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM7_STOP
  732. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM12_STOP
  733. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM13_STOP
  734. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM14_STOP
  735. * @arg @ref LL_DBGMCU_APB1_GRP1_LPTIM1_STOP
  736. * @arg @ref LL_DBGMCU_APB1_GRP1_RTC_STOP
  737. * @arg @ref LL_DBGMCU_APB1_GRP1_WWDG_STOP
  738. * @arg @ref LL_DBGMCU_APB1_GRP1_IWDG_STOP
  739. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C1_STOP
  740. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C2_STOP
  741. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C3_STOP
  742. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C4_STOP (*)
  743. * @arg @ref LL_DBGMCU_APB1_GRP1_CAN1_STOP
  744. * @arg @ref LL_DBGMCU_APB1_GRP1_CAN2_STOP (*)
  745. * @arg @ref LL_DBGMCU_APB1_GRP1_CAN3_STOP (*)
  746. * (*) value not defined in all devices.
  747. * @retval None
  748. */
  749. __STATIC_INLINE void LL_DBGMCU_APB1_GRP1_UnFreezePeriph(uint32_t Periphs)
  750. {
  751. CLEAR_BIT(DBGMCU->APB1FZ, Periphs);
  752. }
  753. /**
  754. * @brief Freeze APB2 peripherals
  755. * @rmtoll DBGMCU_APB2_FZ DBG_TIM1_STOP LL_DBGMCU_APB2_GRP1_FreezePeriph\n
  756. * DBGMCU_APB2_FZ DBG_TIM8_STOP LL_DBGMCU_APB2_GRP1_FreezePeriph\n
  757. * DBGMCU_APB2_FZ DBG_TIM9_STOP LL_DBGMCU_APB2_GRP1_FreezePeriph\n
  758. * DBGMCU_APB2_FZ DBG_TIM10_STOP LL_DBGMCU_APB2_GRP1_FreezePeriph\n
  759. * DBGMCU_APB2_FZ DBG_TIM11_STOP LL_DBGMCU_APB2_GRP1_FreezePeriph
  760. * @param Periphs This parameter can be a combination of the following values:
  761. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM1_STOP
  762. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM8_STOP
  763. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM9_STOP
  764. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM10_STOP
  765. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM11_STOP
  766. *
  767. * (*) value not defined in all devices.
  768. * @retval None
  769. */
  770. __STATIC_INLINE void LL_DBGMCU_APB2_GRP1_FreezePeriph(uint32_t Periphs)
  771. {
  772. SET_BIT(DBGMCU->APB2FZ, Periphs);
  773. }
  774. /**
  775. * @brief Unfreeze APB2 peripherals
  776. * @rmtoll DBGMCU_APB2_FZ DBG_TIM1_STOP LL_DBGMCU_APB2_GRP1_UnFreezePeriph\n
  777. * DBGMCU_APB2_FZ DBG_TIM8_STOP LL_DBGMCU_APB2_GRP1_UnFreezePeriph\n
  778. * DBGMCU_APB2_FZ DBG_TIM9_STOP LL_DBGMCU_APB2_GRP1_UnFreezePeriph\n
  779. * DBGMCU_APB2_FZ DBG_TIM10_STOP LL_DBGMCU_APB2_GRP1_UnFreezePeriph\n
  780. * DBGMCU_APB2_FZ DBG_TIM11_STOP LL_DBGMCU_APB2_GRP1_UnFreezePeriph
  781. * @param Periphs This parameter can be a combination of the following values:
  782. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM1_STOP
  783. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM8_STOP
  784. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM9_STOP
  785. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM10_STOP
  786. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM11_STOP
  787. *
  788. * (*) value not defined in all devices.
  789. * @retval None
  790. */
  791. __STATIC_INLINE void LL_DBGMCU_APB2_GRP1_UnFreezePeriph(uint32_t Periphs)
  792. {
  793. CLEAR_BIT(DBGMCU->APB2FZ, Periphs);
  794. }
  795. /**
  796. * @}
  797. */
  798. /** @defgroup SYSTEM_LL_EF_FLASH FLASH
  799. * @{
  800. */
  801. /**
  802. * @brief Set FLASH Latency
  803. * @rmtoll FLASH_ACR LATENCY LL_FLASH_SetLatency
  804. * @param Latency This parameter can be one of the following values:
  805. * @arg @ref LL_FLASH_LATENCY_0
  806. * @arg @ref LL_FLASH_LATENCY_1
  807. * @arg @ref LL_FLASH_LATENCY_2
  808. * @arg @ref LL_FLASH_LATENCY_3
  809. * @arg @ref LL_FLASH_LATENCY_4
  810. * @arg @ref LL_FLASH_LATENCY_5
  811. * @arg @ref LL_FLASH_LATENCY_6
  812. * @arg @ref LL_FLASH_LATENCY_7
  813. * @arg @ref LL_FLASH_LATENCY_8
  814. * @arg @ref LL_FLASH_LATENCY_9
  815. * @arg @ref LL_FLASH_LATENCY_10
  816. * @arg @ref LL_FLASH_LATENCY_11
  817. * @arg @ref LL_FLASH_LATENCY_12
  818. * @arg @ref LL_FLASH_LATENCY_13
  819. * @arg @ref LL_FLASH_LATENCY_14
  820. * @arg @ref LL_FLASH_LATENCY_15
  821. * @retval None
  822. */
  823. __STATIC_INLINE void LL_FLASH_SetLatency(uint32_t Latency)
  824. {
  825. MODIFY_REG(FLASH->ACR, FLASH_ACR_LATENCY, Latency);
  826. }
  827. /**
  828. * @brief Get FLASH Latency
  829. * @rmtoll FLASH_ACR LATENCY LL_FLASH_GetLatency
  830. * @retval Returned value can be one of the following values:
  831. * @arg @ref LL_FLASH_LATENCY_0
  832. * @arg @ref LL_FLASH_LATENCY_1
  833. * @arg @ref LL_FLASH_LATENCY_2
  834. * @arg @ref LL_FLASH_LATENCY_3
  835. * @arg @ref LL_FLASH_LATENCY_4
  836. * @arg @ref LL_FLASH_LATENCY_5
  837. * @arg @ref LL_FLASH_LATENCY_6
  838. * @arg @ref LL_FLASH_LATENCY_7
  839. * @arg @ref LL_FLASH_LATENCY_8
  840. * @arg @ref LL_FLASH_LATENCY_9
  841. * @arg @ref LL_FLASH_LATENCY_10
  842. * @arg @ref LL_FLASH_LATENCY_11
  843. * @arg @ref LL_FLASH_LATENCY_12
  844. * @arg @ref LL_FLASH_LATENCY_13
  845. * @arg @ref LL_FLASH_LATENCY_14
  846. * @arg @ref LL_FLASH_LATENCY_15
  847. */
  848. __STATIC_INLINE uint32_t LL_FLASH_GetLatency(void)
  849. {
  850. return (uint32_t)(READ_BIT(FLASH->ACR, FLASH_ACR_LATENCY));
  851. }
  852. /**
  853. * @brief Enable Prefetch
  854. * @rmtoll FLASH_ACR PRFTEN LL_FLASH_EnablePrefetch
  855. * @retval None
  856. */
  857. __STATIC_INLINE void LL_FLASH_EnablePrefetch(void)
  858. {
  859. SET_BIT(FLASH->ACR, FLASH_ACR_PRFTEN);
  860. }
  861. /**
  862. * @brief Disable Prefetch
  863. * @rmtoll FLASH_ACR PRFTEN LL_FLASH_DisablePrefetch
  864. * @retval None
  865. */
  866. __STATIC_INLINE void LL_FLASH_DisablePrefetch(void)
  867. {
  868. CLEAR_BIT(FLASH->ACR, FLASH_ACR_PRFTEN);
  869. }
  870. /**
  871. * @brief Check if Prefetch buffer is enabled
  872. * @rmtoll FLASH_ACR PRFTEN LL_FLASH_IsPrefetchEnabled
  873. * @retval State of bit (1 or 0).
  874. */
  875. __STATIC_INLINE uint32_t LL_FLASH_IsPrefetchEnabled(void)
  876. {
  877. return (READ_BIT(FLASH->ACR, FLASH_ACR_PRFTEN) == (FLASH_ACR_PRFTEN));
  878. }
  879. /**
  880. * @brief Enable ART Accelerator
  881. * @rmtoll FLASH_ACR ARTEN LL_FLASH_EnableART
  882. * @retval None
  883. */
  884. __STATIC_INLINE void LL_FLASH_EnableART(void)
  885. {
  886. SET_BIT(FLASH->ACR, FLASH_ACR_ARTEN);
  887. }
  888. /**
  889. * @brief Disable ART Accelerator
  890. * @rmtoll FLASH_ACR ARTEN LL_FLASH_DisableART
  891. * @retval None
  892. */
  893. __STATIC_INLINE void LL_FLASH_DisableART(void)
  894. {
  895. CLEAR_BIT(FLASH->ACR, FLASH_ACR_ARTEN);
  896. }
  897. /**
  898. * @brief Enable ART Reset
  899. * @rmtoll FLASH_ACR ARTRST LL_FLASH_EnableARTReset
  900. * @retval None
  901. */
  902. __STATIC_INLINE void LL_FLASH_EnableARTReset(void)
  903. {
  904. SET_BIT(FLASH->ACR, FLASH_ACR_ARTRST);
  905. }
  906. /**
  907. * @brief Disable ART Reset
  908. * @rmtoll FLASH_ACR ARTRST LL_FLASH_DisableARTReset
  909. * @retval None
  910. */
  911. __STATIC_INLINE void LL_FLASH_DisableARTReset(void)
  912. {
  913. CLEAR_BIT(FLASH->ACR, FLASH_ACR_ARTRST);
  914. }
  915. /**
  916. * @}
  917. */
  918. /**
  919. * @}
  920. */
  921. /**
  922. * @}
  923. */
  924. #endif /* defined (FLASH) || defined (SYSCFG) || defined (DBGMCU) */
  925. /**
  926. * @}
  927. */
  928. #ifdef __cplusplus
  929. }
  930. #endif
  931. #endif /* __STM32F7xx_LL_SYSTEM_H */