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.
 
 
 

1727 lines
70 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32f4xx_ll_system.h
  4. * @author MCD Application Team
  5. * @version V1.7.1
  6. * @date 14-April-2017
  7. * @brief Header file of SYSTEM LL module.
  8. @verbatim
  9. ==============================================================================
  10. ##### How to use this driver #####
  11. ==============================================================================
  12. [..]
  13. The LL SYSTEM driver contains a set of generic APIs that can be
  14. used by user:
  15. (+) Some of the FLASH features need to be handled in the SYSTEM file.
  16. (+) Access to DBGCMU registers
  17. (+) Access to SYSCFG registers
  18. @endverbatim
  19. ******************************************************************************
  20. * @attention
  21. *
  22. * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
  23. *
  24. * Redistribution and use in source and binary forms, with or without modification,
  25. * are permitted provided that the following conditions are met:
  26. * 1. Redistributions of source code must retain the above copyright notice,
  27. * this list of conditions and the following disclaimer.
  28. * 2. Redistributions in binary form must reproduce the above copyright notice,
  29. * this list of conditions and the following disclaimer in the documentation
  30. * and/or other materials provided with the distribution.
  31. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  32. * may be used to endorse or promote products derived from this software
  33. * without specific prior written permission.
  34. *
  35. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  36. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  37. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  38. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  39. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  40. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  41. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  42. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  43. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  44. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  45. *
  46. ******************************************************************************
  47. */
  48. /* Define to prevent recursive inclusion -------------------------------------*/
  49. #ifndef __STM32F4xx_LL_SYSTEM_H
  50. #define __STM32F4xx_LL_SYSTEM_H
  51. #ifdef __cplusplus
  52. extern "C" {
  53. #endif
  54. /* Includes ------------------------------------------------------------------*/
  55. #include "stm32f4xx.h"
  56. /** @addtogroup STM32F4xx_LL_Driver
  57. * @{
  58. */
  59. #if defined (FLASH) || defined (SYSCFG) || defined (DBGMCU)
  60. /** @defgroup SYSTEM_LL SYSTEM
  61. * @{
  62. */
  63. /* Private types -------------------------------------------------------------*/
  64. /* Private variables ---------------------------------------------------------*/
  65. /* Private constants ---------------------------------------------------------*/
  66. /** @defgroup SYSTEM_LL_Private_Constants SYSTEM Private Constants
  67. * @{
  68. */
  69. /**
  70. * @}
  71. */
  72. /* Private macros ------------------------------------------------------------*/
  73. /* Exported types ------------------------------------------------------------*/
  74. /* Exported constants --------------------------------------------------------*/
  75. /** @defgroup SYSTEM_LL_Exported_Constants SYSTEM Exported Constants
  76. * @{
  77. */
  78. /** @defgroup SYSTEM_LL_EC_REMAP SYSCFG REMAP
  79. * @{
  80. */
  81. #define LL_SYSCFG_REMAP_FLASH (uint32_t)0x00000000 /*!< Main Flash memory mapped at 0x00000000 */
  82. #define LL_SYSCFG_REMAP_SYSTEMFLASH SYSCFG_MEMRMP_MEM_MODE_0 /*!< System Flash memory mapped at 0x00000000 */
  83. #if defined(FSMC_Bank1)
  84. #define LL_SYSCFG_REMAP_FSMC SYSCFG_MEMRMP_MEM_MODE_1 /*!< FSMC(NOR/PSRAM 1 and 2) mapped at 0x00000000 */
  85. #endif /* FSMC_Bank1 */
  86. #if defined(FMC_Bank1)
  87. #define LL_SYSCFG_REMAP_FMC SYSCFG_MEMRMP_MEM_MODE_1 /*!< FMC(NOR/PSRAM 1 and 2) mapped at 0x00000000 */
  88. #endif /* FMC_Bank1 */
  89. #define LL_SYSCFG_REMAP_SRAM (SYSCFG_MEMRMP_MEM_MODE_1 | SYSCFG_MEMRMP_MEM_MODE_0) /*!< SRAM1 mapped at 0x00000000 */
  90. /**
  91. * @}
  92. */
  93. #if defined(SYSCFG_PMC_MII_RMII_SEL)
  94. /** @defgroup SYSTEM_LL_EC_PMC SYSCFG PMC
  95. * @{
  96. */
  97. #define LL_SYSCFG_PMC_ETHMII (uint32_t)0x00000000 /*!< ETH Media MII interface */
  98. #define LL_SYSCFG_PMC_ETHRMII (uint32_t)SYSCFG_PMC_MII_RMII_SEL /*!< ETH Media RMII interface */
  99. /**
  100. * @}
  101. */
  102. #endif /* SYSCFG_PMC_MII_RMII_SEL */
  103. #if defined(SYSCFG_MEMRMP_UFB_MODE)
  104. /** @defgroup SYSTEM_LL_EC_BANKMODE SYSCFG BANK MODE
  105. * @{
  106. */
  107. #define LL_SYSCFG_BANKMODE_BANK1 (uint32_t)0x00000000 /*!< Flash Bank 1 base address mapped at 0x0800 0000 (AXI) and 0x0020 0000 (TCM)
  108. and Flash Bank 2 base address mapped at 0x0810 0000 (AXI) and 0x0030 0000 (TCM)*/
  109. #define LL_SYSCFG_BANKMODE_BANK2 SYSCFG_MEMRMP_UFB_MODE /*!< Flash Bank 2 base address mapped at 0x0800 0000 (AXI) and 0x0020 0000(TCM)
  110. and Flash Bank 1 base address mapped at 0x0810 0000 (AXI) and 0x0030 0000(TCM) */
  111. /**
  112. * @}
  113. */
  114. #endif /* SYSCFG_MEMRMP_UFB_MODE */
  115. /** @defgroup SYSTEM_LL_EC_I2C_FASTMODEPLUS SYSCFG I2C FASTMODEPLUS
  116. * @{
  117. */
  118. #if defined(SYSCFG_CFGR_FMPI2C1_SCL)
  119. #define LL_SYSCFG_I2C_FASTMODEPLUS_SCL SYSCFG_CFGR_FMPI2C1_SCL /*!< Enable Fast Mode Plus on FMPI2C_SCL pin */
  120. #define LL_SYSCFG_I2C_FASTMODEPLUS_SDA SYSCFG_CFGR_FMPI2C1_SDA /*!< Enable Fast Mode Plus on FMPI2C_SDA pin*/
  121. #endif /* SYSCFG_CFGR_FMPI2C1_SCL */
  122. /**
  123. * @}
  124. */
  125. /** @defgroup SYSTEM_LL_EC_EXTI_PORT SYSCFG EXTI PORT
  126. * @{
  127. */
  128. #define LL_SYSCFG_EXTI_PORTA (uint32_t)0 /*!< EXTI PORT A */
  129. #define LL_SYSCFG_EXTI_PORTB (uint32_t)1 /*!< EXTI PORT B */
  130. #define LL_SYSCFG_EXTI_PORTC (uint32_t)2 /*!< EXTI PORT C */
  131. #define LL_SYSCFG_EXTI_PORTD (uint32_t)3 /*!< EXTI PORT D */
  132. #define LL_SYSCFG_EXTI_PORTE (uint32_t)4 /*!< EXTI PORT E */
  133. #if defined(GPIOF)
  134. #define LL_SYSCFG_EXTI_PORTF (uint32_t)5 /*!< EXTI PORT F */
  135. #endif /* GPIOF */
  136. #if defined(GPIOG)
  137. #define LL_SYSCFG_EXTI_PORTG (uint32_t)6 /*!< EXTI PORT G */
  138. #endif /* GPIOG */
  139. #define LL_SYSCFG_EXTI_PORTH (uint32_t)7 /*!< EXTI PORT H */
  140. #if defined(GPIOI)
  141. #define LL_SYSCFG_EXTI_PORTI (uint32_t)8 /*!< EXTI PORT I */
  142. #endif /* GPIOI */
  143. #if defined(GPIOJ)
  144. #define LL_SYSCFG_EXTI_PORTJ (uint32_t)9 /*!< EXTI PORT J */
  145. #endif /* GPIOJ */
  146. #if defined(GPIOK)
  147. #define LL_SYSCFG_EXTI_PORTK (uint32_t)10 /*!< EXTI PORT k */
  148. #endif /* GPIOK */
  149. /**
  150. * @}
  151. */
  152. /** @defgroup SYSTEM_LL_EC_EXTI_LINE SYSCFG EXTI LINE
  153. * @{
  154. */
  155. #define LL_SYSCFG_EXTI_LINE0 (uint32_t)(0x000FU << 16 | 0) /*!< EXTI_POSITION_0 | EXTICR[0] */
  156. #define LL_SYSCFG_EXTI_LINE1 (uint32_t)(0x00F0U << 16 | 0) /*!< EXTI_POSITION_4 | EXTICR[0] */
  157. #define LL_SYSCFG_EXTI_LINE2 (uint32_t)(0x0F00U << 16 | 0) /*!< EXTI_POSITION_8 | EXTICR[0] */
  158. #define LL_SYSCFG_EXTI_LINE3 (uint32_t)(0xF000U << 16 | 0) /*!< EXTI_POSITION_12 | EXTICR[0] */
  159. #define LL_SYSCFG_EXTI_LINE4 (uint32_t)(0x000FU << 16 | 1) /*!< EXTI_POSITION_0 | EXTICR[1] */
  160. #define LL_SYSCFG_EXTI_LINE5 (uint32_t)(0x00F0U << 16 | 1) /*!< EXTI_POSITION_4 | EXTICR[1] */
  161. #define LL_SYSCFG_EXTI_LINE6 (uint32_t)(0x0F00U << 16 | 1) /*!< EXTI_POSITION_8 | EXTICR[1] */
  162. #define LL_SYSCFG_EXTI_LINE7 (uint32_t)(0xF000U << 16 | 1) /*!< EXTI_POSITION_12 | EXTICR[1] */
  163. #define LL_SYSCFG_EXTI_LINE8 (uint32_t)(0x000FU << 16 | 2) /*!< EXTI_POSITION_0 | EXTICR[2] */
  164. #define LL_SYSCFG_EXTI_LINE9 (uint32_t)(0x00F0U << 16 | 2) /*!< EXTI_POSITION_4 | EXTICR[2] */
  165. #define LL_SYSCFG_EXTI_LINE10 (uint32_t)(0x0F00U << 16 | 2) /*!< EXTI_POSITION_8 | EXTICR[2] */
  166. #define LL_SYSCFG_EXTI_LINE11 (uint32_t)(0xF000U << 16 | 2) /*!< EXTI_POSITION_12 | EXTICR[2] */
  167. #define LL_SYSCFG_EXTI_LINE12 (uint32_t)(0x000FU << 16 | 3) /*!< EXTI_POSITION_0 | EXTICR[3] */
  168. #define LL_SYSCFG_EXTI_LINE13 (uint32_t)(0x00F0U << 16 | 3) /*!< EXTI_POSITION_4 | EXTICR[3] */
  169. #define LL_SYSCFG_EXTI_LINE14 (uint32_t)(0x0F00U << 16 | 3) /*!< EXTI_POSITION_8 | EXTICR[3] */
  170. #define LL_SYSCFG_EXTI_LINE15 (uint32_t)(0xF000U << 16 | 3) /*!< EXTI_POSITION_12 | EXTICR[3] */
  171. /**
  172. * @}
  173. */
  174. /** @defgroup SYSTEM_LL_EC_TIMBREAK SYSCFG TIMER BREAK
  175. * @{
  176. */
  177. #if defined(SYSCFG_CFGR2_LOCKUP_LOCK)
  178. #define LL_SYSCFG_TIMBREAK_LOCKUP SYSCFG_CFGR2_LOCKUP_LOCK /*!< Enables and locks the LOCKUP output of CortexM4
  179. with Break Input of TIM1/8 */
  180. #define LL_SYSCFG_TIMBREAK_PVD SYSCFG_CFGR2_PVD_LOCK /*!< Enables and locks the PVD connection with TIM1/8 Break Input
  181. and also the PVDE and PLS bits of the Power Control Interface */
  182. #endif /* SYSCFG_CFGR2_CLL */
  183. /**
  184. * @}
  185. */
  186. #if defined(SYSCFG_MCHDLYCR_BSCKSEL)
  187. /** @defgroup SYSTEM_LL_DFSDM_BitStream_ClockSource SYSCFG MCHDLY BCKKSEL
  188. * @{
  189. */
  190. #define LL_SYSCFG_BITSTREAM_CLOCK_TIM2OC1 (uint32_t)0x00000000
  191. #define LL_SYSCFG_BITSTREAM_CLOCK_DFSDM2 SYSCFG_MCHDLYCR_BSCKSEL
  192. /**
  193. * @}
  194. */
  195. /** @defgroup SYSTEM_LL_DFSDM_MCHDLYEN SYSCFG MCHDLY MCHDLYEN
  196. * @{
  197. */
  198. #define LL_SYSCFG_DFSDM1_MCHDLYEN SYSCFG_MCHDLYCR_MCHDLY1EN
  199. #define LL_SYSCFG_DFSDM2_MCHDLYEN SYSCFG_MCHDLYCR_MCHDLY2EN
  200. /**
  201. * @}
  202. */
  203. /** @defgroup SYSTEM_LL_DFSDM_DataIn0_Source SYSCFG MCHDLY DFSDMD0SEL
  204. * @{
  205. */
  206. #define LL_SYSCFG_DFSDM1_DataIn0 SYSCFG_MCHDLYCR_DFSDM1D0SEL
  207. #define LL_SYSCFG_DFSDM2_DataIn0 SYSCFG_MCHDLYCR_DFSDM2D0SEL
  208. #define LL_SYSCFG_DFSDM1_DataIn0_PAD (uint32_t)((SYSCFG_MCHDLYCR_DFSDM1D0SEL << 16) | 0x00000000)
  209. #define LL_SYSCFG_DFSDM1_DataIn0_DM (uint32_t)((SYSCFG_MCHDLYCR_DFSDM1D0SEL << 16) | SYSCFG_MCHDLYCR_DFSDM1D0SEL)
  210. #define LL_SYSCFG_DFSDM2_DataIn0_PAD (uint32_t)((SYSCFG_MCHDLYCR_DFSDM2D0SEL << 16) | 0x00000000)
  211. #define LL_SYSCFG_DFSDM2_DataIn0_DM (uint32_t)((SYSCFG_MCHDLYCR_DFSDM2D0SEL << 16) | SYSCFG_MCHDLYCR_DFSDM2D0SEL)
  212. /**
  213. * @}
  214. */
  215. /** @defgroup SYSTEM_LL_DFSDM_DataIn2_Source SYSCFG MCHDLY DFSDMD2SEL
  216. * @{
  217. */
  218. #define LL_SYSCFG_DFSDM1_DataIn2 SYSCFG_MCHDLYCR_DFSDM1D2SEL
  219. #define LL_SYSCFG_DFSDM2_DataIn2 SYSCFG_MCHDLYCR_DFSDM2D2SEL
  220. #define LL_SYSCFG_DFSDM1_DataIn2_PAD (uint32_t)((SYSCFG_MCHDLYCR_DFSDM1D2SEL << 16) | 0x00000000)
  221. #define LL_SYSCFG_DFSDM1_DataIn2_DM (uint32_t)((SYSCFG_MCHDLYCR_DFSDM1D2SEL << 16) | SYSCFG_MCHDLYCR_DFSDM1D2SEL)
  222. #define LL_SYSCFG_DFSDM2_DataIn2_PAD (uint32_t)((SYSCFG_MCHDLYCR_DFSDM2D2SEL << 16) | 0x00000000)
  223. #define LL_SYSCFG_DFSDM2_DataIn2_DM (uint32_t)((SYSCFG_MCHDLYCR_DFSDM2D2SEL << 16) | SYSCFG_MCHDLYCR_DFSDM2D2SEL)
  224. /**
  225. * @}
  226. */
  227. /** @defgroup SYSTEM_LL_DFSDM1_TIM4OC2_BitstreamDistribution SYSCFG MCHDLY DFSDM1CK02SEL
  228. * @{
  229. */
  230. #define LL_SYSCFG_DFSDM1_TIM4OC2_CLKIN0 (uint32_t)0x00000000
  231. #define LL_SYSCFG_DFSDM1_TIM4OC2_CLKIN2 SYSCFG_MCHDLYCR_DFSDM1CK02SEL
  232. /**
  233. * @}
  234. */
  235. /** @defgroup SYSTEM_LL_DFSDM1_TIM4OC1_BitstreamDistribution SYSCFG MCHDLY DFSDM1CK13SEL
  236. * @{
  237. */
  238. #define LL_SYSCFG_DFSDM1_TIM4OC1_CLKIN1 (uint32_t)0x00000000
  239. #define LL_SYSCFG_DFSDM1_TIM4OC1_CLKIN3 SYSCFG_MCHDLYCR_DFSDM1CK13SEL
  240. /**
  241. * @}
  242. */
  243. /** @defgroup SYSTEM_LL_DFSDM1_CLKIN_SourceSelection SYSCFG MCHDLY DFSDMCFG
  244. * @{
  245. */
  246. #define LL_SYSCFG_DFSDM1_CKIN_PAD (uint32_t)0x00000000
  247. #define LL_SYSCFG_DFSDM1_CKIN_DM SYSCFG_MCHDLYCR_DFSDM1CFG
  248. /**
  249. * @}
  250. */
  251. /** @defgroup SYSTEM_LL_DFSDM1_CLKOUT_SourceSelection SYSCFG MCHDLY DFSDM1CKOSEL
  252. * @{
  253. */
  254. #define LL_SYSCFG_DFSDM1_CKOUT (uint32_t)0x00000000
  255. #define LL_SYSCFG_DFSDM1_CKOUT_M27 SYSCFG_MCHDLYCR_DFSDM1CKOSEL
  256. /**
  257. * @}
  258. */
  259. /** @defgroup SYSTEM_LL_DFSDM2_DataIn4_SourceSelection SYSCFG MCHDLY DFSDM2D4SEL
  260. * @{
  261. */
  262. #define LL_SYSCFG_DFSDM2_DataIn4_PAD (uint32_t)0x00000000
  263. #define LL_SYSCFG_DFSDM2_DataIn4_DM SYSCFG_MCHDLYCR_DFSDM2D4SEL
  264. /**
  265. * @}
  266. */
  267. /** @defgroup SYSTEM_LL_DFSDM2_DataIn6_SourceSelection SYSCFG MCHDLY DFSDM2D6SEL
  268. * @{
  269. */
  270. #define LL_SYSCFG_DFSDM2_DataIn6_PAD (uint32_t)0x00000000
  271. #define LL_SYSCFG_DFSDM2_DataIn6_DM SYSCFG_MCHDLYCR_DFSDM2D6SEL
  272. /**
  273. * @}
  274. */
  275. /** @defgroup SYSTEM_LL_DFSDM2_TIM3OC4_BitstreamDistribution SYSCFG MCHDLY DFSDM2CK04SEL
  276. * @{
  277. */
  278. #define LL_SYSCFG_DFSDM2_TIM3OC4_CLKIN0 (uint32_t)0x00000000
  279. #define LL_SYSCFG_DFSDM2_TIM3OC4_CLKIN4 SYSCFG_MCHDLYCR_DFSDM2CK04SEL
  280. /**
  281. * @}
  282. */
  283. /** @defgroup SYSTEM_LL_DFSDM2_TIM3OC3_BitstreamDistribution SYSCFG MCHDLY DFSDM2CK15SEL
  284. * @{
  285. */
  286. #define LL_SYSCFG_DFSDM2_TIM3OC3_CLKIN1 (uint32_t)0x00000000
  287. #define LL_SYSCFG_DFSDM2_TIM3OC3_CLKIN5 SYSCFG_MCHDLYCR_DFSDM2CK15SEL
  288. /**
  289. * @}
  290. */
  291. /** @defgroup SYSTEM_LL_DFSDM2_TIM3OC2_BitstreamDistribution SYSCFG MCHDLY DFSDM2CK26SEL
  292. * @{
  293. */
  294. #define LL_SYSCFG_DFSDM2_TIM3OC2_CLKIN2 (uint32_t)0x00000000
  295. #define LL_SYSCFG_DFSDM2_TIM3OC2_CLKIN6 SYSCFG_MCHDLYCR_DFSDM2CK26SEL
  296. /**
  297. * @}
  298. */
  299. /** @defgroup SYSTEM_LL_DFSDM2_TIM3OC1_BitstreamDistribution SYSCFG MCHDLY DFSDM2CK37SEL
  300. * @{
  301. */
  302. #define LL_SYSCFG_DFSDM2_TIM3OC1_CLKIN3 (uint32_t)0x00000000
  303. #define LL_SYSCFG_DFSDM2_TIM3OC1_CLKIN7 SYSCFG_MCHDLYCR_DFSDM2CK37SEL
  304. /**
  305. * @}
  306. */
  307. /** @defgroup SYSTEM_LL_DFSDM2_CLKIN_SourceSelection SYSCFG MCHDLY DFSDM2CFG
  308. * @{
  309. */
  310. #define LL_SYSCFG_DFSDM2_CKIN_PAD (uint32_t)0x00000000
  311. #define LL_SYSCFG_DFSDM2_CKIN_DM SYSCFG_MCHDLYCR_DFSDM2CFG
  312. /**
  313. * @}
  314. */
  315. /** @defgroup SYSTEM_LL_DFSDM2_CLKOUT_SourceSelection SYSCFG MCHDLY DFSDM2CKOSEL
  316. * @{
  317. */
  318. #define LL_SYSCFG_DFSDM2_CKOUT (uint32_t)0x00000000
  319. #define LL_SYSCFG_DFSDM2_CKOUT_M27 SYSCFG_MCHDLYCR_DFSDM2CKOSEL
  320. /**
  321. * @}
  322. */
  323. #endif /* SYSCFG_MCHDLYCR_BSCKSEL */
  324. /** @defgroup SYSTEM_LL_EC_TRACE DBGMCU TRACE Pin Assignment
  325. * @{
  326. */
  327. #define LL_DBGMCU_TRACE_NONE 0x00000000U /*!< TRACE pins not assigned (default state) */
  328. #define LL_DBGMCU_TRACE_ASYNCH DBGMCU_CR_TRACE_IOEN /*!< TRACE pin assignment for Asynchronous Mode */
  329. #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 */
  330. #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 */
  331. #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 */
  332. /**
  333. * @}
  334. */
  335. /** @defgroup SYSTEM_LL_EC_APB1_GRP1_STOP_IP DBGMCU APB1 GRP1 STOP IP
  336. * @{
  337. */
  338. #if defined(DBGMCU_APB1_FZ_DBG_TIM2_STOP)
  339. #define LL_DBGMCU_APB1_GRP1_TIM2_STOP DBGMCU_APB1_FZ_DBG_TIM2_STOP /*!< TIM2 counter stopped when core is halted */
  340. #endif /* DBGMCU_APB1_FZ_DBG_TIM2_STOP */
  341. #if defined(DBGMCU_APB1_FZ_DBG_TIM3_STOP)
  342. #define LL_DBGMCU_APB1_GRP1_TIM3_STOP DBGMCU_APB1_FZ_DBG_TIM3_STOP /*!< TIM3 counter stopped when core is halted */
  343. #endif /* DBGMCU_APB1_FZ_DBG_TIM3_STOP */
  344. #if defined(DBGMCU_APB1_FZ_DBG_TIM4_STOP)
  345. #define LL_DBGMCU_APB1_GRP1_TIM4_STOP DBGMCU_APB1_FZ_DBG_TIM4_STOP /*!< TIM4 counter stopped when core is halted */
  346. #endif /* DBGMCU_APB1_FZ_DBG_TIM4_STOP */
  347. #define LL_DBGMCU_APB1_GRP1_TIM5_STOP DBGMCU_APB1_FZ_DBG_TIM5_STOP /*!< TIM5 counter stopped when core is halted */
  348. #if defined(DBGMCU_APB1_FZ_DBG_TIM6_STOP)
  349. #define LL_DBGMCU_APB1_GRP1_TIM6_STOP DBGMCU_APB1_FZ_DBG_TIM6_STOP /*!< TIM6 counter stopped when core is halted */
  350. #endif /* DBGMCU_APB1_FZ_DBG_TIM6_STOP */
  351. #if defined(DBGMCU_APB1_FZ_DBG_TIM7_STOP)
  352. #define LL_DBGMCU_APB1_GRP1_TIM7_STOP DBGMCU_APB1_FZ_DBG_TIM7_STOP /*!< TIM7 counter stopped when core is halted */
  353. #endif /* DBGMCU_APB1_FZ_DBG_TIM7_STOP */
  354. #if defined(DBGMCU_APB1_FZ_DBG_TIM12_STOP)
  355. #define LL_DBGMCU_APB1_GRP1_TIM12_STOP DBGMCU_APB1_FZ_DBG_TIM12_STOP /*!< TIM12 counter stopped when core is halted */
  356. #endif /* DBGMCU_APB1_FZ_DBG_TIM12_STOP */
  357. #if defined(DBGMCU_APB1_FZ_DBG_TIM13_STOP)
  358. #define LL_DBGMCU_APB1_GRP1_TIM13_STOP DBGMCU_APB1_FZ_DBG_TIM13_STOP /*!< TIM13 counter stopped when core is halted */
  359. #endif /* DBGMCU_APB1_FZ_DBG_TIM13_STOP */
  360. #if defined(DBGMCU_APB1_FZ_DBG_TIM14_STOP)
  361. #define LL_DBGMCU_APB1_GRP1_TIM14_STOP DBGMCU_APB1_FZ_DBG_TIM14_STOP /*!< TIM14 counter stopped when core is halted */
  362. #endif /* DBGMCU_APB1_FZ_DBG_TIM14_STOP */
  363. #if defined(DBGMCU_APB1_FZ_DBG_LPTIM_STOP)
  364. #define LL_DBGMCU_APB1_GRP1_LPTIM_STOP DBGMCU_APB1_FZ_DBG_LPTIM_STOP /*!< LPTIM counter stopped when core is halted */
  365. #endif /* DBGMCU_APB1_FZ_DBG_LPTIM_STOP */
  366. #define LL_DBGMCU_APB1_GRP1_RTC_STOP DBGMCU_APB1_FZ_DBG_RTC_STOP /*!< RTC counter stopped when core is halted */
  367. #define LL_DBGMCU_APB1_GRP1_WWDG_STOP DBGMCU_APB1_FZ_DBG_WWDG_STOP /*!< Debug Window Watchdog stopped when Core is halted */
  368. #define LL_DBGMCU_APB1_GRP1_IWDG_STOP DBGMCU_APB1_FZ_DBG_IWDG_STOP /*!< Debug Independent Watchdog stopped when Core is halted */
  369. #define LL_DBGMCU_APB1_GRP1_I2C1_STOP DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT /*!< I2C1 SMBUS timeout mode stopped when Core is halted */
  370. #define LL_DBGMCU_APB1_GRP1_I2C2_STOP DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT /*!< I2C2 SMBUS timeout mode stopped when Core is halted */
  371. #if defined(DBGMCU_APB1_FZ_DBG_I2C3_SMBUS_TIMEOUT)
  372. #define LL_DBGMCU_APB1_GRP1_I2C3_STOP DBGMCU_APB1_FZ_DBG_I2C3_SMBUS_TIMEOUT /*!< I2C3 SMBUS timeout mode stopped when Core is halted */
  373. #endif /* DBGMCU_APB1_FZ_DBG_I2C3_SMBUS_TIMEOUT */
  374. #if defined(DBGMCU_APB1_FZ_DBG_I2C4_SMBUS_TIMEOUT)
  375. #define LL_DBGMCU_APB1_GRP1_I2C4_STOP DBGMCU_APB1_FZ_DBG_I2C4_SMBUS_TIMEOUT /*!< I2C4 SMBUS timeout mode stopped when Core is halted */
  376. #endif /* DBGMCU_APB1_FZ_DBG_I2C4_SMBUS_TIMEOUT */
  377. #if defined(DBGMCU_APB1_FZ_DBG_CAN1_STOP)
  378. #define LL_DBGMCU_APB1_GRP1_CAN1_STOP DBGMCU_APB1_FZ_DBG_CAN1_STOP /*!< CAN1 debug stopped when Core is halted */
  379. #endif /* DBGMCU_APB1_FZ_DBG_CAN1_STOP */
  380. #if defined(DBGMCU_APB1_FZ_DBG_CAN2_STOP)
  381. #define LL_DBGMCU_APB1_GRP1_CAN2_STOP DBGMCU_APB1_FZ_DBG_CAN2_STOP /*!< CAN2 debug stopped when Core is halted */
  382. #endif /* DBGMCU_APB1_FZ_DBG_CAN2_STOP */
  383. #if defined(DBGMCU_APB1_FZ_DBG_CAN3_STOP)
  384. #define LL_DBGMCU_APB1_GRP1_CAN3_STOP DBGMCU_APB1_FZ_DBG_CAN3_STOP /*!< CAN3 debug stopped when Core is halted */
  385. #endif /* DBGMCU_APB1_FZ_DBG_CAN3_STOP */
  386. /**
  387. * @}
  388. */
  389. /** @defgroup SYSTEM_LL_EC_APB2_GRP1_STOP_IP DBGMCU APB2 GRP1 STOP IP
  390. * @{
  391. */
  392. #define LL_DBGMCU_APB2_GRP1_TIM1_STOP DBGMCU_APB2_FZ_DBG_TIM1_STOP /*!< TIM1 counter stopped when core is halted */
  393. #if defined(DBGMCU_APB2_FZ_DBG_TIM8_STOP)
  394. #define LL_DBGMCU_APB2_GRP1_TIM8_STOP DBGMCU_APB2_FZ_DBG_TIM8_STOP /*!< TIM8 counter stopped when core is halted */
  395. #endif /* DBGMCU_APB2_FZ_DBG_TIM8_STOP */
  396. #define LL_DBGMCU_APB2_GRP1_TIM9_STOP DBGMCU_APB2_FZ_DBG_TIM9_STOP /*!< TIM9 counter stopped when core is halted */
  397. #if defined(DBGMCU_APB2_FZ_DBG_TIM10_STOP)
  398. #define LL_DBGMCU_APB2_GRP1_TIM10_STOP DBGMCU_APB2_FZ_DBG_TIM10_STOP /*!< TIM10 counter stopped when core is halted */
  399. #endif /* DBGMCU_APB2_FZ_DBG_TIM10_STOP */
  400. #define LL_DBGMCU_APB2_GRP1_TIM11_STOP DBGMCU_APB2_FZ_DBG_TIM11_STOP /*!< TIM11 counter stopped when core is halted */
  401. /**
  402. * @}
  403. */
  404. /** @defgroup SYSTEM_LL_EC_LATENCY FLASH LATENCY
  405. * @{
  406. */
  407. #define LL_FLASH_LATENCY_0 FLASH_ACR_LATENCY_0WS /*!< FLASH Zero wait state */
  408. #define LL_FLASH_LATENCY_1 FLASH_ACR_LATENCY_1WS /*!< FLASH One wait state */
  409. #define LL_FLASH_LATENCY_2 FLASH_ACR_LATENCY_2WS /*!< FLASH Two wait states */
  410. #define LL_FLASH_LATENCY_3 FLASH_ACR_LATENCY_3WS /*!< FLASH Three wait states */
  411. #define LL_FLASH_LATENCY_4 FLASH_ACR_LATENCY_4WS /*!< FLASH Four wait states */
  412. #define LL_FLASH_LATENCY_5 FLASH_ACR_LATENCY_5WS /*!< FLASH five wait state */
  413. #define LL_FLASH_LATENCY_6 FLASH_ACR_LATENCY_6WS /*!< FLASH six wait state */
  414. #define LL_FLASH_LATENCY_7 FLASH_ACR_LATENCY_7WS /*!< FLASH seven wait states */
  415. #define LL_FLASH_LATENCY_8 FLASH_ACR_LATENCY_8WS /*!< FLASH eight wait states */
  416. #define LL_FLASH_LATENCY_9 FLASH_ACR_LATENCY_9WS /*!< FLASH nine wait states */
  417. #define LL_FLASH_LATENCY_10 FLASH_ACR_LATENCY_10WS /*!< FLASH ten wait states */
  418. #define LL_FLASH_LATENCY_11 FLASH_ACR_LATENCY_11WS /*!< FLASH eleven wait states */
  419. #define LL_FLASH_LATENCY_12 FLASH_ACR_LATENCY_12WS /*!< FLASH twelve wait states */
  420. #define LL_FLASH_LATENCY_13 FLASH_ACR_LATENCY_13WS /*!< FLASH thirteen wait states */
  421. #define LL_FLASH_LATENCY_14 FLASH_ACR_LATENCY_14WS /*!< FLASH fourteen wait states */
  422. #define LL_FLASH_LATENCY_15 FLASH_ACR_LATENCY_15WS /*!< FLASH fifteen wait states */
  423. /**
  424. * @}
  425. */
  426. /**
  427. * @}
  428. */
  429. /* Exported macro ------------------------------------------------------------*/
  430. /* Exported functions --------------------------------------------------------*/
  431. /** @defgroup SYSTEM_LL_Exported_Functions SYSTEM Exported Functions
  432. * @{
  433. */
  434. /** @defgroup SYSTEM_LL_EF_SYSCFG SYSCFG
  435. * @{
  436. */
  437. /**
  438. * @brief Set memory mapping at address 0x00000000
  439. * @rmtoll SYSCFG_MEMRMP MEM_MODE LL_SYSCFG_SetRemapMemory
  440. * @param Memory This parameter can be one of the following values:
  441. * @arg @ref LL_SYSCFG_REMAP_FLASH
  442. * @arg @ref LL_SYSCFG_REMAP_SYSTEMFLASH
  443. * @arg @ref LL_SYSCFG_REMAP_SRAM
  444. * @arg @ref LL_SYSCFG_REMAP_FSMC (*)
  445. * @arg @ref LL_SYSCFG_REMAP_FMC (*)
  446. * @retval None
  447. */
  448. __STATIC_INLINE void LL_SYSCFG_SetRemapMemory(uint32_t Memory)
  449. {
  450. MODIFY_REG(SYSCFG->MEMRMP, SYSCFG_MEMRMP_MEM_MODE, Memory);
  451. }
  452. /**
  453. * @brief Get memory mapping at address 0x00000000
  454. * @rmtoll SYSCFG_MEMRMP MEM_MODE LL_SYSCFG_GetRemapMemory
  455. * @retval Returned value can be one of the following values:
  456. * @arg @ref LL_SYSCFG_REMAP_FLASH
  457. * @arg @ref LL_SYSCFG_REMAP_SYSTEMFLASH
  458. * @arg @ref LL_SYSCFG_REMAP_SRAM
  459. * @arg @ref LL_SYSCFG_REMAP_FSMC (*)
  460. * @arg @ref LL_SYSCFG_REMAP_FMC (*)
  461. */
  462. __STATIC_INLINE uint32_t LL_SYSCFG_GetRemapMemory(void)
  463. {
  464. return (uint32_t)(READ_BIT(SYSCFG->MEMRMP, SYSCFG_MEMRMP_MEM_MODE));
  465. }
  466. #if defined(SYSCFG_MEMRMP_SWP_FMC)
  467. /**
  468. * @brief Enables the FMC Memory Mapping Swapping
  469. * @rmtoll SYSCFG_MEMRMP SWP_FMC LL_SYSCFG_EnableFMCMemorySwapping
  470. * @note SDRAM is accessible at 0x60000000 and NOR/RAM
  471. * is accessible at 0xC0000000
  472. * @retval None
  473. */
  474. __STATIC_INLINE void LL_SYSCFG_EnableFMCMemorySwapping(void)
  475. {
  476. SET_BIT(SYSCFG->MEMRMP, SYSCFG_MEMRMP_SWP_FMC_0);
  477. }
  478. /**
  479. * @brief Disables the FMC Memory Mapping Swapping
  480. * @rmtoll SYSCFG_MEMRMP SWP_FMC LL_SYSCFG_DisableFMCMemorySwapping
  481. * @note SDRAM is accessible at 0xC0000000 (default mapping)
  482. * and NOR/RAM is accessible at 0x60000000 (default mapping)
  483. * @retval None
  484. */
  485. __STATIC_INLINE void LL_SYSCFG_DisableFMCMemorySwapping(void)
  486. {
  487. CLEAR_BIT(SYSCFG->MEMRMP, SYSCFG_MEMRMP_SWP_FMC);
  488. }
  489. #endif /* SYSCFG_MEMRMP_SWP_FMC */
  490. /**
  491. * @brief Enables the Compensation cell Power Down
  492. * @rmtoll SYSCFG_CMPCR CMP_PD LL_SYSCFG_EnableCompensationCell
  493. * @note The I/O compensation cell can be used only when the device supply
  494. * voltage ranges from 2.4 to 3.6 V
  495. * @retval None
  496. */
  497. __STATIC_INLINE void LL_SYSCFG_EnableCompensationCell(void)
  498. {
  499. SET_BIT(SYSCFG->CMPCR, SYSCFG_CMPCR_CMP_PD);
  500. }
  501. /**
  502. * @brief Disables the Compensation cell Power Down
  503. * @rmtoll SYSCFG_CMPCR CMP_PD LL_SYSCFG_DisableCompensationCell
  504. * @note The I/O compensation cell can be used only when the device supply
  505. * voltage ranges from 2.4 to 3.6 V
  506. * @retval None
  507. */
  508. __STATIC_INLINE void LL_SYSCFG_DisableCompensationCell(void)
  509. {
  510. CLEAR_BIT(SYSCFG->CMPCR, SYSCFG_CMPCR_CMP_PD);
  511. }
  512. /**
  513. * @brief Get Compensation Cell ready Flag
  514. * @rmtoll SYSCFG_CMPCR READY LL_SYSCFG_IsActiveFlag_CMPCR
  515. * @retval State of bit (1 or 0).
  516. */
  517. __STATIC_INLINE uint32_t LL_SYSCFG_IsActiveFlag_CMPCR(void)
  518. {
  519. return (READ_BIT(SYSCFG->CMPCR, SYSCFG_CMPCR_READY) == (SYSCFG_CMPCR_READY));
  520. }
  521. #if defined(SYSCFG_PMC_MII_RMII_SEL)
  522. /**
  523. * @brief Select Ethernet PHY interface
  524. * @rmtoll SYSCFG_PMC MII_RMII_SEL LL_SYSCFG_SetPHYInterface
  525. * @param Interface This parameter can be one of the following values:
  526. * @arg @ref LL_SYSCFG_PMC_ETHMII
  527. * @arg @ref LL_SYSCFG_PMC_ETHRMII
  528. * @retval None
  529. */
  530. __STATIC_INLINE void LL_SYSCFG_SetPHYInterface(uint32_t Interface)
  531. {
  532. MODIFY_REG(SYSCFG->PMC, SYSCFG_PMC_MII_RMII_SEL, Interface);
  533. }
  534. /**
  535. * @brief Get Ethernet PHY interface
  536. * @rmtoll SYSCFG_PMC MII_RMII_SEL LL_SYSCFG_GetPHYInterface
  537. * @retval Returned value can be one of the following values:
  538. * @arg @ref LL_SYSCFG_PMC_ETHMII
  539. * @arg @ref LL_SYSCFG_PMC_ETHRMII
  540. * @retval None
  541. */
  542. __STATIC_INLINE uint32_t LL_SYSCFG_GetPHYInterface(void)
  543. {
  544. return (uint32_t)(READ_BIT(SYSCFG->PMC, SYSCFG_PMC_MII_RMII_SEL));
  545. }
  546. #endif /* SYSCFG_PMC_MII_RMII_SEL */
  547. #if defined(SYSCFG_MEMRMP_UFB_MODE)
  548. /**
  549. * @brief Select Flash bank mode (Bank flashed at 0x08000000)
  550. * @rmtoll SYSCFG_MEMRMP UFB_MODE LL_SYSCFG_SetFlashBankMode
  551. * @param Bank This parameter can be one of the following values:
  552. * @arg @ref LL_SYSCFG_BANKMODE_BANK1
  553. * @arg @ref LL_SYSCFG_BANKMODE_BANK2
  554. * @retval None
  555. */
  556. __STATIC_INLINE void LL_SYSCFG_SetFlashBankMode(uint32_t Bank)
  557. {
  558. MODIFY_REG(SYSCFG->MEMRMP, SYSCFG_MEMRMP_UFB_MODE, Bank);
  559. }
  560. /**
  561. * @brief Get Flash bank mode (Bank flashed at 0x08000000)
  562. * @rmtoll SYSCFG_MEMRMP UFB_MODE LL_SYSCFG_GetFlashBankMode
  563. * @retval Returned value can be one of the following values:
  564. * @arg @ref LL_SYSCFG_BANKMODE_BANK1
  565. * @arg @ref LL_SYSCFG_BANKMODE_BANK2
  566. */
  567. __STATIC_INLINE uint32_t LL_SYSCFG_GetFlashBankMode(void)
  568. {
  569. return (uint32_t)(READ_BIT(SYSCFG->MEMRMP, SYSCFG_MEMRMP_UFB_MODE));
  570. }
  571. #endif /* SYSCFG_MEMRMP_UFB_MODE */
  572. #if defined(SYSCFG_CFGR_FMPI2C1_SCL)
  573. /**
  574. * @brief Enable the I2C fast mode plus driving capability.
  575. * @rmtoll SYSCFG_CFGR FMPI2C1_SCL LL_SYSCFG_EnableFastModePlus\n
  576. * SYSCFG_CFGR FMPI2C1_SDA LL_SYSCFG_EnableFastModePlus
  577. * @param ConfigFastModePlus This parameter can be a combination of the following values:
  578. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_SCL
  579. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_SDA
  580. * (*) value not defined in all devices
  581. * @retval None
  582. */
  583. __STATIC_INLINE void LL_SYSCFG_EnableFastModePlus(uint32_t ConfigFastModePlus)
  584. {
  585. SET_BIT(SYSCFG->CFGR, ConfigFastModePlus);
  586. }
  587. /**
  588. * @brief Disable the I2C fast mode plus driving capability.
  589. * @rmtoll SYSCFG_CFGR FMPI2C1_SCL LL_SYSCFG_DisableFastModePlus\n
  590. * SYSCFG_CFGR FMPI2C1_SDA LL_SYSCFG_DisableFastModePlus\n
  591. * @param ConfigFastModePlus This parameter can be a combination of the following values:
  592. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_SCL
  593. * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_SDA
  594. * (*) value not defined in all devices
  595. * @retval None
  596. */
  597. __STATIC_INLINE void LL_SYSCFG_DisableFastModePlus(uint32_t ConfigFastModePlus)
  598. {
  599. CLEAR_BIT(SYSCFG->CFGR, ConfigFastModePlus);
  600. }
  601. #endif /* SYSCFG_CFGR_FMPI2C1_SCL */
  602. /**
  603. * @brief Configure source input for the EXTI external interrupt.
  604. * @rmtoll SYSCFG_EXTICR1 EXTIx LL_SYSCFG_SetEXTISource\n
  605. * SYSCFG_EXTICR2 EXTIx LL_SYSCFG_SetEXTISource\n
  606. * SYSCFG_EXTICR3 EXTIx LL_SYSCFG_SetEXTISource\n
  607. * SYSCFG_EXTICR4 EXTIx LL_SYSCFG_SetEXTISource
  608. * @param Port This parameter can be one of the following values:
  609. * @arg @ref LL_SYSCFG_EXTI_PORTA
  610. * @arg @ref LL_SYSCFG_EXTI_PORTB
  611. * @arg @ref LL_SYSCFG_EXTI_PORTC
  612. * @arg @ref LL_SYSCFG_EXTI_PORTD
  613. * @arg @ref LL_SYSCFG_EXTI_PORTE
  614. * @arg @ref LL_SYSCFG_EXTI_PORTF (*)
  615. * @arg @ref LL_SYSCFG_EXTI_PORTG (*)
  616. * @arg @ref LL_SYSCFG_EXTI_PORTH
  617. *
  618. * (*) value not defined in all devices
  619. * @param Line This parameter can be one of the following values:
  620. * @arg @ref LL_SYSCFG_EXTI_LINE0
  621. * @arg @ref LL_SYSCFG_EXTI_LINE1
  622. * @arg @ref LL_SYSCFG_EXTI_LINE2
  623. * @arg @ref LL_SYSCFG_EXTI_LINE3
  624. * @arg @ref LL_SYSCFG_EXTI_LINE4
  625. * @arg @ref LL_SYSCFG_EXTI_LINE5
  626. * @arg @ref LL_SYSCFG_EXTI_LINE6
  627. * @arg @ref LL_SYSCFG_EXTI_LINE7
  628. * @arg @ref LL_SYSCFG_EXTI_LINE8
  629. * @arg @ref LL_SYSCFG_EXTI_LINE9
  630. * @arg @ref LL_SYSCFG_EXTI_LINE10
  631. * @arg @ref LL_SYSCFG_EXTI_LINE11
  632. * @arg @ref LL_SYSCFG_EXTI_LINE12
  633. * @arg @ref LL_SYSCFG_EXTI_LINE13
  634. * @arg @ref LL_SYSCFG_EXTI_LINE14
  635. * @arg @ref LL_SYSCFG_EXTI_LINE15
  636. * @retval None
  637. */
  638. __STATIC_INLINE void LL_SYSCFG_SetEXTISource(uint32_t Port, uint32_t Line)
  639. {
  640. MODIFY_REG(SYSCFG->EXTICR[Line & 0xFF], (Line >> 16), Port << POSITION_VAL((Line >> 16)));
  641. }
  642. /**
  643. * @brief Get the configured defined for specific EXTI Line
  644. * @rmtoll SYSCFG_EXTICR1 EXTIx LL_SYSCFG_GetEXTISource\n
  645. * SYSCFG_EXTICR2 EXTIx LL_SYSCFG_GetEXTISource\n
  646. * SYSCFG_EXTICR3 EXTIx LL_SYSCFG_GetEXTISource\n
  647. * SYSCFG_EXTICR4 EXTIx LL_SYSCFG_GetEXTISource
  648. * @param Line This parameter can be one of the following values:
  649. * @arg @ref LL_SYSCFG_EXTI_LINE0
  650. * @arg @ref LL_SYSCFG_EXTI_LINE1
  651. * @arg @ref LL_SYSCFG_EXTI_LINE2
  652. * @arg @ref LL_SYSCFG_EXTI_LINE3
  653. * @arg @ref LL_SYSCFG_EXTI_LINE4
  654. * @arg @ref LL_SYSCFG_EXTI_LINE5
  655. * @arg @ref LL_SYSCFG_EXTI_LINE6
  656. * @arg @ref LL_SYSCFG_EXTI_LINE7
  657. * @arg @ref LL_SYSCFG_EXTI_LINE8
  658. * @arg @ref LL_SYSCFG_EXTI_LINE9
  659. * @arg @ref LL_SYSCFG_EXTI_LINE10
  660. * @arg @ref LL_SYSCFG_EXTI_LINE11
  661. * @arg @ref LL_SYSCFG_EXTI_LINE12
  662. * @arg @ref LL_SYSCFG_EXTI_LINE13
  663. * @arg @ref LL_SYSCFG_EXTI_LINE14
  664. * @arg @ref LL_SYSCFG_EXTI_LINE15
  665. * @retval Returned value can be one of the following values:
  666. * @arg @ref LL_SYSCFG_EXTI_PORTA
  667. * @arg @ref LL_SYSCFG_EXTI_PORTB
  668. * @arg @ref LL_SYSCFG_EXTI_PORTC
  669. * @arg @ref LL_SYSCFG_EXTI_PORTD
  670. * @arg @ref LL_SYSCFG_EXTI_PORTE
  671. * @arg @ref LL_SYSCFG_EXTI_PORTF (*)
  672. * @arg @ref LL_SYSCFG_EXTI_PORTG (*)
  673. * @arg @ref LL_SYSCFG_EXTI_PORTH
  674. * (*) value not defined in all devices
  675. */
  676. __STATIC_INLINE uint32_t LL_SYSCFG_GetEXTISource(uint32_t Line)
  677. {
  678. return (uint32_t)(READ_BIT(SYSCFG->EXTICR[Line & 0xFF], (Line >> 16)) >> POSITION_VAL(Line >> 16));
  679. }
  680. #if defined(SYSCFG_CFGR2_LOCKUP_LOCK)
  681. /**
  682. * @brief Set connections to TIM1/8 break inputs
  683. * @rmtoll SYSCFG_CFGR2 LockUp Lock LL_SYSCFG_SetTIMBreakInputs \n
  684. * SYSCFG_CFGR2 PVD Lock LL_SYSCFG_SetTIMBreakInputs
  685. * @param Break This parameter can be a combination of the following values:
  686. * @arg @ref LL_SYSCFG_TIMBREAK_LOCKUP
  687. * @arg @ref LL_SYSCFG_TIMBREAK_PVD
  688. * @retval None
  689. */
  690. __STATIC_INLINE void LL_SYSCFG_SetTIMBreakInputs(uint32_t Break)
  691. {
  692. MODIFY_REG(SYSCFG->CFGR2, SYSCFG_CFGR2_LOCKUP_LOCK | SYSCFG_CFGR2_PVD_LOCK, Break);
  693. }
  694. /**
  695. * @brief Get connections to TIM1/8 Break inputs
  696. * @rmtoll SYSCFG_CFGR2 LockUp Lock LL_SYSCFG_SetTIMBreakInputs \n
  697. * SYSCFG_CFGR2 PVD Lock LL_SYSCFG_SetTIMBreakInputs
  698. * @retval Returned value can be can be a combination of the following values:
  699. * @arg @ref LL_SYSCFG_TIMBREAK_LOCKUP
  700. * @arg @ref LL_SYSCFG_TIMBREAK_PVD
  701. */
  702. __STATIC_INLINE uint32_t LL_SYSCFG_GetTIMBreakInputs(void)
  703. {
  704. return (uint32_t)(READ_BIT(SYSCFG->CFGR2, SYSCFG_CFGR2_LOCKUP_LOCK | SYSCFG_CFGR2_PVD_LOCK));
  705. }
  706. #endif /* SYSCFG_CFGR2_LOCKUP_LOCK */
  707. #if defined(SYSCFG_MCHDLYCR_BSCKSEL)
  708. /**
  709. * @brief Select the DFSDM2 or TIM2_OC1 as clock source for the bitstream clock.
  710. * @rmtoll SYSCFG_MCHDLYCR BSCKSEL LL_SYSCFG_DFSDM_SetBitstreamClockSourceSelection
  711. * @param ClockSource This parameter can be one of the following values:
  712. * @arg @ref LL_SYSCFG_BITSTREAM_CLOCK_DFSDM2
  713. * @arg @ref LL_SYSCFG_BITSTREAM_CLOCK_TIM2OC1
  714. * @retval None
  715. */
  716. __STATIC_INLINE void LL_SYSCFG_DFSDM_SetBitstreamClockSourceSelection(uint32_t ClockSource)
  717. {
  718. MODIFY_REG(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_BSCKSEL, ClockSource);
  719. }
  720. /**
  721. * @brief Get the DFSDM2 or TIM2_OC1 as clock source for the bitstream clock.
  722. * @rmtoll SYSCFG_MCHDLYCR BSCKSEL LL_SYSCFG_DFSDM_GetBitstreamClockSourceSelection
  723. * @retval Returned value can be one of the following values:
  724. * @arg @ref LL_SYSCFG_BITSTREAM_CLOCK_DFSDM2
  725. * @arg @ref LL_SYSCFG_BITSTREAM_CLOCK_TIM2OC1
  726. * @retval None
  727. */
  728. __STATIC_INLINE uint32_t LL_SYSCFG_DFSDM_GetBitstreamClockSourceSelection(void)
  729. {
  730. return (uint32_t)(READ_BIT(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_BSCKSEL));
  731. }
  732. /**
  733. * @brief Enables the DFSDM1 or DFSDM2 Delay clock
  734. * @rmtoll SYSCFG_MCHDLYCR MCHDLYEN LL_SYSCFG_DFSDM_EnableDelayClock
  735. * @param MCHDLY This paramater can be one of the following values
  736. * @arg @ref LL_SYSCFG_DFSDM1_MCHDLYEN
  737. * @arg @ref LL_SYSCFG_DFSDM2_MCHDLYEN
  738. * @retval None
  739. */
  740. __STATIC_INLINE void LL_SYSCFG_DFSDM_EnableDelayClock(uint32_t MCHDLY)
  741. {
  742. SET_BIT(SYSCFG->MCHDLYCR, MCHDLY);
  743. }
  744. /**
  745. * @brief Disables the DFSDM1 or the DFSDM2 Delay clock
  746. * @rmtoll SYSCFG_MCHDLYCR MCHDLY1EN LL_SYSCFG_DFSDM1_DisableDelayClock
  747. * @param MCHDLY This paramater can be one of the following values
  748. * @arg @ref LL_SYSCFG_DFSDM1_MCHDLYEN
  749. * @arg @ref LL_SYSCFG_DFSDM2_MCHDLYEN
  750. * @retval None
  751. */
  752. __STATIC_INLINE void LL_SYSCFG_DFSDM_DisableDelayClock(uint32_t MCHDLY)
  753. {
  754. CLEAR_BIT(SYSCFG->MCHDLYCR, MCHDLY);
  755. }
  756. /**
  757. * @brief Select the source for DFSDM1 or DFSDM2 DatIn0
  758. * @rmtoll SYSCFG_MCHDLYCR DFSDMD0SEL LL_SYSCFG_DFSDM_SetDataIn0Source
  759. * @param Source This parameter can be one of the following values:
  760. * @arg @ref LL_SYSCFG_DFSDM1_DataIn0_PAD
  761. * @arg @ref LL_SYSCFG_DFSDM1_DataIn0_DM
  762. * @arg @ref LL_SYSCFG_DFSDM2_DataIn0_PAD
  763. * @arg @ref LL_SYSCFG_DFSDM2_DataIn0_DM
  764. * @retval None
  765. */
  766. __STATIC_INLINE void LL_SYSCFG_DFSDM_SetDataIn0Source(uint32_t Source)
  767. {
  768. MODIFY_REG(SYSCFG->MCHDLYCR, (Source >> 16), (Source & 0x0000FFFF));
  769. }
  770. /**
  771. * @brief Get the source for DFSDM1 or DFSDM2 DatIn0.
  772. * @rmtoll SYSCFG_MCHDLYCR DFSDMD0SEL LL_SYSCFG_DFSDM_GetDataIn0Source
  773. * @param Source This parameter can be one of the following values:
  774. * @arg @ref LL_SYSCFG_DFSDM1_DataIn0
  775. * @arg @ref LL_SYSCFG_DFSDM2_DataIn0
  776. * @retval Returned value can be one of the following values:
  777. * @arg @ref LL_SYSCFG_DFSDM1_DataIn0_PAD
  778. * @arg @ref LL_SYSCFG_DFSDM1_DataIn0_DM
  779. * @arg @ref LL_SYSCFG_DFSDM2_DataIn0_PAD
  780. * @arg @ref LL_SYSCFG_DFSDM2_DataIn0_DM
  781. * @retval None
  782. */
  783. __STATIC_INLINE uint32_t LL_SYSCFG_DFSDM_GetDataIn0Source(uint32_t Source)
  784. {
  785. return (uint32_t)(READ_BIT(SYSCFG->MCHDLYCR, Source));
  786. }
  787. /**
  788. * @brief Select the source for DFSDM1 or DFSDM2 DatIn2
  789. * @rmtoll SYSCFG_MCHDLYCR DFSDMD2SEL LL_SYSCFG_DFSDM_SetDataIn2Source
  790. * @param Source This parameter can be one of the following values:
  791. * @arg @ref LL_SYSCFG_DFSDM1_DataIn2_PAD
  792. * @arg @ref LL_SYSCFG_DFSDM1_DataIn2_DM
  793. * @arg @ref LL_SYSCFG_DFSDM2_DataIn2_PAD
  794. * @arg @ref LL_SYSCFG_DFSDM2_DataIn2_DM
  795. * @retval None
  796. */
  797. __STATIC_INLINE void LL_SYSCFG_DFSDM_SetDataIn2Source(uint32_t Source)
  798. {
  799. MODIFY_REG(SYSCFG->MCHDLYCR, (Source >> 16), (Source & 0x0000FFFF));
  800. }
  801. /**
  802. * @brief Get the source for DFSDM1 or DFSDM2 DatIn2.
  803. * @rmtoll SYSCFG_MCHDLYCR DFSDMD2SEL LL_SYSCFG_DFSDM_GetDataIn2Source
  804. * @param Source This parameter can be one of the following values:
  805. * @arg @ref LL_SYSCFG_DFSDM1_DataIn2
  806. * @arg @ref LL_SYSCFG_DFSDM2_DataIn2
  807. * @retval Returned value can be one of the following values:
  808. * @arg @ref LL_SYSCFG_DFSDM1_DataIn2_PAD
  809. * @arg @ref LL_SYSCFG_DFSDM1_DataIn2_DM
  810. * @arg @ref LL_SYSCFG_DFSDM2_DataIn2_PAD
  811. * @arg @ref LL_SYSCFG_DFSDM2_DataIn2_DM
  812. * @retval None
  813. */
  814. __STATIC_INLINE uint32_t LL_SYSCFG_DFSDM_GetDataIn2Source(uint32_t Source)
  815. {
  816. return (uint32_t)(READ_BIT(SYSCFG->MCHDLYCR, Source));
  817. }
  818. /**
  819. * @brief Select the distribution of the bitsream lock gated by TIM4 OC2
  820. * @rmtoll SYSCFG_MCHDLYCR DFSDM1CK02SEL LL_SYSCFG_DFSDM1_SetTIM4OC2BitStreamDistribution
  821. * @param Source This parameter can be one of the following values:
  822. * @arg @ref LL_SYSCFG_DFSDM1_TIM4OC2_CLKIN0
  823. * @arg @ref LL_SYSCFG_DFSDM1_TIM4OC2_CLKIN2
  824. * @retval None
  825. */
  826. __STATIC_INLINE void LL_SYSCFG_DFSDM1_SetTIM4OC2BitStreamDistribution(uint32_t Source)
  827. {
  828. MODIFY_REG(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM1CK02SEL, Source);
  829. }
  830. /**
  831. * @brief Get the distribution of the bitsream lock gated by TIM4 OC2
  832. * @rmtoll SYSCFG_MCHDLYCR DFSDM1D2SEL LL_SYSCFG_DFSDM1_GetTIM4OC2BitStreamDistribution
  833. * @retval Returned value can be one of the following values:
  834. * @arg @ref LL_SYSCFG_DFSDM1_TIM4OC2_CLKIN0
  835. * @arg @ref LL_SYSCFG_DFSDM1_TIM4OC2_CLKIN2
  836. * @retval None
  837. */
  838. __STATIC_INLINE uint32_t LL_SYSCFG_DFSDM1_GetTIM4OC2BitStreamDistribution(void)
  839. {
  840. return (uint32_t)(READ_BIT(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM1CK02SEL));
  841. }
  842. /**
  843. * @brief Select the distribution of the bitsream lock gated by TIM4 OC1
  844. * @rmtoll SYSCFG_MCHDLYCR DFSDM1CK13SEL LL_SYSCFG_DFSDM1_SetTIM4OC1BitStreamDistribution
  845. * @param Source This parameter can be one of the following values:
  846. * @arg @ref LL_SYSCFG_DFSDM1_TIM4OC1_CLKIN1
  847. * @arg @ref LL_SYSCFG_DFSDM1_TIM4OC1_CLKIN3
  848. * @retval None
  849. */
  850. __STATIC_INLINE void LL_SYSCFG_DFSDM1_SetTIM4OC1BitStreamDistribution(uint32_t Source)
  851. {
  852. MODIFY_REG(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM1CK13SEL, Source);
  853. }
  854. /**
  855. * @brief Get the distribution of the bitsream lock gated by TIM4 OC1
  856. * @rmtoll SYSCFG_MCHDLYCR DFSDM1D2SEL LL_SYSCFG_DFSDM1_GetTIM4OC1BitStreamDistribution
  857. * @retval Returned value can be one of the following values:
  858. * @arg @ref LL_SYSCFG_DFSDM1_TIM4OC1_CLKIN1
  859. * @arg @ref LL_SYSCFG_DFSDM1_TIM4OC1_CLKIN3
  860. * @retval None
  861. */
  862. __STATIC_INLINE uint32_t LL_SYSCFG_DFSDM1_GetTIM4OC1BitStreamDistribution(void)
  863. {
  864. return (uint32_t)(READ_BIT(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM1CK13SEL));
  865. }
  866. /**
  867. * @brief Select the DFSDM1 Clock In
  868. * @rmtoll SYSCFG_MCHDLYCR DFSDM1CFG LL_SYSCFG_DFSDM1_SetClockInSourceSelection
  869. * @param ClockSource This parameter can be one of the following values:
  870. * @arg @ref LL_SYSCFG_DFSDM1_CKIN_PAD
  871. * @arg @ref LL_SYSCFG_DFSDM1_CKIN_DM
  872. * @retval None
  873. */
  874. __STATIC_INLINE void LL_SYSCFG_DFSDM1_SetClockInSourceSelection(uint32_t ClockSource)
  875. {
  876. MODIFY_REG(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM1CFG, ClockSource);
  877. }
  878. /**
  879. * @brief GET the DFSDM1 Clock In
  880. * @rmtoll SYSCFG_MCHDLYCR DFSDM1CFG LL_SYSCFG_DFSDM1_GetClockInSourceSelection
  881. * @retval Returned value can be one of the following values:
  882. * @arg @ref LL_SYSCFG_DFSDM1_CKIN_PAD
  883. * @arg @ref LL_SYSCFG_DFSDM1_CKIN_DM
  884. * @retval None
  885. */
  886. __STATIC_INLINE uint32_t LL_SYSCFG_DFSDM1_GetClockInSourceSelection(void)
  887. {
  888. return (uint32_t)(READ_BIT(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM1CFG));
  889. }
  890. /**
  891. * @brief Select the DFSDM1 Clock Out
  892. * @rmtoll SYSCFG_MCHDLYCR DFSDM1CKOSEL LL_SYSCFG_DFSDM1_SetClockOutSourceSelection
  893. * @param ClockSource This parameter can be one of the following values:
  894. * @arg @ref LL_SYSCFG_DFSDM1_CKOUT
  895. * @arg @ref LL_SYSCFG_DFSDM1_CKOUT_M27
  896. * @retval None
  897. */
  898. __STATIC_INLINE void LL_SYSCFG_DFSDM1_SetClockOutSourceSelection(uint32_t ClockSource)
  899. {
  900. MODIFY_REG(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM1CKOSEL, ClockSource);
  901. }
  902. /**
  903. * @brief GET the DFSDM1 Clock Out
  904. * @rmtoll SYSCFG_MCHDLYCR DFSDM1CKOSEL LL_SYSCFG_DFSDM1_GetClockOutSourceSelection
  905. * @retval Returned value can be one of the following values:
  906. * @arg @ref LL_SYSCFG_DFSDM1_CKOUT
  907. * @arg @ref LL_SYSCFG_DFSDM1_CKOUT_M27
  908. * @retval None
  909. */
  910. __STATIC_INLINE uint32_t LL_SYSCFG_DFSDM1_GetClockOutSourceSelection(void)
  911. {
  912. return (uint32_t)(READ_BIT(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM1CKOSEL));
  913. }
  914. /**
  915. * @brief Enables the DFSDM2 Delay clock
  916. * @rmtoll SYSCFG_MCHDLYCR MCHDLY2EN LL_SYSCFG_DFSDM2_EnableDelayClock
  917. * @retval None
  918. */
  919. __STATIC_INLINE void LL_SYSCFG_DFSDM2_EnableDelayClock(void)
  920. {
  921. SET_BIT(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_MCHDLY2EN);
  922. }
  923. /**
  924. * @brief Disables the DFSDM2 Delay clock
  925. * @rmtoll SYSCFG_MCHDLYCR MCHDLY2EN LL_SYSCFG_DFSDM2_DisableDelayClock
  926. * @retval None
  927. */
  928. __STATIC_INLINE void LL_SYSCFG_DFSDM2_DisableDelayClock(void)
  929. {
  930. CLEAR_BIT(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_MCHDLY2EN);
  931. }
  932. /**
  933. * @brief Select the source for DFSDM2 DatIn0
  934. * @rmtoll SYSCFG_MCHDLYCR DFSDM2D0SEL LL_SYSCFG_DFSDM2_SetDataIn0Source
  935. * @param Source This parameter can be one of the following values:
  936. * @arg @ref LL_SYSCFG_DFSDM2_DataIn0_PAD
  937. * @arg @ref LL_SYSCFG_DFSDM2_DataIn0_DM
  938. * @retval None
  939. */
  940. __STATIC_INLINE void LL_SYSCFG_DFSDM2_SetDataIn0Source(uint32_t Source)
  941. {
  942. MODIFY_REG(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM2D0SEL, Source);
  943. }
  944. /**
  945. * @brief Get the source for DFSDM2 DatIn0.
  946. * @rmtoll SYSCFG_MCHDLYCR DFSDM2D0SEL LL_SYSCFG_DFSDM2_GetDataIn0Source
  947. * @retval Returned value can be one of the following values:
  948. * @arg @ref LL_SYSCFG_DFSDM2_DataIn0_PAD
  949. * @arg @ref LL_SYSCFG_DFSDM2_DataIn0_DM
  950. * @retval None
  951. */
  952. __STATIC_INLINE uint32_t LL_SYSCFG_DFSDM2_GetDataIn0Source(void)
  953. {
  954. return (uint32_t)(READ_BIT(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM2D0SEL));
  955. }
  956. /**
  957. * @brief Select the source for DFSDM2 DatIn2
  958. * @rmtoll SYSCFG_MCHDLYCR DFSDM2D2SEL LL_SYSCFG_DFSDM2_SetDataIn2Source
  959. * @param Source This parameter can be one of the following values:
  960. * @arg @ref LL_SYSCFG_DFSDM2_DataIn2_PAD
  961. * @arg @ref LL_SYSCFG_DFSDM2_DataIn2_DM
  962. * @retval None
  963. */
  964. __STATIC_INLINE void LL_SYSCFG_DFSDM2_SetDataIn2Source(uint32_t Source)
  965. {
  966. MODIFY_REG(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM2D2SEL, Source);
  967. }
  968. /**
  969. * @brief Get the source for DFSDM2 DatIn2.
  970. * @rmtoll SYSCFG_MCHDLYCR DFSDM2D2SEL LL_SYSCFG_DFSDM2_GetDataIn2Source
  971. * @retval Returned value can be one of the following values:
  972. * @arg @ref LL_SYSCFG_DFSDM2_DataIn2_PAD
  973. * @arg @ref LL_SYSCFG_DFSDM2_DataIn2_DM
  974. * @retval None
  975. */
  976. __STATIC_INLINE uint32_t LL_SYSCFG_DFSDM2_GetDataIn2Source(void)
  977. {
  978. return (uint32_t)(READ_BIT(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM2D2SEL));
  979. }
  980. /**
  981. * @brief Select the source for DFSDM2 DatIn4
  982. * @rmtoll SYSCFG_MCHDLYCR DFSDM2D4SEL LL_SYSCFG_DFSDM2_SetDataIn4Source
  983. * @param Source This parameter can be one of the following values:
  984. * @arg @ref LL_SYSCFG_DFSDM2_DataIn4_PAD
  985. * @arg @ref LL_SYSCFG_DFSDM2_DataIn4_DM
  986. * @retval None
  987. */
  988. __STATIC_INLINE void LL_SYSCFG_DFSDM2_SetDataIn4Source(uint32_t Source)
  989. {
  990. MODIFY_REG(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM2D4SEL, Source);
  991. }
  992. /**
  993. * @brief Get the source for DFSDM2 DatIn4.
  994. * @rmtoll SYSCFG_MCHDLYCR DFSDM2D4SEL LL_SYSCFG_DFSDM2_GetDataIn4Source
  995. * @retval Returned value can be one of the following values:
  996. * @arg @ref LL_SYSCFG_DFSDM2_DataIn4_PAD
  997. * @arg @ref LL_SYSCFG_DFSDM2_DataIn4_DM
  998. * @retval None
  999. */
  1000. __STATIC_INLINE uint32_t LL_SYSCFG_DFSDM2_GetDataIn4Source(void)
  1001. {
  1002. return (uint32_t)(READ_BIT(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM2D4SEL));
  1003. }
  1004. /**
  1005. * @brief Select the source for DFSDM2 DatIn6
  1006. * @rmtoll SYSCFG_MCHDLYCR DFSDM2D6SEL LL_SYSCFG_DFSDM2_SetDataIn6Source
  1007. * @param Source This parameter can be one of the following values:
  1008. * @arg @ref LL_SYSCFG_DFSDM2_DataIn6_PAD
  1009. * @arg @ref LL_SYSCFG_DFSDM2_DataIn6_DM
  1010. * @retval None
  1011. */
  1012. __STATIC_INLINE void LL_SYSCFG_DFSDM2_SetDataIn6Source(uint32_t Source)
  1013. {
  1014. MODIFY_REG(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM2D6SEL, Source);
  1015. }
  1016. /**
  1017. * @brief Get the source for DFSDM2 DatIn6.
  1018. * @rmtoll SYSCFG_MCHDLYCR DFSDM2D6SEL LL_SYSCFG_DFSDM2_GetDataIn6Source
  1019. * @retval Returned value can be one of the following values:
  1020. * @arg @ref LL_SYSCFG_DFSDM2_DataIn6_PAD
  1021. * @arg @ref LL_SYSCFG_DFSDM2_DataIn6_DM
  1022. * @retval None
  1023. */
  1024. __STATIC_INLINE uint32_t LL_SYSCFG_DFSDM2_GetDataIn6Source(void)
  1025. {
  1026. return (uint32_t)(READ_BIT(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM2D6SEL));
  1027. }
  1028. /**
  1029. * @brief Select the distribution of the bitsream lock gated by TIM3 OC4
  1030. * @rmtoll SYSCFG_MCHDLYCR DFSDM2CK04SEL LL_SYSCFG_DFSDM2_SetTIM3OC4BitStreamDistribution
  1031. * @param Source This parameter can be one of the following values:
  1032. * @arg @ref LL_SYSCFG_DFSDM2_TIM3OC4_CLKIN0
  1033. * @arg @ref LL_SYSCFG_DFSDM2_TIM3OC4_CLKIN4
  1034. * @retval None
  1035. */
  1036. __STATIC_INLINE void LL_SYSCFG_DFSDM2_SetTIM3OC4BitStreamDistribution(uint32_t Source)
  1037. {
  1038. MODIFY_REG(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM2CK04SEL, Source);
  1039. }
  1040. /**
  1041. * @brief Get the distribution of the bitsream lock gated by TIM3 OC4
  1042. * @rmtoll SYSCFG_MCHDLYCR DFSDM2CK04SEL LL_SYSCFG_DFSDM2_GetTIM3OC4BitStreamDistribution
  1043. * @retval Returned value can be one of the following values:
  1044. * @arg @ref LL_SYSCFG_DFSDM2_TIM3OC4_CLKIN0
  1045. * @arg @ref LL_SYSCFG_DFSDM2_TIM3OC4_CLKIN4
  1046. * @retval None
  1047. */
  1048. __STATIC_INLINE uint32_t LL_SYSCFG_DFSDM2_GetTIM3OC4BitStreamDistribution(void)
  1049. {
  1050. return (uint32_t)(READ_BIT(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM2CK04SEL));
  1051. }
  1052. /**
  1053. * @brief Select the distribution of the bitsream lock gated by TIM3 OC3
  1054. * @rmtoll SYSCFG_MCHDLYCR DFSDM2CK15SEL LL_SYSCFG_DFSDM2_SetTIM3OC3BitStreamDistribution
  1055. * @param Source This parameter can be one of the following values:
  1056. * @arg @ref LL_SYSCFG_DFSDM2_TIM3OC3_CLKIN1
  1057. * @arg @ref LL_SYSCFG_DFSDM2_TIM3OC3_CLKIN5
  1058. * @retval None
  1059. */
  1060. __STATIC_INLINE void LL_SYSCFG_DFSDM2_SetTIM3OC3BitStreamDistribution(uint32_t Source)
  1061. {
  1062. MODIFY_REG(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM2CK15SEL, Source);
  1063. }
  1064. /**
  1065. * @brief Get the distribution of the bitsream lock gated by TIM3 OC4
  1066. * @rmtoll SYSCFG_MCHDLYCR DFSDM2CK04SEL LL_SYSCFG_DFSDM2_GetTIM3OC3BitStreamDistribution
  1067. * @retval Returned value can be one of the following values:
  1068. * @arg @ref LL_SYSCFG_DFSDM2_TIM3OC3_CLKIN1
  1069. * @arg @ref LL_SYSCFG_DFSDM2_TIM3OC3_CLKIN5
  1070. * @retval None
  1071. */
  1072. __STATIC_INLINE uint32_t LL_SYSCFG_DFSDM2_GetTIM3OC3BitStreamDistribution(void)
  1073. {
  1074. return (uint32_t)(READ_BIT(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM2CK15SEL));
  1075. }
  1076. /**
  1077. * @brief Select the distribution of the bitsream lock gated by TIM3 OC2
  1078. * @rmtoll SYSCFG_MCHDLYCR DFSDM2CK26SEL LL_SYSCFG_DFSDM2_SetTIM3OC2BitStreamDistribution
  1079. * @param Source This parameter can be one of the following values:
  1080. * @arg @ref LL_SYSCFG_DFSDM2_TIM3OC2_CLKIN2
  1081. * @arg @ref LL_SYSCFG_DFSDM2_TIM3OC2_CLKIN6
  1082. * @retval None
  1083. */
  1084. __STATIC_INLINE void LL_SYSCFG_DFSDM2_SetTIM3OC2BitStreamDistribution(uint32_t Source)
  1085. {
  1086. MODIFY_REG(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM2CK26SEL, Source);
  1087. }
  1088. /**
  1089. * @brief Get the distribution of the bitsream lock gated by TIM3 OC2
  1090. * @rmtoll SYSCFG_MCHDLYCR DFSDM2CK04SEL LL_SYSCFG_DFSDM2_GetTIM3OC2BitStreamDistribution
  1091. * @retval Returned value can be one of the following values:
  1092. * @arg @ref LL_SYSCFG_DFSDM2_TIM3OC2_CLKIN2
  1093. * @arg @ref LL_SYSCFG_DFSDM2_TIM3OC2_CLKIN6
  1094. * @retval None
  1095. */
  1096. __STATIC_INLINE uint32_t LL_SYSCFG_DFSDM2_GetTIM3OC2BitStreamDistribution(void)
  1097. {
  1098. return (uint32_t)(READ_BIT(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM2CK26SEL));
  1099. }
  1100. /**
  1101. * @brief Select the distribution of the bitsream lock gated by TIM3 OC1
  1102. * @rmtoll SYSCFG_MCHDLYCR DFSDM2CK37SEL LL_SYSCFG_DFSDM2_SetTIM3OC1BitStreamDistribution
  1103. * @param Source This parameter can be one of the following values:
  1104. * @arg @ref LL_SYSCFG_DFSDM2_TIM3OC1_CLKIN3
  1105. * @arg @ref LL_SYSCFG_DFSDM2_TIM3OC1_CLKIN7
  1106. * @retval None
  1107. */
  1108. __STATIC_INLINE void LL_SYSCFG_DFSDM2_SetTIM3OC1BitStreamDistribution(uint32_t Source)
  1109. {
  1110. MODIFY_REG(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM2CK37SEL, Source);
  1111. }
  1112. /**
  1113. * @brief Get the distribution of the bitsream lock gated by TIM3 OC1
  1114. * @rmtoll SYSCFG_MCHDLYCR DFSDM2CK37SEL LL_SYSCFG_DFSDM2_GetTIM3OC1BitStreamDistribution
  1115. * @retval Returned value can be one of the following values:
  1116. * @arg @ref LL_SYSCFG_DFSDM2_TIM3OC1_CLKIN3
  1117. * @arg @ref LL_SYSCFG_DFSDM2_TIM3OC1_CLKIN7
  1118. * @retval None
  1119. */
  1120. __STATIC_INLINE uint32_t LL_SYSCFG_DFSDM2_GetTIM3OC1BitStreamDistribution(void)
  1121. {
  1122. return (uint32_t)(READ_BIT(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM2CK37SEL));
  1123. }
  1124. /**
  1125. * @brief Select the DFSDM2 Clock In
  1126. * @rmtoll SYSCFG_MCHDLYCR DFSDM2CFG LL_SYSCFG_DFSDM2_SetClockInSourceSelection
  1127. * @param ClockSource This parameter can be one of the following values:
  1128. * @arg @ref LL_SYSCFG_DFSDM2_CKIN_PAD
  1129. * @arg @ref LL_SYSCFG_DFSDM2_CKIN_DM
  1130. * @retval None
  1131. */
  1132. __STATIC_INLINE void LL_SYSCFG_DFSDM2_SetClockInSourceSelection(uint32_t ClockSource)
  1133. {
  1134. MODIFY_REG(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM2CFG, ClockSource);
  1135. }
  1136. /**
  1137. * @brief GET the DFSDM2 Clock In
  1138. * @rmtoll SYSCFG_MCHDLYCR DFSDM2CFG LL_SYSCFG_DFSDM2_GetClockInSourceSelection
  1139. * @retval Returned value can be one of the following values:
  1140. * @arg @ref LL_SYSCFG_DFSDM2_CKIN_PAD
  1141. * @arg @ref LL_SYSCFG_DFSDM2_CKIN_DM
  1142. * @retval None
  1143. */
  1144. __STATIC_INLINE uint32_t LL_SYSCFG_DFSDM2_GetClockInSourceSelection(void)
  1145. {
  1146. return (uint32_t)(READ_BIT(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM2CFG));
  1147. }
  1148. /**
  1149. * @brief Select the DFSDM2 Clock Out
  1150. * @rmtoll SYSCFG_MCHDLYCR DFSDM2CKOSEL LL_SYSCFG_DFSDM2_SetClockOutSourceSelection
  1151. * @param ClockSource This parameter can be one of the following values:
  1152. * @arg @ref LL_SYSCFG_DFSDM2_CKOUT
  1153. * @arg @ref LL_SYSCFG_DFSDM2_CKOUT_M27
  1154. * @retval None
  1155. */
  1156. __STATIC_INLINE void LL_SYSCFG_DFSDM2_SetClockOutSourceSelection(uint32_t ClockSource)
  1157. {
  1158. MODIFY_REG(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM2CKOSEL, ClockSource);
  1159. }
  1160. /**
  1161. * @brief GET the DFSDM2 Clock Out
  1162. * @rmtoll SYSCFG_MCHDLYCR DFSDM2CKOSEL LL_SYSCFG_DFSDM2_GetClockOutSourceSelection
  1163. * @retval Returned value can be one of the following values:
  1164. * @arg @ref LL_SYSCFG_DFSDM2_CKOUT
  1165. * @arg @ref LL_SYSCFG_DFSDM2_CKOUT_M27
  1166. * @retval None
  1167. */
  1168. __STATIC_INLINE uint32_t LL_SYSCFG_DFSDM2_GetClockOutSourceSelection(void)
  1169. {
  1170. return (uint32_t)(READ_BIT(SYSCFG->MCHDLYCR, SYSCFG_MCHDLYCR_DFSDM2CKOSEL));
  1171. }
  1172. #endif /* SYSCFG_MCHDLYCR_BSCKSEL */
  1173. /**
  1174. * @}
  1175. */
  1176. /** @defgroup SYSTEM_LL_EF_DBGMCU DBGMCU
  1177. * @{
  1178. */
  1179. /**
  1180. * @brief Return the device identifier
  1181. * @note For STM32F405/407xx and STM32F415/417xx devices, the device ID is 0x413
  1182. * @note For STM32F42xxx and STM32F43xxx devices, the device ID is 0x419
  1183. * @note For STM32F401xx devices, the device ID is 0x423
  1184. * @note For STM32F401xx devices, the device ID is 0x433
  1185. * @note For STM32F411xx devices, the device ID is 0x431
  1186. * @note For STM32F410xx devices, the device ID is 0x458
  1187. * @note For STM32F412xx devices, the device ID is 0x441
  1188. * @note For STM32F413xx and STM32423xx devices, the device ID is 0x463
  1189. * @note For STM32F446xx devices, the device ID is 0x421
  1190. * @note For STM32F469xx and STM32F479xx devices, the device ID is 0x434
  1191. * @rmtoll DBGMCU_IDCODE DEV_ID LL_DBGMCU_GetDeviceID
  1192. * @retval Values between Min_Data=0x00 and Max_Data=0xFFF
  1193. */
  1194. __STATIC_INLINE uint32_t LL_DBGMCU_GetDeviceID(void)
  1195. {
  1196. return (uint32_t)(READ_BIT(DBGMCU->IDCODE, DBGMCU_IDCODE_DEV_ID));
  1197. }
  1198. /**
  1199. * @brief Return the device revision identifier
  1200. * @note This field indicates the revision of the device.
  1201. For example, it is read as RevA -> 0x1000, Cat 2 revZ -> 0x1001, rev1 -> 0x1003, rev2 ->0x1007, revY -> 0x100F for STM32F405/407xx and STM32F415/417xx devices
  1202. For example, it is read as RevA -> 0x1000, Cat 2 revY -> 0x1003, rev1 -> 0x1007, rev3 ->0x2001 for STM32F42xxx and STM32F43xxx devices
  1203. For example, it is read as RevZ -> 0x1000, Cat 2 revA -> 0x1001 for STM32F401xB/C devices
  1204. For example, it is read as RevA -> 0x1000, Cat 2 revZ -> 0x1001 for STM32F401xD/E devices
  1205. For example, it is read as RevA -> 0x1000 for STM32F411xx,STM32F413/423xx,STM32F469/423xx, STM32F446xx and STM32F410xx devices
  1206. For example, it is read as RevZ -> 0x1001, Cat 2 revB -> 0x2000, revC -> 0x3000 for STM32F412xx devices
  1207. * @rmtoll DBGMCU_IDCODE REV_ID LL_DBGMCU_GetRevisionID
  1208. * @retval Values between Min_Data=0x00 and Max_Data=0xFFFF
  1209. */
  1210. __STATIC_INLINE uint32_t LL_DBGMCU_GetRevisionID(void)
  1211. {
  1212. return (uint32_t)(READ_BIT(DBGMCU->IDCODE, DBGMCU_IDCODE_REV_ID) >> DBGMCU_IDCODE_REV_ID_Pos);
  1213. }
  1214. /**
  1215. * @brief Enable the Debug Module during SLEEP mode
  1216. * @rmtoll DBGMCU_CR DBG_SLEEP LL_DBGMCU_EnableDBGSleepMode
  1217. * @retval None
  1218. */
  1219. __STATIC_INLINE void LL_DBGMCU_EnableDBGSleepMode(void)
  1220. {
  1221. SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP);
  1222. }
  1223. /**
  1224. * @brief Disable the Debug Module during SLEEP mode
  1225. * @rmtoll DBGMCU_CR DBG_SLEEP LL_DBGMCU_DisableDBGSleepMode
  1226. * @retval None
  1227. */
  1228. __STATIC_INLINE void LL_DBGMCU_DisableDBGSleepMode(void)
  1229. {
  1230. CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP);
  1231. }
  1232. /**
  1233. * @brief Enable the Debug Module during STOP mode
  1234. * @rmtoll DBGMCU_CR DBG_STOP LL_DBGMCU_EnableDBGStopMode
  1235. * @retval None
  1236. */
  1237. __STATIC_INLINE void LL_DBGMCU_EnableDBGStopMode(void)
  1238. {
  1239. SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOP);
  1240. }
  1241. /**
  1242. * @brief Disable the Debug Module during STOP mode
  1243. * @rmtoll DBGMCU_CR DBG_STOP LL_DBGMCU_DisableDBGStopMode
  1244. * @retval None
  1245. */
  1246. __STATIC_INLINE void LL_DBGMCU_DisableDBGStopMode(void)
  1247. {
  1248. CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOP);
  1249. }
  1250. /**
  1251. * @brief Enable the Debug Module during STANDBY mode
  1252. * @rmtoll DBGMCU_CR DBG_STANDBY LL_DBGMCU_EnableDBGStandbyMode
  1253. * @retval None
  1254. */
  1255. __STATIC_INLINE void LL_DBGMCU_EnableDBGStandbyMode(void)
  1256. {
  1257. SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY);
  1258. }
  1259. /**
  1260. * @brief Disable the Debug Module during STANDBY mode
  1261. * @rmtoll DBGMCU_CR DBG_STANDBY LL_DBGMCU_DisableDBGStandbyMode
  1262. * @retval None
  1263. */
  1264. __STATIC_INLINE void LL_DBGMCU_DisableDBGStandbyMode(void)
  1265. {
  1266. CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY);
  1267. }
  1268. /**
  1269. * @brief Set Trace pin assignment control
  1270. * @rmtoll DBGMCU_CR TRACE_IOEN LL_DBGMCU_SetTracePinAssignment\n
  1271. * DBGMCU_CR TRACE_MODE LL_DBGMCU_SetTracePinAssignment
  1272. * @param PinAssignment This parameter can be one of the following values:
  1273. * @arg @ref LL_DBGMCU_TRACE_NONE
  1274. * @arg @ref LL_DBGMCU_TRACE_ASYNCH
  1275. * @arg @ref LL_DBGMCU_TRACE_SYNCH_SIZE1
  1276. * @arg @ref LL_DBGMCU_TRACE_SYNCH_SIZE2
  1277. * @arg @ref LL_DBGMCU_TRACE_SYNCH_SIZE4
  1278. * @retval None
  1279. */
  1280. __STATIC_INLINE void LL_DBGMCU_SetTracePinAssignment(uint32_t PinAssignment)
  1281. {
  1282. MODIFY_REG(DBGMCU->CR, DBGMCU_CR_TRACE_IOEN | DBGMCU_CR_TRACE_MODE, PinAssignment);
  1283. }
  1284. /**
  1285. * @brief Get Trace pin assignment control
  1286. * @rmtoll DBGMCU_CR TRACE_IOEN LL_DBGMCU_GetTracePinAssignment\n
  1287. * DBGMCU_CR TRACE_MODE LL_DBGMCU_GetTracePinAssignment
  1288. * @retval Returned value can be one of the following values:
  1289. * @arg @ref LL_DBGMCU_TRACE_NONE
  1290. * @arg @ref LL_DBGMCU_TRACE_ASYNCH
  1291. * @arg @ref LL_DBGMCU_TRACE_SYNCH_SIZE1
  1292. * @arg @ref LL_DBGMCU_TRACE_SYNCH_SIZE2
  1293. * @arg @ref LL_DBGMCU_TRACE_SYNCH_SIZE4
  1294. */
  1295. __STATIC_INLINE uint32_t LL_DBGMCU_GetTracePinAssignment(void)
  1296. {
  1297. return (uint32_t)(READ_BIT(DBGMCU->CR, DBGMCU_CR_TRACE_IOEN | DBGMCU_CR_TRACE_MODE));
  1298. }
  1299. /**
  1300. * @brief Freeze APB1 peripherals (group1 peripherals)
  1301. * @rmtoll DBGMCU_APB1_FZ DBG_TIM2_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1302. * DBGMCU_APB1_FZ DBG_TIM3_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1303. * DBGMCU_APB1_FZ DBG_TIM4_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1304. * DBGMCU_APB1_FZ DBG_TIM5_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1305. * DBGMCU_APB1_FZ DBG_TIM6_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1306. * DBGMCU_APB1_FZ DBG_TIM7_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1307. * DBGMCU_APB1_FZ DBG_TIM12_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1308. * DBGMCU_APB1_FZ DBG_TIM13_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1309. * DBGMCU_APB1_FZ DBG_TIM14_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1310. * DBGMCU_APB1_FZ DBG_LPTIM_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1311. * DBGMCU_APB1_FZ DBG_RTC_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1312. * DBGMCU_APB1_FZ DBG_WWDG_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1313. * DBGMCU_APB1_FZ DBG_IWDG_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1314. * DBGMCU_APB1_FZ DBG_I2C1_SMBUS_TIMEOUT LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1315. * DBGMCU_APB1_FZ DBG_I2C2_SMBUS_TIMEOUT LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1316. * DBGMCU_APB1_FZ DBG_I2C3_SMBUS_TIMEOUT LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1317. * DBGMCU_APB1_FZ DBG_I2C4_SMBUS_TIMEOUT LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1318. * DBGMCU_APB1_FZ DBG_CAN1_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1319. * DBGMCU_APB1_FZ DBG_CAN2_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n
  1320. * DBGMCU_APB1_FZ DBG_CAN3_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph
  1321. * @param Periphs This parameter can be a combination of the following values:
  1322. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM2_STOP (*)
  1323. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM3_STOP (*)
  1324. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM4_STOP (*)
  1325. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM5_STOP
  1326. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM6_STOP (*)
  1327. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM7_STOP (*)
  1328. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM12_STOP (*)
  1329. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM13_STOP (*)
  1330. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM14_STOP (*)
  1331. * @arg @ref LL_DBGMCU_APB1_GRP1_LPTIM_STOP (*)
  1332. * @arg @ref LL_DBGMCU_APB1_GRP1_RTC_STOP
  1333. * @arg @ref LL_DBGMCU_APB1_GRP1_WWDG_STOP
  1334. * @arg @ref LL_DBGMCU_APB1_GRP1_IWDG_STOP
  1335. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C1_STOP
  1336. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C2_STOP
  1337. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C3_STOP (*)
  1338. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C4_STOP (*)
  1339. * @arg @ref LL_DBGMCU_APB1_GRP1_CAN1_STOP (*)
  1340. * @arg @ref LL_DBGMCU_APB1_GRP1_CAN2_STOP (*)
  1341. * @arg @ref LL_DBGMCU_APB1_GRP1_CAN3_STOP (*)
  1342. *
  1343. * (*) value not defined in all devices.
  1344. * @retval None
  1345. */
  1346. __STATIC_INLINE void LL_DBGMCU_APB1_GRP1_FreezePeriph(uint32_t Periphs)
  1347. {
  1348. SET_BIT(DBGMCU->APB1FZ, Periphs);
  1349. }
  1350. /**
  1351. * @brief Unfreeze APB1 peripherals (group1 peripherals)
  1352. * @rmtoll DBGMCU_APB1_FZ DBG_TIM2_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  1353. * DBGMCU_APB1_FZ DBG_TIM3_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  1354. * DBGMCU_APB1_FZ DBG_TIM4_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  1355. * DBGMCU_APB1_FZ DBG_TIM5_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  1356. * DBGMCU_APB1_FZ DBG_TIM6_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  1357. * DBGMCU_APB1_FZ DBG_TIM7_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  1358. * DBGMCU_APB1_FZ DBG_TIM12_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  1359. * DBGMCU_APB1_FZ DBG_TIM13_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  1360. * DBGMCU_APB1_FZ DBG_TIM14_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  1361. * DBGMCU_APB1_FZ DBG_LPTIM_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  1362. * DBGMCU_APB1_FZ DBG_RTC_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  1363. * DBGMCU_APB1_FZ DBG_WWDG_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  1364. * DBGMCU_APB1_FZ DBG_IWDG_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  1365. * DBGMCU_APB1_FZ DBG_I2C1_SMBUS_TIMEOUT LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  1366. * DBGMCU_APB1_FZ DBG_I2C2_SMBUS_TIMEOUT LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  1367. * DBGMCU_APB1_FZ DBG_I2C3_SMBUS_TIMEOUT LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  1368. * DBGMCU_APB1_FZ DBG_I2C4_SMBUS_TIMEOUT LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  1369. * DBGMCU_APB1_FZ DBG_CAN1_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  1370. * DBGMCU_APB1_FZ DBG_CAN2_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n
  1371. * DBGMCU_APB1_FZ DBG_CAN3_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph
  1372. * @param Periphs This parameter can be a combination of the following values:
  1373. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM2_STOP (*)
  1374. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM3_STOP (*)
  1375. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM4_STOP (*)
  1376. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM5_STOP
  1377. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM6_STOP (*)
  1378. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM7_STOP (*)
  1379. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM12_STOP (*)
  1380. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM13_STOP (*)
  1381. * @arg @ref LL_DBGMCU_APB1_GRP1_TIM14_STOP (*)
  1382. * @arg @ref LL_DBGMCU_APB1_GRP1_LPTIM_STOP (*)
  1383. * @arg @ref LL_DBGMCU_APB1_GRP1_RTC_STOP
  1384. * @arg @ref LL_DBGMCU_APB1_GRP1_WWDG_STOP
  1385. * @arg @ref LL_DBGMCU_APB1_GRP1_IWDG_STOP
  1386. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C1_STOP
  1387. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C2_STOP
  1388. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C3_STOP (*)
  1389. * @arg @ref LL_DBGMCU_APB1_GRP1_I2C4_STOP (*)
  1390. * @arg @ref LL_DBGMCU_APB1_GRP1_CAN1_STOP (*)
  1391. * @arg @ref LL_DBGMCU_APB1_GRP1_CAN2_STOP (*)
  1392. * @arg @ref LL_DBGMCU_APB1_GRP1_CAN3_STOP (*)
  1393. *
  1394. * (*) value not defined in all devices.
  1395. * @retval None
  1396. */
  1397. __STATIC_INLINE void LL_DBGMCU_APB1_GRP1_UnFreezePeriph(uint32_t Periphs)
  1398. {
  1399. CLEAR_BIT(DBGMCU->APB1FZ, Periphs);
  1400. }
  1401. /**
  1402. * @brief Freeze APB2 peripherals
  1403. * @rmtoll DBGMCU_APB2_FZ DBG_TIM1_STOP LL_DBGMCU_APB2_GRP1_FreezePeriph\n
  1404. * DBGMCU_APB2_FZ DBG_TIM8_STOP LL_DBGMCU_APB2_GRP1_FreezePeriph\n
  1405. * DBGMCU_APB2_FZ DBG_TIM9_STOP LL_DBGMCU_APB2_GRP1_FreezePeriph\n
  1406. * DBGMCU_APB2_FZ DBG_TIM10_STOP LL_DBGMCU_APB2_GRP1_FreezePeriph\n
  1407. * DBGMCU_APB2_FZ DBG_TIM11_STOP LL_DBGMCU_APB2_GRP1_FreezePeriph
  1408. * @param Periphs This parameter can be a combination of the following values:
  1409. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM1_STOP
  1410. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM8_STOP (*)
  1411. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM9_STOP (*)
  1412. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM10_STOP (*)
  1413. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM11_STOP (*)
  1414. *
  1415. * (*) value not defined in all devices.
  1416. * @retval None
  1417. */
  1418. __STATIC_INLINE void LL_DBGMCU_APB2_GRP1_FreezePeriph(uint32_t Periphs)
  1419. {
  1420. SET_BIT(DBGMCU->APB2FZ, Periphs);
  1421. }
  1422. /**
  1423. * @brief Unfreeze APB2 peripherals
  1424. * @rmtoll DBGMCU_APB2_FZ DBG_TIM1_STOP LL_DBGMCU_APB2_GRP1_UnFreezePeriph\n
  1425. * DBGMCU_APB2_FZ DBG_TIM8_STOP LL_DBGMCU_APB2_GRP1_UnFreezePeriph\n
  1426. * DBGMCU_APB2_FZ DBG_TIM9_STOP LL_DBGMCU_APB2_GRP1_UnFreezePeriph\n
  1427. * DBGMCU_APB2_FZ DBG_TIM10_STOP LL_DBGMCU_APB2_GRP1_UnFreezePeriph\n
  1428. * DBGMCU_APB2_FZ DBG_TIM11_STOP LL_DBGMCU_APB2_GRP1_UnFreezePeriph
  1429. * @param Periphs This parameter can be a combination of the following values:
  1430. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM1_STOP
  1431. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM8_STOP (*)
  1432. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM9_STOP (*)
  1433. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM10_STOP (*)
  1434. * @arg @ref LL_DBGMCU_APB2_GRP1_TIM11_STOP (*)
  1435. *
  1436. * (*) value not defined in all devices.
  1437. * @retval None
  1438. */
  1439. __STATIC_INLINE void LL_DBGMCU_APB2_GRP1_UnFreezePeriph(uint32_t Periphs)
  1440. {
  1441. CLEAR_BIT(DBGMCU->APB2FZ, Periphs);
  1442. }
  1443. /**
  1444. * @}
  1445. */
  1446. /** @defgroup SYSTEM_LL_EF_FLASH FLASH
  1447. * @{
  1448. */
  1449. /**
  1450. * @brief Set FLASH Latency
  1451. * @rmtoll FLASH_ACR LATENCY LL_FLASH_SetLatency
  1452. * @param Latency This parameter can be one of the following values:
  1453. * @arg @ref LL_FLASH_LATENCY_0
  1454. * @arg @ref LL_FLASH_LATENCY_1
  1455. * @arg @ref LL_FLASH_LATENCY_2
  1456. * @arg @ref LL_FLASH_LATENCY_3
  1457. * @arg @ref LL_FLASH_LATENCY_4
  1458. * @arg @ref LL_FLASH_LATENCY_5
  1459. * @arg @ref LL_FLASH_LATENCY_6
  1460. * @arg @ref LL_FLASH_LATENCY_7
  1461. * @arg @ref LL_FLASH_LATENCY_8
  1462. * @arg @ref LL_FLASH_LATENCY_9
  1463. * @arg @ref LL_FLASH_LATENCY_10
  1464. * @arg @ref LL_FLASH_LATENCY_11
  1465. * @arg @ref LL_FLASH_LATENCY_12
  1466. * @arg @ref LL_FLASH_LATENCY_13
  1467. * @arg @ref LL_FLASH_LATENCY_14
  1468. * @arg @ref LL_FLASH_LATENCY_15
  1469. * @retval None
  1470. */
  1471. __STATIC_INLINE void LL_FLASH_SetLatency(uint32_t Latency)
  1472. {
  1473. MODIFY_REG(FLASH->ACR, FLASH_ACR_LATENCY, Latency);
  1474. }
  1475. /**
  1476. * @brief Get FLASH Latency
  1477. * @rmtoll FLASH_ACR LATENCY LL_FLASH_GetLatency
  1478. * @retval Returned value can be one of the following values:
  1479. * @arg @ref LL_FLASH_LATENCY_0
  1480. * @arg @ref LL_FLASH_LATENCY_1
  1481. * @arg @ref LL_FLASH_LATENCY_2
  1482. * @arg @ref LL_FLASH_LATENCY_3
  1483. * @arg @ref LL_FLASH_LATENCY_4
  1484. * @arg @ref LL_FLASH_LATENCY_5
  1485. * @arg @ref LL_FLASH_LATENCY_6
  1486. * @arg @ref LL_FLASH_LATENCY_7
  1487. * @arg @ref LL_FLASH_LATENCY_8
  1488. * @arg @ref LL_FLASH_LATENCY_9
  1489. * @arg @ref LL_FLASH_LATENCY_10
  1490. * @arg @ref LL_FLASH_LATENCY_11
  1491. * @arg @ref LL_FLASH_LATENCY_12
  1492. * @arg @ref LL_FLASH_LATENCY_13
  1493. * @arg @ref LL_FLASH_LATENCY_14
  1494. * @arg @ref LL_FLASH_LATENCY_15
  1495. */
  1496. __STATIC_INLINE uint32_t LL_FLASH_GetLatency(void)
  1497. {
  1498. return (uint32_t)(READ_BIT(FLASH->ACR, FLASH_ACR_LATENCY));
  1499. }
  1500. /**
  1501. * @brief Enable Prefetch
  1502. * @rmtoll FLASH_ACR PRFTEN LL_FLASH_EnablePrefetch
  1503. * @retval None
  1504. */
  1505. __STATIC_INLINE void LL_FLASH_EnablePrefetch(void)
  1506. {
  1507. SET_BIT(FLASH->ACR, FLASH_ACR_PRFTEN);
  1508. }
  1509. /**
  1510. * @brief Disable Prefetch
  1511. * @rmtoll FLASH_ACR PRFTEN LL_FLASH_DisablePrefetch
  1512. * @retval None
  1513. */
  1514. __STATIC_INLINE void LL_FLASH_DisablePrefetch(void)
  1515. {
  1516. CLEAR_BIT(FLASH->ACR, FLASH_ACR_PRFTEN);
  1517. }
  1518. /**
  1519. * @brief Check if Prefetch buffer is enabled
  1520. * @rmtoll FLASH_ACR PRFTEN LL_FLASH_IsPrefetchEnabled
  1521. * @retval State of bit (1 or 0).
  1522. */
  1523. __STATIC_INLINE uint32_t LL_FLASH_IsPrefetchEnabled(void)
  1524. {
  1525. return (READ_BIT(FLASH->ACR, FLASH_ACR_PRFTEN) == (FLASH_ACR_PRFTEN));
  1526. }
  1527. /**
  1528. * @brief Enable Instruction cache
  1529. * @rmtoll FLASH_ACR ICEN LL_FLASH_EnableInstCache
  1530. * @retval None
  1531. */
  1532. __STATIC_INLINE void LL_FLASH_EnableInstCache(void)
  1533. {
  1534. SET_BIT(FLASH->ACR, FLASH_ACR_ICEN);
  1535. }
  1536. /**
  1537. * @brief Disable Instruction cache
  1538. * @rmtoll FLASH_ACR ICEN LL_FLASH_DisableInstCache
  1539. * @retval None
  1540. */
  1541. __STATIC_INLINE void LL_FLASH_DisableInstCache(void)
  1542. {
  1543. CLEAR_BIT(FLASH->ACR, FLASH_ACR_ICEN);
  1544. }
  1545. /**
  1546. * @brief Enable Data cache
  1547. * @rmtoll FLASH_ACR DCEN LL_FLASH_EnableDataCache
  1548. * @retval None
  1549. */
  1550. __STATIC_INLINE void LL_FLASH_EnableDataCache(void)
  1551. {
  1552. SET_BIT(FLASH->ACR, FLASH_ACR_DCEN);
  1553. }
  1554. /**
  1555. * @brief Disable Data cache
  1556. * @rmtoll FLASH_ACR DCEN LL_FLASH_DisableDataCache
  1557. * @retval None
  1558. */
  1559. __STATIC_INLINE void LL_FLASH_DisableDataCache(void)
  1560. {
  1561. CLEAR_BIT(FLASH->ACR, FLASH_ACR_DCEN);
  1562. }
  1563. /**
  1564. * @brief Enable Instruction cache reset
  1565. * @note bit can be written only when the instruction cache is disabled
  1566. * @rmtoll FLASH_ACR ICRST LL_FLASH_EnableInstCacheReset
  1567. * @retval None
  1568. */
  1569. __STATIC_INLINE void LL_FLASH_EnableInstCacheReset(void)
  1570. {
  1571. SET_BIT(FLASH->ACR, FLASH_ACR_ICRST);
  1572. }
  1573. /**
  1574. * @brief Disable Instruction cache reset
  1575. * @rmtoll FLASH_ACR ICRST LL_FLASH_DisableInstCacheReset
  1576. * @retval None
  1577. */
  1578. __STATIC_INLINE void LL_FLASH_DisableInstCacheReset(void)
  1579. {
  1580. CLEAR_BIT(FLASH->ACR, FLASH_ACR_ICRST);
  1581. }
  1582. /**
  1583. * @brief Enable Data cache reset
  1584. * @note bit can be written only when the data cache is disabled
  1585. * @rmtoll FLASH_ACR DCRST LL_FLASH_EnableDataCacheReset
  1586. * @retval None
  1587. */
  1588. __STATIC_INLINE void LL_FLASH_EnableDataCacheReset(void)
  1589. {
  1590. SET_BIT(FLASH->ACR, FLASH_ACR_DCRST);
  1591. }
  1592. /**
  1593. * @brief Disable Data cache reset
  1594. * @rmtoll FLASH_ACR DCRST LL_FLASH_DisableDataCacheReset
  1595. * @retval None
  1596. */
  1597. __STATIC_INLINE void LL_FLASH_DisableDataCacheReset(void)
  1598. {
  1599. CLEAR_BIT(FLASH->ACR, FLASH_ACR_DCRST);
  1600. }
  1601. /**
  1602. * @}
  1603. */
  1604. /**
  1605. * @}
  1606. */
  1607. /**
  1608. * @}
  1609. */
  1610. #endif /* defined (FLASH) || defined (SYSCFG) || defined (DBGMCU) */
  1611. /**
  1612. * @}
  1613. */
  1614. #ifdef __cplusplus
  1615. }
  1616. #endif
  1617. #endif /* __STM32F4xx_LL_SYSTEM_H */
  1618. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/