]> git.leonardobizzoni.com Git - pioneer-stm32/blob
f92f9d6560a08e7c31c736b5eb87be21b58493ca
[pioneer-stm32] /
1 /**\r
2   ******************************************************************************\r
3   * @file    stm32f7xx_hal_rcc_ex.h\r
4   * @author  MCD Application Team\r
5   * @brief   Header file of RCC HAL Extension module.\r
6   ******************************************************************************\r
7   * @attention\r
8   *\r
9   * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.\r
10   * All rights reserved.</center></h2>\r
11   *\r
12   * This software component is licensed by ST under BSD 3-Clause license,\r
13   * the "License"; You may not use this file except in compliance with the\r
14   * License. You may obtain a copy of the License at:\r
15   *                        opensource.org/licenses/BSD-3-Clause\r
16   *\r
17   ******************************************************************************\r
18   */\r
19 \r
20 /* Define to prevent recursive inclusion -------------------------------------*/\r
21 #ifndef __STM32F7xx_HAL_RCC_EX_H\r
22 #define __STM32F7xx_HAL_RCC_EX_H\r
23 \r
24 #ifdef __cplusplus\r
25  extern "C" {\r
26 #endif\r
27 \r
28 /* Includes ------------------------------------------------------------------*/\r
29 #include "stm32f7xx_hal_def.h"\r
30 \r
31 /** @addtogroup STM32F7xx_HAL_Driver\r
32   * @{\r
33   */\r
34 \r
35 /** @addtogroup RCCEx\r
36   * @{\r
37   */\r
38 \r
39 /* Exported types ------------------------------------------------------------*/\r
40 /** @defgroup RCCEx_Exported_Types RCCEx Exported Types\r
41   * @{\r
42   */\r
43 \r
44 /**\r
45   * @brief  RCC PLL configuration structure definition\r
46   */\r
47 typedef struct\r
48 {\r
49   uint32_t PLLState;   /*!< The new state of the PLL.\r
50                             This parameter can be a value of @ref RCC_PLL_Config                      */\r
51 \r
52   uint32_t PLLSource;  /*!< RCC_PLLSource: PLL entry clock source.\r
53                             This parameter must be a value of @ref RCC_PLL_Clock_Source               */\r
54 \r
55   uint32_t PLLM;       /*!< PLLM: Division factor for PLL VCO input clock.\r
56                             This parameter must be a number between Min_Data = 2 and Max_Data = 63    */\r
57 \r
58   uint32_t PLLN;       /*!< PLLN: Multiplication factor for PLL VCO output clock.\r
59                             This parameter must be a number between Min_Data = 50 and Max_Data = 432  */\r
60 \r
61   uint32_t PLLP;       /*!< PLLP: Division factor for main system clock (SYSCLK).\r
62                             This parameter must be a value of @ref RCC_PLLP_Clock_Divider             */\r
63 \r
64   uint32_t PLLQ;       /*!< PLLQ: Division factor for OTG FS, SDMMC and RNG clocks.\r
65                             This parameter must be a number between Min_Data = 2 and Max_Data = 15    */\r
66 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
67   uint32_t PLLR;       /*!< PLLR: Division factor for DSI clock.\r
68                             This parameter must be a number between Min_Data = 2 and Max_Data = 7    */\r
69 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
70 \r
71 }RCC_PLLInitTypeDef;\r
72 \r
73 /**\r
74   * @brief  PLLI2S Clock structure definition\r
75   */\r
76 typedef struct\r
77 {\r
78   uint32_t PLLI2SN;    /*!< Specifies the multiplication factor for PLLI2S VCO output clock.\r
79                             This parameter must be a number between Min_Data = 50 and Max_Data = 432.\r
80                             This parameter will be used only when PLLI2S is selected as Clock Source I2S or SAI */\r
81 \r
82   uint32_t PLLI2SR;    /*!< Specifies the division factor for I2S clock.\r
83                             This parameter must be a number between Min_Data = 2 and Max_Data = 7.\r
84                             This parameter will be used only when PLLI2S is selected as Clock Source I2S or SAI */\r
85 \r
86   uint32_t PLLI2SQ;    /*!< Specifies the division factor for SAI1 clock.\r
87                             This parameter must be a number between Min_Data = 2 and Max_Data = 15.\r
88                             This parameter will be used only when PLLI2S is selected as Clock Source SAI */\r
89 \r
90 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) || defined (STM32F767xx) || \\r
91     defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F750xx)\r
92   uint32_t PLLI2SP;    /*!< Specifies the division factor for SPDIF-RX clock.\r
93                             This parameter must be a value of @ref RCCEx_PLLI2SP_Clock_Divider.\r
94                             This parameter will be used only when PLLI2S is selected as Clock Source SPDIF-RX */\r
95 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
96 }RCC_PLLI2SInitTypeDef;\r
97 \r
98 /**\r
99   * @brief  PLLSAI Clock structure definition\r
100   */\r
101 typedef struct\r
102 {\r
103   uint32_t PLLSAIN;    /*!< Specifies the multiplication factor for PLLI2S VCO output clock.\r
104                             This parameter must be a number between Min_Data = 50 and Max_Data = 432.\r
105                             This parameter will be used only when PLLSAI is selected as Clock Source SAI or LTDC */\r
106 \r
107   uint32_t PLLSAIQ;    /*!< Specifies the division factor for SAI1 clock.\r
108                             This parameter must be a number between Min_Data = 2 and Max_Data = 15.\r
109                             This parameter will be used only when PLLSAI is selected as Clock Source SAI or LTDC */\r
110 \r
111 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) || defined (STM32F767xx) || \\r
112     defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F750xx)\r
113   uint32_t PLLSAIR;    /*!< specifies the division factor for LTDC clock\r
114                             This parameter must be a number between Min_Data = 2 and Max_Data = 7.\r
115                             This parameter will be used only when PLLSAI is selected as Clock Source LTDC */\r
116 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
117 \r
118   uint32_t PLLSAIP;    /*!< Specifies the division factor for 48MHz clock.\r
119                             This parameter must be a value of @ref RCCEx_PLLSAIP_Clock_Divider\r
120                             This parameter will be used only when PLLSAI is disabled */\r
121 }RCC_PLLSAIInitTypeDef;\r
122 \r
123 /**\r
124   * @brief  RCC extended clocks structure definition\r
125   */\r
126 typedef struct\r
127 {\r
128   uint32_t PeriphClockSelection; /*!< The Extended Clock to be configured.\r
129                                       This parameter can be a value of @ref RCCEx_Periph_Clock_Selection */\r
130 \r
131   RCC_PLLI2SInitTypeDef PLLI2S;  /*!< PLL I2S structure parameters.\r
132                                       This parameter will be used only when PLLI2S is selected as Clock Source I2S or SAI */\r
133 \r
134   RCC_PLLSAIInitTypeDef PLLSAI;  /*!< PLL SAI structure parameters.\r
135                                       This parameter will be used only when PLLI2S is selected as Clock Source SAI or LTDC */\r
136 \r
137   uint32_t PLLI2SDivQ;           /*!< Specifies the PLLI2S division factor for SAI1 clock.\r
138                                       This parameter must be a number between Min_Data = 1 and Max_Data = 32\r
139                                       This parameter will be used only when PLLI2S is selected as Clock Source SAI */\r
140 \r
141   uint32_t PLLSAIDivQ;           /*!< Specifies the PLLI2S division factor for SAI1 clock.\r
142                                       This parameter must be a number between Min_Data = 1 and Max_Data = 32\r
143                                       This parameter will be used only when PLLSAI is selected as Clock Source SAI */\r
144 \r
145   uint32_t PLLSAIDivR;           /*!< Specifies the PLLSAI division factor for LTDC clock.\r
146                                       This parameter must be one value of @ref RCCEx_PLLSAI_DIVR */\r
147 \r
148   uint32_t RTCClockSelection;      /*!< Specifies RTC Clock source Selection.\r
149                                         This parameter can be a value of @ref RCC_RTC_Clock_Source */\r
150 \r
151   uint32_t I2sClockSelection;      /*!< Specifies I2S Clock source Selection.\r
152                                         This parameter can be a value of @ref RCCEx_I2S_Clock_Source */\r
153 \r
154   uint32_t TIMPresSelection;      /*!< Specifies TIM Clock Prescalers Selection.\r
155                                        This parameter can be a value of @ref RCCEx_TIM_Prescaler_Selection */\r
156 \r
157   uint32_t Sai1ClockSelection;     /*!< Specifies SAI1 Clock Prescalers Selection\r
158                                         This parameter can be a value of @ref RCCEx_SAI1_Clock_Source */\r
159 \r
160   uint32_t Sai2ClockSelection;     /*!< Specifies SAI2 Clock Prescalers Selection\r
161                                         This parameter can be a value of @ref RCCEx_SAI2_Clock_Source */\r
162 \r
163   uint32_t Usart1ClockSelection; /*!< USART1 clock source\r
164                                       This parameter can be a value of @ref RCCEx_USART1_Clock_Source */\r
165 \r
166   uint32_t Usart2ClockSelection; /*!< USART2 clock source\r
167                                       This parameter can be a value of @ref RCCEx_USART2_Clock_Source */\r
168 \r
169   uint32_t Usart3ClockSelection; /*!< USART3 clock source\r
170                                       This parameter can be a value of @ref RCCEx_USART3_Clock_Source */\r
171 \r
172   uint32_t Uart4ClockSelection;  /*!< UART4 clock source\r
173                                       This parameter can be a value of @ref RCCEx_UART4_Clock_Source */\r
174 \r
175   uint32_t Uart5ClockSelection;  /*!< UART5 clock source\r
176                                       This parameter can be a value of @ref RCCEx_UART5_Clock_Source */\r
177 \r
178   uint32_t Usart6ClockSelection;  /*!< USART6 clock source\r
179                                       This parameter can be a value of @ref RCCEx_USART6_Clock_Source */\r
180 \r
181   uint32_t Uart7ClockSelection;  /*!< UART7 clock source\r
182                                       This parameter can be a value of @ref RCCEx_UART7_Clock_Source */\r
183 \r
184   uint32_t Uart8ClockSelection;  /*!< UART8 clock source\r
185                                       This parameter can be a value of @ref RCCEx_UART8_Clock_Source */\r
186 \r
187   uint32_t I2c1ClockSelection;   /*!< I2C1 clock source\r
188                                       This parameter can be a value of @ref RCCEx_I2C1_Clock_Source */\r
189 \r
190   uint32_t I2c2ClockSelection;   /*!< I2C2 clock source\r
191                                       This parameter can be a value of @ref RCCEx_I2C2_Clock_Source */\r
192 \r
193   uint32_t I2c3ClockSelection;   /*!< I2C3 clock source\r
194                                       This parameter can be a value of @ref RCCEx_I2C3_Clock_Source */\r
195 \r
196   uint32_t I2c4ClockSelection;   /*!< I2C4 clock source\r
197                                       This parameter can be a value of @ref RCCEx_I2C4_Clock_Source */\r
198 \r
199   uint32_t Lptim1ClockSelection;   /*!< Specifies LPTIM1 clock source\r
200                                         This parameter can be a value of @ref RCCEx_LPTIM1_Clock_Source */\r
201 \r
202   uint32_t CecClockSelection;      /*!< CEC clock source\r
203                                         This parameter can be a value of @ref RCCEx_CEC_Clock_Source */\r
204 \r
205   uint32_t Clk48ClockSelection;    /*!< Specifies 48Mhz clock source used by USB OTG FS, RNG and SDMMC\r
206                                         This parameter can be a value of @ref RCCEx_CLK48_Clock_Source */\r
207 \r
208   uint32_t Sdmmc1ClockSelection;     /*!< SDMMC1 clock source\r
209                                         This parameter can be a value of @ref RCCEx_SDMMC1_Clock_Source */\r
210 \r
211 #if defined (STM32F722xx) || defined (STM32F723xx) || defined (STM32F732xx) || defined (STM32F733xx) || defined (STM32F765xx) ||\\r
212     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F730xx)\r
213   uint32_t Sdmmc2ClockSelection;     /*!< SDMMC2 clock source\r
214                                         This parameter can be a value of @ref RCCEx_SDMMC2_Clock_Source */\r
215 #endif /* STM32F722xx || STM32F723xx || STM32F732xx || STM32F733xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F730xx */\r
216 \r
217 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
218   uint32_t Dfsdm1ClockSelection;     /*!< DFSDM1 clock source\r
219                                         This parameter can be a value of @ref RCCEx_DFSDM1_Kernel_Clock_Source */\r
220 \r
221   uint32_t Dfsdm1AudioClockSelection; /*!< DFSDM1 clock source\r
222                                         This parameter can be a value of @ref RCCEx_DFSDM1_AUDIO_Clock_Source */\r
223 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
224 }RCC_PeriphCLKInitTypeDef;\r
225 /**\r
226   * @}\r
227   */\r
228 \r
229 /* Exported constants --------------------------------------------------------*/\r
230 /** @defgroup RCCEx_Exported_Constants RCCEx Exported Constants\r
231   * @{\r
232   */\r
233 \r
234 /** @defgroup RCCEx_Periph_Clock_Selection RCC Periph Clock Selection\r
235   * @{\r
236   */\r
237 #define RCC_PERIPHCLK_I2S             ((uint32_t)0x00000001U)\r
238 #if defined(STM32F746xx) || defined(STM32F756xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F750xx)\r
239 #define RCC_PERIPHCLK_LTDC            ((uint32_t)0x00000008U)\r
240 #endif /* STM32F746xx || STM32F756xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
241 #define RCC_PERIPHCLK_TIM             ((uint32_t)0x00000010U)\r
242 #define RCC_PERIPHCLK_RTC             ((uint32_t)0x00000020U)\r
243 #define RCC_PERIPHCLK_USART1          ((uint32_t)0x00000040U)\r
244 #define RCC_PERIPHCLK_USART2          ((uint32_t)0x00000080U)\r
245 #define RCC_PERIPHCLK_USART3          ((uint32_t)0x00000100U)\r
246 #define RCC_PERIPHCLK_UART4           ((uint32_t)0x00000200U)\r
247 #define RCC_PERIPHCLK_UART5           ((uint32_t)0x00000400U)\r
248 #define RCC_PERIPHCLK_USART6          ((uint32_t)0x00000800U)\r
249 #define RCC_PERIPHCLK_UART7           ((uint32_t)0x00001000U)\r
250 #define RCC_PERIPHCLK_UART8           ((uint32_t)0x00002000U)\r
251 #define RCC_PERIPHCLK_I2C1            ((uint32_t)0x00004000U)\r
252 #define RCC_PERIPHCLK_I2C2            ((uint32_t)0x00008000U)\r
253 #define RCC_PERIPHCLK_I2C3            ((uint32_t)0x00010000U)\r
254 #define RCC_PERIPHCLK_I2C4            ((uint32_t)0x00020000U)\r
255 #define RCC_PERIPHCLK_LPTIM1          ((uint32_t)0x00040000U)\r
256 #define RCC_PERIPHCLK_SAI1            ((uint32_t)0x00080000U)\r
257 #define RCC_PERIPHCLK_SAI2            ((uint32_t)0x00100000U)\r
258 #define RCC_PERIPHCLK_CLK48           ((uint32_t)0x00200000U)\r
259 #define RCC_PERIPHCLK_CEC             ((uint32_t)0x00400000U)\r
260 #define RCC_PERIPHCLK_SDMMC1          ((uint32_t)0x00800000U)\r
261 #define RCC_PERIPHCLK_SPDIFRX         ((uint32_t)0x01000000U)\r
262 #define RCC_PERIPHCLK_PLLI2S          ((uint32_t)0x02000000U)\r
263 #if defined (STM32F722xx) || defined (STM32F723xx) || defined (STM32F732xx) || defined (STM32F733xx) || defined (STM32F765xx) ||\\r
264     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F730xx)\r
265 #define RCC_PERIPHCLK_SDMMC2          ((uint32_t)0x04000000U)\r
266 #endif /* STM32F722xx || STM32F723xx || STM32F732xx || STM32F733xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F730xx */\r
267 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
268 #define RCC_PERIPHCLK_DFSDM1           ((uint32_t)0x08000000U)\r
269 #define RCC_PERIPHCLK_DFSDM1_AUDIO     ((uint32_t)0x10000000U)\r
270 #endif /* STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
271 \r
272 /**\r
273   * @}\r
274   */\r
275 \r
276 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) || defined (STM32F767xx) || \\r
277     defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F750xx)\r
278 /** @defgroup RCCEx_PLLI2SP_Clock_Divider RCCEx PLLI2SP Clock Divider\r
279   * @{\r
280   */\r
281 #define RCC_PLLI2SP_DIV2                  ((uint32_t)0x00000000U)\r
282 #define RCC_PLLI2SP_DIV4                  ((uint32_t)0x00000001U)\r
283 #define RCC_PLLI2SP_DIV6                  ((uint32_t)0x00000002U)\r
284 #define RCC_PLLI2SP_DIV8                  ((uint32_t)0x00000003U)\r
285 /**\r
286   * @}\r
287   */\r
288 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
289 \r
290 /** @defgroup RCCEx_PLLSAIP_Clock_Divider RCCEx PLLSAIP Clock Divider\r
291   * @{\r
292   */\r
293 #define RCC_PLLSAIP_DIV2                  ((uint32_t)0x00000000U)\r
294 #define RCC_PLLSAIP_DIV4                  ((uint32_t)0x00000001U)\r
295 #define RCC_PLLSAIP_DIV6                  ((uint32_t)0x00000002U)\r
296 #define RCC_PLLSAIP_DIV8                  ((uint32_t)0x00000003U)\r
297 /**\r
298   * @}\r
299   */\r
300 \r
301 /** @defgroup RCCEx_PLLSAI_DIVR RCCEx PLLSAI DIVR\r
302   * @{\r
303   */\r
304 #define RCC_PLLSAIDIVR_2                ((uint32_t)0x00000000U)\r
305 #define RCC_PLLSAIDIVR_4                RCC_DCKCFGR1_PLLSAIDIVR_0\r
306 #define RCC_PLLSAIDIVR_8                RCC_DCKCFGR1_PLLSAIDIVR_1\r
307 #define RCC_PLLSAIDIVR_16               RCC_DCKCFGR1_PLLSAIDIVR\r
308 /**\r
309   * @}\r
310   */\r
311 \r
312 /** @defgroup RCCEx_I2S_Clock_Source RCCEx I2S Clock Source\r
313   * @{\r
314   */\r
315 #define RCC_I2SCLKSOURCE_PLLI2S             ((uint32_t)0x00000000U)\r
316 #define RCC_I2SCLKSOURCE_EXT                RCC_CFGR_I2SSRC\r
317 \r
318 /**\r
319   * @}\r
320   */\r
321 \r
322 /** @defgroup RCCEx_SAI1_Clock_Source RCCEx SAI1 Clock Source\r
323   * @{\r
324   */\r
325 #define RCC_SAI1CLKSOURCE_PLLSAI             ((uint32_t)0x00000000U)\r
326 #define RCC_SAI1CLKSOURCE_PLLI2S             RCC_DCKCFGR1_SAI1SEL_0\r
327 #define RCC_SAI1CLKSOURCE_PIN                RCC_DCKCFGR1_SAI1SEL_1\r
328 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
329 #define RCC_SAI1CLKSOURCE_PLLSRC             RCC_DCKCFGR1_SAI1SEL\r
330 #endif /* STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
331 /**\r
332   * @}\r
333   */\r
334 \r
335 /** @defgroup RCCEx_SAI2_Clock_Source RCCEx SAI2 Clock Source\r
336   * @{\r
337   */\r
338 #define RCC_SAI2CLKSOURCE_PLLSAI             ((uint32_t)0x00000000U)\r
339 #define RCC_SAI2CLKSOURCE_PLLI2S             RCC_DCKCFGR1_SAI2SEL_0\r
340 #define RCC_SAI2CLKSOURCE_PIN                RCC_DCKCFGR1_SAI2SEL_1\r
341 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
342 #define RCC_SAI2CLKSOURCE_PLLSRC             RCC_DCKCFGR1_SAI2SEL\r
343 #endif /* STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
344 /**\r
345   * @}\r
346   */\r
347 \r
348 /** @defgroup RCCEx_CEC_Clock_Source RCCEx CEC Clock Source\r
349   * @{\r
350   */\r
351 #define RCC_CECCLKSOURCE_LSE             ((uint32_t)0x00000000U)\r
352 #define RCC_CECCLKSOURCE_HSI             RCC_DCKCFGR2_CECSEL /* CEC clock is HSI/488*/\r
353 /**\r
354   * @}\r
355   */\r
356 \r
357 /** @defgroup RCCEx_USART1_Clock_Source RCCEx USART1 Clock Source\r
358   * @{\r
359   */\r
360 #define RCC_USART1CLKSOURCE_PCLK2      ((uint32_t)0x00000000U)\r
361 #define RCC_USART1CLKSOURCE_SYSCLK     RCC_DCKCFGR2_USART1SEL_0\r
362 #define RCC_USART1CLKSOURCE_HSI        RCC_DCKCFGR2_USART1SEL_1\r
363 #define RCC_USART1CLKSOURCE_LSE        RCC_DCKCFGR2_USART1SEL\r
364 /**\r
365   * @}\r
366   */\r
367 \r
368 /** @defgroup RCCEx_USART2_Clock_Source RCCEx USART2 Clock Source\r
369   * @{\r
370   */\r
371 #define RCC_USART2CLKSOURCE_PCLK1       ((uint32_t)0x00000000U)\r
372 #define RCC_USART2CLKSOURCE_SYSCLK     RCC_DCKCFGR2_USART2SEL_0\r
373 #define RCC_USART2CLKSOURCE_HSI        RCC_DCKCFGR2_USART2SEL_1\r
374 #define RCC_USART2CLKSOURCE_LSE        RCC_DCKCFGR2_USART2SEL\r
375 /**\r
376   * @}\r
377   */\r
378 \r
379 /** @defgroup RCCEx_USART3_Clock_Source RCCEx USART3 Clock Source\r
380   * @{\r
381   */\r
382 #define RCC_USART3CLKSOURCE_PCLK1       ((uint32_t)0x00000000U)\r
383 #define RCC_USART3CLKSOURCE_SYSCLK     RCC_DCKCFGR2_USART3SEL_0\r
384 #define RCC_USART3CLKSOURCE_HSI        RCC_DCKCFGR2_USART3SEL_1\r
385 #define RCC_USART3CLKSOURCE_LSE        RCC_DCKCFGR2_USART3SEL\r
386 /**\r
387   * @}\r
388   */\r
389 \r
390 /** @defgroup RCCEx_UART4_Clock_Source RCCEx UART4 Clock Source\r
391   * @{\r
392   */\r
393 #define RCC_UART4CLKSOURCE_PCLK1        ((uint32_t)0x00000000U)\r
394 #define RCC_UART4CLKSOURCE_SYSCLK       RCC_DCKCFGR2_UART4SEL_0\r
395 #define RCC_UART4CLKSOURCE_HSI          RCC_DCKCFGR2_UART4SEL_1\r
396 #define RCC_UART4CLKSOURCE_LSE          RCC_DCKCFGR2_UART4SEL\r
397 /**\r
398   * @}\r
399   */\r
400 \r
401 /** @defgroup RCCEx_UART5_Clock_Source RCCEx UART5 Clock Source\r
402   * @{\r
403   */\r
404 #define RCC_UART5CLKSOURCE_PCLK1        ((uint32_t)0x00000000U)\r
405 #define RCC_UART5CLKSOURCE_SYSCLK       RCC_DCKCFGR2_UART5SEL_0\r
406 #define RCC_UART5CLKSOURCE_HSI          RCC_DCKCFGR2_UART5SEL_1\r
407 #define RCC_UART5CLKSOURCE_LSE          RCC_DCKCFGR2_UART5SEL\r
408 /**\r
409   * @}\r
410   */\r
411 \r
412 /** @defgroup RCCEx_USART6_Clock_Source RCCEx USART6 Clock Source\r
413   * @{\r
414   */\r
415 #define RCC_USART6CLKSOURCE_PCLK2       ((uint32_t)0x00000000U)\r
416 #define RCC_USART6CLKSOURCE_SYSCLK      RCC_DCKCFGR2_USART6SEL_0\r
417 #define RCC_USART6CLKSOURCE_HSI         RCC_DCKCFGR2_USART6SEL_1\r
418 #define RCC_USART6CLKSOURCE_LSE         RCC_DCKCFGR2_USART6SEL\r
419 /**\r
420   * @}\r
421   */\r
422 \r
423 /** @defgroup RCCEx_UART7_Clock_Source RCCEx UART7 Clock Source\r
424   * @{\r
425   */\r
426 #define RCC_UART7CLKSOURCE_PCLK1       ((uint32_t)0x00000000U)\r
427 #define RCC_UART7CLKSOURCE_SYSCLK      RCC_DCKCFGR2_UART7SEL_0\r
428 #define RCC_UART7CLKSOURCE_HSI         RCC_DCKCFGR2_UART7SEL_1\r
429 #define RCC_UART7CLKSOURCE_LSE         RCC_DCKCFGR2_UART7SEL\r
430 /**\r
431   * @}\r
432   */\r
433 \r
434 /** @defgroup RCCEx_UART8_Clock_Source RCCEx UART8 Clock Source\r
435   * @{\r
436   */\r
437 #define RCC_UART8CLKSOURCE_PCLK1        ((uint32_t)0x00000000U)\r
438 #define RCC_UART8CLKSOURCE_SYSCLK      RCC_DCKCFGR2_UART8SEL_0\r
439 #define RCC_UART8CLKSOURCE_HSI         RCC_DCKCFGR2_UART8SEL_1\r
440 #define RCC_UART8CLKSOURCE_LSE         RCC_DCKCFGR2_UART8SEL\r
441 /**\r
442   * @}\r
443   */\r
444 \r
445 /** @defgroup RCCEx_I2C1_Clock_Source RCCEx I2C1 Clock Source\r
446   * @{\r
447   */\r
448 #define RCC_I2C1CLKSOURCE_PCLK1        ((uint32_t)0x00000000U)\r
449 #define RCC_I2C1CLKSOURCE_SYSCLK       RCC_DCKCFGR2_I2C1SEL_0\r
450 #define RCC_I2C1CLKSOURCE_HSI          RCC_DCKCFGR2_I2C1SEL_1\r
451 /**\r
452   * @}\r
453   */\r
454 \r
455 /** @defgroup RCCEx_I2C2_Clock_Source RCCEx I2C2 Clock Source\r
456   * @{\r
457   */\r
458 #define RCC_I2C2CLKSOURCE_PCLK1        ((uint32_t)0x00000000U)\r
459 #define RCC_I2C2CLKSOURCE_SYSCLK       RCC_DCKCFGR2_I2C2SEL_0\r
460 #define RCC_I2C2CLKSOURCE_HSI          RCC_DCKCFGR2_I2C2SEL_1\r
461 \r
462 /**\r
463   * @}\r
464   */\r
465 \r
466 /** @defgroup RCCEx_I2C3_Clock_Source RCCEx I2C3 Clock Source\r
467   * @{\r
468   */\r
469 #define RCC_I2C3CLKSOURCE_PCLK1        ((uint32_t)0x00000000U)\r
470 #define RCC_I2C3CLKSOURCE_SYSCLK       RCC_DCKCFGR2_I2C3SEL_0\r
471 #define RCC_I2C3CLKSOURCE_HSI          RCC_DCKCFGR2_I2C3SEL_1\r
472 /**\r
473   * @}\r
474   */\r
475 \r
476 /** @defgroup RCCEx_I2C4_Clock_Source RCCEx I2C4 Clock Source\r
477   * @{\r
478   */\r
479 #define RCC_I2C4CLKSOURCE_PCLK1        ((uint32_t)0x00000000U)\r
480 #define RCC_I2C4CLKSOURCE_SYSCLK       RCC_DCKCFGR2_I2C4SEL_0\r
481 #define RCC_I2C4CLKSOURCE_HSI          RCC_DCKCFGR2_I2C4SEL_1\r
482 /**\r
483   * @}\r
484   */\r
485 \r
486 /** @defgroup RCCEx_LPTIM1_Clock_Source RCCEx LPTIM1 Clock Source\r
487   * @{\r
488   */\r
489 #define RCC_LPTIM1CLKSOURCE_PCLK1       ((uint32_t)0x00000000U)\r
490 #define RCC_LPTIM1CLKSOURCE_LSI        RCC_DCKCFGR2_LPTIM1SEL_0\r
491 #define RCC_LPTIM1CLKSOURCE_HSI        RCC_DCKCFGR2_LPTIM1SEL_1\r
492 #define RCC_LPTIM1CLKSOURCE_LSE        RCC_DCKCFGR2_LPTIM1SEL\r
493 \r
494 /**\r
495   * @}\r
496   */\r
497 \r
498 /** @defgroup RCCEx_CLK48_Clock_Source RCCEx CLK48 Clock Source\r
499   * @{\r
500   */\r
501 #define RCC_CLK48SOURCE_PLL         ((uint32_t)0x00000000U)\r
502 #define RCC_CLK48SOURCE_PLLSAIP     RCC_DCKCFGR2_CK48MSEL\r
503 /**\r
504   * @}\r
505   */\r
506 \r
507 /** @defgroup RCCEx_TIM_Prescaler_Selection RCCEx TIM Prescaler Selection\r
508   * @{\r
509   */\r
510 #define RCC_TIMPRES_DESACTIVATED        ((uint32_t)0x00000000U)\r
511 #define RCC_TIMPRES_ACTIVATED           RCC_DCKCFGR1_TIMPRE\r
512 /**\r
513   * @}\r
514   */\r
515 \r
516 /** @defgroup RCCEx_SDMMC1_Clock_Source RCCEx SDMMC1 Clock Source\r
517   * @{\r
518   */\r
519 #define RCC_SDMMC1CLKSOURCE_CLK48              ((uint32_t)0x00000000U)\r
520 #define RCC_SDMMC1CLKSOURCE_SYSCLK             RCC_DCKCFGR2_SDMMC1SEL\r
521 /**\r
522   * @}\r
523   */\r
524 \r
525 #if defined (STM32F722xx) || defined (STM32F723xx) || defined (STM32F732xx) || defined (STM32F733xx) || defined (STM32F765xx) ||\\r
526     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F730xx)\r
527 /** @defgroup RCCEx_SDMMC2_Clock_Source RCCEx SDMMC2 Clock Source\r
528   * @{\r
529   */\r
530 #define RCC_SDMMC2CLKSOURCE_CLK48              ((uint32_t)0x00000000U)\r
531 #define RCC_SDMMC2CLKSOURCE_SYSCLK             RCC_DCKCFGR2_SDMMC2SEL\r
532 /**\r
533   * @}\r
534   */\r
535 #endif /* STM32F722xx || STM32F723xx || STM32F732xx || STM32F733xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F730xx */\r
536 \r
537 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
538 /** @defgroup RCCEx_DFSDM1_Kernel_Clock_Source  RCCEx DFSDM1 Kernel Clock Source\r
539   * @{\r
540   */\r
541 #define RCC_DFSDM1CLKSOURCE_PCLK2             ((uint32_t)0x00000000U)\r
542 #define RCC_DFSDM1CLKSOURCE_SYSCLK           RCC_DCKCFGR1_DFSDM1SEL\r
543 /**\r
544   * @}\r
545   */\r
546 \r
547 /** @defgroup RCCEx_DFSDM1_AUDIO_Clock_Source RCCEx DFSDM1 AUDIO Clock Source\r
548   * @{\r
549   */\r
550 #define RCC_DFSDM1AUDIOCLKSOURCE_SAI1        ((uint32_t)0x00000000U)\r
551 #define RCC_DFSDM1AUDIOCLKSOURCE_SAI2        RCC_DCKCFGR1_ADFSDM1SEL\r
552 /**\r
553   * @}\r
554   */\r
555 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
556 \r
557 #if defined (STM32F769xx) || defined (STM32F779xx)\r
558 /** @defgroup RCCEx_DSI_Clock_Source  RCC DSI Clock Source\r
559   * @{\r
560   */\r
561 #define RCC_DSICLKSOURCE_DSIPHY             ((uint32_t)0x00000000U)\r
562 #define RCC_DSICLKSOURCE_PLLR               ((uint32_t)RCC_DCKCFGR2_DSISEL)\r
563 /**\r
564   * @}\r
565   */\r
566 #endif /* STM32F769xx || STM32F779xx */\r
567 \r
568 /**\r
569   * @}\r
570   */\r
571 \r
572 /* Exported macro ------------------------------------------------------------*/\r
573 /** @defgroup RCCEx_Exported_Macros RCCEx Exported Macros\r
574   * @{\r
575   */\r
576 /** @defgroup RCCEx_Peripheral_Clock_Enable_Disable RCCEx_Peripheral_Clock_Enable_Disable\r
577   * @brief  Enables or disables the AHB/APB peripheral clock.\r
578   * @note   After reset, the peripheral clock (used for registers read/write access)\r
579   *         is disabled and the application software has to enable this clock before\r
580   *         using it.\r
581   * @{\r
582   */\r
583 \r
584 /** @brief  Enables or disables the AHB1 peripheral clock.\r
585   * @note   After reset, the peripheral clock (used for registers read/write access)\r
586   *         is disabled and the application software has to enable this clock before\r
587   *         using it.\r
588   */\r
589 #define __HAL_RCC_BKPSRAM_CLK_ENABLE()   do { \\r
590                                         __IO uint32_t tmpreg; \\r
591                                         SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_BKPSRAMEN);\\r
592                                         /* Delay after an RCC peripheral clock enabling */ \\r
593                                         tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_BKPSRAMEN);\\r
594                                         UNUSED(tmpreg); \\r
595                                       } while(0)\r
596 \r
597 #define __HAL_RCC_DTCMRAMEN_CLK_ENABLE()   do { \\r
598                                         __IO uint32_t tmpreg; \\r
599                                         SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DTCMRAMEN);\\r
600                                         /* Delay after an RCC peripheral clock enabling */ \\r
601                                         tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DTCMRAMEN);\\r
602                                         UNUSED(tmpreg); \\r
603                                       } while(0)\r
604 \r
605 #define __HAL_RCC_DMA2_CLK_ENABLE()   do { \\r
606                                         __IO uint32_t tmpreg; \\r
607                                         SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA2EN);\\r
608                                         /* Delay after an RCC peripheral clock enabling */ \\r
609                                         tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA2EN);\\r
610                                         UNUSED(tmpreg); \\r
611                                       } while(0)\r
612 \r
613 #define __HAL_RCC_USB_OTG_HS_CLK_ENABLE()   do { \\r
614                                         __IO uint32_t tmpreg; \\r
615                                         SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_OTGHSEN);\\r
616                                         /* Delay after an RCC peripheral clock enabling */ \\r
617                                         tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_OTGHSEN);\\r
618                                         UNUSED(tmpreg); \\r
619                                       } while(0)\r
620 \r
621 #define __HAL_RCC_USB_OTG_HS_ULPI_CLK_ENABLE()   do { \\r
622                                         __IO uint32_t tmpreg; \\r
623                                         SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_OTGHSULPIEN);\\r
624                                         /* Delay after an RCC peripheral clock enabling */ \\r
625                                         tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_OTGHSULPIEN);\\r
626                                         UNUSED(tmpreg); \\r
627                                       } while(0)\r
628 \r
629 #define __HAL_RCC_GPIOA_CLK_ENABLE()   do { \\r
630                                         __IO uint32_t tmpreg; \\r
631                                         SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOAEN);\\r
632                                         /* Delay after an RCC peripheral clock enabling */ \\r
633                                         tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOAEN);\\r
634                                         UNUSED(tmpreg); \\r
635                                       } while(0)\r
636 \r
637 #define __HAL_RCC_GPIOB_CLK_ENABLE()   do { \\r
638                                         __IO uint32_t tmpreg; \\r
639                                         SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOBEN);\\r
640                                         /* Delay after an RCC peripheral clock enabling */ \\r
641                                         tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOBEN);\\r
642                                         UNUSED(tmpreg); \\r
643                                       } while(0)\r
644 \r
645 #define __HAL_RCC_GPIOC_CLK_ENABLE()   do { \\r
646                                         __IO uint32_t tmpreg; \\r
647                                         SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN);\\r
648                                         /* Delay after an RCC peripheral clock enabling */ \\r
649                                         tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN);\\r
650                                         UNUSED(tmpreg); \\r
651                                       } while(0)\r
652 \r
653 #define __HAL_RCC_GPIOD_CLK_ENABLE()   do { \\r
654                                         __IO uint32_t tmpreg; \\r
655                                         SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIODEN);\\r
656                                         /* Delay after an RCC peripheral clock enabling */ \\r
657                                         tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIODEN);\\r
658                                         UNUSED(tmpreg); \\r
659                                       } while(0)\r
660 \r
661 #define __HAL_RCC_GPIOE_CLK_ENABLE()   do { \\r
662                                         __IO uint32_t tmpreg; \\r
663                                         SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOEEN);\\r
664                                         /* Delay after an RCC peripheral clock enabling */ \\r
665                                         tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOEEN);\\r
666                                         UNUSED(tmpreg); \\r
667                                       } while(0)\r
668 \r
669 #define __HAL_RCC_GPIOF_CLK_ENABLE()   do { \\r
670                                         __IO uint32_t tmpreg; \\r
671                                         SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOFEN);\\r
672                                         /* Delay after an RCC peripheral clock enabling */ \\r
673                                         tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOFEN);\\r
674                                         UNUSED(tmpreg); \\r
675                                       } while(0)\r
676 \r
677 #define __HAL_RCC_GPIOG_CLK_ENABLE()   do { \\r
678                                         __IO uint32_t tmpreg; \\r
679                                         SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOGEN);\\r
680                                         /* Delay after an RCC peripheral clock enabling */ \\r
681                                         tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOGEN);\\r
682                                         UNUSED(tmpreg); \\r
683                                       } while(0)\r
684 \r
685 #define __HAL_RCC_GPIOH_CLK_ENABLE()   do { \\r
686                                         __IO uint32_t tmpreg; \\r
687                                         SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOHEN);\\r
688                                         /* Delay after an RCC peripheral clock enabling */ \\r
689                                         tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOHEN);\\r
690                                         UNUSED(tmpreg); \\r
691                                       } while(0)\r
692 \r
693 #define __HAL_RCC_GPIOI_CLK_ENABLE()   do { \\r
694                                         __IO uint32_t tmpreg; \\r
695                                         SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOIEN);\\r
696                                         /* Delay after an RCC peripheral clock enabling */ \\r
697                                         tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOIEN);\\r
698                                         UNUSED(tmpreg); \\r
699                                       } while(0)\r
700 \r
701 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) ||\\r
702     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) ||\\r
703     defined (STM32F750xx)\r
704 #define __HAL_RCC_GPIOJ_CLK_ENABLE()   do { \\r
705                                         __IO uint32_t tmpreg; \\r
706                                         SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOJEN);\\r
707                                         /* Delay after an RCC peripheral clock enabling */ \\r
708                                         tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOJEN);\\r
709                                         UNUSED(tmpreg); \\r
710                                       } while(0)\r
711 \r
712 #define __HAL_RCC_GPIOK_CLK_ENABLE()   do { \\r
713                                         __IO uint32_t tmpreg; \\r
714                                         SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOKEN);\\r
715                                         /* Delay after an RCC peripheral clock enabling */ \\r
716                                         tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOKEN);\\r
717                                         UNUSED(tmpreg); \\r
718                                       } while(0)\r
719 \r
720 #define __HAL_RCC_DMA2D_CLK_ENABLE()   do { \\r
721                                         __IO uint32_t tmpreg; \\r
722                                         SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA2DEN);\\r
723                                         /* Delay after an RCC peripheral clock enabling */ \\r
724                                         tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA2DEN);\\r
725                                         UNUSED(tmpreg); \\r
726                                       } while(0)\r
727 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
728 \r
729 #define __HAL_RCC_BKPSRAM_CLK_DISABLE()         (RCC->AHB1ENR &= ~(RCC_AHB1ENR_BKPSRAMEN))\r
730 #define __HAL_RCC_DTCMRAMEN_CLK_DISABLE()       (RCC->AHB1ENR &= ~(RCC_AHB1ENR_DTCMRAMEN))\r
731 #define __HAL_RCC_DMA2_CLK_DISABLE()            (RCC->AHB1ENR &= ~(RCC_AHB1ENR_DMA2EN))\r
732 #define __HAL_RCC_USB_OTG_HS_CLK_DISABLE()      (RCC->AHB1ENR &= ~(RCC_AHB1ENR_OTGHSEN))\r
733 #define __HAL_RCC_USB_OTG_HS_ULPI_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_OTGHSULPIEN))\r
734 #define __HAL_RCC_GPIOA_CLK_DISABLE()           (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOAEN))\r
735 #define __HAL_RCC_GPIOB_CLK_DISABLE()           (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOBEN))\r
736 #define __HAL_RCC_GPIOC_CLK_DISABLE()           (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOCEN))\r
737 #define __HAL_RCC_GPIOD_CLK_DISABLE()           (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIODEN))\r
738 #define __HAL_RCC_GPIOE_CLK_DISABLE()           (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOEEN))\r
739 #define __HAL_RCC_GPIOF_CLK_DISABLE()           (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOFEN))\r
740 #define __HAL_RCC_GPIOG_CLK_DISABLE()           (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOGEN))\r
741 #define __HAL_RCC_GPIOH_CLK_DISABLE()           (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOHEN))\r
742 #define __HAL_RCC_GPIOI_CLK_DISABLE()           (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOIEN))\r
743 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) ||\\r
744     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) ||\\r
745     defined (STM32F750xx)\r
746 #define __HAL_RCC_GPIOJ_CLK_DISABLE()           (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOJEN))\r
747 #define __HAL_RCC_GPIOK_CLK_DISABLE()           (RCC->AHB1ENR &= ~(RCC_AHB1ENR_GPIOKEN))\r
748 #define __HAL_RCC_DMA2D_CLK_DISABLE()           (RCC->AHB1ENR &= ~(RCC_AHB1ENR_DMA2DEN))\r
749 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
750 \r
751 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) ||\\r
752     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) ||\\r
753     defined (STM32F750xx)\r
754 /**\r
755   * @brief  Enable ETHERNET clock.\r
756   */\r
757 #define __HAL_RCC_ETHMAC_CLK_ENABLE()   do { \\r
758                                         __IO uint32_t tmpreg; \\r
759                                         SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETHMACEN);\\r
760                                         /* Delay after an RCC peripheral clock enabling */ \\r
761                                         tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETHMACEN);\\r
762                                         UNUSED(tmpreg); \\r
763                                       } while(0)\r
764 \r
765 #define __HAL_RCC_ETHMACTX_CLK_ENABLE()   do { \\r
766                                         __IO uint32_t tmpreg; \\r
767                                         SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETHMACTXEN);\\r
768                                         /* Delay after an RCC peripheral clock enabling */ \\r
769                                         tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETHMACTXEN);\\r
770                                         UNUSED(tmpreg); \\r
771                                       } while(0)\r
772 \r
773 #define __HAL_RCC_ETHMACRX_CLK_ENABLE()   do { \\r
774                                         __IO uint32_t tmpreg; \\r
775                                         SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETHMACRXEN);\\r
776                                         /* Delay after an RCC peripheral clock enabling */ \\r
777                                         tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETHMACRXEN);\\r
778                                         UNUSED(tmpreg); \\r
779                                       } while(0)\r
780 \r
781 #define __HAL_RCC_ETHMACPTP_CLK_ENABLE()   do { \\r
782                                         __IO uint32_t tmpreg; \\r
783                                         SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETHMACPTPEN);\\r
784                                         /* Delay after an RCC peripheral clock enabling */ \\r
785                                         tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_ETHMACPTPEN);\\r
786                                         UNUSED(tmpreg); \\r
787                                       } while(0)\r
788 \r
789 #define __HAL_RCC_ETH_CLK_ENABLE()       do {                            \\r
790                                      __HAL_RCC_ETHMAC_CLK_ENABLE();      \\r
791                                      __HAL_RCC_ETHMACTX_CLK_ENABLE();    \\r
792                                      __HAL_RCC_ETHMACRX_CLK_ENABLE();    \\r
793                                     } while(0)\r
794 /**\r
795   * @brief  Disable ETHERNET clock.\r
796   */\r
797 #define __HAL_RCC_ETHMAC_CLK_DISABLE()    (RCC->AHB1ENR &= ~(RCC_AHB1ENR_ETHMACEN))\r
798 #define __HAL_RCC_ETHMACTX_CLK_DISABLE()  (RCC->AHB1ENR &= ~(RCC_AHB1ENR_ETHMACTXEN))\r
799 #define __HAL_RCC_ETHMACRX_CLK_DISABLE()  (RCC->AHB1ENR &= ~(RCC_AHB1ENR_ETHMACRXEN))\r
800 #define __HAL_RCC_ETHMACPTP_CLK_DISABLE() (RCC->AHB1ENR &= ~(RCC_AHB1ENR_ETHMACPTPEN))\r
801 #define __HAL_RCC_ETH_CLK_DISABLE()       do {                             \\r
802                                       __HAL_RCC_ETHMACTX_CLK_DISABLE();    \\r
803                                       __HAL_RCC_ETHMACRX_CLK_DISABLE();    \\r
804                                       __HAL_RCC_ETHMAC_CLK_DISABLE();      \\r
805                                      } while(0)\r
806 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
807 \r
808 /** @brief  Enable or disable the AHB2 peripheral clock.\r
809   * @note   After reset, the peripheral clock (used for registers read/write access)\r
810   *         is disabled and the application software has to enable this clock before\r
811   *         using it.\r
812   */\r
813 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) ||\\r
814     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) ||\\r
815     defined (STM32F750xx)\r
816 #define __HAL_RCC_DCMI_CLK_ENABLE()   do { \\r
817                                         __IO uint32_t tmpreg; \\r
818                                         SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_DCMIEN);\\r
819                                         /* Delay after an RCC peripheral clock enabling */ \\r
820                                         tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_DCMIEN);\\r
821                                         UNUSED(tmpreg); \\r
822                                       } while(0)\r
823 #define __HAL_RCC_DCMI_CLK_DISABLE()  (RCC->AHB2ENR &= ~(RCC_AHB2ENR_DCMIEN))\r
824 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
825 \r
826 #if defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
827 #define __HAL_RCC_JPEG_CLK_ENABLE()   do { \\r
828                                         __IO uint32_t tmpreg; \\r
829                                         SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_JPEGEN);\\r
830                                         /* Delay after an RCC peripheral clock enabling */ \\r
831                                         tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_JPEGEN);\\r
832                                         UNUSED(tmpreg); \\r
833                                       } while(0)\r
834 #define __HAL_RCC_JPEG_CLK_DISABLE()  (RCC->AHB2ENR &= ~(RCC_AHB2ENR_JPEGEN))\r
835 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
836 \r
837 #define __HAL_RCC_RNG_CLK_ENABLE()   do { \\r
838                                         __IO uint32_t tmpreg; \\r
839                                         SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_RNGEN);\\r
840                                         /* Delay after an RCC peripheral clock enabling */ \\r
841                                         tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_RNGEN);\\r
842                                         UNUSED(tmpreg); \\r
843                                       } while(0)\r
844 \r
845 #define __HAL_RCC_USB_OTG_FS_CLK_ENABLE()   do { \\r
846                                         __IO uint32_t tmpreg; \\r
847                                         SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_OTGFSEN);\\r
848                                         /* Delay after an RCC peripheral clock enabling */ \\r
849                                         tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_OTGFSEN);\\r
850                                         UNUSED(tmpreg); \\r
851                                         __HAL_RCC_SYSCFG_CLK_ENABLE();\\r
852                                       } while(0)\r
853 \r
854 #define __HAL_RCC_RNG_CLK_DISABLE()   (RCC->AHB2ENR &= ~(RCC_AHB2ENR_RNGEN))\r
855 \r
856 #define __HAL_RCC_USB_OTG_FS_CLK_DISABLE() (RCC->AHB2ENR &= ~(RCC_AHB2ENR_OTGFSEN))\r
857 #if defined(STM32F756xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F750xx)\r
858 #define __HAL_RCC_CRYP_CLK_ENABLE()   do { \\r
859                                         __IO uint32_t tmpreg; \\r
860                                         SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_CRYPEN);\\r
861                                         /* Delay after an RCC peripheral clock enabling */ \\r
862                                         tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_CRYPEN);\\r
863                                         UNUSED(tmpreg); \\r
864                                       } while(0)\r
865 \r
866 #define __HAL_RCC_HASH_CLK_ENABLE()   do { \\r
867                                         __IO uint32_t tmpreg; \\r
868                                         SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_HASHEN);\\r
869                                         /* Delay after an RCC peripheral clock enabling */ \\r
870                                         tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_HASHEN);\\r
871                                         UNUSED(tmpreg); \\r
872                                       } while(0)\r
873 \r
874 #define __HAL_RCC_CRYP_CLK_DISABLE()  (RCC->AHB2ENR &= ~(RCC_AHB2ENR_CRYPEN))\r
875 #define __HAL_RCC_HASH_CLK_DISABLE()  (RCC->AHB2ENR &= ~(RCC_AHB2ENR_HASHEN))\r
876 #endif /* STM32F756x || STM32F777xx || STM32F779xx || STM32F750xx */\r
877 \r
878 #if defined(STM32F732xx) || defined (STM32F733xx) || defined (STM32F730xx)\r
879 #define __HAL_RCC_AES_CLK_ENABLE()    do { \\r
880                                         __IO uint32_t tmpreg; \\r
881                                         SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_AESEN);\\r
882                                         /* Delay after an RCC peripheral clock enabling */ \\r
883                                         tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_AESEN);\\r
884                                         UNUSED(tmpreg); \\r
885                                       } while(0)\r
886 \r
887 #define __HAL_RCC_AES_CLK_DISABLE()  (RCC->AHB2ENR &= ~(RCC_AHB2ENR_AESEN))\r
888 #endif /* STM32F732xx || STM32F733xx || STM32F730xx */\r
889 \r
890 /** @brief  Enables or disables the AHB3 peripheral clock.\r
891   * @note   After reset, the peripheral clock (used for registers read/write access)\r
892   *         is disabled and the application software has to enable this clock before\r
893   *         using it.\r
894   */\r
895 #define __HAL_RCC_FMC_CLK_ENABLE()   do { \\r
896                                         __IO uint32_t tmpreg; \\r
897                                         SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN);\\r
898                                         /* Delay after an RCC peripheral clock enabling */ \\r
899                                         tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN);\\r
900                                         UNUSED(tmpreg); \\r
901                                       } while(0)\r
902 \r
903 #define __HAL_RCC_QSPI_CLK_ENABLE()   do { \\r
904                                         __IO uint32_t tmpreg; \\r
905                                         SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_QSPIEN);\\r
906                                         /* Delay after an RCC peripheral clock enabling */ \\r
907                                         tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_QSPIEN);\\r
908                                         UNUSED(tmpreg); \\r
909                                       } while(0)\r
910 \r
911 #define __HAL_RCC_FMC_CLK_DISABLE()   (RCC->AHB3ENR &= ~(RCC_AHB3ENR_FMCEN))\r
912 #define __HAL_RCC_QSPI_CLK_DISABLE()  (RCC->AHB3ENR &= ~(RCC_AHB3ENR_QSPIEN))\r
913 \r
914 /** @brief  Enable or disable the Low Speed APB (APB1) peripheral clock.\r
915   * @note   After reset, the peripheral clock (used for registers read/write access)\r
916   *         is disabled and the application software has to enable this clock before\r
917   *         using it.\r
918   */\r
919 #define __HAL_RCC_TIM2_CLK_ENABLE()   do { \\r
920                                         __IO uint32_t tmpreg; \\r
921                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM2EN);\\r
922                                         /* Delay after an RCC peripheral clock enabling */ \\r
923                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM2EN);\\r
924                                         UNUSED(tmpreg); \\r
925                                       } while(0)\r
926 \r
927 #define __HAL_RCC_TIM3_CLK_ENABLE()   do { \\r
928                                         __IO uint32_t tmpreg; \\r
929                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM3EN);\\r
930                                         /* Delay after an RCC peripheral clock enabling */ \\r
931                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM3EN);\\r
932                                         UNUSED(tmpreg); \\r
933                                       } while(0)\r
934 \r
935 #define __HAL_RCC_TIM4_CLK_ENABLE()   do { \\r
936                                         __IO uint32_t tmpreg; \\r
937                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM4EN);\\r
938                                         /* Delay after an RCC peripheral clock enabling */ \\r
939                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM4EN);\\r
940                                         UNUSED(tmpreg); \\r
941                                       } while(0)\r
942 \r
943 #define __HAL_RCC_TIM5_CLK_ENABLE()   do { \\r
944                                         __IO uint32_t tmpreg; \\r
945                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM5EN);\\r
946                                         /* Delay after an RCC peripheral clock enabling */ \\r
947                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM5EN);\\r
948                                         UNUSED(tmpreg); \\r
949                                       } while(0)\r
950 \r
951 #define __HAL_RCC_TIM6_CLK_ENABLE()   do { \\r
952                                         __IO uint32_t tmpreg; \\r
953                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM6EN);\\r
954                                         /* Delay after an RCC peripheral clock enabling */ \\r
955                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM6EN);\\r
956                                         UNUSED(tmpreg); \\r
957                                       } while(0)\r
958 \r
959 #define __HAL_RCC_TIM7_CLK_ENABLE()   do { \\r
960                                         __IO uint32_t tmpreg; \\r
961                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM7EN);\\r
962                                         /* Delay after an RCC peripheral clock enabling */ \\r
963                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM7EN);\\r
964                                         UNUSED(tmpreg); \\r
965                                       } while(0)\r
966 \r
967 #define __HAL_RCC_TIM12_CLK_ENABLE()   do { \\r
968                                         __IO uint32_t tmpreg; \\r
969                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM12EN);\\r
970                                         /* Delay after an RCC peripheral clock enabling */ \\r
971                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM12EN);\\r
972                                         UNUSED(tmpreg); \\r
973                                       } while(0)\r
974 \r
975 #define __HAL_RCC_TIM13_CLK_ENABLE()   do { \\r
976                                         __IO uint32_t tmpreg; \\r
977                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM13EN);\\r
978                                         /* Delay after an RCC peripheral clock enabling */ \\r
979                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM13EN);\\r
980                                         UNUSED(tmpreg); \\r
981                                       } while(0)\r
982 \r
983 #define __HAL_RCC_TIM14_CLK_ENABLE()   do { \\r
984                                         __IO uint32_t tmpreg; \\r
985                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM14EN);\\r
986                                         /* Delay after an RCC peripheral clock enabling */ \\r
987                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM14EN);\\r
988                                         UNUSED(tmpreg); \\r
989                                       } while(0)\r
990 \r
991 #define __HAL_RCC_LPTIM1_CLK_ENABLE()   do { \\r
992                                         __IO uint32_t tmpreg; \\r
993                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_LPTIM1EN);\\r
994                                         /* Delay after an RCC peripheral clock enabling */ \\r
995                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_LPTIM1EN);\\r
996                                         UNUSED(tmpreg); \\r
997                                       } while(0)\r
998 \r
999 #if defined (STM32F722xx) || defined (STM32F723xx) || defined (STM32F732xx) || defined (STM32F733xx) ||\\r
1000     defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) ||\\r
1001     defined (STM32F779xx) || defined (STM32F730xx)\r
1002 #define __HAL_RCC_RTC_CLK_ENABLE()   do { \\r
1003                                         __IO uint32_t tmpreg; \\r
1004                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_RTCEN);\\r
1005                                         /* Delay after an RCC peripheral clock enabling */ \\r
1006                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_RTCEN);\\r
1007                                         UNUSED(tmpreg); \\r
1008                                       } while(0)\r
1009 #endif /* STM32F722xx || STM32F723xx || STM32F732xx || STM32F733xx || STM32F765xx || STM32F767xx ||\r
1010           STM32F769xx || STM32F777xx || STM32F779xx || STM32F730xx */\r
1011 \r
1012 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
1013 #define __HAL_RCC_CAN3_CLK_ENABLE()   do { \\r
1014                                         __IO uint32_t tmpreg; \\r
1015                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_CAN3EN);\\r
1016                                         /* Delay after an RCC peripheral clock enabling */ \\r
1017                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_CAN3EN);\\r
1018                                         UNUSED(tmpreg); \\r
1019                                       } while(0)\r
1020 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
1021 \r
1022 #define __HAL_RCC_SPI2_CLK_ENABLE()   do { \\r
1023                                         __IO uint32_t tmpreg; \\r
1024                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI2EN);\\r
1025                                         /* Delay after an RCC peripheral clock enabling */ \\r
1026                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI2EN);\\r
1027                                         UNUSED(tmpreg); \\r
1028                                       } while(0)\r
1029 \r
1030 #define __HAL_RCC_SPI3_CLK_ENABLE()   do { \\r
1031                                         __IO uint32_t tmpreg; \\r
1032                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI3EN);\\r
1033                                         /* Delay after an RCC peripheral clock enabling */ \\r
1034                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI3EN);\\r
1035                                         UNUSED(tmpreg); \\r
1036                                       } while(0)\r
1037 \r
1038 #define __HAL_RCC_USART2_CLK_ENABLE()   do { \\r
1039                                         __IO uint32_t tmpreg; \\r
1040                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_USART2EN);\\r
1041                                         /* Delay after an RCC peripheral clock enabling */ \\r
1042                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_USART2EN);\\r
1043                                         UNUSED(tmpreg); \\r
1044                                       } while(0)\r
1045 \r
1046 #define __HAL_RCC_USART3_CLK_ENABLE()   do { \\r
1047                                         __IO uint32_t tmpreg; \\r
1048                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_USART3EN);\\r
1049                                         /* Delay after an RCC peripheral clock enabling */ \\r
1050                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_USART3EN);\\r
1051                                         UNUSED(tmpreg); \\r
1052                                       } while(0)\r
1053 \r
1054 #define __HAL_RCC_UART4_CLK_ENABLE()   do { \\r
1055                                         __IO uint32_t tmpreg; \\r
1056                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_UART4EN);\\r
1057                                         /* Delay after an RCC peripheral clock enabling */ \\r
1058                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_UART4EN);\\r
1059                                         UNUSED(tmpreg); \\r
1060                                       } while(0)\r
1061 \r
1062 #define __HAL_RCC_UART5_CLK_ENABLE()   do { \\r
1063                                         __IO uint32_t tmpreg; \\r
1064                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_UART5EN);\\r
1065                                         /* Delay after an RCC peripheral clock enabling */ \\r
1066                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_UART5EN);\\r
1067                                         UNUSED(tmpreg); \\r
1068                                       } while(0)\r
1069 \r
1070 #define __HAL_RCC_I2C1_CLK_ENABLE()   do { \\r
1071                                         __IO uint32_t tmpreg; \\r
1072                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C1EN);\\r
1073                                         /* Delay after an RCC peripheral clock enabling */ \\r
1074                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C1EN);\\r
1075                                         UNUSED(tmpreg); \\r
1076                                       } while(0)\r
1077 \r
1078 #define __HAL_RCC_I2C2_CLK_ENABLE()   do { \\r
1079                                         __IO uint32_t tmpreg; \\r
1080                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C2EN);\\r
1081                                         /* Delay after an RCC peripheral clock enabling */ \\r
1082                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C2EN);\\r
1083                                         UNUSED(tmpreg); \\r
1084                                       } while(0)\r
1085 \r
1086 #define __HAL_RCC_I2C3_CLK_ENABLE()   do { \\r
1087                                         __IO uint32_t tmpreg; \\r
1088                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C3EN);\\r
1089                                         /* Delay after an RCC peripheral clock enabling */ \\r
1090                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C3EN);\\r
1091                                         UNUSED(tmpreg); \\r
1092                                       } while(0)\r
1093 \r
1094 #define __HAL_RCC_CAN1_CLK_ENABLE()   do { \\r
1095                                         __IO uint32_t tmpreg; \\r
1096                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_CAN1EN);\\r
1097                                         /* Delay after an RCC peripheral clock enabling */ \\r
1098                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_CAN1EN);\\r
1099                                         UNUSED(tmpreg); \\r
1100                                       } while(0)\r
1101 \r
1102 #define __HAL_RCC_DAC_CLK_ENABLE()   do { \\r
1103                                         __IO uint32_t tmpreg; \\r
1104                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_DACEN);\\r
1105                                         /* Delay after an RCC peripheral clock enabling */ \\r
1106                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_DACEN);\\r
1107                                         UNUSED(tmpreg); \\r
1108                                       } while(0)\r
1109 \r
1110 #define __HAL_RCC_UART7_CLK_ENABLE()   do { \\r
1111                                         __IO uint32_t tmpreg; \\r
1112                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_UART7EN);\\r
1113                                         /* Delay after an RCC peripheral clock enabling */ \\r
1114                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_UART7EN);\\r
1115                                         UNUSED(tmpreg); \\r
1116                                       } while(0)\r
1117 \r
1118 #define __HAL_RCC_UART8_CLK_ENABLE()   do { \\r
1119                                         __IO uint32_t tmpreg; \\r
1120                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_UART8EN);\\r
1121                                         /* Delay after an RCC peripheral clock enabling */ \\r
1122                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_UART8EN);\\r
1123                                         UNUSED(tmpreg); \\r
1124                                       } while(0)\r
1125 \r
1126 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) ||\\r
1127     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) ||\\r
1128     defined (STM32F750xx)\r
1129 #define __HAL_RCC_SPDIFRX_CLK_ENABLE()   do { \\r
1130                                         __IO uint32_t tmpreg; \\r
1131                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_SPDIFRXEN);\\r
1132                                         /* Delay after an RCC peripheral clock enabling */ \\r
1133                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_SPDIFRXEN);\\r
1134                                         UNUSED(tmpreg); \\r
1135                                       } while(0)\r
1136 \r
1137 #define __HAL_RCC_I2C4_CLK_ENABLE()   do { \\r
1138                                         __IO uint32_t tmpreg; \\r
1139                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C4EN);\\r
1140                                         /* Delay after an RCC peripheral clock enabling */ \\r
1141                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C4EN);\\r
1142                                         UNUSED(tmpreg); \\r
1143                                       } while(0)\r
1144 \r
1145 #define __HAL_RCC_CAN2_CLK_ENABLE()   do { \\r
1146                                         __IO uint32_t tmpreg; \\r
1147                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_CAN2EN);\\r
1148                                         /* Delay after an RCC peripheral clock enabling */ \\r
1149                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_CAN2EN);\\r
1150                                         UNUSED(tmpreg); \\r
1151                                       } while(0)\r
1152 \r
1153 #define __HAL_RCC_CEC_CLK_ENABLE()   do { \\r
1154                                         __IO uint32_t tmpreg; \\r
1155                                         SET_BIT(RCC->APB1ENR, RCC_APB1ENR_CECEN);\\r
1156                                         /* Delay after an RCC peripheral clock enabling */ \\r
1157                                         tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_CECEN);\\r
1158                                         UNUSED(tmpreg); \\r
1159                                       } while(0)\r
1160 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
1161 \r
1162 #define __HAL_RCC_TIM2_CLK_DISABLE()   (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM2EN))\r
1163 #define __HAL_RCC_TIM3_CLK_DISABLE()   (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM3EN))\r
1164 #define __HAL_RCC_TIM4_CLK_DISABLE()   (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM4EN))\r
1165 #define __HAL_RCC_TIM5_CLK_DISABLE()   (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM5EN))\r
1166 #define __HAL_RCC_TIM6_CLK_DISABLE()   (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM6EN))\r
1167 #define __HAL_RCC_TIM7_CLK_DISABLE()   (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM7EN))\r
1168 #define __HAL_RCC_TIM12_CLK_DISABLE()  (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM12EN))\r
1169 #define __HAL_RCC_TIM13_CLK_DISABLE()  (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM13EN))\r
1170 #define __HAL_RCC_TIM14_CLK_DISABLE()  (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM14EN))\r
1171 #define __HAL_RCC_LPTIM1_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_LPTIM1EN))\r
1172 #if defined (STM32F722xx) || defined (STM32F723xx) || defined (STM32F732xx) || defined (STM32F733xx) ||\\r
1173     defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) ||\\r
1174     defined (STM32F779xx) || defined (STM32F730xx)\r
1175 #define __HAL_RCC_RTC_CLK_DISABLE()    (RCC->APB1ENR &= ~(RCC_APB1ENR_RTCEN))\r
1176 #endif /* STM32F722xx || STM32F723xx || STM32F732xx || STM32F733xx || STM32F765xx || STM32F767xx ||\r
1177           STM32F769xx || STM32F777xx || STM32F779xx || STM32F730xx */\r
1178 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
1179 #define __HAL_RCC_CAN3_CLK_DISABLE()   (RCC->APB1ENR &= ~(RCC_APB1ENR_CAN3EN))\r
1180 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
1181 #define __HAL_RCC_SPI2_CLK_DISABLE()   (RCC->APB1ENR &= ~(RCC_APB1ENR_SPI2EN))\r
1182 #define __HAL_RCC_SPI3_CLK_DISABLE()   (RCC->APB1ENR &= ~(RCC_APB1ENR_SPI3EN))\r
1183 #define __HAL_RCC_USART2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_USART2EN))\r
1184 #define __HAL_RCC_USART3_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_USART3EN))\r
1185 #define __HAL_RCC_UART4_CLK_DISABLE()  (RCC->APB1ENR &= ~(RCC_APB1ENR_UART4EN))\r
1186 #define __HAL_RCC_UART5_CLK_DISABLE()  (RCC->APB1ENR &= ~(RCC_APB1ENR_UART5EN))\r
1187 #define __HAL_RCC_I2C1_CLK_DISABLE()   (RCC->APB1ENR &= ~(RCC_APB1ENR_I2C1EN))\r
1188 #define __HAL_RCC_I2C2_CLK_DISABLE()   (RCC->APB1ENR &= ~(RCC_APB1ENR_I2C2EN))\r
1189 #define __HAL_RCC_I2C3_CLK_DISABLE()   (RCC->APB1ENR &= ~(RCC_APB1ENR_I2C3EN))\r
1190 #define __HAL_RCC_CAN1_CLK_DISABLE()   (RCC->APB1ENR &= ~(RCC_APB1ENR_CAN1EN))\r
1191 #define __HAL_RCC_DAC_CLK_DISABLE()    (RCC->APB1ENR &= ~(RCC_APB1ENR_DACEN))\r
1192 #define __HAL_RCC_UART7_CLK_DISABLE()  (RCC->APB1ENR &= ~(RCC_APB1ENR_UART7EN))\r
1193 #define __HAL_RCC_UART8_CLK_DISABLE()  (RCC->APB1ENR &= ~(RCC_APB1ENR_UART8EN))\r
1194 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) ||\\r
1195     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) ||\\r
1196     defined (STM32F750xx)\r
1197 #define __HAL_RCC_SPDIFRX_CLK_DISABLE()(RCC->APB1ENR &= ~(RCC_APB1ENR_SPDIFRXEN))\r
1198 #define __HAL_RCC_I2C4_CLK_DISABLE()   (RCC->APB1ENR &= ~(RCC_APB1ENR_I2C4EN))\r
1199 #define __HAL_RCC_CAN2_CLK_DISABLE()   (RCC->APB1ENR &= ~(RCC_APB1ENR_CAN2EN))\r
1200 #define __HAL_RCC_CEC_CLK_DISABLE()    (RCC->APB1ENR &= ~(RCC_APB1ENR_CECEN))\r
1201 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || || STM32F750xx */\r
1202 \r
1203 /** @brief  Enable or disable the High Speed APB (APB2) peripheral clock.\r
1204   * @note   After reset, the peripheral clock (used for registers read/write access)\r
1205   *         is disabled and the application software has to enable this clock before\r
1206   *         using it.\r
1207   */\r
1208 #define __HAL_RCC_TIM1_CLK_ENABLE()   do { \\r
1209                                         __IO uint32_t tmpreg; \\r
1210                                         SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM1EN);\\r
1211                                         /* Delay after an RCC peripheral clock enabling */ \\r
1212                                         tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM1EN);\\r
1213                                         UNUSED(tmpreg); \\r
1214                                       } while(0)\r
1215 \r
1216 #define __HAL_RCC_TIM8_CLK_ENABLE()   do { \\r
1217                                         __IO uint32_t tmpreg; \\r
1218                                         SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM8EN);\\r
1219                                         /* Delay after an RCC peripheral clock enabling */ \\r
1220                                         tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM8EN);\\r
1221                                         UNUSED(tmpreg); \\r
1222                                       } while(0)\r
1223 \r
1224 #define __HAL_RCC_USART1_CLK_ENABLE()   do { \\r
1225                                         __IO uint32_t tmpreg; \\r
1226                                         SET_BIT(RCC->APB2ENR, RCC_APB2ENR_USART1EN);\\r
1227                                         /* Delay after an RCC peripheral clock enabling */ \\r
1228                                         tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_USART1EN);\\r
1229                                         UNUSED(tmpreg); \\r
1230                                       } while(0)\r
1231 \r
1232 #define __HAL_RCC_USART6_CLK_ENABLE()   do { \\r
1233                                         __IO uint32_t tmpreg; \\r
1234                                         SET_BIT(RCC->APB2ENR, RCC_APB2ENR_USART6EN);\\r
1235                                         /* Delay after an RCC peripheral clock enabling */ \\r
1236                                         tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_USART6EN);\\r
1237                                         UNUSED(tmpreg); \\r
1238                                       } while(0)\r
1239 \r
1240 #if defined (STM32F722xx) || defined (STM32F723xx) || defined (STM32F732xx) || defined (STM32F733xx) || defined (STM32F765xx) ||\\r
1241     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F730xx)\r
1242 #define __HAL_RCC_SDMMC2_CLK_ENABLE()   do { \\r
1243                                         __IO uint32_t tmpreg; \\r
1244                                         SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SDMMC2EN);\\r
1245                                         /* Delay after an RCC peripheral clock enabling */ \\r
1246                                         tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SDMMC2EN);\\r
1247                                         UNUSED(tmpreg); \\r
1248                                       } while(0)\r
1249 #endif /* STM32F722xx || STM32F723xx || STM32F732xx || STM32F733xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || || STM32F730xx */\r
1250 \r
1251 #define __HAL_RCC_ADC1_CLK_ENABLE()   do { \\r
1252                                         __IO uint32_t tmpreg; \\r
1253                                         SET_BIT(RCC->APB2ENR, RCC_APB2ENR_ADC1EN);\\r
1254                                         /* Delay after an RCC peripheral clock enabling */ \\r
1255                                         tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_ADC1EN);\\r
1256                                         UNUSED(tmpreg); \\r
1257                                       } while(0)\r
1258 \r
1259 #define __HAL_RCC_ADC2_CLK_ENABLE()   do { \\r
1260                                         __IO uint32_t tmpreg; \\r
1261                                         SET_BIT(RCC->APB2ENR, RCC_APB2ENR_ADC2EN);\\r
1262                                         /* Delay after an RCC peripheral clock enabling */ \\r
1263                                         tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_ADC2EN);\\r
1264                                         UNUSED(tmpreg); \\r
1265                                       } while(0)\r
1266 \r
1267 #define __HAL_RCC_ADC3_CLK_ENABLE()   do { \\r
1268                                         __IO uint32_t tmpreg; \\r
1269                                         SET_BIT(RCC->APB2ENR, RCC_APB2ENR_ADC3EN);\\r
1270                                         /* Delay after an RCC peripheral clock enabling */ \\r
1271                                         tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_ADC3EN);\\r
1272                                         UNUSED(tmpreg); \\r
1273                                       } while(0)\r
1274 \r
1275 #define __HAL_RCC_SDMMC1_CLK_ENABLE()   do { \\r
1276                                         __IO uint32_t tmpreg; \\r
1277                                         SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SDMMC1EN);\\r
1278                                         /* Delay after an RCC peripheral clock enabling */ \\r
1279                                         tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SDMMC1EN);\\r
1280                                         UNUSED(tmpreg); \\r
1281                                       } while(0)\r
1282 \r
1283 #define __HAL_RCC_SPI1_CLK_ENABLE()   do { \\r
1284                                         __IO uint32_t tmpreg; \\r
1285                                         SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI1EN);\\r
1286                                         /* Delay after an RCC peripheral clock enabling */ \\r
1287                                         tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI1EN);\\r
1288                                         UNUSED(tmpreg); \\r
1289                                       } while(0)\r
1290 \r
1291 #define __HAL_RCC_SPI4_CLK_ENABLE()   do { \\r
1292                                         __IO uint32_t tmpreg; \\r
1293                                         SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI4EN);\\r
1294                                         /* Delay after an RCC peripheral clock enabling */ \\r
1295                                         tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI4EN);\\r
1296                                         UNUSED(tmpreg); \\r
1297                                       } while(0)\r
1298 \r
1299 #define __HAL_RCC_TIM9_CLK_ENABLE()   do { \\r
1300                                         __IO uint32_t tmpreg; \\r
1301                                         SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM9EN);\\r
1302                                         /* Delay after an RCC peripheral clock enabling */ \\r
1303                                         tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM9EN);\\r
1304                                         UNUSED(tmpreg); \\r
1305                                       } while(0)\r
1306 \r
1307 #define __HAL_RCC_TIM10_CLK_ENABLE()   do { \\r
1308                                         __IO uint32_t tmpreg; \\r
1309                                         SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM10EN);\\r
1310                                         /* Delay after an RCC peripheral clock enabling */ \\r
1311                                         tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM10EN);\\r
1312                                         UNUSED(tmpreg); \\r
1313                                       } while(0)\r
1314 \r
1315 #define __HAL_RCC_TIM11_CLK_ENABLE()   do { \\r
1316                                         __IO uint32_t tmpreg; \\r
1317                                         SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM11EN);\\r
1318                                         /* Delay after an RCC peripheral clock enabling */ \\r
1319                                         tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM11EN);\\r
1320                                         UNUSED(tmpreg); \\r
1321                                       } while(0)\r
1322 \r
1323 #define __HAL_RCC_SPI5_CLK_ENABLE()   do { \\r
1324                                         __IO uint32_t tmpreg; \\r
1325                                         SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI5EN);\\r
1326                                         /* Delay after an RCC peripheral clock enabling */ \\r
1327                                         tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI5EN);\\r
1328                                         UNUSED(tmpreg); \\r
1329                                       } while(0)\r
1330 \r
1331 #define __HAL_RCC_SPI6_CLK_ENABLE()   do { \\r
1332                                         __IO uint32_t tmpreg; \\r
1333                                         SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI6EN);\\r
1334                                         /* Delay after an RCC peripheral clock enabling */ \\r
1335                                         tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI6EN);\\r
1336                                         UNUSED(tmpreg); \\r
1337                                       } while(0)\r
1338 \r
1339 #define __HAL_RCC_SAI1_CLK_ENABLE()   do { \\r
1340                                         __IO uint32_t tmpreg; \\r
1341                                         SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI1EN);\\r
1342                                         /* Delay after an RCC peripheral clock enabling */ \\r
1343                                         tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI1EN);\\r
1344                                         UNUSED(tmpreg); \\r
1345                                       } while(0)\r
1346 \r
1347 #define __HAL_RCC_SAI2_CLK_ENABLE()   do { \\r
1348                                         __IO uint32_t tmpreg; \\r
1349                                         SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI2EN);\\r
1350                                         /* Delay after an RCC peripheral clock enabling */ \\r
1351                                         tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI2EN);\\r
1352                                         UNUSED(tmpreg); \\r
1353                                       } while(0)\r
1354 \r
1355 #if defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F750xx)\r
1356 #define __HAL_RCC_LTDC_CLK_ENABLE()   do { \\r
1357                                         __IO uint32_t tmpreg; \\r
1358                                         SET_BIT(RCC->APB2ENR, RCC_APB2ENR_LTDCEN);\\r
1359                                         /* Delay after an RCC peripheral clock enabling */ \\r
1360                                         tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_LTDCEN);\\r
1361                                         UNUSED(tmpreg); \\r
1362                                       } while(0)\r
1363 #endif /* STM32F746xx || STM32F756xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
1364 \r
1365 #if defined (STM32F769xx) || defined (STM32F779xx)\r
1366 #define __HAL_RCC_DSI_CLK_ENABLE()   do { \\r
1367                                         __IO uint32_t tmpreg; \\r
1368                                         SET_BIT(RCC->APB2ENR, RCC_APB2ENR_DSIEN);\\r
1369                                         /* Delay after an RCC peripheral clock enabling */ \\r
1370                                         tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_DSIEN);\\r
1371                                         UNUSED(tmpreg); \\r
1372                                       } while(0)\r
1373 #endif /* STM32F769xx || STM32F779xx */\r
1374 \r
1375 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
1376 #define __HAL_RCC_DFSDM1_CLK_ENABLE()   do { \\r
1377                                         __IO uint32_t tmpreg; \\r
1378                                         SET_BIT(RCC->APB2ENR, RCC_APB2ENR_DFSDM1EN);\\r
1379                                         /* Delay after an RCC peripheral clock enabling */ \\r
1380                                         tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_DFSDM1EN);\\r
1381                                         UNUSED(tmpreg); \\r
1382                                       } while(0)\r
1383 \r
1384 #define __HAL_RCC_MDIO_CLK_ENABLE()   do { \\r
1385                                         __IO uint32_t tmpreg; \\r
1386                                         SET_BIT(RCC->APB2ENR, RCC_APB2ENR_MDIOEN);\\r
1387                                         /* Delay after an RCC peripheral clock enabling */ \\r
1388                                         tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_MDIOEN);\\r
1389                                         UNUSED(tmpreg); \\r
1390                                       } while(0)\r
1391 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
1392 #if defined (STM32F723xx) || defined (STM32F733xx) || defined (STM32F730xx)\r
1393 #define __HAL_RCC_OTGPHYC_CLK_ENABLE()   do { \\r
1394                                         __IO uint32_t tmpreg; \\r
1395                                         SET_BIT(RCC->APB2ENR, RCC_APB2ENR_OTGPHYCEN);\\r
1396                                         /* Delay after an RCC peripheral clock enabling */ \\r
1397                                         tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_OTGPHYCEN);\\r
1398                                         UNUSED(tmpreg); \\r
1399                                       } while(0)\r
1400 #endif /* STM32F723xx || STM32F733xx || STM32F730xx */\r
1401 \r
1402 #define __HAL_RCC_TIM1_CLK_DISABLE()   (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM1EN))\r
1403 #define __HAL_RCC_TIM8_CLK_DISABLE()   (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM8EN))\r
1404 #define __HAL_RCC_USART1_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_USART1EN))\r
1405 #define __HAL_RCC_USART6_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_USART6EN))\r
1406 #if defined (STM32F722xx) || defined (STM32F723xx) || defined (STM32F732xx) || defined (STM32F733xx) || defined (STM32F765xx) ||\\r
1407     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F730xx)\r
1408 #define __HAL_RCC_SDMMC2_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SDMMC2EN))\r
1409 #endif /* STM32F722xx || STM32F723xx || STM32F732xx || STM32F733xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F730xx */\r
1410 #define __HAL_RCC_ADC1_CLK_DISABLE()   (RCC->APB2ENR &= ~(RCC_APB2ENR_ADC1EN))\r
1411 #define __HAL_RCC_ADC2_CLK_DISABLE()   (RCC->APB2ENR &= ~(RCC_APB2ENR_ADC2EN))\r
1412 #define __HAL_RCC_ADC3_CLK_DISABLE()   (RCC->APB2ENR &= ~(RCC_APB2ENR_ADC3EN))\r
1413 #define __HAL_RCC_SDMMC1_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SDMMC1EN))\r
1414 #define __HAL_RCC_SPI1_CLK_DISABLE()   (RCC->APB2ENR &= ~(RCC_APB2ENR_SPI1EN))\r
1415 #define __HAL_RCC_SPI4_CLK_DISABLE()   (RCC->APB2ENR &= ~(RCC_APB2ENR_SPI4EN))\r
1416 #define __HAL_RCC_TIM9_CLK_DISABLE()   (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM9EN))\r
1417 #define __HAL_RCC_TIM10_CLK_DISABLE()  (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM10EN))\r
1418 #define __HAL_RCC_TIM11_CLK_DISABLE()  (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM11EN))\r
1419 #define __HAL_RCC_SPI5_CLK_DISABLE()   (RCC->APB2ENR &= ~(RCC_APB2ENR_SPI5EN))\r
1420 #define __HAL_RCC_SPI6_CLK_DISABLE()   (RCC->APB2ENR &= ~(RCC_APB2ENR_SPI6EN))\r
1421 #define __HAL_RCC_SAI1_CLK_DISABLE()   (RCC->APB2ENR &= ~(RCC_APB2ENR_SAI1EN))\r
1422 #define __HAL_RCC_SAI2_CLK_DISABLE()   (RCC->APB2ENR &= ~(RCC_APB2ENR_SAI2EN))\r
1423 #if defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F750xx)\r
1424 #define __HAL_RCC_LTDC_CLK_DISABLE()   (RCC->APB2ENR &= ~(RCC_APB2ENR_LTDCEN))\r
1425 #endif /* STM32F746xx || STM32F756xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
1426 #if defined (STM32F769xx) || defined (STM32F779xx)\r
1427 #define __HAL_RCC_DSI_CLK_DISABLE()    (RCC->APB2ENR &= ~(RCC_APB2ENR_DSIEN))\r
1428 #endif /* STM32F769xx || STM32F779xx */\r
1429 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
1430 #define __HAL_RCC_DFSDM1_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_DFSDM1EN))\r
1431 #define __HAL_RCC_MDIO_CLK_DISABLE()   (RCC->APB2ENR &= ~(RCC_APB2ENR_MDIOEN))\r
1432 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
1433 #if defined (STM32F723xx) || defined (STM32F733xx) || defined (STM32F730xx)\r
1434 #define __HAL_RCC_OTGPHYC_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_OTGPHYCEN))\r
1435 #endif /* STM32F723xx || STM32F733xx || STM32F730xx */\r
1436 \r
1437 /**\r
1438   * @}\r
1439   */\r
1440 \r
1441 /** @defgroup RCCEx_Peripheral_Clock_Enable_Disable_Status Peripheral Clock Enable Disable Status\r
1442   * @brief  Get the enable or disable status of the AHB/APB peripheral clock.\r
1443   * @note   After reset, the peripheral clock (used for registers read/write access)\r
1444   *         is disabled and the application software has to enable this clock before\r
1445   *         using it.\r
1446   * @{\r
1447   */\r
1448 \r
1449 /** @brief  Get the enable or disable status of the AHB1 peripheral clock.\r
1450   * @note   After reset, the peripheral clock (used for registers read/write access)\r
1451   *         is disabled and the application software has to enable this clock before\r
1452   *         using it.\r
1453   */\r
1454 #define __HAL_RCC_BKPSRAM_IS_CLK_ENABLED()          ((RCC->AHB1ENR & (RCC_AHB1ENR_BKPSRAMEN)) != RESET)\r
1455 #define __HAL_RCC_DTCMRAMEN_IS_CLK_ENABLED()        ((RCC->AHB1ENR & (RCC_AHB1ENR_DTCMRAMEN)) != RESET)\r
1456 #define __HAL_RCC_DMA2_IS_CLK_ENABLED()             ((RCC->AHB1ENR & (RCC_AHB1ENR_DMA2EN)) != RESET)\r
1457 #define __HAL_RCC_USB_OTG_HS_IS_CLK_ENABLED()       ((RCC->AHB1ENR & (RCC_AHB1ENR_OTGHSEN)) != RESET)\r
1458 #define __HAL_RCC_USB_OTG_HS_ULPI_IS_CLK_ENABLED()  ((RCC->AHB1ENR & (RCC_AHB1ENR_OTGHSULPIEN)) != RESET)\r
1459 #define __HAL_RCC_GPIOA_IS_CLK_ENABLED()            ((RCC->AHB1ENR & (RCC_AHB1ENR_GPIOAEN)) != RESET)\r
1460 #define __HAL_RCC_GPIOB_IS_CLK_ENABLED()            ((RCC->AHB1ENR & (RCC_AHB1ENR_GPIOBEN)) != RESET)\r
1461 #define __HAL_RCC_GPIOC_IS_CLK_ENABLED()            ((RCC->AHB1ENR & (RCC_AHB1ENR_GPIOCEN)) != RESET)\r
1462 #define __HAL_RCC_GPIOD_IS_CLK_ENABLED()            ((RCC->AHB1ENR & (RCC_AHB1ENR_GPIODEN)) != RESET)\r
1463 #define __HAL_RCC_GPIOE_IS_CLK_ENABLED()            ((RCC->AHB1ENR & (RCC_AHB1ENR_GPIOEEN)) != RESET)\r
1464 #define __HAL_RCC_GPIOF_IS_CLK_ENABLED()            ((RCC->AHB1ENR & (RCC_AHB1ENR_GPIOFEN)) != RESET)\r
1465 #define __HAL_RCC_GPIOG_IS_CLK_ENABLED()            ((RCC->AHB1ENR & (RCC_AHB1ENR_GPIOGEN)) != RESET)\r
1466 #define __HAL_RCC_GPIOH_IS_CLK_ENABLED()            ((RCC->AHB1ENR & (RCC_AHB1ENR_GPIOHEN)) != RESET)\r
1467 #define __HAL_RCC_GPIOI_IS_CLK_ENABLED()            ((RCC->AHB1ENR & (RCC_AHB1ENR_GPIOIEN)) != RESET)\r
1468 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) ||\\r
1469     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) ||\\r
1470     defined (STM32F750xx)\r
1471 #define __HAL_RCC_GPIOJ_IS_CLK_ENABLED()            ((RCC->AHB1ENR & (RCC_AHB1ENR_GPIOJEN)) != RESET)\r
1472 #define __HAL_RCC_GPIOK_IS_CLK_ENABLED()            ((RCC->AHB1ENR & (RCC_AHB1ENR_GPIOKEN)) != RESET)\r
1473 #define __HAL_RCC_DMA2D_IS_CLK_ENABLED()            ((RCC->AHB1ENR & (RCC_AHB1ENR_DMA2DEN)) != RESET)\r
1474 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
1475 \r
1476 #define __HAL_RCC_BKPSRAM_IS_CLK_DISABLED()         ((RCC->AHB1ENR & (RCC_AHB1ENR_BKPSRAMEN)) == RESET)\r
1477 #define __HAL_RCC_DTCMRAMEN_IS_CLK_DISABLED()       ((RCC->AHB1ENR & (RCC_AHB1ENR_DTCMRAMEN)) == RESET)\r
1478 #define __HAL_RCC_DMA2_IS_CLK_DISABLED()            ((RCC->AHB1ENR & (RCC_AHB1ENR_DMA2EN)) == RESET)\r
1479 #define __HAL_RCC_USB_OTG_HS_IS_CLK_DISABLED()      ((RCC->AHB1ENR & (RCC_AHB1ENR_OTGHSEN)) == RESET)\r
1480 #define __HAL_RCC_USB_OTG_HS_ULPI_IS_CLK_DISABLED() ((RCC->AHB1ENR & (RCC_AHB1ENR_OTGHSULPIEN)) == RESET)\r
1481 #define __HAL_RCC_GPIOA_IS_CLK_DISABLED()           ((RCC->AHB1ENR & (RCC_AHB1ENR_GPIOAEN)) == RESET)\r
1482 #define __HAL_RCC_GPIOB_IS_CLK_DISABLED()           ((RCC->AHB1ENR & (RCC_AHB1ENR_GPIOBEN)) == RESET)\r
1483 #define __HAL_RCC_GPIOC_IS_CLK_DISABLED()           ((RCC->AHB1ENR & (RCC_AHB1ENR_GPIOCEN)) == RESET)\r
1484 #define __HAL_RCC_GPIOD_IS_CLK_DISABLED()           ((RCC->AHB1ENR & (RCC_AHB1ENR_GPIODEN)) == RESET)\r
1485 #define __HAL_RCC_GPIOE_IS_CLK_DISABLED()           ((RCC->AHB1ENR & (RCC_AHB1ENR_GPIOEEN)) == RESET)\r
1486 #define __HAL_RCC_GPIOF_IS_CLK_DISABLED()           ((RCC->AHB1ENR & (RCC_AHB1ENR_GPIOFEN)) == RESET)\r
1487 #define __HAL_RCC_GPIOG_IS_CLK_DISABLED()           ((RCC->AHB1ENR & (RCC_AHB1ENR_GPIOGEN)) == RESET)\r
1488 #define __HAL_RCC_GPIOH_IS_CLK_DISABLED()           ((RCC->AHB1ENR & (RCC_AHB1ENR_GPIOHEN)) == RESET)\r
1489 #define __HAL_RCC_GPIOI_IS_CLK_DISABLED()           ((RCC->AHB1ENR & (RCC_AHB1ENR_GPIOIEN)) == RESET)\r
1490 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) ||\\r
1491     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) ||\\r
1492     defined (STM32F750xx)\r
1493 #define __HAL_RCC_GPIOJ_IS_CLK_DISABLED()           ((RCC->AHB1ENR & (RCC_AHB1ENR_GPIOJEN)) == RESET)\r
1494 #define __HAL_RCC_GPIOK_IS_CLK_DISABLED()           ((RCC->AHB1ENR & (RCC_AHB1ENR_GPIOKEN)) == RESET)\r
1495 #define __HAL_RCC_DMA2D_IS_CLK_DISABLED()           ((RCC->AHB1ENR & (RCC_AHB1ENR_DMA2DEN)) == RESET)\r
1496 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
1497 \r
1498 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) ||\\r
1499     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) ||\\r
1500     defined (STM32F750xx)\r
1501 /**\r
1502   * @brief  Enable ETHERNET clock.\r
1503   */\r
1504 #define __HAL_RCC_ETHMAC_IS_CLK_ENABLED()     ((RCC->AHB1ENR & (RCC_AHB1ENR_ETHMACEN)) != RESET)\r
1505 #define __HAL_RCC_ETHMACTX_IS_CLK_ENABLED()   ((RCC->AHB1ENR & (RCC_AHB1ENR_ETHMACTXEN)) != RESET)\r
1506 #define __HAL_RCC_ETHMACRX_IS_CLK_ENABLED()   ((RCC->AHB1ENR & (RCC_AHB1ENR_ETHMACRXEN)) != RESET)\r
1507 #define __HAL_RCC_ETHMACPTP_IS_CLK_ENABLED()  ((RCC->AHB1ENR & (RCC_AHB1ENR_ETHMACPTPEN)) != RESET)\r
1508 #define __HAL_RCC_ETH_IS_CLK_ENABLED()        (__HAL_RCC_ETHMAC_IS_CLK_ENABLED()   && \\r
1509                                                __HAL_RCC_ETHMACTX_IS_CLK_ENABLED() && \\r
1510                                                __HAL_RCC_ETHMACRX_IS_CLK_ENABLED())\r
1511 \r
1512 /**\r
1513   * @brief  Disable ETHERNET clock.\r
1514   */\r
1515 #define __HAL_RCC_ETHMAC_IS_CLK_DISABLED()    ((RCC->AHB1ENR & (RCC_AHB1ENR_ETHMACEN)) == RESET)\r
1516 #define __HAL_RCC_ETHMACTX_IS_CLK_DISABLED()  ((RCC->AHB1ENR & (RCC_AHB1ENR_ETHMACTXEN)) == RESET)\r
1517 #define __HAL_RCC_ETHMACRX_IS_CLK_DISABLED()  ((RCC->AHB1ENR & (RCC_AHB1ENR_ETHMACRXEN)) == RESET)\r
1518 #define __HAL_RCC_ETHMACPTP_IS_CLK_DISABLED() ((RCC->AHB1ENR & (RCC_AHB1ENR_ETHMACPTPEN)) == RESET)\r
1519 #define __HAL_RCC_ETH_IS_CLK_DISABLED()        (__HAL_RCC_ETHMAC_IS_CLK_DISABLED()   && \\r
1520                                                 __HAL_RCC_ETHMACTX_IS_CLK_DISABLED() && \\r
1521                                                 __HAL_RCC_ETHMACRX_IS_CLK_DISABLED())\r
1522 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
1523 \r
1524 /** @brief  Get the enable or disable status of the AHB2 peripheral clock.\r
1525   * @note   After reset, the peripheral clock (used for registers read/write access)\r
1526   *         is disabled and the application software has to enable this clock before\r
1527   *         using it.\r
1528   */\r
1529 #define __HAL_RCC_RNG_IS_CLK_ENABLED()         ((RCC->AHB2ENR & (RCC_AHB2ENR_RNGEN)) != RESET)\r
1530 #define __HAL_RCC_USB_OTG_FS_IS_CLK_ENABLED()  ((RCC->AHB2ENR & (RCC_AHB2ENR_OTGFSEN)) != RESET)\r
1531 \r
1532 #define __HAL_RCC_RNG_IS_CLK_DISABLED()        ((RCC->AHB2ENR & (RCC_AHB2ENR_RNGEN)) == RESET)\r
1533 #define __HAL_RCC_USB_IS_OTG_FS_CLK_DISABLED() ((RCC->AHB2ENR & (RCC_AHB2ENR_OTGFSEN)) == RESET)\r
1534 \r
1535 #if defined(STM32F756xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F750xx)\r
1536 #define __HAL_RCC_CRYP_IS_CLK_ENABLED()   ((RCC->AHB2ENR & (RCC_AHB2ENR_CRYPEN)) != RESET)\r
1537 #define __HAL_RCC_HASH_IS_CLK_ENABLED()   ((RCC->AHB2ENR & (RCC_AHB2ENR_HASHEN)) != RESET)\r
1538 #define __HAL_RCC_CRYP_IS_CLK_DISABLED()  ((RCC->AHB2ENR & (RCC_AHB2ENR_CRYPEN)) == RESET)\r
1539 #define __HAL_RCC_HASH_IS_CLK_DISABLED()  ((RCC->AHB2ENR & (RCC_AHB2ENR_HASHEN)) == RESET)\r
1540 #endif /* STM32F756xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
1541 \r
1542 #if defined(STM32F732xx) || defined (STM32F733xx) || defined (STM32F730xx)\r
1543 #define __HAL_RCC_AES_IS_CLK_ENABLED()   ((RCC->AHB2ENR & (RCC_AHB2ENR_AESEN)) != RESET)\r
1544 #define __HAL_RCC_AES_IS_CLK_DISABLED()  ((RCC->AHB2ENR & (RCC_AHB2ENR_AESEN)) == RESET)\r
1545 #endif /* STM32F732xx || STM32F733xx || STM32F730xx */\r
1546 \r
1547 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) ||\\r
1548     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) ||\\r
1549     defined (STM32F750xx)\r
1550 #define __HAL_RCC_DCMI_IS_CLK_ENABLED()        ((RCC->AHB2ENR & (RCC_AHB2ENR_DCMIEN)) != RESET)\r
1551 #define __HAL_RCC_DCMI_IS_CLK_DISABLED()       ((RCC->AHB2ENR & (RCC_AHB2ENR_DCMIEN)) == RESET)\r
1552 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
1553 \r
1554 #if defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
1555 #define __HAL_RCC_JPEG_IS_CLK_ENABLED()        ((RCC->AHB2ENR & (RCC_AHB2ENR_JPEGEN)) != RESET)\r
1556 #define __HAL_RCC_JPEG_IS_CLK_DISABLED()       ((RCC->AHB2ENR & (RCC_AHB2ENR_JPEGEN)) == RESET)\r
1557 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
1558 \r
1559 /** @brief  Get the enable or disable status of the AHB3 peripheral clock.\r
1560   * @note   After reset, the peripheral clock (used for registers read/write access)\r
1561   *         is disabled and the application software has to enable this clock before\r
1562   *         using it.\r
1563   */\r
1564 #define __HAL_RCC_FMC_IS_CLK_ENABLED()   ((RCC->AHB3ENR & (RCC_AHB3ENR_FMCEN)) != RESET)\r
1565 #define __HAL_RCC_QSPI_IS_CLK_ENABLED()  ((RCC->AHB3ENR & (RCC_AHB3ENR_QSPIEN)) != RESET)\r
1566 \r
1567 #define __HAL_RCC_FMC_IS_CLK_DISABLED()   ((RCC->AHB3ENR & (RCC_AHB3ENR_FMCEN)) == RESET)\r
1568 #define __HAL_RCC_QSPI_IS_CLK_DISABLED()  ((RCC->AHB3ENR & (RCC_AHB3ENR_QSPIEN)) == RESET)\r
1569 \r
1570 /** @brief  Get the enable or disable status of the APB1 peripheral clock.\r
1571   * @note   After reset, the peripheral clock (used for registers read/write access)\r
1572   *         is disabled and the application software has to enable this clock before\r
1573   *         using it.\r
1574   */\r
1575 #define __HAL_RCC_TIM2_IS_CLK_ENABLED()    ((RCC->APB1ENR & (RCC_APB1ENR_TIM2EN)) != RESET)\r
1576 #define __HAL_RCC_TIM3_IS_CLK_ENABLED()    ((RCC->APB1ENR & (RCC_APB1ENR_TIM3EN)) != RESET)\r
1577 #define __HAL_RCC_TIM4_IS_CLK_ENABLED()    ((RCC->APB1ENR & (RCC_APB1ENR_TIM4EN)) != RESET)\r
1578 #define __HAL_RCC_TIM5_IS_CLK_ENABLED()    ((RCC->APB1ENR & (RCC_APB1ENR_TIM5EN)) != RESET)\r
1579 #define __HAL_RCC_TIM6_IS_CLK_ENABLED()    ((RCC->APB1ENR & (RCC_APB1ENR_TIM6EN)) != RESET)\r
1580 #define __HAL_RCC_TIM7_IS_CLK_ENABLED()    ((RCC->APB1ENR & (RCC_APB1ENR_TIM7EN)) != RESET)\r
1581 #define __HAL_RCC_TIM12_IS_CLK_ENABLED()   ((RCC->APB1ENR & (RCC_APB1ENR_TIM12EN)) != RESET)\r
1582 #define __HAL_RCC_TIM13_IS_CLK_ENABLED()   ((RCC->APB1ENR & (RCC_APB1ENR_TIM13EN)) != RESET)\r
1583 #define __HAL_RCC_TIM14_IS_CLK_ENABLED()   ((RCC->APB1ENR & (RCC_APB1ENR_TIM14EN)) != RESET)\r
1584 #define __HAL_RCC_LPTIM1_IS_CLK_ENABLED()  ((RCC->APB1ENR & (RCC_APB1ENR_LPTIM1EN)) != RESET)\r
1585 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
1586 #define __HAL_RCC_CAN3_IS_CLK_ENABLED()    ((RCC->APB1ENR & (RCC_APB1ENR_CAN3EN)) != RESET)\r
1587 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
1588 #define __HAL_RCC_SPI2_IS_CLK_ENABLED()    ((RCC->APB1ENR & (RCC_APB1ENR_SPI2EN)) != RESET)\r
1589 #define __HAL_RCC_SPI3_IS_CLK_ENABLED()    ((RCC->APB1ENR & (RCC_APB1ENR_SPI3EN)) != RESET)\r
1590 #define __HAL_RCC_USART2_IS_CLK_ENABLED()  ((RCC->APB1ENR & (RCC_APB1ENR_USART2EN)) != RESET)\r
1591 #define __HAL_RCC_USART3_IS_CLK_ENABLED()  ((RCC->APB1ENR & (RCC_APB1ENR_USART3EN)) != RESET)\r
1592 #define __HAL_RCC_UART4_IS_CLK_ENABLED()   ((RCC->APB1ENR & (RCC_APB1ENR_UART4EN)) != RESET)\r
1593 #define __HAL_RCC_UART5_IS_CLK_ENABLED()   ((RCC->APB1ENR & (RCC_APB1ENR_UART5EN)) != RESET)\r
1594 #define __HAL_RCC_I2C1_IS_CLK_ENABLED()    ((RCC->APB1ENR & (RCC_APB1ENR_I2C1EN)) != RESET)\r
1595 #define __HAL_RCC_I2C2_IS_CLK_ENABLED()    ((RCC->APB1ENR & (RCC_APB1ENR_I2C2EN)) != RESET)\r
1596 #define __HAL_RCC_I2C3_IS_CLK_ENABLED()    ((RCC->APB1ENR & (RCC_APB1ENR_I2C3EN)) != RESET)\r
1597 #define __HAL_RCC_CAN1_IS_CLK_ENABLED()    ((RCC->APB1ENR & (RCC_APB1ENR_CAN1EN)) != RESET)\r
1598 #define __HAL_RCC_DAC_IS_CLK_ENABLED()     ((RCC->APB1ENR & (RCC_APB1ENR_DACEN)) != RESET)\r
1599 #define __HAL_RCC_UART7_IS_CLK_ENABLED()   ((RCC->APB1ENR & (RCC_APB1ENR_UART7EN)) != RESET)\r
1600 #define __HAL_RCC_UART8_IS_CLK_ENABLED()   ((RCC->APB1ENR & (RCC_APB1ENR_UART8EN)) != RESET)\r
1601 \r
1602 #define __HAL_RCC_TIM2_IS_CLK_DISABLED()   ((RCC->APB1ENR & (RCC_APB1ENR_TIM2EN)) == RESET)\r
1603 #define __HAL_RCC_TIM3_IS_CLK_DISABLED()   ((RCC->APB1ENR & (RCC_APB1ENR_TIM3EN)) == RESET)\r
1604 #define __HAL_RCC_TIM4_IS_CLK_DISABLED()   ((RCC->APB1ENR & (RCC_APB1ENR_TIM4EN)) == RESET)\r
1605 #define __HAL_RCC_TIM5_IS_CLK_DISABLED()   ((RCC->APB1ENR & (RCC_APB1ENR_TIM5EN)) == RESET)\r
1606 #define __HAL_RCC_TIM6_IS_CLK_DISABLED()   ((RCC->APB1ENR & (RCC_APB1ENR_TIM6EN)) == RESET)\r
1607 #define __HAL_RCC_TIM7_IS_CLK_DISABLED()   ((RCC->APB1ENR & (RCC_APB1ENR_TIM7EN)) == RESET)\r
1608 #define __HAL_RCC_TIM12_IS_CLK_DISABLED()  ((RCC->APB1ENR & (RCC_APB1ENR_TIM12EN)) == RESET)\r
1609 #define __HAL_RCC_TIM13_IS_CLK_DISABLED()  ((RCC->APB1ENR & (RCC_APB1ENR_TIM13EN)) == RESET)\r
1610 #define __HAL_RCC_TIM14_IS_CLK_DISABLED()  ((RCC->APB1ENR & (RCC_APB1ENR_TIM14EN)) == RESET)\r
1611 #define __HAL_RCC_LPTIM1_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_LPTIM1EN)) == RESET)\r
1612 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
1613 #define __HAL_RCC_CAN3_IS_CLK_DISABLED()   ((RCC->APB1ENR & (RCC_APB1ENR_CAN3EN)) == RESET)\r
1614 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
1615 #define __HAL_RCC_SPI2_IS_CLK_DISABLED()   ((RCC->APB1ENR & (RCC_APB1ENR_SPI2EN)) == RESET)\r
1616 #define __HAL_RCC_SPI3_IS_CLK_DISABLED()   ((RCC->APB1ENR & (RCC_APB1ENR_SPI3EN)) == RESET)\r
1617 #define __HAL_RCC_USART2_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_USART2EN)) == RESET)\r
1618 #define __HAL_RCC_USART3_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_USART3EN)) == RESET)\r
1619 #define __HAL_RCC_UART4_IS_CLK_DISABLED()  ((RCC->APB1ENR & (RCC_APB1ENR_UART4EN)) == RESET)\r
1620 #define __HAL_RCC_UART5_IS_CLK_DISABLED()  ((RCC->APB1ENR & (RCC_APB1ENR_UART5EN)) == RESET)\r
1621 #define __HAL_RCC_I2C1_IS_CLK_DISABLED()   ((RCC->APB1ENR & (RCC_APB1ENR_I2C1EN)) == RESET)\r
1622 #define __HAL_RCC_I2C2_IS_CLK_DISABLED()   ((RCC->APB1ENR & (RCC_APB1ENR_I2C2EN)) == RESET)\r
1623 #define __HAL_RCC_I2C3_IS_CLK_DISABLED()   ((RCC->APB1ENR & (RCC_APB1ENR_I2C3EN)) == RESET)\r
1624 #define __HAL_RCC_CAN1_IS_CLK_DISABLED()   ((RCC->APB1ENR & (RCC_APB1ENR_CAN1EN)) == RESET)\r
1625 #define __HAL_RCC_DAC_IS_CLK_DISABLED()    ((RCC->APB1ENR & (RCC_APB1ENR_DACEN)) == RESET)\r
1626 #define __HAL_RCC_UART7_IS_CLK_DISABLED()  ((RCC->APB1ENR & (RCC_APB1ENR_UART7EN)) == RESET)\r
1627 #define __HAL_RCC_UART8_IS_CLK_DISABLED()  ((RCC->APB1ENR & (RCC_APB1ENR_UART8EN)) == RESET)\r
1628 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) ||\\r
1629     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) ||\\r
1630     defined (STM32F750xx)\r
1631 #define __HAL_RCC_SPDIFRX_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_SPDIFRXEN)) != RESET)\r
1632 #define __HAL_RCC_CAN2_IS_CLK_ENABLED()    ((RCC->APB1ENR & (RCC_APB1ENR_CAN2EN)) != RESET)\r
1633 #define __HAL_RCC_CEC_IS_CLK_ENABLED()     ((RCC->APB1ENR & (RCC_APB1ENR_CECEN)) != RESET)\r
1634 #define __HAL_RCC_I2C4_IS_CLK_ENABLED()    ((RCC->APB1ENR & (RCC_APB1ENR_I2C4EN)) != RESET)\r
1635 \r
1636 #define __HAL_RCC_SPDIFRX_IS_CLK_DISABLED()((RCC->APB1ENR & (RCC_APB1ENR_SPDIFRXEN)) == RESET)\r
1637 #define __HAL_RCC_CAN2_IS_CLK_DISABLED()   ((RCC->APB1ENR & (RCC_APB1ENR_CAN2EN)) == RESET)\r
1638 #define __HAL_RCC_CEC_IS_CLK_DISABLED()    ((RCC->APB1ENR & (RCC_APB1ENR_CECEN)) == RESET)\r
1639 #define __HAL_RCC_I2C4_IS_CLK_DISABLED()   ((RCC->APB1ENR & (RCC_APB1ENR_I2C4EN)) == RESET)\r
1640 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
1641 \r
1642 #if defined (STM32F722xx) || defined (STM32F723xx) || defined (STM32F732xx) || defined (STM32F733xx) ||\\r
1643     defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) ||\\r
1644     defined (STM32F779xx) || defined (STM32F730xx)\r
1645 #define __HAL_RCC_RTC_IS_CLK_ENABLED()     ((RCC->APB1ENR & (RCC_APB1ENR_RTCEN)) != RESET)\r
1646 #define __HAL_RCC_RTC_IS_CLK_DISABLED()    ((RCC->APB1ENR & (RCC_APB1ENR_RTCEN)) == RESET)\r
1647 #endif /* STM32F722xx || STM32F723xx || STM32F732xx || STM32F733xx || STM32F765xx || STM32F767xx ||\r
1648           STM32F769xx || STM32F777xx || STM32F779xx || STM32F730xx */\r
1649 \r
1650 /** @brief  Get the enable or disable status of the APB2 peripheral clock.\r
1651   * @note   After reset, the peripheral clock (used for registers read/write access)\r
1652   *         is disabled and the application software has to enable this clock before\r
1653   *         using it.\r
1654   */\r
1655 #define __HAL_RCC_TIM1_IS_CLK_ENABLED()    ((RCC->APB2ENR & (RCC_APB2ENR_TIM1EN)) != RESET)\r
1656 #define __HAL_RCC_TIM8_IS_CLK_ENABLED()    ((RCC->APB2ENR & (RCC_APB2ENR_TIM8EN)) != RESET)\r
1657 #define __HAL_RCC_USART1_IS_CLK_ENABLED()  ((RCC->APB2ENR & (RCC_APB2ENR_USART1EN)) != RESET)\r
1658 #define __HAL_RCC_USART6_IS_CLK_ENABLED()  ((RCC->APB2ENR & (RCC_APB2ENR_USART6EN)) != RESET)\r
1659 #define __HAL_RCC_ADC1_IS_CLK_ENABLED()    ((RCC->APB2ENR & (RCC_APB2ENR_ADC1EN)) != RESET)\r
1660 #define __HAL_RCC_ADC2_IS_CLK_ENABLED()    ((RCC->APB2ENR & (RCC_APB2ENR_ADC2EN)) != RESET)\r
1661 #define __HAL_RCC_ADC3_IS_CLK_ENABLED()    ((RCC->APB2ENR & (RCC_APB2ENR_ADC3EN)) != RESET)\r
1662 #define __HAL_RCC_SDMMC1_IS_CLK_ENABLED()  ((RCC->APB2ENR & (RCC_APB2ENR_SDMMC1EN)) != RESET)\r
1663 #define __HAL_RCC_SPI1_IS_CLK_ENABLED()    ((RCC->APB2ENR & (RCC_APB2ENR_SPI1EN)) != RESET)\r
1664 #define __HAL_RCC_SPI4_IS_CLK_ENABLED()    ((RCC->APB2ENR & (RCC_APB2ENR_SPI4EN)) != RESET)\r
1665 #define __HAL_RCC_TIM9_IS_CLK_ENABLED()    ((RCC->APB2ENR & (RCC_APB2ENR_TIM9EN)) != RESET)\r
1666 #define __HAL_RCC_TIM10_IS_CLK_ENABLED()   ((RCC->APB2ENR & (RCC_APB2ENR_TIM10EN)) != RESET)\r
1667 #define __HAL_RCC_TIM11_IS_CLK_ENABLED()   ((RCC->APB2ENR & (RCC_APB2ENR_TIM11EN)) != RESET)\r
1668 #define __HAL_RCC_SPI5_IS_CLK_ENABLED()    ((RCC->APB2ENR & (RCC_APB2ENR_SPI5EN)) != RESET)\r
1669 #define __HAL_RCC_SPI6_IS_CLK_ENABLED()    ((RCC->APB2ENR & (RCC_APB2ENR_SPI6EN)) != RESET)\r
1670 #define __HAL_RCC_SAI1_IS_CLK_ENABLED()    ((RCC->APB2ENR & (RCC_APB2ENR_SAI1EN)) != RESET)\r
1671 #define __HAL_RCC_SAI2_IS_CLK_ENABLED()    ((RCC->APB2ENR & (RCC_APB2ENR_SAI2EN)) != RESET)\r
1672 #if defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F750xx)\r
1673 #define __HAL_RCC_LTDC_IS_CLK_ENABLED()    ((RCC->APB2ENR & (RCC_APB2ENR_LTDCEN)) != RESET)\r
1674 #endif /* STM32F746xx || STM32F756xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
1675 #if defined (STM32F769xx) || defined (STM32F779xx)\r
1676 #define __HAL_RCC_DSI_IS_CLK_ENABLED()     ((RCC->APB2ENR & (RCC_APB2ENR_DSIEN)) != RESET)\r
1677 #endif /* STM32F769xx || STM32F779xx */\r
1678 #if defined (STM32F722xx) || defined (STM32F723xx) || defined (STM32F732xx) || defined (STM32F733xx) || defined (STM32F765xx) ||\\r
1679     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F730xx)\r
1680 #define __HAL_RCC_SDMMC2_IS_CLK_ENABLED()  ((RCC->APB2ENR & (RCC_APB2ENR_SDMMC2EN)) != RESET)\r
1681 #endif /* STM32F722xx || STM32F723xx || STM32F732xx || STM32F733xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F730xx */\r
1682 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
1683 #define __HAL_RCC_DFSDM1_IS_CLK_ENABLED()  ((RCC->APB2ENR & (RCC_APB2ENR_DFSDM1EN)) != RESET)\r
1684 #define __HAL_RCC_MDIO_IS_CLK_ENABLED()    ((RCC->APB2ENR & (RCC_APB2ENR_MDIOEN)) != RESET)\r
1685 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
1686 #if defined (STM32F723xx) || defined (STM32F733xx) || defined (STM32F730xx)\r
1687 #define __HAL_RCC_OTGPHYC_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_OTGPHYCEN)) != RESET)\r
1688 #endif /* STM32F723xx || STM32F733xx || STM32F730xx */\r
1689 \r
1690 #define __HAL_RCC_TIM1_IS_CLK_DISABLED()   ((RCC->APB2ENR & (RCC_APB2ENR_TIM1EN)) == RESET)\r
1691 #define __HAL_RCC_TIM8_IS_CLK_DISABLED()   ((RCC->APB2ENR & (RCC_APB2ENR_TIM8EN)) == RESET)\r
1692 #define __HAL_RCC_USART1_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_USART1EN)) == RESET)\r
1693 #define __HAL_RCC_USART6_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_USART6EN)) == RESET)\r
1694 #define __HAL_RCC_ADC1_IS_CLK_DISABLED()   ((RCC->APB2ENR & (RCC_APB2ENR_ADC1EN)) == RESET)\r
1695 #define __HAL_RCC_ADC2_IS_CLK_DISABLED()   ((RCC->APB2ENR & (RCC_APB2ENR_ADC2EN)) == RESET)\r
1696 #define __HAL_RCC_ADC3_IS_CLK_DISABLED()   ((RCC->APB2ENR & (RCC_APB2ENR_ADC3EN)) == RESET)\r
1697 #define __HAL_RCC_SDMMC1_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_SDMMC1EN)) == RESET)\r
1698 #define __HAL_RCC_SPI1_IS_CLK_DISABLED()   ((RCC->APB2ENR & (RCC_APB2ENR_SPI1EN)) == RESET)\r
1699 #define __HAL_RCC_SPI4_IS_CLK_DISABLED()   ((RCC->APB2ENR & (RCC_APB2ENR_SPI4EN)) == RESET)\r
1700 #define __HAL_RCC_TIM9_IS_CLK_DISABLED()   ((RCC->APB2ENR & (RCC_APB2ENR_TIM9EN)) == RESET)\r
1701 #define __HAL_RCC_TIM10_IS_CLK_DISABLED()  ((RCC->APB2ENR & (RCC_APB2ENR_TIM10EN)) == RESET)\r
1702 #define __HAL_RCC_TIM11_IS_CLK_DISABLED()  ((RCC->APB2ENR & (RCC_APB2ENR_TIM11EN)) == RESET)\r
1703 #define __HAL_RCC_SPI5_IS_CLK_DISABLED()   ((RCC->APB2ENR & (RCC_APB2ENR_SPI5EN)) == RESET)\r
1704 #define __HAL_RCC_SPI6_IS_CLK_DISABLED()   ((RCC->APB2ENR & (RCC_APB2ENR_SPI6EN)) == RESET)\r
1705 #define __HAL_RCC_SAI1_IS_CLK_DISABLED()   ((RCC->APB2ENR & (RCC_APB2ENR_SAI1EN)) == RESET)\r
1706 #define __HAL_RCC_SAI2_IS_CLK_DISABLED()   ((RCC->APB2ENR & (RCC_APB2ENR_SAI2EN)) == RESET)\r
1707 #if defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F750xx)\r
1708 #define __HAL_RCC_LTDC_IS_CLK_DISABLED()   ((RCC->APB2ENR & (RCC_APB2ENR_LTDCEN)) == RESET)\r
1709 #endif /* STM32F746xx || STM32F756xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
1710 #if defined (STM32F769xx) || defined (STM32F779xx)\r
1711 #define __HAL_RCC_DSI_IS_CLK_DISABLED()    ((RCC->APB2ENR & (RCC_APB2ENR_DSIEN)) == RESET)\r
1712 #endif /* STM32F769xx || STM32F779xx */\r
1713 #if defined (STM32F722xx) || defined (STM32F723xx) || defined (STM32F732xx) || defined (STM32F733xx) || defined (STM32F765xx) ||\\r
1714     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F730xx)\r
1715 #define __HAL_RCC_SDMMC2_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_SDMMC2EN)) == RESET)\r
1716 #endif /* STM32F722xx || STM32F723xx || STM32F732xx || STM32F733xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F730xx */\r
1717 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
1718 #define __HAL_RCC_DFSDM1_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_DFSDM1EN)) == RESET)\r
1719 #define __HAL_RCC_MDIO_IS_CLK_DISABLED()   ((RCC->APB2ENR & (RCC_APB2ENR_MDIOEN)) == RESET)\r
1720 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
1721 #if defined (STM32F723xx) || defined (STM32F733xx) || defined (STM32F730xx)\r
1722 #define __HAL_RCC_OTGPHYC_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_OTGPHYCEN)) == RESET)\r
1723 #endif /* STM32F723xx || STM32F733xx || STM32F730xx */\r
1724 \r
1725 /**\r
1726   * @}\r
1727   */\r
1728 \r
1729 /** @defgroup RCCEx_Force_Release_Peripheral_Reset RCCEx Force Release Peripheral Reset\r
1730   * @brief  Forces or releases AHB/APB peripheral reset.\r
1731   * @{\r
1732   */\r
1733 \r
1734 /** @brief  Force or release AHB1 peripheral reset.\r
1735   */\r
1736 #define __HAL_RCC_DMA2_FORCE_RESET()    (RCC->AHB1RSTR |= (RCC_AHB1RSTR_DMA2RST))\r
1737 #define __HAL_RCC_USB_OTG_HS_FORCE_RESET()    (RCC->AHB1RSTR |= (RCC_AHB1RSTR_OTGHRST))\r
1738 #define __HAL_RCC_GPIOA_FORCE_RESET()   (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOARST))\r
1739 #define __HAL_RCC_GPIOB_FORCE_RESET()   (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOBRST))\r
1740 #define __HAL_RCC_GPIOC_FORCE_RESET()   (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOCRST))\r
1741 #define __HAL_RCC_GPIOD_FORCE_RESET()   (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIODRST))\r
1742 #define __HAL_RCC_GPIOE_FORCE_RESET()   (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOERST))\r
1743 #define __HAL_RCC_GPIOF_FORCE_RESET()   (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOFRST))\r
1744 #define __HAL_RCC_GPIOG_FORCE_RESET()   (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOGRST))\r
1745 #define __HAL_RCC_GPIOH_FORCE_RESET()   (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOHRST))\r
1746 #define __HAL_RCC_GPIOI_FORCE_RESET()   (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOIRST))\r
1747 \r
1748 #define __HAL_RCC_DMA2_RELEASE_RESET()  (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_DMA2RST))\r
1749 #define __HAL_RCC_USB_OTG_HS_RELEASE_RESET()  (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_OTGHRST))\r
1750 #define __HAL_RCC_GPIOA_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOARST))\r
1751 #define __HAL_RCC_GPIOB_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOBRST))\r
1752 #define __HAL_RCC_GPIOC_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOCRST))\r
1753 #define __HAL_RCC_GPIOD_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIODRST))\r
1754 #define __HAL_RCC_GPIOE_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOERST))\r
1755 #define __HAL_RCC_GPIOF_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOFRST))\r
1756 #define __HAL_RCC_GPIOG_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOGRST))\r
1757 #define __HAL_RCC_GPIOH_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOHRST))\r
1758 #define __HAL_RCC_GPIOI_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOIRST))\r
1759 \r
1760 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) ||\\r
1761     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) ||\\r
1762     defined (STM32F750xx)\r
1763 #define __HAL_RCC_DMA2D_FORCE_RESET()    (RCC->AHB1RSTR |= (RCC_AHB1RSTR_DMA2DRST))\r
1764 #define __HAL_RCC_ETHMAC_FORCE_RESET()   (RCC->AHB1RSTR |= (RCC_AHB1RSTR_ETHMACRST))\r
1765 #define __HAL_RCC_GPIOJ_FORCE_RESET()   (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOJRST))\r
1766 #define __HAL_RCC_GPIOK_FORCE_RESET()   (RCC->AHB1RSTR |= (RCC_AHB1RSTR_GPIOKRST))\r
1767 \r
1768 #define __HAL_RCC_DMA2D_RELEASE_RESET()  (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_DMA2DRST))\r
1769 #define __HAL_RCC_ETHMAC_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_ETHMACRST))\r
1770 #define __HAL_RCC_GPIOJ_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOJRST))\r
1771 #define __HAL_RCC_GPIOK_RELEASE_RESET() (RCC->AHB1RSTR &= ~(RCC_AHB1RSTR_GPIOKRST))\r
1772 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
1773 \r
1774 /** @brief  Force or release AHB2 peripheral reset.\r
1775   */\r
1776 #define __HAL_RCC_AHB2_FORCE_RESET()    (RCC->AHB2RSTR = 0xFFFFFFFFU)\r
1777 #define __HAL_RCC_RNG_FORCE_RESET()    (RCC->AHB2RSTR |= (RCC_AHB2RSTR_RNGRST))\r
1778 #define __HAL_RCC_USB_OTG_FS_FORCE_RESET()   (RCC->AHB2RSTR |= (RCC_AHB2RSTR_OTGFSRST))\r
1779 \r
1780 #define __HAL_RCC_AHB2_RELEASE_RESET()  (RCC->AHB2RSTR = 0x00U)\r
1781 #define __HAL_RCC_RNG_RELEASE_RESET()  (RCC->AHB2RSTR &= ~(RCC_AHB2RSTR_RNGRST))\r
1782 #define __HAL_RCC_USB_OTG_FS_RELEASE_RESET() (RCC->AHB2RSTR &= ~(RCC_AHB2RSTR_OTGFSRST))\r
1783 \r
1784 #if defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
1785 #define __HAL_RCC_JPEG_FORCE_RESET()   (RCC->AHB2RSTR |= (RCC_AHB2RSTR_JPEGRST))\r
1786 #define __HAL_RCC_JPEG_RELEASE_RESET() (RCC->AHB2RSTR &= ~(RCC_AHB2RSTR_JPEGRST))\r
1787 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
1788 \r
1789 #if defined(STM32F756xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F750xx)\r
1790 #define __HAL_RCC_CRYP_FORCE_RESET()   (RCC->AHB2RSTR |= (RCC_AHB2RSTR_CRYPRST))\r
1791 #define __HAL_RCC_HASH_FORCE_RESET()   (RCC->AHB2RSTR |= (RCC_AHB2RSTR_HASHRST))\r
1792 #define __HAL_RCC_CRYP_RELEASE_RESET() (RCC->AHB2RSTR &= ~(RCC_AHB2RSTR_CRYPRST))\r
1793 #define __HAL_RCC_HASH_RELEASE_RESET() (RCC->AHB2RSTR &= ~(RCC_AHB2RSTR_HASHRST))\r
1794 #endif /* STM32F756xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
1795 \r
1796 #if defined(STM32F732xx) || defined (STM32F733xx) || defined (STM32F730xx)\r
1797 #define __HAL_RCC_AES_FORCE_RESET()   (RCC->AHB2RSTR |= (RCC_AHB2RSTR_AESRST))\r
1798 #define __HAL_RCC_AES_RELEASE_RESET() (RCC->AHB2RSTR &= ~(RCC_AHB2RSTR_AESRST))\r
1799 #endif /* STM32F732xx || STM32F733xx || STM32F730xx */\r
1800 \r
1801 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) ||\\r
1802     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) ||\\r
1803     defined (STM32F750xx)\r
1804 #define __HAL_RCC_DCMI_FORCE_RESET()   (RCC->AHB2RSTR |= (RCC_AHB2RSTR_DCMIRST))\r
1805 #define __HAL_RCC_DCMI_RELEASE_RESET() (RCC->AHB2RSTR &= ~(RCC_AHB2RSTR_DCMIRST))\r
1806 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
1807 \r
1808 /** @brief  Force or release AHB3 peripheral reset\r
1809   */\r
1810 #define __HAL_RCC_AHB3_FORCE_RESET()   (RCC->AHB3RSTR = 0xFFFFFFFFU)\r
1811 #define __HAL_RCC_FMC_FORCE_RESET()    (RCC->AHB3RSTR |= (RCC_AHB3RSTR_FMCRST))\r
1812 #define __HAL_RCC_QSPI_FORCE_RESET()   (RCC->AHB3RSTR |= (RCC_AHB3RSTR_QSPIRST))\r
1813 \r
1814 #define __HAL_RCC_AHB3_RELEASE_RESET() (RCC->AHB3RSTR = 0x00U)\r
1815 #define __HAL_RCC_FMC_RELEASE_RESET()  (RCC->AHB3RSTR &= ~(RCC_AHB3RSTR_FMCRST))\r
1816 #define __HAL_RCC_QSPI_RELEASE_RESET() (RCC->AHB3RSTR &= ~(RCC_AHB3RSTR_QSPIRST))\r
1817 \r
1818 /** @brief  Force or release APB1 peripheral reset.\r
1819   */\r
1820 #define __HAL_RCC_TIM2_FORCE_RESET()     (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM2RST))\r
1821 #define __HAL_RCC_TIM3_FORCE_RESET()     (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM3RST))\r
1822 #define __HAL_RCC_TIM4_FORCE_RESET()     (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM4RST))\r
1823 #define __HAL_RCC_TIM5_FORCE_RESET()     (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM5RST))\r
1824 #define __HAL_RCC_TIM6_FORCE_RESET()     (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM6RST))\r
1825 #define __HAL_RCC_TIM7_FORCE_RESET()     (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM7RST))\r
1826 #define __HAL_RCC_TIM12_FORCE_RESET()    (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM12RST))\r
1827 #define __HAL_RCC_TIM13_FORCE_RESET()    (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM13RST))\r
1828 #define __HAL_RCC_TIM14_FORCE_RESET()    (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM14RST))\r
1829 #define __HAL_RCC_LPTIM1_FORCE_RESET()   (RCC->APB1RSTR |= (RCC_APB1RSTR_LPTIM1RST))\r
1830 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
1831 #define __HAL_RCC_CAN3_FORCE_RESET()     (RCC->APB1RSTR |= (RCC_APB1RSTR_CAN3RST))\r
1832 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
1833 #define __HAL_RCC_SPI2_FORCE_RESET()     (RCC->APB1RSTR |= (RCC_APB1RSTR_SPI2RST))\r
1834 #define __HAL_RCC_SPI3_FORCE_RESET()     (RCC->APB1RSTR |= (RCC_APB1RSTR_SPI3RST))\r
1835 #define __HAL_RCC_USART2_FORCE_RESET()   (RCC->APB1RSTR |= (RCC_APB1RSTR_USART2RST))\r
1836 #define __HAL_RCC_USART3_FORCE_RESET()   (RCC->APB1RSTR |= (RCC_APB1RSTR_USART3RST))\r
1837 #define __HAL_RCC_UART4_FORCE_RESET()    (RCC->APB1RSTR |= (RCC_APB1RSTR_UART4RST))\r
1838 #define __HAL_RCC_UART5_FORCE_RESET()    (RCC->APB1RSTR |= (RCC_APB1RSTR_UART5RST))\r
1839 #define __HAL_RCC_I2C1_FORCE_RESET()     (RCC->APB1RSTR |= (RCC_APB1RSTR_I2C1RST))\r
1840 #define __HAL_RCC_I2C2_FORCE_RESET()     (RCC->APB1RSTR |= (RCC_APB1RSTR_I2C2RST))\r
1841 #define __HAL_RCC_I2C3_FORCE_RESET()     (RCC->APB1RSTR |= (RCC_APB1RSTR_I2C3RST))\r
1842 #define __HAL_RCC_CAN1_FORCE_RESET()     (RCC->APB1RSTR |= (RCC_APB1RSTR_CAN1RST))\r
1843 #define __HAL_RCC_DAC_FORCE_RESET()      (RCC->APB1RSTR |= (RCC_APB1RSTR_DACRST))\r
1844 #define __HAL_RCC_UART7_FORCE_RESET()    (RCC->APB1RSTR |= (RCC_APB1RSTR_UART7RST))\r
1845 #define __HAL_RCC_UART8_FORCE_RESET()    (RCC->APB1RSTR |= (RCC_APB1RSTR_UART8RST))\r
1846 \r
1847 #define __HAL_RCC_TIM2_RELEASE_RESET()   (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM2RST))\r
1848 #define __HAL_RCC_TIM3_RELEASE_RESET()   (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM3RST))\r
1849 #define __HAL_RCC_TIM4_RELEASE_RESET()   (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM4RST))\r
1850 #define __HAL_RCC_TIM5_RELEASE_RESET()   (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM5RST))\r
1851 #define __HAL_RCC_TIM6_RELEASE_RESET()   (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM6RST))\r
1852 #define __HAL_RCC_TIM7_RELEASE_RESET()   (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM7RST))\r
1853 #define __HAL_RCC_TIM12_RELEASE_RESET()  (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM12RST))\r
1854 #define __HAL_RCC_TIM13_RELEASE_RESET()  (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM13RST))\r
1855 #define __HAL_RCC_TIM14_RELEASE_RESET()  (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM14RST))\r
1856 #define __HAL_RCC_LPTIM1_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_LPTIM1RST))\r
1857 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
1858 #define __HAL_RCC_CAN3_RELEASE_RESET()   (RCC->APB1RSTR &= ~(RCC_APB1RSTR_CAN3RST))\r
1859 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
1860 #define __HAL_RCC_SPI2_RELEASE_RESET()   (RCC->APB1RSTR &= ~(RCC_APB1RSTR_SPI2RST))\r
1861 #define __HAL_RCC_SPI3_RELEASE_RESET()   (RCC->APB1RSTR &= ~(RCC_APB1RSTR_SPI3RST))\r
1862 #define __HAL_RCC_USART2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_USART2RST))\r
1863 #define __HAL_RCC_USART3_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_USART3RST))\r
1864 #define __HAL_RCC_UART4_RELEASE_RESET()  (RCC->APB1RSTR &= ~(RCC_APB1RSTR_UART4RST))\r
1865 #define __HAL_RCC_UART5_RELEASE_RESET()  (RCC->APB1RSTR &= ~(RCC_APB1RSTR_UART5RST))\r
1866 #define __HAL_RCC_I2C1_RELEASE_RESET()   (RCC->APB1RSTR &= ~(RCC_APB1RSTR_I2C1RST))\r
1867 #define __HAL_RCC_I2C2_RELEASE_RESET()   (RCC->APB1RSTR &= ~(RCC_APB1RSTR_I2C2RST))\r
1868 #define __HAL_RCC_I2C3_RELEASE_RESET()   (RCC->APB1RSTR &= ~(RCC_APB1RSTR_I2C3RST))\r
1869 #define __HAL_RCC_CAN1_RELEASE_RESET()   (RCC->APB1RSTR &= ~(RCC_APB1RSTR_CAN1RST))\r
1870 #define __HAL_RCC_DAC_RELEASE_RESET()    (RCC->APB1RSTR &= ~(RCC_APB1RSTR_DACRST))\r
1871 #define __HAL_RCC_UART7_RELEASE_RESET()  (RCC->APB1RSTR &= ~(RCC_APB1RSTR_UART7RST))\r
1872 #define __HAL_RCC_UART8_RELEASE_RESET()  (RCC->APB1RSTR &= ~(RCC_APB1RSTR_UART8RST))\r
1873 \r
1874 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) ||\\r
1875     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) ||\\r
1876     defined (STM32F750xx)\r
1877 #define __HAL_RCC_SPDIFRX_FORCE_RESET()  (RCC->APB1RSTR |= (RCC_APB1RSTR_SPDIFRXRST))\r
1878 #define __HAL_RCC_I2C4_FORCE_RESET()     (RCC->APB1RSTR |= (RCC_APB1RSTR_I2C4RST))\r
1879 #define __HAL_RCC_CAN2_FORCE_RESET()     (RCC->APB1RSTR |= (RCC_APB1RSTR_CAN2RST))\r
1880 #define __HAL_RCC_CEC_FORCE_RESET()      (RCC->APB1RSTR |= (RCC_APB1RSTR_CECRST))\r
1881 \r
1882 #define __HAL_RCC_SPDIFRX_RELEASE_RESET()(RCC->APB1RSTR &= ~(RCC_APB1RSTR_SPDIFRXRST))\r
1883 #define __HAL_RCC_I2C4_RELEASE_RESET()   (RCC->APB1RSTR &= ~(RCC_APB1RSTR_I2C4RST))\r
1884 #define __HAL_RCC_CAN2_RELEASE_RESET()   (RCC->APB1RSTR &= ~(RCC_APB1RSTR_CAN2RST))\r
1885 #define __HAL_RCC_CEC_RELEASE_RESET()    (RCC->APB1RSTR &= ~(RCC_APB1RSTR_CECRST))\r
1886 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
1887 \r
1888 /** @brief  Force or release APB2 peripheral reset.\r
1889   */\r
1890 #define __HAL_RCC_TIM1_FORCE_RESET()     (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM1RST))\r
1891 #define __HAL_RCC_TIM8_FORCE_RESET()     (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM8RST))\r
1892 #define __HAL_RCC_USART1_FORCE_RESET()   (RCC->APB2RSTR |= (RCC_APB2RSTR_USART1RST))\r
1893 #define __HAL_RCC_USART6_FORCE_RESET()   (RCC->APB2RSTR |= (RCC_APB2RSTR_USART6RST))\r
1894 #define __HAL_RCC_ADC_FORCE_RESET()      (RCC->APB2RSTR |= (RCC_APB2RSTR_ADCRST))\r
1895 #define __HAL_RCC_SDMMC1_FORCE_RESET()   (RCC->APB2RSTR |= (RCC_APB2RSTR_SDMMC1RST))\r
1896 #define __HAL_RCC_SPI1_FORCE_RESET()     (RCC->APB2RSTR |= (RCC_APB2RSTR_SPI1RST))\r
1897 #define __HAL_RCC_SPI4_FORCE_RESET()     (RCC->APB2RSTR |= (RCC_APB2RSTR_SPI4RST))\r
1898 #define __HAL_RCC_TIM9_FORCE_RESET()     (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM9RST))\r
1899 #define __HAL_RCC_TIM10_FORCE_RESET()    (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM10RST))\r
1900 #define __HAL_RCC_TIM11_FORCE_RESET()    (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM11RST))\r
1901 #define __HAL_RCC_SPI5_FORCE_RESET()     (RCC->APB2RSTR |= (RCC_APB2RSTR_SPI5RST))\r
1902 #define __HAL_RCC_SPI6_FORCE_RESET()     (RCC->APB2RSTR |= (RCC_APB2RSTR_SPI6RST))\r
1903 #define __HAL_RCC_SAI1_FORCE_RESET()     (RCC->APB2RSTR |= (RCC_APB2RSTR_SAI1RST))\r
1904 #define __HAL_RCC_SAI2_FORCE_RESET()     (RCC->APB2RSTR |= (RCC_APB2RSTR_SAI2RST))\r
1905 #if defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F750xx)\r
1906 #define __HAL_RCC_LTDC_FORCE_RESET()     (RCC->APB2RSTR |= (RCC_APB2RSTR_LTDCRST))\r
1907 #endif /* STM32F746xx || STM32F756xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
1908 #if defined (STM32F723xx) || defined (STM32F733xx) || defined (STM32F730xx)\r
1909 #define __HAL_RCC_OTGPHYC_FORCE_RESET()  (RCC->APB2RSTR |= (RCC_APB2RSTR_OTGPHYCRST))\r
1910 #endif /* STM32F723xx || STM32F733xx || STM32F730xx */\r
1911 \r
1912 #define __HAL_RCC_TIM1_RELEASE_RESET()   (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM1RST))\r
1913 #define __HAL_RCC_TIM8_RELEASE_RESET()   (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM8RST))\r
1914 #define __HAL_RCC_USART1_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_USART1RST))\r
1915 #define __HAL_RCC_USART6_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_USART6RST))\r
1916 #define __HAL_RCC_ADC_RELEASE_RESET()    (RCC->APB2RSTR &= ~(RCC_APB2RSTR_ADCRST))\r
1917 #define __HAL_RCC_SDMMC1_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SDMMC1RST))\r
1918 #define __HAL_RCC_SPI1_RELEASE_RESET()   (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SPI1RST))\r
1919 #define __HAL_RCC_SPI4_RELEASE_RESET()   (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SPI4RST))\r
1920 #define __HAL_RCC_TIM9_RELEASE_RESET()   (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM9RST))\r
1921 #define __HAL_RCC_TIM10_RELEASE_RESET()  (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM10RST))\r
1922 #define __HAL_RCC_TIM11_RELEASE_RESET()  (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM11RST))\r
1923 #define __HAL_RCC_SPI5_RELEASE_RESET()   (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SPI5RST))\r
1924 #define __HAL_RCC_SPI6_RELEASE_RESET()   (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SPI6RST))\r
1925 #define __HAL_RCC_SAI1_RELEASE_RESET()   (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SAI1RST))\r
1926 #define __HAL_RCC_SAI2_RELEASE_RESET()   (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SAI2RST))\r
1927 #if defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F750xx)\r
1928 #define __HAL_RCC_LTDC_RELEASE_RESET()   (RCC->APB2RSTR &= ~(RCC_APB2RSTR_LTDCRST))\r
1929 #endif /* STM32F746xx || STM32F756xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
1930 #if defined (STM32F723xx) || defined (STM32F733xx) || defined (STM32F730xx)\r
1931 #define __HAL_RCC_OTGPHYC_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_OTGPHYCRST))\r
1932 #endif /* STM32F723xx || STM32F733xx || STM32F730xx */\r
1933 \r
1934 #if defined (STM32F769xx) || defined (STM32F779xx)\r
1935 #define __HAL_RCC_DSI_FORCE_RESET()      (RCC->APB2RSTR |= (RCC_APB2RSTR_DSIRST))\r
1936 #define __HAL_RCC_DSI_RELEASE_RESET()    (RCC->APB2RSTR &= ~(RCC_APB2RSTR_DSIRST))\r
1937 #endif /* STM32F769xx || STM32F779xx */\r
1938 \r
1939 #if defined (STM32F722xx) || defined (STM32F723xx) || defined (STM32F732xx) || defined (STM32F733xx) || defined (STM32F765xx) ||\\r
1940     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F730xx)\r
1941 #define __HAL_RCC_SDMMC2_FORCE_RESET()   (RCC->APB2RSTR |= (RCC_APB2RSTR_SDMMC2RST))\r
1942 #define __HAL_RCC_SDMMC2_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SDMMC2RST))\r
1943 #endif /* STM32F722xx || STM32F723xx || STM32F732xx || STM32F733xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F730xx */\r
1944 \r
1945 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
1946 #define __HAL_RCC_DFSDM1_FORCE_RESET()    (RCC->APB2RSTR |= (RCC_APB2RSTR_DFSDM1RST))\r
1947 #define __HAL_RCC_MDIO_FORCE_RESET()    (RCC->APB2RSTR |= (RCC_APB2RSTR_MDIORST))\r
1948 #define __HAL_RCC_DFSDM1_RELEASE_RESET()  (RCC->APB2RSTR &= ~(RCC_APB2RSTR_DFSDM1RST))\r
1949 #define __HAL_RCC_MDIO_RELEASE_RESET()  (RCC->APB2RSTR &= ~(RCC_APB2RSTR_MDIORST))\r
1950 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
1951 /**\r
1952   * @}\r
1953   */\r
1954 \r
1955 /** @defgroup RCCEx_Peripheral_Clock_Sleep_Enable_Disable RCCEx Peripheral Clock Sleep Enable Disable\r
1956   * @brief  Enables or disables the AHB/APB peripheral clock during Low Power (Sleep) mode.\r
1957   * @note   Peripheral clock gating in SLEEP mode can be used to further reduce\r
1958   *         power consumption.\r
1959   * @note   After wakeup from SLEEP mode, the peripheral clock is enabled again.\r
1960   * @note   By default, all peripheral clocks are enabled during SLEEP mode.\r
1961   * @{\r
1962   */\r
1963 \r
1964 /** @brief  Enable or disable the AHB1 peripheral clock during Low Power (Sleep) mode.\r
1965   */\r
1966 #define __HAL_RCC_FLITF_CLK_SLEEP_ENABLE()      (RCC->AHB1LPENR |= (RCC_AHB1LPENR_FLITFLPEN))\r
1967 #define __HAL_RCC_AXI_CLK_SLEEP_ENABLE()        (RCC->AHB1LPENR |= (RCC_AHB1LPENR_AXILPEN))\r
1968 #define __HAL_RCC_SRAM1_CLK_SLEEP_ENABLE()      (RCC->AHB1LPENR |= (RCC_AHB1LPENR_SRAM1LPEN))\r
1969 #define __HAL_RCC_SRAM2_CLK_SLEEP_ENABLE()      (RCC->AHB1LPENR |= (RCC_AHB1LPENR_SRAM2LPEN))\r
1970 #define __HAL_RCC_BKPSRAM_CLK_SLEEP_ENABLE()    (RCC->AHB1LPENR |= (RCC_AHB1LPENR_BKPSRAMLPEN))\r
1971 #define __HAL_RCC_DTCM_CLK_SLEEP_ENABLE()       (RCC->AHB1LPENR |= (RCC_AHB1LPENR_DTCMLPEN))\r
1972 #define __HAL_RCC_DMA2_CLK_SLEEP_ENABLE()       (RCC->AHB1LPENR |= (RCC_AHB1LPENR_DMA2LPEN))\r
1973 #define __HAL_RCC_USB_OTG_HS_CLK_SLEEP_ENABLE()      (RCC->AHB1LPENR |= (RCC_AHB1LPENR_OTGHSLPEN))\r
1974 #define __HAL_RCC_USB_OTG_HS_ULPI_CLK_SLEEP_ENABLE() (RCC->AHB1LPENR |= (RCC_AHB1LPENR_OTGHSULPILPEN))\r
1975 #define __HAL_RCC_GPIOA_CLK_SLEEP_ENABLE()      (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOALPEN))\r
1976 #define __HAL_RCC_GPIOB_CLK_SLEEP_ENABLE()      (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOBLPEN))\r
1977 #define __HAL_RCC_GPIOC_CLK_SLEEP_ENABLE()      (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOCLPEN))\r
1978 #define __HAL_RCC_GPIOD_CLK_SLEEP_ENABLE()      (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIODLPEN))\r
1979 #define __HAL_RCC_GPIOE_CLK_SLEEP_ENABLE()      (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOELPEN))\r
1980 #define __HAL_RCC_GPIOF_CLK_SLEEP_ENABLE()      (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOFLPEN))\r
1981 #define __HAL_RCC_GPIOG_CLK_SLEEP_ENABLE()      (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOGLPEN))\r
1982 #define __HAL_RCC_GPIOH_CLK_SLEEP_ENABLE()      (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOHLPEN))\r
1983 #define __HAL_RCC_GPIOI_CLK_SLEEP_ENABLE()      (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOILPEN))\r
1984 \r
1985 #define __HAL_RCC_FLITF_CLK_SLEEP_DISABLE()     (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_FLITFLPEN))\r
1986 #define __HAL_RCC_AXI_CLK_SLEEP_DISABLE()       (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_AXILPEN))\r
1987 #define __HAL_RCC_SRAM1_CLK_SLEEP_DISABLE()     (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_SRAM1LPEN))\r
1988 #define __HAL_RCC_SRAM2_CLK_SLEEP_DISABLE()     (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_SRAM2LPEN))\r
1989 #define __HAL_RCC_BKPSRAM_CLK_SLEEP_DISABLE()   (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_BKPSRAMLPEN))\r
1990 #define __HAL_RCC_DTCM_CLK_SLEEP_DISABLE()      (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_DTCMLPEN))\r
1991 #define __HAL_RCC_DMA2_CLK_SLEEP_DISABLE()      (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_DMA2LPEN))\r
1992 #define __HAL_RCC_USB_OTG_HS_CLK_SLEEP_DISABLE()      (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_OTGHSLPEN))\r
1993 #define __HAL_RCC_USB_OTG_HS_ULPI_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_OTGHSULPILPEN))\r
1994 #define __HAL_RCC_GPIOA_CLK_SLEEP_DISABLE()     (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOALPEN))\r
1995 #define __HAL_RCC_GPIOB_CLK_SLEEP_DISABLE()     (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOBLPEN))\r
1996 #define __HAL_RCC_GPIOC_CLK_SLEEP_DISABLE()     (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOCLPEN))\r
1997 #define __HAL_RCC_GPIOD_CLK_SLEEP_DISABLE()     (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIODLPEN))\r
1998 #define __HAL_RCC_GPIOE_CLK_SLEEP_DISABLE()     (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOELPEN))\r
1999 #define __HAL_RCC_GPIOF_CLK_SLEEP_DISABLE()     (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOFLPEN))\r
2000 #define __HAL_RCC_GPIOG_CLK_SLEEP_DISABLE()     (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOGLPEN))\r
2001 #define __HAL_RCC_GPIOH_CLK_SLEEP_DISABLE()     (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOHLPEN))\r
2002 #define __HAL_RCC_GPIOI_CLK_SLEEP_DISABLE()     (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOILPEN))\r
2003 \r
2004 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) ||\\r
2005     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) ||\\r
2006     defined (STM32F750xx)\r
2007 #define __HAL_RCC_DMA2D_CLK_SLEEP_ENABLE()      (RCC->AHB1LPENR |= (RCC_AHB1LPENR_DMA2DLPEN))\r
2008 #define __HAL_RCC_ETHMAC_CLK_SLEEP_ENABLE()     (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ETHMACLPEN))\r
2009 #define __HAL_RCC_ETHMACTX_CLK_SLEEP_ENABLE()   (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ETHMACTXLPEN))\r
2010 #define __HAL_RCC_ETHMACRX_CLK_SLEEP_ENABLE()   (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ETHMACRXLPEN))\r
2011 #define __HAL_RCC_ETHMACPTP_CLK_SLEEP_ENABLE()  (RCC->AHB1LPENR |= (RCC_AHB1LPENR_ETHMACPTPLPEN))\r
2012 #define __HAL_RCC_GPIOJ_CLK_SLEEP_ENABLE()      (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOJLPEN))\r
2013 #define __HAL_RCC_GPIOK_CLK_SLEEP_ENABLE()      (RCC->AHB1LPENR |= (RCC_AHB1LPENR_GPIOKLPEN))\r
2014 \r
2015 #define __HAL_RCC_DMA2D_CLK_SLEEP_DISABLE()     (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_DMA2DLPEN))\r
2016 #define __HAL_RCC_ETHMAC_CLK_SLEEP_DISABLE()    (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_ETHMACLPEN))\r
2017 #define __HAL_RCC_ETHMACTX_CLK_SLEEP_DISABLE()  (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_ETHMACTXLPEN))\r
2018 #define __HAL_RCC_ETHMACRX_CLK_SLEEP_DISABLE()  (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_ETHMACRXLPEN))\r
2019 #define __HAL_RCC_ETHMACPTP_CLK_SLEEP_DISABLE() (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_ETHMACPTPLPEN))\r
2020 #define __HAL_RCC_GPIOJ_CLK_SLEEP_DISABLE()     (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOJLPEN))\r
2021 #define __HAL_RCC_GPIOK_CLK_SLEEP_DISABLE()     (RCC->AHB1LPENR &= ~(RCC_AHB1LPENR_GPIOKLPEN))\r
2022 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
2023 \r
2024 /** @brief  Enable or disable the AHB2 peripheral clock during Low Power (Sleep) mode.\r
2025   * @note   Peripheral clock gating in SLEEP mode can be used to further reduce\r
2026   *         power consumption.\r
2027   * @note   After wakeup from SLEEP mode, the peripheral clock is enabled again.\r
2028   * @note   By default, all peripheral clocks are enabled during SLEEP mode.\r
2029   */\r
2030 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) ||\\r
2031     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) ||\\r
2032     defined (STM32F750xx)\r
2033 #define __HAL_RCC_DCMI_CLK_SLEEP_ENABLE()        (RCC->AHB2LPENR |= (RCC_AHB2LPENR_DCMILPEN))\r
2034 #define __HAL_RCC_DCMI_CLK_SLEEP_DISABLE()       (RCC->AHB2LPENR &= ~(RCC_AHB2LPENR_DCMILPEN))\r
2035 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
2036 \r
2037 #if defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
2038 #define __HAL_RCC_JPEG_CLK_SLEEP_ENABLE()        (RCC->AHB2LPENR |= (RCC_AHB2LPENR_JPEGLPEN))\r
2039 #define __HAL_RCC_JPEG_CLK_SLEEP_DISABLE()       (RCC->AHB2LPENR &= ~(RCC_AHB2LPENR_JPEGLPEN))\r
2040 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
2041 \r
2042 #define __HAL_RCC_RNG_CLK_SLEEP_ENABLE()         (RCC->AHB2LPENR |= (RCC_AHB2LPENR_RNGLPEN))\r
2043 #define __HAL_RCC_RNG_CLK_SLEEP_DISABLE()        (RCC->AHB2LPENR &= ~(RCC_AHB2LPENR_RNGLPEN))\r
2044 \r
2045 #define __HAL_RCC_USB_OTG_FS_CLK_SLEEP_ENABLE()  (RCC->AHB2LPENR |= (RCC_AHB2LPENR_OTGFSLPEN))\r
2046 #define __HAL_RCC_USB_OTG_FS_CLK_SLEEP_DISABLE() (RCC->AHB2LPENR &= ~(RCC_AHB2LPENR_OTGFSLPEN))\r
2047 \r
2048 #if defined(STM32F756xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F750xx)\r
2049 #define __HAL_RCC_CRYP_CLK_SLEEP_ENABLE()        (RCC->AHB2LPENR |= (RCC_AHB2LPENR_CRYPLPEN))\r
2050 #define __HAL_RCC_HASH_CLK_SLEEP_ENABLE()        (RCC->AHB2LPENR |= (RCC_AHB2LPENR_HASHLPEN))\r
2051 \r
2052 #define __HAL_RCC_CRYP_CLK_SLEEP_DISABLE()       (RCC->AHB2LPENR &= ~(RCC_AHB2LPENR_CRYPLPEN))\r
2053 #define __HAL_RCC_HASH_CLK_SLEEP_DISABLE()       (RCC->AHB2LPENR &= ~(RCC_AHB2LPENR_HASHLPEN))\r
2054 #endif /* STM32F756xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
2055 \r
2056 #if defined(STM32F732xx) || defined (STM32F733xx) || defined (STM32F730xx)\r
2057 #define __HAL_RCC_AES_CLK_SLEEP_ENABLE()        (RCC->AHB2LPENR |= (RCC_AHB2LPENR_AESLPEN))\r
2058 #define __HAL_RCC_AES_CLK_SLEEP_DISABLE()       (RCC->AHB2LPENR &= ~(RCC_AHB2LPENR_AESLPEN))\r
2059 #endif /* STM32F732xx || STM32F733xx || STM32F730xx */\r
2060 \r
2061 /** @brief  Enable or disable the AHB3 peripheral clock during Low Power (Sleep) mode.\r
2062   * @note   Peripheral clock gating in SLEEP mode can be used to further reduce\r
2063   *         power consumption.\r
2064   * @note   After wakeup from SLEEP mode, the peripheral clock is enabled again.\r
2065   * @note   By default, all peripheral clocks are enabled during SLEEP mode.\r
2066   */\r
2067 #define __HAL_RCC_FMC_CLK_SLEEP_ENABLE()  (RCC->AHB3LPENR |= (RCC_AHB3LPENR_FMCLPEN))\r
2068 #define __HAL_RCC_FMC_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~(RCC_AHB3LPENR_FMCLPEN))\r
2069 \r
2070 #define __HAL_RCC_QSPI_CLK_SLEEP_ENABLE()  (RCC->AHB3LPENR |= (RCC_AHB3LPENR_QSPILPEN))\r
2071 #define __HAL_RCC_QSPI_CLK_SLEEP_DISABLE() (RCC->AHB3LPENR &= ~(RCC_AHB3LPENR_QSPILPEN))\r
2072 \r
2073 /** @brief  Enable or disable the APB1 peripheral clock during Low Power (Sleep) mode.\r
2074   * @note   Peripheral clock gating in SLEEP mode can be used to further reduce\r
2075   *         power consumption.\r
2076   * @note   After wakeup from SLEEP mode, the peripheral clock is enabled again.\r
2077   * @note   By default, all peripheral clocks are enabled during SLEEP mode.\r
2078   */\r
2079 #define __HAL_RCC_TIM2_CLK_SLEEP_ENABLE()    (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM2LPEN))\r
2080 #define __HAL_RCC_TIM3_CLK_SLEEP_ENABLE()    (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM3LPEN))\r
2081 #define __HAL_RCC_TIM4_CLK_SLEEP_ENABLE()    (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM4LPEN))\r
2082 #define __HAL_RCC_TIM5_CLK_SLEEP_ENABLE()    (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM5LPEN))\r
2083 #define __HAL_RCC_TIM6_CLK_SLEEP_ENABLE()    (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM6LPEN))\r
2084 #define __HAL_RCC_TIM7_CLK_SLEEP_ENABLE()    (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM7LPEN))\r
2085 #define __HAL_RCC_TIM12_CLK_SLEEP_ENABLE()   (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM12LPEN))\r
2086 #define __HAL_RCC_TIM13_CLK_SLEEP_ENABLE()   (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM13LPEN))\r
2087 #define __HAL_RCC_TIM14_CLK_SLEEP_ENABLE()   (RCC->APB1LPENR |= (RCC_APB1LPENR_TIM14LPEN))\r
2088 #define __HAL_RCC_LPTIM1_CLK_SLEEP_ENABLE()  (RCC->APB1LPENR |= (RCC_APB1LPENR_LPTIM1LPEN))\r
2089 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
2090 #define __HAL_RCC_CAN3_CLK_SLEEP_ENABLE()    (RCC->APB1LPENR |= (RCC_APB1LPENR_CAN3LPEN))\r
2091 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
2092 #define __HAL_RCC_SPI2_CLK_SLEEP_ENABLE()    (RCC->APB1LPENR |= (RCC_APB1LPENR_SPI2LPEN))\r
2093 #define __HAL_RCC_SPI3_CLK_SLEEP_ENABLE()    (RCC->APB1LPENR |= (RCC_APB1LPENR_SPI3LPEN))\r
2094 #define __HAL_RCC_USART2_CLK_SLEEP_ENABLE()  (RCC->APB1LPENR |= (RCC_APB1LPENR_USART2LPEN))\r
2095 #define __HAL_RCC_USART3_CLK_SLEEP_ENABLE()  (RCC->APB1LPENR |= (RCC_APB1LPENR_USART3LPEN))\r
2096 #define __HAL_RCC_UART4_CLK_SLEEP_ENABLE()   (RCC->APB1LPENR |= (RCC_APB1LPENR_UART4LPEN))\r
2097 #define __HAL_RCC_UART5_CLK_SLEEP_ENABLE()   (RCC->APB1LPENR |= (RCC_APB1LPENR_UART5LPEN))\r
2098 #define __HAL_RCC_I2C1_CLK_SLEEP_ENABLE()    (RCC->APB1LPENR |= (RCC_APB1LPENR_I2C1LPEN))\r
2099 #define __HAL_RCC_I2C2_CLK_SLEEP_ENABLE()    (RCC->APB1LPENR |= (RCC_APB1LPENR_I2C2LPEN))\r
2100 #define __HAL_RCC_I2C3_CLK_SLEEP_ENABLE()    (RCC->APB1LPENR |= (RCC_APB1LPENR_I2C3LPEN))\r
2101 #define __HAL_RCC_CAN1_CLK_SLEEP_ENABLE()    (RCC->APB1LPENR |= (RCC_APB1LPENR_CAN1LPEN))\r
2102 #define __HAL_RCC_DAC_CLK_SLEEP_ENABLE()     (RCC->APB1LPENR |= (RCC_APB1LPENR_DACLPEN))\r
2103 #define __HAL_RCC_UART7_CLK_SLEEP_ENABLE()   (RCC->APB1LPENR |= (RCC_APB1LPENR_UART7LPEN))\r
2104 #define __HAL_RCC_UART8_CLK_SLEEP_ENABLE()   (RCC->APB1LPENR |= (RCC_APB1LPENR_UART8LPEN))\r
2105 \r
2106 #define __HAL_RCC_TIM2_CLK_SLEEP_DISABLE()   (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM2LPEN))\r
2107 #define __HAL_RCC_TIM3_CLK_SLEEP_DISABLE()   (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM3LPEN))\r
2108 #define __HAL_RCC_TIM4_CLK_SLEEP_DISABLE()   (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM4LPEN))\r
2109 #define __HAL_RCC_TIM5_CLK_SLEEP_DISABLE()   (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM5LPEN))\r
2110 #define __HAL_RCC_TIM6_CLK_SLEEP_DISABLE()   (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM6LPEN))\r
2111 #define __HAL_RCC_TIM7_CLK_SLEEP_DISABLE()   (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM7LPEN))\r
2112 #define __HAL_RCC_TIM12_CLK_SLEEP_DISABLE()  (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM12LPEN))\r
2113 #define __HAL_RCC_TIM13_CLK_SLEEP_DISABLE()  (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM13LPEN))\r
2114 #define __HAL_RCC_TIM14_CLK_SLEEP_DISABLE()  (RCC->APB1LPENR &= ~(RCC_APB1LPENR_TIM14LPEN))\r
2115 #define __HAL_RCC_LPTIM1_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_LPTIM1LPEN))\r
2116 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
2117 #define __HAL_RCC_CAN3_CLK_SLEEP_DISABLE()   (RCC->APB1LPENR &= ~(RCC_APB1LPENR_CAN3LPEN))\r
2118 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
2119 #define __HAL_RCC_SPI2_CLK_SLEEP_DISABLE()   (RCC->APB1LPENR &= ~(RCC_APB1LPENR_SPI2LPEN))\r
2120 #define __HAL_RCC_SPI3_CLK_SLEEP_DISABLE()   (RCC->APB1LPENR &= ~(RCC_APB1LPENR_SPI3LPEN))\r
2121 #define __HAL_RCC_USART2_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_USART2LPEN))\r
2122 #define __HAL_RCC_USART3_CLK_SLEEP_DISABLE() (RCC->APB1LPENR &= ~(RCC_APB1LPENR_USART3LPEN))\r
2123 #define __HAL_RCC_UART4_CLK_SLEEP_DISABLE()  (RCC->APB1LPENR &= ~(RCC_APB1LPENR_UART4LPEN))\r
2124 #define __HAL_RCC_UART5_CLK_SLEEP_DISABLE()  (RCC->APB1LPENR &= ~(RCC_APB1LPENR_UART5LPEN))\r
2125 #define __HAL_RCC_I2C1_CLK_SLEEP_DISABLE()   (RCC->APB1LPENR &= ~(RCC_APB1LPENR_I2C1LPEN))\r
2126 #define __HAL_RCC_I2C2_CLK_SLEEP_DISABLE()   (RCC->APB1LPENR &= ~(RCC_APB1LPENR_I2C2LPEN))\r
2127 #define __HAL_RCC_I2C3_CLK_SLEEP_DISABLE()   (RCC->APB1LPENR &= ~(RCC_APB1LPENR_I2C3LPEN))\r
2128 #define __HAL_RCC_CAN1_CLK_SLEEP_DISABLE()   (RCC->APB1LPENR &= ~(RCC_APB1LPENR_CAN1LPEN))\r
2129 #define __HAL_RCC_DAC_CLK_SLEEP_DISABLE()    (RCC->APB1LPENR &= ~(RCC_APB1LPENR_DACLPEN))\r
2130 #define __HAL_RCC_UART7_CLK_SLEEP_DISABLE()  (RCC->APB1LPENR &= ~(RCC_APB1LPENR_UART7LPEN))\r
2131 #define __HAL_RCC_UART8_CLK_SLEEP_DISABLE()  (RCC->APB1LPENR &= ~(RCC_APB1LPENR_UART8LPEN))\r
2132 \r
2133 #if defined (STM32F722xx) || defined (STM32F723xx) || defined (STM32F732xx) || defined (STM32F733xx) ||\\r
2134     defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) ||\\r
2135     defined (STM32F779xx) || defined (STM32F730xx)\r
2136 #define __HAL_RCC_RTC_CLK_SLEEP_ENABLE()     (RCC->APB1LPENR |= (RCC_APB1LPENR_RTCLPEN))\r
2137 #define __HAL_RCC_RTC_CLK_SLEEP_DISABLE()    (RCC->APB1LPENR &= ~(RCC_APB1LPENR_RTCLPEN))\r
2138 #endif /* STM32F722xx || STM32F723xx || STM32F732xx || STM32F733xx || STM32F765xx || STM32F767xx ||\r
2139           STM32F769xx || STM32F777xx || STM32F779xx || STM32F730xx */\r
2140 \r
2141 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) ||\\r
2142     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) ||\\r
2143     defined (STM32F750xx)\r
2144 #define __HAL_RCC_SPDIFRX_CLK_SLEEP_ENABLE() (RCC->APB1LPENR |= (RCC_APB1LPENR_SPDIFRXLPEN))\r
2145 #define __HAL_RCC_I2C4_CLK_SLEEP_ENABLE()    (RCC->APB1LPENR |= (RCC_APB1LPENR_I2C4LPEN))\r
2146 #define __HAL_RCC_CAN2_CLK_SLEEP_ENABLE()    (RCC->APB1LPENR |= (RCC_APB1LPENR_CAN2LPEN))\r
2147 #define __HAL_RCC_CEC_CLK_SLEEP_ENABLE()     (RCC->APB1LPENR |= (RCC_APB1LPENR_CECLPEN))\r
2148 \r
2149 #define __HAL_RCC_SPDIFRX_CLK_SLEEP_DISABLE()(RCC->APB1LPENR &= ~(RCC_APB1LPENR_SPDIFRXLPEN))\r
2150 #define __HAL_RCC_I2C4_CLK_SLEEP_DISABLE()   (RCC->APB1LPENR &= ~(RCC_APB1LPENR_I2C4LPEN))\r
2151 #define __HAL_RCC_CAN2_CLK_SLEEP_DISABLE()   (RCC->APB1LPENR &= ~(RCC_APB1LPENR_CAN2LPEN))\r
2152 #define __HAL_RCC_CEC_CLK_SLEEP_DISABLE()    (RCC->APB1LPENR &= ~(RCC_APB1LPENR_CECLPEN))\r
2153 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
2154 \r
2155 /** @brief  Enable or disable the APB2 peripheral clock during Low Power (Sleep) mode.\r
2156   * @note   Peripheral clock gating in SLEEP mode can be used to further reduce\r
2157   *         power consumption.\r
2158   * @note   After wakeup from SLEEP mode, the peripheral clock is enabled again.\r
2159   * @note   By default, all peripheral clocks are enabled during SLEEP mode.\r
2160   */\r
2161 #define __HAL_RCC_TIM1_CLK_SLEEP_ENABLE()    (RCC->APB2LPENR |= (RCC_APB2LPENR_TIM1LPEN))\r
2162 #define __HAL_RCC_TIM8_CLK_SLEEP_ENABLE()    (RCC->APB2LPENR |= (RCC_APB2LPENR_TIM8LPEN))\r
2163 #define __HAL_RCC_USART1_CLK_SLEEP_ENABLE()  (RCC->APB2LPENR |= (RCC_APB2LPENR_USART1LPEN))\r
2164 #define __HAL_RCC_USART6_CLK_SLEEP_ENABLE()  (RCC->APB2LPENR |= (RCC_APB2LPENR_USART6LPEN))\r
2165 #define __HAL_RCC_ADC1_CLK_SLEEP_ENABLE()    (RCC->APB2LPENR |= (RCC_APB2LPENR_ADC1LPEN))\r
2166 #define __HAL_RCC_ADC2_CLK_SLEEP_ENABLE()    (RCC->APB2LPENR |= (RCC_APB2LPENR_ADC2LPEN))\r
2167 #define __HAL_RCC_ADC3_CLK_SLEEP_ENABLE()    (RCC->APB2LPENR |= (RCC_APB2LPENR_ADC3LPEN))\r
2168 #define __HAL_RCC_SDMMC1_CLK_SLEEP_ENABLE()  (RCC->APB2LPENR |= (RCC_APB2LPENR_SDMMC1LPEN))\r
2169 #define __HAL_RCC_SPI1_CLK_SLEEP_ENABLE()    (RCC->APB2LPENR |= (RCC_APB2LPENR_SPI1LPEN))\r
2170 #define __HAL_RCC_SPI4_CLK_SLEEP_ENABLE()    (RCC->APB2LPENR |= (RCC_APB2LPENR_SPI4LPEN))\r
2171 #define __HAL_RCC_TIM9_CLK_SLEEP_ENABLE()    (RCC->APB2LPENR |= (RCC_APB2LPENR_TIM9LPEN))\r
2172 #define __HAL_RCC_TIM10_CLK_SLEEP_ENABLE()   (RCC->APB2LPENR |= (RCC_APB2LPENR_TIM10LPEN))\r
2173 #define __HAL_RCC_TIM11_CLK_SLEEP_ENABLE()   (RCC->APB2LPENR |= (RCC_APB2LPENR_TIM11LPEN))\r
2174 #define __HAL_RCC_SPI5_CLK_SLEEP_ENABLE()    (RCC->APB2LPENR |= (RCC_APB2LPENR_SPI5LPEN))\r
2175 #define __HAL_RCC_SAI1_CLK_SLEEP_ENABLE()    (RCC->APB2LPENR |= (RCC_APB2LPENR_SAI1LPEN))\r
2176 #define __HAL_RCC_SAI2_CLK_SLEEP_ENABLE()    (RCC->APB2LPENR |= (RCC_APB2LPENR_SAI2LPEN))\r
2177 #if defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F750xx)\r
2178 #define __HAL_RCC_LTDC_CLK_SLEEP_ENABLE()    (RCC->APB2LPENR |= (RCC_APB2LPENR_LTDCLPEN))\r
2179 #endif /* STM32F746xx || STM32F756xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
2180 \r
2181 #define __HAL_RCC_TIM1_CLK_SLEEP_DISABLE()   (RCC->APB2LPENR &= ~(RCC_APB2LPENR_TIM1LPEN))\r
2182 #define __HAL_RCC_TIM8_CLK_SLEEP_DISABLE()   (RCC->APB2LPENR &= ~(RCC_APB2LPENR_TIM8LPEN))\r
2183 #define __HAL_RCC_USART1_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_USART1LPEN))\r
2184 #define __HAL_RCC_USART6_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_USART6LPEN))\r
2185 #define __HAL_RCC_ADC1_CLK_SLEEP_DISABLE()   (RCC->APB2LPENR &= ~(RCC_APB2LPENR_ADC1LPEN))\r
2186 #define __HAL_RCC_ADC2_CLK_SLEEP_DISABLE()   (RCC->APB2LPENR &= ~(RCC_APB2LPENR_ADC2LPEN))\r
2187 #define __HAL_RCC_ADC3_CLK_SLEEP_DISABLE()   (RCC->APB2LPENR &= ~(RCC_APB2LPENR_ADC3LPEN))\r
2188 #define __HAL_RCC_SDMMC1_CLK_SLEEP_DISABLE()  (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SDMMC1LPEN))\r
2189 #define __HAL_RCC_SPI1_CLK_SLEEP_DISABLE()   (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SPI1LPEN))\r
2190 #define __HAL_RCC_SPI4_CLK_SLEEP_DISABLE()   (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SPI4LPEN))\r
2191 #define __HAL_RCC_TIM9_CLK_SLEEP_DISABLE()   (RCC->APB2LPENR &= ~(RCC_APB2LPENR_TIM9LPEN))\r
2192 #define __HAL_RCC_TIM10_CLK_SLEEP_DISABLE()  (RCC->APB2LPENR &= ~(RCC_APB2LPENR_TIM10LPEN))\r
2193 #define __HAL_RCC_TIM11_CLK_SLEEP_DISABLE()  (RCC->APB2LPENR &= ~(RCC_APB2LPENR_TIM11LPEN))\r
2194 #define __HAL_RCC_SPI5_CLK_SLEEP_DISABLE()   (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SPI5LPEN))\r
2195 #define __HAL_RCC_SAI1_CLK_SLEEP_DISABLE()   (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SAI1LPEN))\r
2196 #define __HAL_RCC_SAI2_CLK_SLEEP_DISABLE()   (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SAI2LPEN))\r
2197 #if defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)|| defined (STM32F750xx)\r
2198 #define __HAL_RCC_LTDC_CLK_SLEEP_DISABLE()   (RCC->APB2LPENR &= ~(RCC_APB2LPENR_LTDCLPEN))\r
2199 #endif /* STM32F746xx || STM32F756xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx  */\r
2200 #if defined (STM32F769xx) || defined (STM32F779xx)\r
2201 #define __HAL_RCC_DSI_CLK_SLEEP_ENABLE()     (RCC->APB2LPENR |= (RCC_APB2LPENR_DSILPEN))\r
2202 #define __HAL_RCC_DSI_CLK_SLEEP_DISABLE()    (RCC->APB2LPENR &= ~(RCC_APB2LPENR_DSILPEN))\r
2203 #endif /* STM32F769xx || STM32F779xx */\r
2204 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
2205 #define __HAL_RCC_DFSDM1_CLK_SLEEP_ENABLE()   (RCC->APB2LPENR |= (RCC_APB2LPENR_DFSDM1LPEN))\r
2206 #define __HAL_RCC_MDIO_CLK_SLEEP_ENABLE()    (RCC->APB2LPENR |= (RCC_APB2LPENR_MDIOLPEN))\r
2207 #define __HAL_RCC_DFSDM1_CLK_SLEEP_DISABLE()  (RCC->APB2LPENR &= ~(RCC_APB2LPENR_DFSDM1LPEN))\r
2208 #define __HAL_RCC_MDIO_CLK_SLEEP_DISABLE()   (RCC->APB2LPENR &= ~(RCC_APB2LPENR_MDIOLPEN))\r
2209 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
2210 #if defined (STM32F722xx) || defined (STM32F723xx) || defined (STM32F732xx) || defined (STM32F733xx) || defined (STM32F765xx) ||\\r
2211     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F730xx)\r
2212 #define __HAL_RCC_SDMMC2_CLK_SLEEP_ENABLE()  (RCC->APB2LPENR |= (RCC_APB2LPENR_SDMMC2LPEN))\r
2213 #define __HAL_RCC_SDMMC2_CLK_SLEEP_DISABLE() (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SDMMC2LPEN))\r
2214 #endif /* STM32F722xx || STM32F723xx || STM32F732xx || STM32F733xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F730xx */\r
2215 \r
2216 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) ||\\r
2217     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) ||\\r
2218     defined (STM32F750xx)\r
2219 #define __HAL_RCC_SPI6_CLK_SLEEP_ENABLE()    (RCC->APB2LPENR |= (RCC_APB2LPENR_SPI6LPEN))\r
2220 #define __HAL_RCC_SPI6_CLK_SLEEP_DISABLE()   (RCC->APB2LPENR &= ~(RCC_APB2LPENR_SPI6LPEN))\r
2221 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
2222 /**\r
2223   * @}\r
2224   */\r
2225 \r
2226 /** @defgroup RCC_Clock_Sleep_Enable_Disable_Status AHB/APB Peripheral Clock Sleep Enable Disable Status\r
2227   * @brief  Get the enable or disable status of the AHB/APB peripheral clock during Low Power (Sleep) mode.\r
2228   * @note   Peripheral clock gating in SLEEP mode can be used to further reduce\r
2229   *         power consumption.\r
2230   * @note   After wakeup from SLEEP mode, the peripheral clock is enabled again.\r
2231   * @note   By default, all peripheral clocks are enabled during SLEEP mode.\r
2232   * @{\r
2233   */\r
2234 \r
2235 /** @brief  Get the enable or disable status of the AHB1 peripheral clock during Low Power (Sleep) mode.\r
2236   * @note   Peripheral clock gating in SLEEP mode can be used to further reduce\r
2237   *         power consumption.\r
2238   * @note   After wakeup from SLEEP mode, the peripheral clock is enabled again.\r
2239   * @note   By default, all peripheral clocks are enabled during SLEEP mode.\r
2240   */\r
2241 #define __HAL_RCC_FLITF_IS_CLK_SLEEP_ENABLED()      ((RCC->AHB1LPENR & (RCC_AHB1LPENR_FLITFLPEN)) != RESET)\r
2242 #define __HAL_RCC_AXI_IS_CLK_SLEEP_ENABLED()        ((RCC->AHB1LPENR & (RCC_AHB1LPENR_AXILPEN)) != RESET)\r
2243 #define __HAL_RCC_SRAM1_IS_CLK_SLEEP_ENABLED()      ((RCC->AHB1LPENR & (RCC_AHB1LPENR_SRAM1LPEN)) != RESET)\r
2244 #define __HAL_RCC_SRAM2_IS_CLK_SLEEP_ENABLED()      ((RCC->AHB1LPENR & (RCC_AHB1LPENR_SRAM2LPEN)) != RESET)\r
2245 #define __HAL_RCC_BKPSRAM_IS_CLK_SLEEP_ENABLED()    ((RCC->AHB1LPENR & (RCC_AHB1LPENR_BKPSRAMLPEN)) != RESET)\r
2246 #define __HAL_RCC_DTCM_IS_CLK_SLEEP_ENABLED()       ((RCC->AHB1LPENR & (RCC_AHB1LPENR_DTCMLPEN)) != RESET)\r
2247 #define __HAL_RCC_DMA2_IS_CLK_SLEEP_ENABLED()       ((RCC->AHB1LPENR & (RCC_AHB1LPENR_DMA2LPEN)) != RESET)\r
2248 #define __HAL_RCC_USB_OTG_HS_IS_CLK_SLEEP_ENABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_OTGHSLPEN)) != RESET)\r
2249 #define __HAL_RCC_USB_OTG_HS_ULPI_IS_CLK_SLEEP_ENABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_OTGHSULPILPEN)) != RESET)\r
2250 #define __HAL_RCC_GPIOA_IS_CLK_SLEEP_ENABLED()      ((RCC->AHB1LPENR & (RCC_AHB1LPENR_GPIOALPEN)) != RESET)\r
2251 #define __HAL_RCC_GPIOB_IS_CLK_SLEEP_ENABLED()      ((RCC->AHB1LPENR & (RCC_AHB1LPENR_GPIOBLPEN)) != RESET)\r
2252 #define __HAL_RCC_GPIOC_IS_CLK_SLEEP_ENABLED()      ((RCC->AHB1LPENR & (RCC_AHB1LPENR_GPIOCLPEN)) != RESET)\r
2253 #define __HAL_RCC_GPIOD_IS_CLK_SLEEP_ENABLED()      ((RCC->AHB1LPENR & (RCC_AHB1LPENR_GPIODLPEN)) != RESET)\r
2254 #define __HAL_RCC_GPIOE_IS_CLK_SLEEP_ENABLED()      ((RCC->AHB1LPENR & (RCC_AHB1LPENR_GPIOELPEN)) != RESET)\r
2255 #define __HAL_RCC_GPIOF_IS_CLK_SLEEP_ENABLED()      ((RCC->AHB1LPENR & (RCC_AHB1LPENR_GPIOFLPEN)) != RESET)\r
2256 #define __HAL_RCC_GPIOG_IS_CLK_SLEEP_ENABLED()      ((RCC->AHB1LPENR & (RCC_AHB1LPENR_GPIOGLPEN)) != RESET)\r
2257 #define __HAL_RCC_GPIOH_IS_CLK_SLEEP_ENABLED()      ((RCC->AHB1LPENR & (RCC_AHB1LPENR_GPIOHLPEN)) != RESET)\r
2258 #define __HAL_RCC_GPIOI_IS_CLK_SLEEP_ENABLED()      ((RCC->AHB1LPENR & (RCC_AHB1LPENR_GPIOILPEN)) != RESET)\r
2259 \r
2260 #define __HAL_RCC_FLITF_IS_CLK_SLEEP_DISABLED()     ((RCC->AHB1LPENR & (RCC_AHB1LPENR_FLITFLPEN)) == RESET)\r
2261 #define __HAL_RCC_AXI_IS_CLK_SLEEP_DISABLED()       ((RCC->AHB1LPENR & (RCC_AHB1LPENR_AXILPEN)) == RESET)\r
2262 #define __HAL_RCC_SRAM1_IS_CLK_SLEEP_DISABLED()     ((RCC->AHB1LPENR & (RCC_AHB1LPENR_SRAM1LPEN)) == RESET)\r
2263 #define __HAL_RCC_SRAM2_IS_CLK_SLEEP_DISABLED()     ((RCC->AHB1LPENR & (RCC_AHB1LPENR_SRAM2LPEN)) == RESET)\r
2264 #define __HAL_RCC_BKPSRAM_IS_CLK_SLEEP_DISABLED()   ((RCC->AHB1LPENR & (RCC_AHB1LPENR_BKPSRAMLPEN)) == RESET)\r
2265 #define __HAL_RCC_DTCM_IS_CLK_SLEEP_DISABLED()      ((RCC->AHB1LPENR & (RCC_AHB1LPENR_DTCMLPEN)) == RESET)\r
2266 #define __HAL_RCC_DMA2_IS_CLK_SLEEP_DISABLED()      ((RCC->AHB1LPENR & (RCC_AHB1LPENR_DMA2LPEN)) == RESET)\r
2267 #define __HAL_RCC_USB_OTG_HS_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_OTGHSLPEN)) == RESET)\r
2268 #define __HAL_RCC_USB_OTG_HS_ULPI_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_OTGHSULPILPEN)) == RESET)\r
2269 #define __HAL_RCC_GPIOA_IS_CLK_SLEEP_DISABLED()     ((RCC->AHB1LPENR & (RCC_AHB1LPENR_GPIOALPEN)) == RESET)\r
2270 #define __HAL_RCC_GPIOB_IS_CLK_SLEEP_DISABLED()     ((RCC->AHB1LPENR & (RCC_AHB1LPENR_GPIOBLPEN)) == RESET)\r
2271 #define __HAL_RCC_GPIOC_IS_CLK_SLEEP_DISABLED()     ((RCC->AHB1LPENR & (RCC_AHB1LPENR_GPIOCLPEN)) == RESET)\r
2272 #define __HAL_RCC_GPIOD_IS_CLK_SLEEP_DISABLED()     ((RCC->AHB1LPENR & (RCC_AHB1LPENR_GPIODLPEN)) == RESET)\r
2273 #define __HAL_RCC_GPIOE_IS_CLK_SLEEP_DISABLED()     ((RCC->AHB1LPENR & (RCC_AHB1LPENR_GPIOELPEN)) == RESET)\r
2274 #define __HAL_RCC_GPIOF_IS_CLK_SLEEP_DISABLED()     ((RCC->AHB1LPENR & (RCC_AHB1LPENR_GPIOFLPEN)) == RESET)\r
2275 #define __HAL_RCC_GPIOG_IS_CLK_SLEEP_DISABLED()     ((RCC->AHB1LPENR & (RCC_AHB1LPENR_GPIOGLPEN)) == RESET)\r
2276 #define __HAL_RCC_GPIOH_IS_CLK_SLEEP_DISABLED()     ((RCC->AHB1LPENR & (RCC_AHB1LPENR_GPIOHLPEN)) == RESET)\r
2277 #define __HAL_RCC_GPIOI_IS_CLK_SLEEP_DISABLED()     ((RCC->AHB1LPENR & (RCC_AHB1LPENR_GPIOILPEN)) == RESET)\r
2278 \r
2279 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) ||\\r
2280     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) ||\\r
2281     defined (STM32F750xx)\r
2282 #define __HAL_RCC_DMA2D_IS_CLK_SLEEP_ENABLED()      ((RCC->AHB1LPENR & (RCC_AHB1LPENR_DMA2DLPEN)) != RESET)\r
2283 #define __HAL_RCC_ETHMAC_IS_CLK_SLEEP_ENABLED()     ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ETHMACLPEN)) != RESET)\r
2284 #define __HAL_RCC_ETHMACTX_IS_CLK_SLEEP_ENABLED()   ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ETHMACTXLPEN)) != RESET)\r
2285 #define __HAL_RCC_ETHMACRX_IS_CLK_SLEEP_ENABLED()   ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ETHMACRXLPEN)) != RESET)\r
2286 #define __HAL_RCC_ETHMACPTP_IS_CLK_SLEEP_ENABLED()  ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ETHMACPTPLPEN)) != RESET)\r
2287 #define __HAL_RCC_GPIOJ_IS_CLK_SLEEP_ENABLED()      ((RCC->AHB1LPENR & (RCC_AHB1LPENR_GPIOJLPEN)) != RESET)\r
2288 #define __HAL_RCC_GPIOK_IS_CLK_SLEEP_ENABLED()      ((RCC->AHB1LPENR & (RCC_AHB1LPENR_GPIOKLPEN)) != RESET)\r
2289 \r
2290 #define __HAL_RCC_DMA2D_IS_CLK_SLEEP_DISABLED()     ((RCC->AHB1LPENR & (RCC_AHB1LPENR_DMA2DLPEN)) == RESET)\r
2291 #define __HAL_RCC_ETHMAC_IS_CLK_SLEEP_DISABLED()    ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ETHMACLPEN)) == RESET)\r
2292 #define __HAL_RCC_ETHMACTX_IS_CLK_SLEEP_DISABLED()  ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ETHMACTXLPEN)) == RESET)\r
2293 #define __HAL_RCC_ETHMACRX_IS_CLK_SLEEP_DISABLED()  ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ETHMACRXLPEN)) == RESET)\r
2294 #define __HAL_RCC_ETHMACPTP_IS_CLK_SLEEP_DISABLED() ((RCC->AHB1LPENR & (RCC_AHB1LPENR_ETHMACPTPLPEN)) == RESET)\r
2295 #define __HAL_RCC_GPIOJ_IS_CLK_SLEEP_DISABLED()     ((RCC->AHB1LPENR & (RCC_AHB1LPENR_GPIOJLPEN)) == RESET)\r
2296 #define __HAL_RCC_GPIOK_IS_CLK_SLEEP_DISABLED()     ((RCC->AHB1LPENR & (RCC_AHB1LPENR_GPIOKLPEN)) == RESET)\r
2297 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
2298 \r
2299 /** @brief  Get the enable or disable status of the AHB2 peripheral clock during Low Power (Sleep) mode.\r
2300   * @note   Peripheral clock gating in SLEEP mode can be used to further reduce\r
2301   *         power consumption.\r
2302   * @note   After wakeup from SLEEP mode, the peripheral clock is enabled again.\r
2303   * @note   By default, all peripheral clocks are enabled during SLEEP mode.\r
2304   */\r
2305 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) ||\\r
2306     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) ||\\r
2307     defined (STM32F750xx)\r
2308 #define __HAL_RCC_DCMI_IS_CLK_SLEEP_ENABLED()        ((RCC->AHB2LPENR & (RCC_AHB2LPENR_DCMILPEN)) != RESET)\r
2309 #define __HAL_RCC_DCMI_IS_CLK_SLEEP_DISABLED()       ((RCC->AHB2LPENR & (RCC_AHB2LPENR_DCMILPEN)) == RESET)\r
2310 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
2311 \r
2312 #if defined(STM32F767xx) || defined(STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
2313 #define __HAL_RCC_JPEG_IS_CLK_SLEEP_ENABLED()        ((RCC->AHB2LPENR & (RCC_AHB2LPENR_JPEGLPEN)) != RESET)\r
2314 #define __HAL_RCC_JPEG_IS_CLK_SLEEP_DISABLED()       ((RCC->AHB2LPENR & (RCC_AHB2LPENR_JPEGLPEN)) == RESET)\r
2315 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
2316 \r
2317 #define __HAL_RCC_RNG_IS_CLK_SLEEP_ENABLED()         ((RCC->AHB2LPENR & (RCC_AHB2LPENR_RNGLPEN)) != RESET)\r
2318 #define __HAL_RCC_RNG_IS_CLK_SLEEP_DISABLED()        ((RCC->AHB2LPENR & (RCC_AHB2LPENR_RNGLPEN)) == RESET)\r
2319 \r
2320 #define __HAL_RCC_USB_OTG_FS_IS_CLK_SLEEP_ENABLED()  ((RCC->AHB2LPENR & (RCC_AHB2LPENR_OTGFSLPEN)) != RESET)\r
2321 #define __HAL_RCC_USB_OTG_FS_IS_CLK_SLEEP_DISABLED() ((RCC->AHB2LPENR & (RCC_AHB2LPENR_OTGFSLPEN)) == RESET)\r
2322 \r
2323 #if defined(STM32F756xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F750xx)\r
2324 #define __HAL_RCC_CRYP_IS_CLK_SLEEP_ENABLED()        ((RCC->AHB2LPENR & (RCC_AHB2LPENR_CRYPLPEN)) != RESET)\r
2325 #define __HAL_RCC_HASH_IS_CLK_SLEEP_ENABLED()        ((RCC->AHB2LPENR & (RCC_AHB2LPENR_HASHLPEN)) != RESET)\r
2326 \r
2327 #define __HAL_RCC_CRYP_IS_CLK_SLEEP_DISABLED()       ((RCC->AHB2LPENR & (RCC_AHB2LPENR_CRYPLPEN)) == RESET)\r
2328 #define __HAL_RCC_HASH_IS_CLK_SLEEP_DISABLED()       ((RCC->AHB2LPENR & (RCC_AHB2LPENR_HASHLPEN)) == RESET)\r
2329 #endif /* STM32F756xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
2330 \r
2331 #if defined(STM32F732xx) || defined (STM32F733xx) || defined (STM32F730xx)\r
2332 #define __HAL_RCC_AES_IS_CLK_SLEEP_ENABLED()        ((RCC->AHB2LPENR & (RCC_AHB2LPENR_AESLPEN)) != RESET)\r
2333 #define __HAL_RCC_AES_IS_CLK_SLEEP_DISABLED()       ((RCC->AHB2LPENR & (RCC_AHB2LPENR_AESLPEN)) == RESET)\r
2334 #endif /* STM32F732xx || STM32F733xx || STM32F730xx */\r
2335 \r
2336 /** @brief  Get the enable or disable status of the AHB3 peripheral clock during Low Power (Sleep) mode.\r
2337   * @note   Peripheral clock gating in SLEEP mode can be used to further reduce\r
2338   *         power consumption.\r
2339   * @note   After wakeup from SLEEP mode, the peripheral clock is enabled again.\r
2340   * @note   By default, all peripheral clocks are enabled during SLEEP mode.\r
2341   */\r
2342 #define __HAL_RCC_FMC_IS_CLK_SLEEP_ENABLED()  ((RCC->AHB3LPENR & (RCC_AHB3LPENR_FMCLPEN)) != RESET)\r
2343 #define __HAL_RCC_FMC_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & (RCC_AHB3LPENR_FMCLPEN)) == RESET)\r
2344 \r
2345 #define __HAL_RCC_QSPI_IS_CLK_SLEEP_ENABLED()  ((RCC->AHB3LPENR & (RCC_AHB3LPENR_QSPILPEN)) != RESET)\r
2346 #define __HAL_RCC_QSPI_IS_CLK_SLEEP_DISABLED() ((RCC->AHB3LPENR & (RCC_AHB3LPENR_QSPILPEN)) == RESET)\r
2347 \r
2348 /** @brief  Get the enable or disable status of the APB1 peripheral clock during Low Power (Sleep) mode.\r
2349   * @note   Peripheral clock gating in SLEEP mode can be used to further reduce\r
2350   *         power consumption.\r
2351   * @note   After wakeup from SLEEP mode, the peripheral clock is enabled again.\r
2352   * @note   By default, all peripheral clocks are enabled during SLEEP mode.\r
2353   */\r
2354 #define __HAL_RCC_TIM2_IS_CLK_SLEEP_ENABLED()    ((RCC->APB1LPENR & (RCC_APB1LPENR_TIM2LPEN)) != RESET)\r
2355 #define __HAL_RCC_TIM3_IS_CLK_SLEEP_ENABLED()    ((RCC->APB1LPENR & (RCC_APB1LPENR_TIM3LPEN)) != RESET)\r
2356 #define __HAL_RCC_TIM4_IS_CLK_SLEEP_ENABLED()    ((RCC->APB1LPENR & (RCC_APB1LPENR_TIM4LPEN)) != RESET)\r
2357 #define __HAL_RCC_TIM5_IS_CLK_SLEEP_ENABLED()    ((RCC->APB1LPENR & (RCC_APB1LPENR_TIM5LPEN)) != RESET)\r
2358 #define __HAL_RCC_TIM6_IS_CLK_SLEEP_ENABLED()    ((RCC->APB1LPENR & (RCC_APB1LPENR_TIM6LPEN)) != RESET)\r
2359 #define __HAL_RCC_TIM7_IS_CLK_SLEEP_ENABLED()    ((RCC->APB1LPENR & (RCC_APB1LPENR_TIM7LPEN)) != RESET)\r
2360 #define __HAL_RCC_TIM12_IS_CLK_SLEEP_ENABLED()   ((RCC->APB1LPENR & (RCC_APB1LPENR_TIM12LPEN)) != RESET)\r
2361 #define __HAL_RCC_TIM13_IS_CLK_SLEEP_ENABLED()   ((RCC->APB1LPENR & (RCC_APB1LPENR_TIM13LPEN)) != RESET)\r
2362 #define __HAL_RCC_TIM14_IS_CLK_SLEEP_ENABLED()   ((RCC->APB1LPENR & (RCC_APB1LPENR_TIM14LPEN)) != RESET)\r
2363 #define __HAL_RCC_LPTIM1_IS_CLK_SLEEP_ENABLED()  ((RCC->APB1LPENR & (RCC_APB1LPENR_LPTIM1LPEN)) != RESET)\r
2364 #if defined (STM32F722xx) || defined (STM32F723xx) || defined (STM32F732xx) || defined (STM32F733xx) ||\\r
2365     defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) ||\\r
2366     defined (STM32F779xx) || defined (STM32F730xx)\r
2367 #define __HAL_RCC_RTC_IS_CLK_SLEEP_ENABLED()     ((RCC->APB1LPENR & (RCC_APB1LPENR_RTCLPEN)) != RESET)\r
2368 #endif /* STM32F722xx || STM32F723xx || STM32F732xx || STM32F733xx || STM32F765xx || STM32F767xx ||\r
2369           STM32F769xx || STM32F777xx || STM32F779xx || STM32F730xx */\r
2370 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
2371 #define __HAL_RCC_CAN3_IS_CLK_SLEEP_ENABLED()    ((RCC->APB1LPENR & (RCC_APB1LPENR_CAN3LPEN)) != RESET)\r
2372 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
2373 #define __HAL_RCC_SPI2_IS_CLK_SLEEP_ENABLED()    ((RCC->APB1LPENR & (RCC_APB1LPENR_SPI2LPEN)) != RESET)\r
2374 #define __HAL_RCC_SPI3_IS_CLK_SLEEP_ENABLED()    ((RCC->APB1LPENR & (RCC_APB1LPENR_SPI3LPEN)) != RESET)\r
2375 #define __HAL_RCC_USART2_IS_CLK_SLEEP_ENABLED()  ((RCC->APB1LPENR & (RCC_APB1LPENR_USART2LPEN)) != RESET)\r
2376 #define __HAL_RCC_USART3_IS_CLK_SLEEP_ENABLED()  ((RCC->APB1LPENR & (RCC_APB1LPENR_USART3LPEN)) != RESET)\r
2377 #define __HAL_RCC_UART4_IS_CLK_SLEEP_ENABLED()   ((RCC->APB1LPENR & (RCC_APB1LPENR_UART4LPEN)) != RESET)\r
2378 #define __HAL_RCC_UART5_IS_CLK_SLEEP_ENABLED()   ((RCC->APB1LPENR & (RCC_APB1LPENR_UART5LPEN)) != RESET)\r
2379 #define __HAL_RCC_I2C1_IS_CLK_SLEEP_ENABLED()    ((RCC->APB1LPENR & (RCC_APB1LPENR_I2C1LPEN)) != RESET)\r
2380 #define __HAL_RCC_I2C2_IS_CLK_SLEEP_ENABLED()    ((RCC->APB1LPENR & (RCC_APB1LPENR_I2C2LPEN)) != RESET)\r
2381 #define __HAL_RCC_I2C3_IS_CLK_SLEEP_ENABLED()    ((RCC->APB1LPENR & (RCC_APB1LPENR_I2C3LPEN)) != RESET)\r
2382 #define __HAL_RCC_CAN1_IS_CLK_SLEEP_ENABLED()    ((RCC->APB1LPENR & (RCC_APB1LPENR_CAN1LPEN)) != RESET)\r
2383 #define __HAL_RCC_DAC_IS_CLK_SLEEP_ENABLED()     ((RCC->APB1LPENR & (RCC_APB1LPENR_DACLPEN)) != RESET)\r
2384 #define __HAL_RCC_UART7_IS_CLK_SLEEP_ENABLED()   ((RCC->APB1LPENR & (RCC_APB1LPENR_UART7LPEN)) != RESET)\r
2385 #define __HAL_RCC_UART8_IS_CLK_SLEEP_ENABLED()   ((RCC->APB1LPENR & (RCC_APB1LPENR_UART8LPEN)) != RESET)\r
2386 \r
2387 #define __HAL_RCC_TIM2_IS_CLK_SLEEP_DISABLED()   ((RCC->APB1LPENR & (RCC_APB1LPENR_TIM2LPEN)) == RESET)\r
2388 #define __HAL_RCC_TIM3_IS_CLK_SLEEP_DISABLED()   ((RCC->APB1LPENR & (RCC_APB1LPENR_TIM3LPEN)) == RESET)\r
2389 #define __HAL_RCC_TIM4_IS_CLK_SLEEP_DISABLED()   ((RCC->APB1LPENR & (RCC_APB1LPENR_TIM4LPEN)) == RESET)\r
2390 #define __HAL_RCC_TIM5_IS_CLK_SLEEP_DISABLED()   ((RCC->APB1LPENR & (RCC_APB1LPENR_TIM5LPEN)) == RESET)\r
2391 #define __HAL_RCC_TIM6_IS_CLK_SLEEP_DISABLED()   ((RCC->APB1LPENR & (RCC_APB1LPENR_TIM6LPEN)) == RESET)\r
2392 #define __HAL_RCC_TIM7_IS_CLK_SLEEP_DISABLED()   ((RCC->APB1LPENR & (RCC_APB1LPENR_TIM7LPEN)) == RESET)\r
2393 #define __HAL_RCC_TIM12_IS_CLK_SLEEP_DISABLED()  ((RCC->APB1LPENR & (RCC_APB1LPENR_TIM12LPEN)) == RESET)\r
2394 #define __HAL_RCC_TIM13_IS_CLK_SLEEP_DISABLED()  ((RCC->APB1LPENR & (RCC_APB1LPENR_TIM13LPEN)) == RESET)\r
2395 #define __HAL_RCC_TIM14_IS_CLK_SLEEP_DISABLED()  ((RCC->APB1LPENR & (RCC_APB1LPENR_TIM14LPEN)) == RESET)\r
2396 #define __HAL_RCC_LPTIM1_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LPENR & (RCC_APB1LPENR_LPTIM1LPEN)) == RESET)\r
2397 #if defined (STM32F722xx) || defined (STM32F723xx) || defined (STM32F732xx) || defined (STM32F733xx) ||\\r
2398     defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) ||\\r
2399     defined (STM32F779xx) || defined (STM32F730xx)\r
2400 #define __HAL_RCC_RTC_IS_CLK_SLEEP_DISABLED()    ((RCC->APB1LPENR & (RCC_APB1LPENR_RTCLPEN)) == RESET)\r
2401 #endif /* STM32F722xx || STM32F723xx || STM32F732xx || STM32F733xx || STM32F765xx || STM32F767xx ||\r
2402           STM32F769xx || STM32F777xx || STM32F779xx || STM32F730xx */\r
2403 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
2404 #define __HAL_RCC_CAN3_IS_CLK_SLEEP_DISABLED()   ((RCC->APB1LPENR & (RCC_APB1LPENR_CAN3LPEN)) == RESET)\r
2405 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
2406 #define __HAL_RCC_SPI2_IS_CLK_SLEEP_DISABLED()   ((RCC->APB1LPENR & (RCC_APB1LPENR_SPI2LPEN)) == RESET)\r
2407 #define __HAL_RCC_SPI3_IS_CLK_SLEEP_DISABLED()   ((RCC->APB1LPENR & (RCC_APB1LPENR_SPI3LPEN)) == RESET)\r
2408 #define __HAL_RCC_USART2_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LPENR & (RCC_APB1LPENR_USART2LPEN)) == RESET)\r
2409 #define __HAL_RCC_USART3_IS_CLK_SLEEP_DISABLED() ((RCC->APB1LPENR & (RCC_APB1LPENR_USART3LPEN)) == RESET)\r
2410 #define __HAL_RCC_UART4_IS_CLK_SLEEP_DISABLED()  ((RCC->APB1LPENR & (RCC_APB1LPENR_UART4LPEN)) == RESET)\r
2411 #define __HAL_RCC_UART5_IS_CLK_SLEEP_DISABLED()  ((RCC->APB1LPENR & (RCC_APB1LPENR_UART5LPEN)) == RESET)\r
2412 #define __HAL_RCC_I2C1_IS_CLK_SLEEP_DISABLED()   ((RCC->APB1LPENR & (RCC_APB1LPENR_I2C1LPEN)) == RESET)\r
2413 #define __HAL_RCC_I2C2_IS_CLK_SLEEP_DISABLED()   ((RCC->APB1LPENR & (RCC_APB1LPENR_I2C2LPEN)) == RESET)\r
2414 #define __HAL_RCC_I2C3_IS_CLK_SLEEP_DISABLED()   ((RCC->APB1LPENR & (RCC_APB1LPENR_I2C3LPEN)) == RESET)\r
2415 #define __HAL_RCC_CAN1_IS_CLK_SLEEP_DISABLED()   ((RCC->APB1LPENR & (RCC_APB1LPENR_CAN1LPEN)) == RESET)\r
2416 #define __HAL_RCC_DAC_IS_CLK_SLEEP_DISABLED()    ((RCC->APB1LPENR & (RCC_APB1LPENR_DACLPEN)) == RESET)\r
2417 #define __HAL_RCC_UART7_IS_CLK_SLEEP_DISABLED()  ((RCC->APB1LPENR & (RCC_APB1LPENR_UART7LPEN)) == RESET)\r
2418 #define __HAL_RCC_UART8_IS_CLK_SLEEP_DISABLED()  ((RCC->APB1LPENR & (RCC_APB1LPENR_UART8LPEN)) == RESET)\r
2419 \r
2420 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) ||\\r
2421     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) ||\\r
2422     defined (STM32F750xx)\r
2423 #define __HAL_RCC_SPDIFRX_IS_CLK_SLEEP_ENABLED() ((RCC->APB1LPENR & (RCC_APB1LPENR_SPDIFRXLPEN)) != RESET)\r
2424 #define __HAL_RCC_I2C4_IS_CLK_SLEEP_ENABLED()    ((RCC->APB1LPENR & (RCC_APB1LPENR_I2C4LPEN)) != RESET)\r
2425 #define __HAL_RCC_CAN2_IS_CLK_SLEEP_ENABLED()    ((RCC->APB1LPENR & (RCC_APB1LPENR_CAN2LPEN)) != RESET)\r
2426 #define __HAL_RCC_CEC_IS_CLK_SLEEP_ENABLED()     ((RCC->APB1LPENR & (RCC_APB1LPENR_CECLPEN)) != RESET)\r
2427 \r
2428 #define __HAL_RCC_SPDIFRX_IS_CLK_SLEEP_DISABLED()((RCC->APB1LPENR & (RCC_APB1LPENR_SPDIFRXLPEN)) == RESET)\r
2429 #define __HAL_RCC_I2C4_IS_CLK_SLEEP_DISABLED()   ((RCC->APB1LPENR & (RCC_APB1LPENR_I2C4LPEN)) == RESET)\r
2430 #define __HAL_RCC_CAN2_IS_CLK_SLEEP_DISABLED()   ((RCC->APB1LPENR & (RCC_APB1LPENR_CAN2LPEN)) == RESET)\r
2431 #define __HAL_RCC_CEC_IS_CLK_SLEEP_DISABLED()    ((RCC->APB1LPENR & (RCC_APB1LPENR_CECLPEN)) == RESET)\r
2432 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
2433 \r
2434 /** @brief  Get the enable or disable status of the APB2 peripheral clock during Low Power (Sleep) mode.\r
2435   * @note   Peripheral clock gating in SLEEP mode can be used to further reduce\r
2436   *         power consumption.\r
2437   * @note   After wakeup from SLEEP mode, the peripheral clock is enabled again.\r
2438   * @note   By default, all peripheral clocks are enabled during SLEEP mode.\r
2439   */\r
2440 #define __HAL_RCC_TIM1_IS_CLK_SLEEP_ENABLED()    ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM1LPEN)) != RESET)\r
2441 #define __HAL_RCC_TIM8_IS_CLK_SLEEP_ENABLED()    ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM8LPEN)) != RESET)\r
2442 #define __HAL_RCC_USART1_IS_CLK_SLEEP_ENABLED()  ((RCC->APB2LPENR & (RCC_APB2LPENR_USART1LPEN)) != RESET)\r
2443 #define __HAL_RCC_USART6_IS_CLK_SLEEP_ENABLED()  ((RCC->APB2LPENR & (RCC_APB2LPENR_USART6LPEN)) != RESET)\r
2444 #define __HAL_RCC_ADC1_IS_CLK_SLEEP_ENABLED()    ((RCC->APB2LPENR & (RCC_APB2LPENR_ADC1LPEN)) != RESET)\r
2445 #define __HAL_RCC_ADC2_IS_CLK_SLEEP_ENABLED()    ((RCC->APB2LPENR & (RCC_APB2LPENR_ADC2LPEN)) != RESET)\r
2446 #define __HAL_RCC_ADC3_IS_CLK_SLEEP_ENABLED()    ((RCC->APB2LPENR & (RCC_APB2LPENR_ADC3LPEN)) != RESET)\r
2447 #define __HAL_RCC_SDMMC1_IS_CLK_SLEEP_ENABLED()  ((RCC->APB2LPENR & (RCC_APB2LPENR_SDMMC1LPEN)) != RESET)\r
2448 #define __HAL_RCC_SPI1_IS_CLK_SLEEP_ENABLED()    ((RCC->APB2LPENR & (RCC_APB2LPENR_SPI1LPEN)) != RESET)\r
2449 #define __HAL_RCC_SPI4_IS_CLK_SLEEP_ENABLED()    ((RCC->APB2LPENR & (RCC_APB2LPENR_SPI4LPEN)) != RESET)\r
2450 #define __HAL_RCC_TIM9_IS_CLK_SLEEP_ENABLED()    ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM9LPEN)) != RESET)\r
2451 #define __HAL_RCC_TIM10_IS_CLK_SLEEP_ENABLED()   ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM10LPEN)) != RESET)\r
2452 #define __HAL_RCC_TIM11_IS_CLK_SLEEP_ENABLED()   ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM11LPEN)) != RESET)\r
2453 #define __HAL_RCC_SPI5_IS_CLK_SLEEP_ENABLED()    ((RCC->APB2LPENR & (RCC_APB2LPENR_SPI5LPEN)) != RESET)\r
2454 #define __HAL_RCC_SAI1_IS_CLK_SLEEP_ENABLED()    ((RCC->APB2LPENR & (RCC_APB2LPENR_SAI1LPEN)) != RESET)\r
2455 #define __HAL_RCC_SAI2_IS_CLK_SLEEP_ENABLED()    ((RCC->APB2LPENR & (RCC_APB2LPENR_SAI2LPEN)) != RESET)\r
2456 #if defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F750xx)\r
2457 #define __HAL_RCC_LTDC_IS_CLK_SLEEP_ENABLED()    ((RCC->APB2LPENR & (RCC_APB2LPENR_LTDCLPEN)) != RESET)\r
2458 #endif /* STM32F746xx || STM32F756xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
2459 #if defined (STM32F769xx) || defined (STM32F779xx)\r
2460 #define __HAL_RCC_DSI_IS_CLK_SLEEP_ENABLED()     ((RCC->APB2LPENR & (RCC_APB2LPENR_DSILPEN)) != RESET)\r
2461 #endif /* STM32F769xx || STM32F779xx */\r
2462 #if defined (STM32F722xx) || defined (STM32F723xx) || defined (STM32F732xx) || defined (STM32F733xx) || defined (STM32F765xx) ||\\r
2463     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F730xx)\r
2464 #define __HAL_RCC_SDMMC2_IS_CLK_SLEEP_ENABLED()  ((RCC->APB2LPENR & (RCC_APB2LPENR_SDMMC2LPEN)) != RESET)\r
2465 #endif /* STM32F722xx || STM32F723xx || STM32F732xx || STM32F733xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F730xx */\r
2466 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
2467 #define __HAL_RCC_DFSDM1_IS_CLK_SLEEP_ENABLED()   ((RCC->APB2LPENR & (RCC_APB2LPENR_DFSDM1LPEN)) != RESET)\r
2468 #define __HAL_RCC_MDIO_IS_CLK_SLEEP_ENABLED()    ((RCC->APB2LPENR & (RCC_APB2LPENR_MDIOLPEN)) != RESET)\r
2469 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
2470 \r
2471 #define __HAL_RCC_TIM1_IS_CLK_SLEEP_DISABLED()   ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM1LPEN)) == RESET)\r
2472 #define __HAL_RCC_TIM8_IS_CLK_SLEEP_DISABLED()   ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM8LPEN)) == RESET)\r
2473 #define __HAL_RCC_USART1_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_USART1LPEN)) == RESET)\r
2474 #define __HAL_RCC_USART6_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_USART6LPEN)) == RESET)\r
2475 #define __HAL_RCC_ADC1_IS_CLK_SLEEP_DISABLED()   ((RCC->APB2LPENR & (RCC_APB2LPENR_ADC1LPEN)) == RESET)\r
2476 #define __HAL_RCC_ADC2_IS_CLK_SLEEP_DISABLED()   ((RCC->APB2LPENR & (RCC_APB2LPENR_ADC2LPEN)) == RESET)\r
2477 #define __HAL_RCC_ADC3_IS_CLK_SLEEP_DISABLED()   ((RCC->APB2LPENR & (RCC_APB2LPENR_ADC3LPEN)) == RESET)\r
2478 #define __HAL_RCC_SDMMC1_IS_CLK_SLEEP_DISABLED() ((RCC->APB2LPENR & (RCC_APB2LPENR_SDMMC1LPEN)) == RESET)\r
2479 #define __HAL_RCC_SPI1_IS_CLK_SLEEP_DISABLED()   ((RCC->APB2LPENR & (RCC_APB2LPENR_SPI1LPEN)) == RESET)\r
2480 #define __HAL_RCC_SPI4_IS_CLK_SLEEP_DISABLED()   ((RCC->APB2LPENR & (RCC_APB2LPENR_SPI4LPEN)) == RESET)\r
2481 #define __HAL_RCC_TIM9_IS_CLK_SLEEP_DISABLED()   ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM9LPEN)) == RESET)\r
2482 #define __HAL_RCC_TIM10_IS_CLK_SLEEP_DISABLED()  ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM10LPEN)) == RESET)\r
2483 #define __HAL_RCC_TIM11_IS_CLK_SLEEP_DISABLED()  ((RCC->APB2LPENR & (RCC_APB2LPENR_TIM11LPEN)) == RESET)\r
2484 #define __HAL_RCC_SPI5_IS_CLK_SLEEP_DISABLED()   ((RCC->APB2LPENR & (RCC_APB2LPENR_SPI5LPEN)) == RESET)\r
2485 #define __HAL_RCC_SAI1_IS_CLK_SLEEP_DISABLED()   ((RCC->APB2LPENR & (RCC_APB2LPENR_SAI1LPEN)) == RESET)\r
2486 #define __HAL_RCC_SAI2_IS_CLK_SLEEP_DISABLED()   ((RCC->APB2LPENR & (RCC_APB2LPENR_SAI2LPEN)) == RESET)\r
2487 #if defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F750xx)\r
2488 #define __HAL_RCC_LTDC_IS_CLK_SLEEP_DISABLED()   ((RCC->APB2LPENR & (RCC_APB2LPENR_LTDCLPEN)) == RESET)\r
2489 #endif /* STM32F746xx || STM32F756xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
2490 #if defined (STM32F769xx) || defined (STM32F779xx)\r
2491 #define __HAL_RCC_DSI_IS_CLK_SLEEP_DISABLED()     ((RCC->APB2LPENR & (RCC_APB2LPENR_DSILPEN)) == RESET)\r
2492 #endif /* STM32F769xx || STM32F779xx */\r
2493 #if defined (STM32F722xx) || defined (STM32F723xx) || defined (STM32F732xx) || defined (STM32F733xx) || defined (STM32F765xx) ||\\r
2494     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F730xx)\r
2495 #define __HAL_RCC_SDMMC2_IS_CLK_SLEEP_DISABLED()  ((RCC->APB2LPENR & (RCC_APB2LPENR_SDMMC2LPEN)) == RESET)\r
2496 #endif /* STM32F722xx || STM32F723xx || STM32F732xx || STM32F733xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F730xx */\r
2497 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
2498 #define __HAL_RCC_DFSDM1_IS_CLK_SLEEP_DISABLED()   ((RCC->APB2LPENR & (RCC_APB2LPENR_DFSDM1LPEN)) == RESET)\r
2499 #define __HAL_RCC_MDIO_IS_CLK_SLEEP_DISABLED()    ((RCC->APB2LPENR & (RCC_APB2LPENR_MDIOLPEN)) == RESET)\r
2500 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
2501 \r
2502 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) ||\\r
2503     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) ||\\r
2504     defined (STM32F750xx)\r
2505 #define __HAL_RCC_SPI6_IS_CLK_SLEEP_ENABLED()    ((RCC->APB2LPENR & (RCC_APB2LPENR_SPI6LPEN)) != RESET)\r
2506 #define __HAL_RCC_SPI6_IS_CLK_SLEEP_DISABLED()   ((RCC->APB2LPENR & (RCC_APB2LPENR_SPI6LPEN)) == RESET)\r
2507 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
2508 /**\r
2509   * @}\r
2510   */\r
2511 \r
2512 /*------------------------------- PLL Configuration --------------------------*/\r
2513 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
2514 /** @brief  Macro to configure the main PLL clock source, multiplication and division factors.\r
2515   * @note   This function must be used only when the main PLL is disabled.\r
2516   * @param  __RCC_PLLSource__ specifies the PLL entry clock source.\r
2517   *         This parameter can be one of the following values:\r
2518   *            @arg RCC_PLLSOURCE_HSI: HSI oscillator clock selected as PLL clock entry\r
2519   *            @arg RCC_PLLSOURCE_HSE: HSE oscillator clock selected as PLL clock entry\r
2520   * @note   This clock source (RCC_PLLSource) is common for the main PLL and PLLI2S.\r
2521   * @param  __PLLM__ specifies the division factor for PLL VCO input clock\r
2522   *         This parameter must be a number between Min_Data = 2 and Max_Data = 63.\r
2523   * @note   You have to set the PLLM parameter correctly to ensure that the VCO input\r
2524   *         frequency ranges from 1 to 2 MHz. It is recommended to select a frequency\r
2525   *         of 2 MHz to limit PLL jitter.\r
2526   * @param  __PLLN__ specifies the multiplication factor for PLL VCO output clock\r
2527   *         This parameter must be a number between Min_Data = 50 and Max_Data = 432.\r
2528   * @note   You have to set the PLLN parameter correctly to ensure that the VCO\r
2529   *         output frequency is between 100 and 432 MHz.\r
2530   * @param  __PLLP__ specifies the division factor for main system clock (SYSCLK)\r
2531   *         This parameter must be a number in the range {2, 4, 6, or 8}.\r
2532   * @note   You have to set the PLLP parameter correctly to not exceed 216 MHz on\r
2533   *         the System clock frequency.\r
2534   * @param  __PLLQ__ specifies the division factor for OTG FS, SDMMC and RNG clocks\r
2535   *         This parameter must be a number between Min_Data = 2 and Max_Data = 15.\r
2536   * @note   If the USB OTG FS is used in your application, you have to set the\r
2537   *         PLLQ parameter correctly to have 48 MHz clock for the USB. However,\r
2538   *         the SDMMC and RNG need a frequency lower than or equal to 48 MHz to work\r
2539   *         correctly.\r
2540   * @param  __PLLR__ specifies the division factor for DSI clock\r
2541   *         This parameter must be a number between Min_Data = 2 and Max_Data = 7.\r
2542   */\r
2543 #define __HAL_RCC_PLL_CONFIG(__RCC_PLLSource__, __PLLM__, __PLLN__, __PLLP__, __PLLQ__,__PLLR__)  \\r
2544                             (RCC->PLLCFGR = ((__RCC_PLLSource__) | (__PLLM__)                   | \\r
2545                             ((__PLLN__) << RCC_PLLCFGR_PLLN_Pos)                      | \\r
2546                             ((((__PLLP__) >> 1) -1) << RCC_PLLCFGR_PLLP_Pos)          | \\r
2547                             ((__PLLQ__) << RCC_PLLCFGR_PLLQ_Pos)                      | \\r
2548                             ((__PLLR__) << RCC_PLLCFGR_PLLR_Pos)))\r
2549 #else\r
2550 /** @brief  Macro to configure the main PLL clock source, multiplication and division factors.\r
2551   * @note   This function must be used only when the main PLL is disabled.\r
2552   * @param  __RCC_PLLSource__ specifies the PLL entry clock source.\r
2553   *         This parameter can be one of the following values:\r
2554   *            @arg RCC_PLLSOURCE_HSI: HSI oscillator clock selected as PLL clock entry\r
2555   *            @arg RCC_PLLSOURCE_HSE: HSE oscillator clock selected as PLL clock entry\r
2556   * @note   This clock source (RCC_PLLSource) is common for the main PLL and PLLI2S.\r
2557   * @param  __PLLM__ specifies the division factor for PLL VCO input clock\r
2558   *         This parameter must be a number between Min_Data = 2 and Max_Data = 63.\r
2559   * @note   You have to set the PLLM parameter correctly to ensure that the VCO input\r
2560   *         frequency ranges from 1 to 2 MHz. It is recommended to select a frequency\r
2561   *         of 2 MHz to limit PLL jitter.\r
2562   * @param  __PLLN__ specifies the multiplication factor for PLL VCO output clock\r
2563   *         This parameter must be a number between Min_Data = 50 and Max_Data = 432.\r
2564   * @note   You have to set the PLLN parameter correctly to ensure that the VCO\r
2565   *         output frequency is between 100 and 432 MHz.\r
2566   * @param  __PLLP__ specifies the division factor for main system clock (SYSCLK)\r
2567   *         This parameter must be a number in the range {2, 4, 6, or 8}.\r
2568   * @note   You have to set the PLLP parameter correctly to not exceed 216 MHz on\r
2569   *         the System clock frequency.\r
2570   * @param  __PLLQ__ specifies the division factor for OTG FS, SDMMC and RNG clocks\r
2571   *         This parameter must be a number between Min_Data = 2 and Max_Data = 15.\r
2572   * @note   If the USB OTG FS is used in your application, you have to set the\r
2573   *         PLLQ parameter correctly to have 48 MHz clock for the USB. However,\r
2574   *         the SDMMC and RNG need a frequency lower than or equal to 48 MHz to work\r
2575   *         correctly.\r
2576   */\r
2577 #define __HAL_RCC_PLL_CONFIG(__RCC_PLLSource__, __PLLM__, __PLLN__, __PLLP__, __PLLQ__)     \\r
2578                             (RCC->PLLCFGR = (0x20000000 | (__RCC_PLLSource__) | (__PLLM__)| \\r
2579                             ((__PLLN__) << RCC_PLLCFGR_PLLN_Pos)                          | \\r
2580                             ((((__PLLP__) >> 1) -1) << RCC_PLLCFGR_PLLP_Pos)              | \\r
2581                             ((__PLLQ__) << RCC_PLLCFGR_PLLQ_Pos)))\r
2582 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
2583 /*---------------------------------------------------------------------------------------------*/\r
2584 \r
2585 /** @brief  Macro to configure the Timers clocks prescalers\r
2586   * @param  __PRESC__  specifies the Timers clocks prescalers selection\r
2587   *         This parameter can be one of the following values:\r
2588   *            @arg RCC_TIMPRES_DESACTIVATED: The Timers kernels clocks prescaler is\r
2589   *                 equal to HPRE if PPREx is corresponding to division by 1 or 2,\r
2590   *                 else it is equal to [(HPRE * PPREx) / 2] if PPREx is corresponding to\r
2591   *                 division by 4 or more.\r
2592   *            @arg RCC_TIMPRES_ACTIVATED: The Timers kernels clocks prescaler is\r
2593   *                 equal to HPRE if PPREx is corresponding to division by 1, 2 or 4,\r
2594   *                 else it is equal to [(HPRE * PPREx) / 4] if PPREx is corresponding\r
2595   *                 to division by 8 or more.\r
2596   */\r
2597 #define __HAL_RCC_TIMCLKPRESCALER(__PRESC__) do {RCC->DCKCFGR1 &= ~(RCC_DCKCFGR1_TIMPRE);\\r
2598                                                  RCC->DCKCFGR1 |= (__PRESC__);           \\r
2599                                                 }while(0)\r
2600 \r
2601 /** @brief Macros to Enable or Disable the PLLISAI.\r
2602   * @note  The PLLSAI is disabled by hardware when entering STOP and STANDBY modes.\r
2603   */\r
2604 #define __HAL_RCC_PLLSAI_ENABLE() (RCC->CR |= (RCC_CR_PLLSAION))\r
2605 #define __HAL_RCC_PLLSAI_DISABLE() (RCC->CR &= ~(RCC_CR_PLLSAION))\r
2606 \r
2607 #if defined (STM32F722xx) || defined (STM32F723xx) || defined (STM32F732xx) || defined (STM32F733xx) || defined (STM32F730xx)\r
2608 /** @brief  Macro to configure the PLLSAI clock multiplication and division factors.\r
2609   * @note   This function must be used only when the PLLSAI is disabled.\r
2610   * @note   PLLSAI clock source is common with the main PLL (configured in\r
2611   *         RCC_PLLConfig function )\r
2612   * @param  __PLLSAIN__ specifies the multiplication factor for PLLSAI VCO output clock.\r
2613   *         This parameter must be a number between Min_Data = 50 and Max_Data = 432.\r
2614   * @note   You have to set the PLLSAIN parameter correctly to ensure that the VCO\r
2615   *         output frequency is between Min_Data = 100 and Max_Data = 432 MHz.\r
2616   * @param  __PLLSAIP__ specifies the division factor for USB, RNG, SDMMC clocks\r
2617   *         This parameter can be a value of @ref RCCEx_PLLSAIP_Clock_Divider.\r
2618   * @param  __PLLSAIQ__ specifies the division factor for SAI clock\r
2619   *         This parameter must be a number between Min_Data = 2 and Max_Data = 15.\r
2620   */\r
2621 #define __HAL_RCC_PLLSAI_CONFIG(__PLLSAIN__, __PLLSAIP__, __PLLSAIQ__)                        \\r
2622                                (RCC->PLLSAICFGR = ((__PLLSAIN__) << RCC_PLLSAICFGR_PLLSAIN_Pos) |\\r
2623                                ((__PLLSAIP__) << RCC_PLLSAICFGR_PLLSAIP_Pos)                    |\\r
2624                                ((__PLLSAIQ__) << RCC_PLLSAICFGR_PLLSAIQ_Pos))\r
2625 \r
2626 /** @brief  Macro to configure the PLLI2S clock multiplication and division factors.\r
2627   * @note   This macro must be used only when the PLLI2S is disabled.\r
2628   * @note   PLLI2S clock source is common with the main PLL (configured in\r
2629   *         HAL_RCC_ClockConfig() API)\r
2630   * @param  __PLLI2SN__ specifies the multiplication factor for PLLI2S VCO output clock.\r
2631   *         This parameter must be a number between Min_Data = 50 and Max_Data = 432.\r
2632   * @note   You have to set the PLLI2SN parameter correctly to ensure that the VCO\r
2633   *         output frequency is between Min_Data = 100 and Max_Data = 432 MHz.\r
2634   * @param  __PLLI2SQ__ specifies the division factor for SAI clock.\r
2635   *         This parameter must be a number between Min_Data = 2 and Max_Data = 15.\r
2636   * @param  __PLLI2SR__ specifies the division factor for I2S clock\r
2637   *         This parameter must be a number between Min_Data = 2 and Max_Data = 7.\r
2638   * @note   You have to set the PLLI2SR parameter correctly to not exceed 192 MHz\r
2639   *         on the I2S clock frequency.\r
2640   */\r
2641 #define __HAL_RCC_PLLI2S_CONFIG(__PLLI2SN__, __PLLI2SQ__, __PLLI2SR__)                        \\r
2642                                (RCC->PLLI2SCFGR = ((__PLLI2SN__) << RCC_PLLI2SCFGR_PLLI2SN_Pos) |\\r
2643                                ((__PLLI2SQ__) << RCC_PLLI2SCFGR_PLLI2SQ_Pos)                    |\\r
2644                                ((__PLLI2SR__) << RCC_PLLI2SCFGR_PLLI2SR_Pos))\r
2645 #else\r
2646 /** @brief  Macro to configure the PLLSAI clock multiplication and division factors.\r
2647   * @note   This function must be used only when the PLLSAI is disabled.\r
2648   * @note   PLLSAI clock source is common with the main PLL (configured in\r
2649   *         RCC_PLLConfig function )\r
2650   * @param  __PLLSAIN__ specifies the multiplication factor for PLLSAI VCO output clock.\r
2651   *         This parameter must be a number between Min_Data = 50 and Max_Data = 432.\r
2652   * @note   You have to set the PLLSAIN parameter correctly to ensure that the VCO\r
2653   *         output frequency is between Min_Data = 100 and Max_Data = 432 MHz.\r
2654   * @param  __PLLSAIP__ specifies the division factor for USB, RNG, SDMMC clocks\r
2655   *         This parameter can be a value of @ref RCCEx_PLLSAIP_Clock_Divider.\r
2656   * @param  __PLLSAIQ__ specifies the division factor for SAI clock\r
2657   *         This parameter must be a number between Min_Data = 2 and Max_Data = 15.\r
2658   * @param  __PLLSAIR__ specifies the division factor for LTDC clock\r
2659   *         This parameter must be a number between Min_Data = 2 and Max_Data = 7.\r
2660   */\r
2661 #define __HAL_RCC_PLLSAI_CONFIG(__PLLSAIN__, __PLLSAIP__, __PLLSAIQ__, __PLLSAIR__)              \\r
2662                                (RCC->PLLSAICFGR = ((__PLLSAIN__) << RCC_PLLSAICFGR_PLLSAIN_Pos) |\\r
2663                                ((__PLLSAIP__) << RCC_PLLSAICFGR_PLLSAIP_Pos)                    |\\r
2664                                ((__PLLSAIQ__) << RCC_PLLSAICFGR_PLLSAIQ_Pos)                    |\\r
2665                                ((__PLLSAIR__) << RCC_PLLSAICFGR_PLLSAIR_Pos))\r
2666 \r
2667 /** @brief  Macro to configure the PLLI2S clock multiplication and division factors.\r
2668   * @note   This macro must be used only when the PLLI2S is disabled.\r
2669   * @note   PLLI2S clock source is common with the main PLL (configured in\r
2670   *         HAL_RCC_ClockConfig() API)\r
2671   * @param  __PLLI2SN__ specifies the multiplication factor for PLLI2S VCO output clock.\r
2672   *         This parameter must be a number between Min_Data = 50 and Max_Data = 432.\r
2673   * @note   You have to set the PLLI2SN parameter correctly to ensure that the VCO\r
2674   *         output frequency is between Min_Data = 100 and Max_Data = 432 MHz.\r
2675   * @param  __PLLI2SP__ specifies the division factor for SPDDIF-RX clock.\r
2676   *         This parameter can be a value of @ref RCCEx_PLLI2SP_Clock_Divider.\r
2677   * @param  __PLLI2SQ__ specifies the division factor for SAI clock.\r
2678   *         This parameter must be a number between Min_Data = 2 and Max_Data = 15.\r
2679   * @param  __PLLI2SR__ specifies the division factor for I2S clock\r
2680   *         This parameter must be a number between Min_Data = 2 and Max_Data = 7.\r
2681   * @note   You have to set the PLLI2SR parameter correctly to not exceed 192 MHz\r
2682   *         on the I2S clock frequency.\r
2683   */\r
2684 #define __HAL_RCC_PLLI2S_CONFIG(__PLLI2SN__, __PLLI2SP__, __PLLI2SQ__, __PLLI2SR__)              \\r
2685                                (RCC->PLLI2SCFGR = ((__PLLI2SN__) << RCC_PLLI2SCFGR_PLLI2SN_Pos) |\\r
2686                                ((__PLLI2SP__) << RCC_PLLI2SCFGR_PLLI2SP_Pos)                    |\\r
2687                                ((__PLLI2SQ__) << RCC_PLLI2SCFGR_PLLI2SQ_Pos)                    |\\r
2688                                ((__PLLI2SR__) << RCC_PLLI2SCFGR_PLLI2SR_Pos))\r
2689 #endif /* STM32F722xx || STM32F723xx || STM32F732xx || STM32F733xx || STM32F730xx */\r
2690 \r
2691 /** @brief  Macro to configure the SAI clock Divider coming from PLLI2S.\r
2692   * @note   This function must be called before enabling the PLLI2S.\r
2693   * @param  __PLLI2SDivQ__ specifies the PLLI2S division factor for SAI1 clock .\r
2694   *          This parameter must be a number between 1 and 32.\r
2695   *          SAI1 clock frequency = f(PLLI2SQ) / __PLLI2SDivQ__\r
2696   */\r
2697 #define __HAL_RCC_PLLI2S_PLLSAICLKDIVQ_CONFIG(__PLLI2SDivQ__) (MODIFY_REG(RCC->DCKCFGR1, RCC_DCKCFGR1_PLLI2SDIVQ, (__PLLI2SDivQ__)-1))\r
2698 \r
2699 /** @brief  Macro to configure the SAI clock Divider coming from PLLSAI.\r
2700   * @note   This function must be called before enabling the PLLSAI.\r
2701   * @param  __PLLSAIDivQ__ specifies the PLLSAI division factor for SAI1 clock .\r
2702   *         This parameter must be a number between Min_Data = 1 and Max_Data = 32.\r
2703   *         SAI1 clock frequency = f(PLLSAIQ) / __PLLSAIDivQ__\r
2704   */\r
2705 #define __HAL_RCC_PLLSAI_PLLSAICLKDIVQ_CONFIG(__PLLSAIDivQ__) (MODIFY_REG(RCC->DCKCFGR1, RCC_DCKCFGR1_PLLSAIDIVQ, ((__PLLSAIDivQ__)-1)<<8))\r
2706 \r
2707 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) ||\\r
2708     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) ||\\r
2709     defined (STM32F750xx)\r
2710 /** @brief  Macro to configure the LTDC clock Divider coming from PLLSAI.\r
2711   * @note   This function must be called before enabling the PLLSAI.\r
2712   * @param  __PLLSAIDivR__ specifies the PLLSAI division factor for LTDC clock .\r
2713   *          This parameter can be a value of @ref RCCEx_PLLSAI_DIVR.\r
2714   *          LTDC clock frequency = f(PLLSAIR) / __PLLSAIDivR__\r
2715   */\r
2716 #define __HAL_RCC_PLLSAI_PLLSAICLKDIVR_CONFIG(__PLLSAIDivR__)\\r
2717                             MODIFY_REG(RCC->DCKCFGR1, RCC_DCKCFGR1_PLLSAIDIVR, (uint32_t)(__PLLSAIDivR__))\r
2718 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
2719 \r
2720 /** @brief  Macro to configure SAI1 clock source selection.\r
2721   * @note   This function must be called before enabling PLLSAI, PLLI2S and\r
2722   *         the SAI clock.\r
2723   * @param  __SOURCE__ specifies the SAI1 clock source.\r
2724   *         This parameter can be one of the following values:\r
2725   *            @arg RCC_SAI1CLKSOURCE_PLLI2S: PLLI2S_Q clock divided by PLLI2SDIVQ used\r
2726   *                                           as SAI1 clock.\r
2727   *            @arg RCC_SAI1CLKSOURCE_PLLSAI: PLLISAI_Q clock divided by PLLSAIDIVQ used\r
2728   *                                           as SAI1 clock.\r
2729   *            @arg RCC_SAI1CLKSOURCE_PIN: External clock mapped on the I2S_CKIN pin\r
2730   *                                        used as SAI1 clock.\r
2731   *            @arg RCC_SAI1CLKSOURCE_PLLSRC: HSI or HSE depending from PLL Source clock\r
2732   *                                           used as SAI1 clock.\r
2733   * @note      The RCC_SAI1CLKSOURCE_PLLSRC value is only available with STM32F767/769/777/779xx Devices\r
2734   */\r
2735 #define __HAL_RCC_SAI1_CONFIG(__SOURCE__)\\r
2736                              MODIFY_REG(RCC->DCKCFGR1, RCC_DCKCFGR1_SAI1SEL, (uint32_t)(__SOURCE__))\r
2737 \r
2738 /** @brief  Macro to get the SAI1 clock source.\r
2739   * @retval The clock source can be one of the following values:\r
2740   *            @arg RCC_SAI1CLKSOURCE_PLLI2S: PLLI2S_Q clock divided by PLLI2SDIVQ used\r
2741   *                                           as SAI1 clock.\r
2742   *            @arg RCC_SAI1CLKSOURCE_PLLSAI: PLLISAI_Q clock divided by PLLSAIDIVQ used\r
2743   *                                           as SAI1 clock.\r
2744   *            @arg RCC_SAI1CLKSOURCE_PIN: External clock mapped on the I2S_CKIN pin\r
2745   *                                        used as SAI1 clock.\r
2746   *            @arg RCC_SAI1CLKSOURCE_PLLSRC: HSI or HSE depending from PLL Source clock\r
2747   *                                           used as SAI1 clock.\r
2748   * @note      The RCC_SAI1CLKSOURCE_PLLSRC value is only available with STM32F767/769/777/779xx Devices\r
2749   */\r
2750 #define __HAL_RCC_GET_SAI1_SOURCE() ((uint32_t)(READ_BIT(RCC->DCKCFGR1, RCC_DCKCFGR1_SAI1SEL)))\r
2751 \r
2752 /** @brief  Macro to configure SAI2 clock source selection.\r
2753   * @note   This function must be called before enabling PLLSAI, PLLI2S and\r
2754   *         the SAI clock.\r
2755   * @param  __SOURCE__ specifies the SAI2 clock source.\r
2756   *         This parameter can be one of the following values:\r
2757   *            @arg RCC_SAI2CLKSOURCE_PLLI2S: PLLI2S_Q clock divided by PLLI2SDIVQ used\r
2758   *                                           as SAI2 clock.\r
2759   *            @arg RCC_SAI2CLKSOURCE_PLLSAI: PLLISAI_Q clock divided by PLLSAIDIVQ used\r
2760   *                                           as SAI2 clock.\r
2761   *            @arg RCC_SAI2CLKSOURCE_PIN: External clock mapped on the I2S_CKIN pin\r
2762   *                                        used as SAI2 clock.\r
2763   *            @arg RCC_SAI2CLKSOURCE_PLLSRC: HSI or HSE depending from PLL Source clock\r
2764   *                                           used as SAI2 clock.\r
2765   * @note      The RCC_SAI2CLKSOURCE_PLLSRC value is only available with STM32F767/769/777/779xx Devices\r
2766   */\r
2767 #define __HAL_RCC_SAI2_CONFIG(__SOURCE__)\\r
2768                             MODIFY_REG(RCC->DCKCFGR1, RCC_DCKCFGR1_SAI2SEL, (uint32_t)(__SOURCE__))\r
2769 \r
2770 \r
2771 /** @brief  Macro to get the SAI2 clock source.\r
2772   * @retval The clock source can be one of the following values:\r
2773   *            @arg RCC_SAI2CLKSOURCE_PLLI2S: PLLI2S_Q clock divided by PLLI2SDIVQ used\r
2774   *                                           as SAI2 clock.\r
2775   *            @arg RCC_SAI2CLKSOURCE_PLLSAI: PLLISAI_Q clock divided by PLLSAIDIVQ used\r
2776   *                                           as SAI2 clock.\r
2777   *            @arg RCC_SAI2CLKSOURCE_PIN: External clock mapped on the I2S_CKIN pin\r
2778   *                                        used as SAI2 clock.\r
2779   *            @arg RCC_SAI2CLKSOURCE_PLLSRC: HSI or HSE depending from PLL Source clock\r
2780   *                                           used as SAI2 clock.\r
2781   * @note      The RCC_SAI2CLKSOURCE_PLLSRC value is only available with STM32F767/769/777/779xx Devices\r
2782   */\r
2783 #define __HAL_RCC_GET_SAI2_SOURCE() ((uint32_t)(READ_BIT(RCC->DCKCFGR1, RCC_DCKCFGR1_SAI2SEL)))\r
2784 \r
2785 \r
2786 /** @brief Enable PLLSAI_RDY interrupt.\r
2787   */\r
2788 #define __HAL_RCC_PLLSAI_ENABLE_IT() (RCC->CIR |= (RCC_CIR_PLLSAIRDYIE))\r
2789 \r
2790 /** @brief Disable PLLSAI_RDY interrupt.\r
2791   */\r
2792 #define __HAL_RCC_PLLSAI_DISABLE_IT() (RCC->CIR &= ~(RCC_CIR_PLLSAIRDYIE))\r
2793 \r
2794 /** @brief Clear the PLLSAI RDY interrupt pending bits.\r
2795   */\r
2796 #define __HAL_RCC_PLLSAI_CLEAR_IT() (RCC->CIR |= (RCC_CIR_PLLSAIRDYF))\r
2797 \r
2798 /** @brief Check the PLLSAI RDY interrupt has occurred or not.\r
2799   * @retval The new state (TRUE or FALSE).\r
2800   */\r
2801 #define __HAL_RCC_PLLSAI_GET_IT() ((RCC->CIR & (RCC_CIR_PLLSAIRDYIE)) == (RCC_CIR_PLLSAIRDYIE))\r
2802 \r
2803 /** @brief  Check PLLSAI RDY flag is set or not.\r
2804   * @retval The new state (TRUE or FALSE).\r
2805   */\r
2806 #define __HAL_RCC_PLLSAI_GET_FLAG() ((RCC->CR & (RCC_CR_PLLSAIRDY)) == (RCC_CR_PLLSAIRDY))\r
2807 \r
2808 /** @brief  Macro to Get I2S clock source selection.\r
2809   * @retval The clock source can be one of the following values:\r
2810   *            @arg RCC_I2SCLKSOURCE_PLLI2S: PLLI2S VCO output clock divided by PLLI2SR used as I2S clock.\r
2811   *            @arg RCC_I2SCLKSOURCE_EXT: External clock mapped on the I2S_CKIN pin used as I2S clock source\r
2812   */\r
2813 #define __HAL_RCC_GET_I2SCLKSOURCE() (READ_BIT(RCC->CFGR, RCC_CFGR_I2SSRC))\r
2814 \r
2815 /** @brief  Macro to configure the I2C1 clock (I2C1CLK).\r
2816   *\r
2817   * @param  __I2C1_CLKSOURCE__ specifies the I2C1 clock source.\r
2818   *          This parameter can be one of the following values:\r
2819   *            @arg RCC_I2C1CLKSOURCE_PCLK1: PCLK1 selected as I2C1 clock\r
2820   *            @arg RCC_I2C1CLKSOURCE_HSI: HSI selected as I2C1 clock\r
2821   *            @arg RCC_I2C1CLKSOURCE_SYSCLK: System Clock selected as I2C1 clock\r
2822   */\r
2823 #define __HAL_RCC_I2C1_CONFIG(__I2C1_CLKSOURCE__) \\r
2824                   MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_I2C1SEL, (uint32_t)(__I2C1_CLKSOURCE__))\r
2825 \r
2826 /** @brief  Macro to get the I2C1 clock source.\r
2827   * @retval The clock source can be one of the following values:\r
2828   *            @arg RCC_I2C1CLKSOURCE_PCLK1: PCLK1 selected as I2C1 clock\r
2829   *            @arg RCC_I2C1CLKSOURCE_HSI: HSI selected as I2C1 clock\r
2830   *            @arg RCC_I2C1CLKSOURCE_SYSCLK: System Clock selected as I2C1 clock\r
2831   */\r
2832 #define __HAL_RCC_GET_I2C1_SOURCE() ((uint32_t)(READ_BIT(RCC->DCKCFGR2, RCC_DCKCFGR2_I2C1SEL)))\r
2833 \r
2834 /** @brief  Macro to configure the I2C2 clock (I2C2CLK).\r
2835   *\r
2836   * @param  __I2C2_CLKSOURCE__ specifies the I2C2 clock source.\r
2837   *          This parameter can be one of the following values:\r
2838   *            @arg RCC_I2C2CLKSOURCE_PCLK1: PCLK1 selected as I2C2 clock\r
2839   *            @arg RCC_I2C2CLKSOURCE_HSI: HSI selected as I2C2 clock\r
2840   *            @arg RCC_I2C2CLKSOURCE_SYSCLK: System Clock selected as I2C2 clock\r
2841   */\r
2842 #define __HAL_RCC_I2C2_CONFIG(__I2C2_CLKSOURCE__) \\r
2843                   MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_I2C2SEL, (uint32_t)(__I2C2_CLKSOURCE__))\r
2844 \r
2845 /** @brief  Macro to get the I2C2 clock source.\r
2846   * @retval The clock source can be one of the following values:\r
2847   *            @arg RCC_I2C2CLKSOURCE_PCLK1: PCLK1 selected as I2C2 clock\r
2848   *            @arg RCC_I2C2CLKSOURCE_HSI: HSI selected as I2C2 clock\r
2849   *            @arg RCC_I2C2CLKSOURCE_SYSCLK: System Clock selected as I2C2 clock\r
2850   */\r
2851 #define __HAL_RCC_GET_I2C2_SOURCE() ((uint32_t)(READ_BIT(RCC->DCKCFGR2, RCC_DCKCFGR2_I2C2SEL)))\r
2852 \r
2853 /** @brief  Macro to configure the I2C3 clock (I2C3CLK).\r
2854   *\r
2855   * @param  __I2C3_CLKSOURCE__ specifies the I2C3 clock source.\r
2856   *          This parameter can be one of the following values:\r
2857   *            @arg RCC_I2C3CLKSOURCE_PCLK1: PCLK1 selected as I2C3 clock\r
2858   *            @arg RCC_I2C3CLKSOURCE_HSI: HSI selected as I2C3 clock\r
2859   *            @arg RCC_I2C3CLKSOURCE_SYSCLK: System Clock selected as I2C3 clock\r
2860   */\r
2861 #define __HAL_RCC_I2C3_CONFIG(__I2C3_CLKSOURCE__) \\r
2862                   MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_I2C3SEL, (uint32_t)(__I2C3_CLKSOURCE__))\r
2863 \r
2864 /** @brief  macro to get the I2C3 clock source.\r
2865   * @retval The clock source can be one of the following values:\r
2866   *            @arg RCC_I2C3CLKSOURCE_PCLK1: PCLK1 selected as I2C3 clock\r
2867   *            @arg RCC_I2C3CLKSOURCE_HSI: HSI selected as I2C3 clock\r
2868   *            @arg RCC_I2C3CLKSOURCE_SYSCLK: System Clock selected as I2C3 clock\r
2869   */\r
2870 #define __HAL_RCC_GET_I2C3_SOURCE() ((uint32_t)(READ_BIT(RCC->DCKCFGR2, RCC_DCKCFGR2_I2C3SEL)))\r
2871 \r
2872 /** @brief  Macro to configure the I2C4 clock (I2C4CLK).\r
2873   *\r
2874   * @param  __I2C4_CLKSOURCE__ specifies the I2C4 clock source.\r
2875   *          This parameter can be one of the following values:\r
2876   *            @arg RCC_I2C4CLKSOURCE_PCLK1: PCLK1 selected as I2C4 clock\r
2877   *            @arg RCC_I2C4CLKSOURCE_HSI: HSI selected as I2C4 clock\r
2878   *            @arg RCC_I2C4CLKSOURCE_SYSCLK: System Clock selected as I2C4 clock\r
2879   */\r
2880 #define __HAL_RCC_I2C4_CONFIG(__I2C4_CLKSOURCE__) \\r
2881                   MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_I2C4SEL, (uint32_t)(__I2C4_CLKSOURCE__))\r
2882 \r
2883 /** @brief  macro to get the I2C4 clock source.\r
2884   * @retval The clock source can be one of the following values:\r
2885   *            @arg RCC_I2C4CLKSOURCE_PCLK1: PCLK1 selected as I2C4 clock\r
2886   *            @arg RCC_I2C4CLKSOURCE_HSI: HSI selected as I2C4 clock\r
2887   *            @arg RCC_I2C4CLKSOURCE_SYSCLK: System Clock selected as I2C4 clock\r
2888   */\r
2889 #define __HAL_RCC_GET_I2C4_SOURCE() ((uint32_t)(READ_BIT(RCC->DCKCFGR2, RCC_DCKCFGR2_I2C4SEL)))\r
2890 \r
2891 /** @brief  Macro to configure the USART1 clock (USART1CLK).\r
2892   *\r
2893   * @param  __USART1_CLKSOURCE__ specifies the USART1 clock source.\r
2894   *          This parameter can be one of the following values:\r
2895   *            @arg RCC_USART1CLKSOURCE_PCLK2: PCLK2 selected as USART1 clock\r
2896   *            @arg RCC_USART1CLKSOURCE_HSI: HSI selected as USART1 clock\r
2897   *            @arg RCC_USART1CLKSOURCE_SYSCLK: System Clock selected as USART1 clock\r
2898   *            @arg RCC_USART1CLKSOURCE_LSE: LSE selected as USART1 clock\r
2899   */\r
2900 #define __HAL_RCC_USART1_CONFIG(__USART1_CLKSOURCE__) \\r
2901                   MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_USART1SEL, (uint32_t)(__USART1_CLKSOURCE__))\r
2902 \r
2903 /** @brief  macro to get the USART1 clock source.\r
2904   * @retval The clock source can be one of the following values:\r
2905   *            @arg RCC_USART1CLKSOURCE_PCLK2: PCLK2 selected as USART1 clock\r
2906   *            @arg RCC_USART1CLKSOURCE_HSI: HSI selected as USART1 clock\r
2907   *            @arg RCC_USART1CLKSOURCE_SYSCLK: System Clock selected as USART1 clock\r
2908   *            @arg RCC_USART1CLKSOURCE_LSE: LSE selected as USART1 clock\r
2909   */\r
2910 #define __HAL_RCC_GET_USART1_SOURCE() ((uint32_t)(READ_BIT(RCC->DCKCFGR2, RCC_DCKCFGR2_USART1SEL)))\r
2911 \r
2912 /** @brief  Macro to configure the USART2 clock (USART2CLK).\r
2913   *\r
2914   * @param  __USART2_CLKSOURCE__ specifies the USART2 clock source.\r
2915   *          This parameter can be one of the following values:\r
2916   *            @arg RCC_USART2CLKSOURCE_PCLK1: PCLK1 selected as USART2 clock\r
2917   *            @arg RCC_USART2CLKSOURCE_HSI: HSI selected as USART2 clock\r
2918   *            @arg RCC_USART2CLKSOURCE_SYSCLK: System Clock selected as USART2 clock\r
2919   *            @arg RCC_USART2CLKSOURCE_LSE: LSE selected as USART2 clock\r
2920   */\r
2921 #define __HAL_RCC_USART2_CONFIG(__USART2_CLKSOURCE__) \\r
2922                   MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_USART2SEL, (uint32_t)(__USART2_CLKSOURCE__))\r
2923 \r
2924 /** @brief  macro to get the USART2 clock source.\r
2925   * @retval The clock source can be one of the following values:\r
2926   *            @arg RCC_USART2CLKSOURCE_PCLK1: PCLK1 selected as USART2 clock\r
2927   *            @arg RCC_USART2CLKSOURCE_HSI: HSI selected as USART2 clock\r
2928   *            @arg RCC_USART2CLKSOURCE_SYSCLK: System Clock selected as USART2 clock\r
2929   *            @arg RCC_USART2CLKSOURCE_LSE: LSE selected as USART2 clock\r
2930   */\r
2931 #define __HAL_RCC_GET_USART2_SOURCE() ((uint32_t)(READ_BIT(RCC->DCKCFGR2, RCC_DCKCFGR2_USART2SEL)))\r
2932 \r
2933 /** @brief  Macro to configure the USART3 clock (USART3CLK).\r
2934   *\r
2935   * @param  __USART3_CLKSOURCE__ specifies the USART3 clock source.\r
2936   *          This parameter can be one of the following values:\r
2937   *            @arg RCC_USART3CLKSOURCE_PCLK1: PCLK1 selected as USART3 clock\r
2938   *            @arg RCC_USART3CLKSOURCE_HSI: HSI selected as USART3 clock\r
2939   *            @arg RCC_USART3CLKSOURCE_SYSCLK: System Clock selected as USART3 clock\r
2940   *            @arg RCC_USART3CLKSOURCE_LSE: LSE selected as USART3 clock\r
2941   */\r
2942 #define __HAL_RCC_USART3_CONFIG(__USART3_CLKSOURCE__) \\r
2943                   MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_USART3SEL, (uint32_t)(__USART3_CLKSOURCE__))\r
2944 \r
2945 /** @brief  macro to get the USART3 clock source.\r
2946   * @retval The clock source can be one of the following values:\r
2947   *            @arg RCC_USART3CLKSOURCE_PCLK1: PCLK1 selected as USART3 clock\r
2948   *            @arg RCC_USART3CLKSOURCE_HSI: HSI selected as USART3 clock\r
2949   *            @arg RCC_USART3CLKSOURCE_SYSCLK: System Clock selected as USART3 clock\r
2950   *            @arg RCC_USART3CLKSOURCE_LSE: LSE selected as USART3 clock\r
2951   */\r
2952 #define __HAL_RCC_GET_USART3_SOURCE() ((uint32_t)(READ_BIT(RCC->DCKCFGR2, RCC_DCKCFGR2_USART3SEL)))\r
2953 \r
2954  /** @brief  Macro to configure the UART4 clock (UART4CLK).\r
2955   *\r
2956   * @param  __UART4_CLKSOURCE__ specifies the UART4 clock source.\r
2957   *          This parameter can be one of the following values:\r
2958   *            @arg RCC_UART4CLKSOURCE_PCLK1: PCLK1 selected as UART4 clock\r
2959   *            @arg RCC_UART4CLKSOURCE_HSI: HSI selected as UART4 clock\r
2960   *            @arg RCC_UART4CLKSOURCE_SYSCLK: System Clock selected as UART4 clock\r
2961   *            @arg RCC_UART4CLKSOURCE_LSE: LSE selected as UART4 clock\r
2962   */\r
2963 #define __HAL_RCC_UART4_CONFIG(__UART4_CLKSOURCE__) \\r
2964                   MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_UART4SEL, (uint32_t)(__UART4_CLKSOURCE__))\r
2965 \r
2966 /** @brief  macro to get the UART4 clock source.\r
2967   * @retval The clock source can be one of the following values:\r
2968   *            @arg RCC_UART4CLKSOURCE_PCLK1: PCLK1 selected as UART4 clock\r
2969   *            @arg RCC_UART4CLKSOURCE_HSI: HSI selected as UART4 clock\r
2970   *            @arg RCC_UART4CLKSOURCE_SYSCLK: System Clock selected as UART4 clock\r
2971   *            @arg RCC_UART4CLKSOURCE_LSE: LSE selected as UART4 clock\r
2972   */\r
2973 #define __HAL_RCC_GET_UART4_SOURCE() ((uint32_t)(READ_BIT(RCC->DCKCFGR2, RCC_DCKCFGR2_UART4SEL)))\r
2974 \r
2975  /** @brief  Macro to configure the UART5 clock (UART5CLK).\r
2976   *\r
2977   * @param  __UART5_CLKSOURCE__ specifies the UART5 clock source.\r
2978   *          This parameter can be one of the following values:\r
2979   *            @arg RCC_UART5CLKSOURCE_PCLK1: PCLK1 selected as UART5 clock\r
2980   *            @arg RCC_UART5CLKSOURCE_HSI: HSI selected as UART5 clock\r
2981   *            @arg RCC_UART5CLKSOURCE_SYSCLK: System Clock selected as UART5 clock\r
2982   *            @arg RCC_UART5CLKSOURCE_LSE: LSE selected as UART5 clock\r
2983   */\r
2984 #define __HAL_RCC_UART5_CONFIG(__UART5_CLKSOURCE__) \\r
2985                   MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_UART5SEL, (uint32_t)(__UART5_CLKSOURCE__))\r
2986 \r
2987 /** @brief  macro to get the UART5 clock source.\r
2988   * @retval The clock source can be one of the following values:\r
2989   *            @arg RCC_UART5CLKSOURCE_PCLK1: PCLK1 selected as UART5 clock\r
2990   *            @arg RCC_UART5CLKSOURCE_HSI: HSI selected as UART5 clock\r
2991   *            @arg RCC_UART5CLKSOURCE_SYSCLK: System Clock selected as UART5 clock\r
2992   *            @arg RCC_UART5CLKSOURCE_LSE: LSE selected as UART5 clock\r
2993   */\r
2994 #define __HAL_RCC_GET_UART5_SOURCE() ((uint32_t)(READ_BIT(RCC->DCKCFGR2, RCC_DCKCFGR2_UART5SEL)))\r
2995 \r
2996  /** @brief  Macro to configure the USART6 clock (USART6CLK).\r
2997   *\r
2998   * @param  __USART6_CLKSOURCE__ specifies the USART6 clock source.\r
2999   *          This parameter can be one of the following values:\r
3000   *            @arg RCC_USART6CLKSOURCE_PCLK1: PCLK1 selected as USART6 clock\r
3001   *            @arg RCC_USART6CLKSOURCE_HSI: HSI selected as USART6 clock\r
3002   *            @arg RCC_USART6CLKSOURCE_SYSCLK: System Clock selected as USART6 clock\r
3003   *            @arg RCC_USART6CLKSOURCE_LSE: LSE selected as USART6 clock\r
3004   */\r
3005 #define __HAL_RCC_USART6_CONFIG(__USART6_CLKSOURCE__) \\r
3006                   MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_USART6SEL, (uint32_t)(__USART6_CLKSOURCE__))\r
3007 \r
3008 /** @brief  macro to get the USART6 clock source.\r
3009   * @retval The clock source can be one of the following values:\r
3010   *            @arg RCC_USART6CLKSOURCE_PCLK1: PCLK1 selected as USART6 clock\r
3011   *            @arg RCC_USART6CLKSOURCE_HSI: HSI selected as USART6 clock\r
3012   *            @arg RCC_USART6CLKSOURCE_SYSCLK: System Clock selected as USART6 clock\r
3013   *            @arg RCC_USART6CLKSOURCE_LSE: LSE selected as USART6 clock\r
3014   */\r
3015 #define __HAL_RCC_GET_USART6_SOURCE() ((uint32_t)(READ_BIT(RCC->DCKCFGR2, RCC_DCKCFGR2_USART6SEL)))\r
3016 \r
3017  /** @brief  Macro to configure the UART7 clock (UART7CLK).\r
3018   *\r
3019   * @param  __UART7_CLKSOURCE__ specifies the UART7 clock source.\r
3020   *          This parameter can be one of the following values:\r
3021   *            @arg RCC_UART7CLKSOURCE_PCLK1: PCLK1 selected as UART7 clock\r
3022   *            @arg RCC_UART7CLKSOURCE_HSI: HSI selected as UART7 clock\r
3023   *            @arg RCC_UART7CLKSOURCE_SYSCLK: System Clock selected as UART7 clock\r
3024   *            @arg RCC_UART7CLKSOURCE_LSE: LSE selected as UART7 clock\r
3025   */\r
3026 #define __HAL_RCC_UART7_CONFIG(__UART7_CLKSOURCE__) \\r
3027                   MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_UART7SEL, (uint32_t)(__UART7_CLKSOURCE__))\r
3028 \r
3029 /** @brief  macro to get the UART7 clock source.\r
3030   * @retval The clock source can be one of the following values:\r
3031   *            @arg RCC_UART7CLKSOURCE_PCLK1: PCLK1 selected as UART7 clock\r
3032   *            @arg RCC_UART7CLKSOURCE_HSI: HSI selected as UART7 clock\r
3033   *            @arg RCC_UART7CLKSOURCE_SYSCLK: System Clock selected as UART7 clock\r
3034   *            @arg RCC_UART7CLKSOURCE_LSE: LSE selected as UART7 clock\r
3035   */\r
3036 #define __HAL_RCC_GET_UART7_SOURCE() ((uint32_t)(READ_BIT(RCC->DCKCFGR2, RCC_DCKCFGR2_UART7SEL)))\r
3037 \r
3038 /** @brief  Macro to configure the UART8 clock (UART8CLK).\r
3039   *\r
3040   * @param  __UART8_CLKSOURCE__ specifies the UART8 clock source.\r
3041   *          This parameter can be one of the following values:\r
3042   *            @arg RCC_UART8CLKSOURCE_PCLK1: PCLK1 selected as UART8 clock\r
3043   *            @arg RCC_UART8CLKSOURCE_HSI: HSI selected as UART8 clock\r
3044   *            @arg RCC_UART8CLKSOURCE_SYSCLK: System Clock selected as UART8 clock\r
3045   *            @arg RCC_UART8CLKSOURCE_LSE: LSE selected as UART8 clock\r
3046   */\r
3047 #define __HAL_RCC_UART8_CONFIG(__UART8_CLKSOURCE__) \\r
3048                   MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_UART8SEL, (uint32_t)(__UART8_CLKSOURCE__))\r
3049 \r
3050 /** @brief  macro to get the UART8 clock source.\r
3051   * @retval The clock source can be one of the following values:\r
3052   *            @arg RCC_UART8CLKSOURCE_PCLK1: PCLK1 selected as UART8 clock\r
3053   *            @arg RCC_UART8CLKSOURCE_HSI: HSI selected as UART8 clock\r
3054   *            @arg RCC_UART8CLKSOURCE_SYSCLK: System Clock selected as UART8 clock\r
3055   *            @arg RCC_UART8CLKSOURCE_LSE: LSE selected as UART8 clock\r
3056   */\r
3057 #define __HAL_RCC_GET_UART8_SOURCE() ((uint32_t)(READ_BIT(RCC->DCKCFGR2, RCC_DCKCFGR2_UART8SEL)))\r
3058 \r
3059 /** @brief  Macro to configure the LPTIM1 clock (LPTIM1CLK).\r
3060   *\r
3061   * @param  __LPTIM1_CLKSOURCE__ specifies the LPTIM1 clock source.\r
3062   *          This parameter can be one of the following values:\r
3063   *            @arg RCC_LPTIM1CLKSOURCE_PCLK1: PCLK selected as LPTIM1 clock\r
3064   *            @arg RCC_LPTIM1CLKSOURCE_HSI: HSI selected as LPTIM1 clock\r
3065   *            @arg RCC_LPTIM1CLKSOURCE_LSI: LSI selected as LPTIM1 clock\r
3066   *            @arg RCC_LPTIM1CLKSOURCE_LSE: LSE selected as LPTIM1 clock\r
3067   */\r
3068 #define __HAL_RCC_LPTIM1_CONFIG(__LPTIM1_CLKSOURCE__) \\r
3069                   MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_LPTIM1SEL, (uint32_t)(__LPTIM1_CLKSOURCE__))\r
3070 \r
3071 /** @brief  macro to get the LPTIM1 clock source.\r
3072   * @retval The clock source can be one of the following values:\r
3073   *            @arg RCC_LPTIM1CLKSOURCE_PCLK1: PCLK selected as LPTIM1 clock\r
3074   *            @arg RCC_LPTIM1CLKSOURCE_HSI: HSI selected as LPTIM1 clock\r
3075   *            @arg RCC_LPTIM1CLKSOURCE_LSI: LSI selected as LPTIM1 clock\r
3076   *            @arg RCC_LPTIM1CLKSOURCE_LSE: LSE selected as LPTIM1 clock\r
3077   */\r
3078 #define __HAL_RCC_GET_LPTIM1_SOURCE() ((uint32_t)(READ_BIT(RCC->DCKCFGR2, RCC_DCKCFGR2_LPTIM1SEL)))\r
3079 \r
3080 /** @brief  Macro to configure the CEC clock (CECCLK).\r
3081   *\r
3082   * @param  __CEC_CLKSOURCE__ specifies the CEC clock source.\r
3083   *          This parameter can be one of the following values:\r
3084   *            @arg RCC_CECCLKSOURCE_LSE: LSE selected as CEC clock\r
3085   *            @arg RCC_CECCLKSOURCE_HSI: HSI divided by 488 selected as CEC clock\r
3086   */\r
3087 #define __HAL_RCC_CEC_CONFIG(__CEC_CLKSOURCE__) \\r
3088                   MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_CECSEL, (uint32_t)(__CEC_CLKSOURCE__))\r
3089 \r
3090 /** @brief  macro to get the CEC clock source.\r
3091   * @retval The clock source can be one of the following values:\r
3092   *            @arg RCC_CECCLKSOURCE_LSE: LSE selected as CEC clock\r
3093   *            @arg RCC_CECCLKSOURCE_HSI: HSI selected as CEC clock\r
3094   */\r
3095 #define __HAL_RCC_GET_CEC_SOURCE() ((uint32_t)(READ_BIT(RCC->DCKCFGR2, RCC_DCKCFGR2_CECSEL)))\r
3096 \r
3097 /** @brief  Macro to configure the CLK48 source (CLK48CLK).\r
3098   *\r
3099   * @param  __CLK48_SOURCE__ specifies the CLK48 clock source.\r
3100   *          This parameter can be one of the following values:\r
3101   *            @arg RCC_CLK48SOURCE_PLL: PLL selected as CLK48 source\r
3102   *            @arg RCC_CLK48SOURCE_PLLSAIP: PLLSAIP selected as CLK48 source\r
3103   */\r
3104 #define __HAL_RCC_CLK48_CONFIG(__CLK48_SOURCE__) \\r
3105                   MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_CK48MSEL, (uint32_t)(__CLK48_SOURCE__))\r
3106 \r
3107 /** @brief  macro to get the CLK48 source.\r
3108   * @retval The clock source can be one of the following values:\r
3109   *            @arg RCC_CLK48SOURCE_PLL: PLL used as CLK48 source\r
3110   *            @arg RCC_CLK48SOURCE_PLLSAIP: PLLSAIP used as CLK48 source\r
3111   */\r
3112 #define __HAL_RCC_GET_CLK48_SOURCE() ((uint32_t)(READ_BIT(RCC->DCKCFGR2, RCC_DCKCFGR2_CK48MSEL)))\r
3113 \r
3114 /** @brief  Macro to configure the SDMMC1 clock (SDMMC1CLK).\r
3115   *\r
3116   * @param  __SDMMC1_CLKSOURCE__ specifies the SDMMC1 clock source.\r
3117   *          This parameter can be one of the following values:\r
3118   *            @arg RCC_SDMMC1CLKSOURCE_CLK48: CLK48 selected as SDMMC clock\r
3119   *            @arg RCC_SDMMC1CLKSOURCE_SYSCLK: SYSCLK selected as SDMMC clock\r
3120   */\r
3121 #define __HAL_RCC_SDMMC1_CONFIG(__SDMMC1_CLKSOURCE__) \\r
3122                   MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_SDMMC1SEL, (uint32_t)(__SDMMC1_CLKSOURCE__))\r
3123 \r
3124 /** @brief  macro to get the SDMMC1 clock source.\r
3125   * @retval The clock source can be one of the following values:\r
3126   *            @arg RCC_SDMMC1CLKSOURCE_CLK48: CLK48 selected as SDMMC1 clock\r
3127   *            @arg RCC_SDMMC1CLKSOURCE_SYSCLK: SYSCLK selected as SDMMC1 clock\r
3128   */\r
3129 #define __HAL_RCC_GET_SDMMC1_SOURCE() ((uint32_t)(READ_BIT(RCC->DCKCFGR2, RCC_DCKCFGR2_SDMMC1SEL)))\r
3130 \r
3131 #if defined (STM32F722xx) || defined (STM32F723xx) || defined (STM32F732xx) || defined (STM32F733xx) || defined (STM32F765xx) ||\\r
3132     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F730xx)\r
3133 /** @brief  Macro to configure the SDMMC2 clock (SDMMC2CLK).\r
3134   * @param  __SDMMC2_CLKSOURCE__ specifies the SDMMC2 clock source.\r
3135   *          This parameter can be one of the following values:\r
3136   *            @arg RCC_SDMMC2CLKSOURCE_CLK48: CLK48 selected as SDMMC2 clock\r
3137   *            @arg RCC_SDMMC2CLKSOURCE_SYSCLK: SYSCLK selected as SDMMC2 clock\r
3138   */\r
3139 #define __HAL_RCC_SDMMC2_CONFIG(__SDMMC2_CLKSOURCE__) \\r
3140                   MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_SDMMC2SEL, (uint32_t)(__SDMMC2_CLKSOURCE__))\r
3141 \r
3142 /** @brief  macro to get the SDMMC2 clock source.\r
3143   * @retval The clock source can be one of the following values:\r
3144   *            @arg RCC_SDMMC2CLKSOURCE_CLK48: CLK48 selected as SDMMC2 clock\r
3145   *            @arg RCC_SDMMC2CLKSOURCE_SYSCLK: SYSCLK selected as SDMMC2 clock\r
3146   */\r
3147 #define __HAL_RCC_GET_SDMMC2_SOURCE() ((uint32_t)(READ_BIT(RCC->DCKCFGR2, RCC_DCKCFGR2_SDMMC2SEL)))\r
3148 #endif /* STM32F722xx || STM32F723xx || STM32F732xx || STM32F733xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx  || STM32F730xx */\r
3149 \r
3150 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
3151 /** @brief  Macro to configure the DFSDM1 clock\r
3152   * @param  __DFSDM1_CLKSOURCE__ specifies the DFSDM1  clock source.\r
3153   *         This parameter can be one of the following values:\r
3154   *            @arg RCC_DFSDM1CLKSOURCE_PCLK2: PCLK2 Clock selected as DFSDM clock\r
3155   *            @arg RCC_DFSDMCLKSOURCE_SYSCLK: System Clock selected as DFSDM clock\r
3156   */\r
3157 #define __HAL_RCC_DFSDM1_CONFIG(__DFSDM1_CLKSOURCE__) \\r
3158                   MODIFY_REG(RCC->DCKCFGR1, RCC_DCKCFGR1_DFSDM1SEL, (uint32_t)(__DFSDM1_CLKSOURCE__))\r
3159 \r
3160 /** @brief  Macro to get the DFSDM1 clock source.\r
3161   * @retval The clock source can be one of the following values:\r
3162   *            @arg RCC_DFSDM1CLKSOURCE_PCLK2:  PCLK2 Clock selected as DFSDM1 clock\r
3163   *            @arg RCC_DFSDM1CLKSOURCE_SYSCLK:   System Clock selected as DFSDM1 clock\r
3164   */\r
3165 #define __HAL_RCC_GET_DFSDM1_SOURCE() ((uint32_t)(READ_BIT(RCC->DCKCFGR1, RCC_DCKCFGR1_DFSDM1SEL)))\r
3166 \r
3167 /** @brief  Macro to configure the DFSDM1 Audio clock\r
3168   * @param  __DFSDM1AUDIO_CLKSOURCE__ specifies the DFSDM1 Audio clock source.\r
3169   *         This parameter can be one of the following values:\r
3170   *            @arg RCC_DFSDM1AUDIOCLKSOURCE_SAI1:  SAI1 Clock selected as DFSDM1 Audio clock\r
3171   *            @arg RCC_DFSDM1AUDIOCLKSOURCE_SAI2:  SAI2 Clock selected as DFSDM1 Audio clock\r
3172   */\r
3173 #define __HAL_RCC_DFSDM1AUDIO_CONFIG(__DFSDM1AUDIO_CLKSOURCE__) \\r
3174                   MODIFY_REG(RCC->DCKCFGR1, RCC_DCKCFGR1_ADFSDM1SEL, (uint32_t)(__DFSDM1AUDIO_CLKSOURCE__))\r
3175 \r
3176 /** @brief  Macro to get the DFSDM1 Audio clock source.\r
3177   * @retval The clock source can be one of the following values:\r
3178   *            @arg RCC_DFSDM1AUDIOCLKSOURCE_SAI1:  SAI1 Clock selected as DFSDM1 Audio clock\r
3179   *            @arg RCC_DFSDM1AUDIOCLKSOURCE_SAI2:  SAI2 Clock selected as DFSDM1 Audio clock\r
3180   */\r
3181 #define __HAL_RCC_GET_DFSDM1AUDIO_SOURCE() ((uint32_t)(READ_BIT(RCC->DCKCFGR1, RCC_DCKCFGR1_ADFSDM1SEL)))\r
3182 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
3183 \r
3184 #if defined (STM32F769xx) || defined (STM32F779xx)\r
3185 /** @brief  Macro to configure the DSI clock.\r
3186   * @param  __DSI_CLKSOURCE__ specifies the DSI clock source.\r
3187   *         This parameter can be one of the following values:\r
3188   *            @arg RCC_DSICLKSOURCE_PLLR: PLLR output used as DSI clock.\r
3189   *            @arg RCC_DSICLKSOURCE_DSIPHY: DSI-PHY output used as DSI clock.\r
3190   */\r
3191 #define __HAL_RCC_DSI_CONFIG(__DSI_CLKSOURCE__) (MODIFY_REG(RCC->DCKCFGR2, RCC_DCKCFGR2_DSISEL, (uint32_t)(__DSI_CLKSOURCE__)))\r
3192 \r
3193 /** @brief  Macro to Get the DSI clock.\r
3194   * @retval The clock source can be one of the following values:\r
3195   *            @arg RCC_DSICLKSOURCE_PLLR: PLLR output used as DSI clock.\r
3196   *            @arg RCC_DSICLKSOURCE_DSIPHY: DSI-PHY output used as DSI clock.\r
3197   */\r
3198 #define __HAL_RCC_GET_DSI_SOURCE() (READ_BIT(RCC->DCKCFGR2, RCC_DCKCFGR2_DSISEL))\r
3199 #endif /* STM32F769xx || STM32F779xx */\r
3200 /**\r
3201   * @}\r
3202   */\r
3203 \r
3204 /* Exported functions --------------------------------------------------------*/\r
3205 /** @addtogroup RCCEx_Exported_Functions_Group1\r
3206   * @{\r
3207   */\r
3208 HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef  *PeriphClkInit);\r
3209 void HAL_RCCEx_GetPeriphCLKConfig(RCC_PeriphCLKInitTypeDef  *PeriphClkInit);\r
3210 uint32_t HAL_RCCEx_GetPeriphCLKFreq(uint32_t PeriphClk);\r
3211 HAL_StatusTypeDef HAL_RCCEx_EnablePLLI2S(RCC_PLLI2SInitTypeDef  *PLLI2SInit);\r
3212 HAL_StatusTypeDef HAL_RCCEx_DisablePLLI2S(void);\r
3213 HAL_StatusTypeDef HAL_RCCEx_EnablePLLSAI(RCC_PLLSAIInitTypeDef  *PLLSAIInit);\r
3214 HAL_StatusTypeDef HAL_RCCEx_DisablePLLSAI(void);\r
3215 /**\r
3216   * @}\r
3217   */\r
3218 /* Private macros ------------------------------------------------------------*/\r
3219 /** @addtogroup RCCEx_Private_Macros RCCEx Private Macros\r
3220   * @{\r
3221   */\r
3222 /** @defgroup RCCEx_IS_RCC_Definitions RCC Private macros to check input parameters\r
3223   * @{\r
3224   */\r
3225 #if defined(STM32F756xx) || defined(STM32F746xx) || defined(STM32F750xx)\r
3226 #define IS_RCC_PERIPHCLOCK(SELECTION)  \\r
3227                ((((SELECTION) & RCC_PERIPHCLK_I2S)         == RCC_PERIPHCLK_I2S)     || \\r
3228                 (((SELECTION) & RCC_PERIPHCLK_LTDC)        == RCC_PERIPHCLK_LTDC)    || \\r
3229                 (((SELECTION) & RCC_PERIPHCLK_TIM)         == RCC_PERIPHCLK_TIM)     || \\r
3230                 (((SELECTION) & RCC_PERIPHCLK_USART1)      == RCC_PERIPHCLK_USART1)  || \\r
3231                 (((SELECTION) & RCC_PERIPHCLK_USART2)      == RCC_PERIPHCLK_USART2)  || \\r
3232                 (((SELECTION) & RCC_PERIPHCLK_USART3)      == RCC_PERIPHCLK_USART3)  || \\r
3233                 (((SELECTION) & RCC_PERIPHCLK_UART4)       == RCC_PERIPHCLK_UART4)   || \\r
3234                 (((SELECTION) & RCC_PERIPHCLK_UART5)       == RCC_PERIPHCLK_UART5)   || \\r
3235                 (((SELECTION) & RCC_PERIPHCLK_USART6)      == RCC_PERIPHCLK_USART6)  || \\r
3236                 (((SELECTION) & RCC_PERIPHCLK_UART7)       == RCC_PERIPHCLK_UART7)   || \\r
3237                 (((SELECTION) & RCC_PERIPHCLK_UART8)       == RCC_PERIPHCLK_UART8)   || \\r
3238                 (((SELECTION) & RCC_PERIPHCLK_I2C1)        == RCC_PERIPHCLK_I2C1)    || \\r
3239                 (((SELECTION) & RCC_PERIPHCLK_I2C2)        == RCC_PERIPHCLK_I2C2)    || \\r
3240                 (((SELECTION) & RCC_PERIPHCLK_I2C3)        == RCC_PERIPHCLK_I2C3)    || \\r
3241                 (((SELECTION) & RCC_PERIPHCLK_I2C4)        == RCC_PERIPHCLK_I2C4)    || \\r
3242                 (((SELECTION) & RCC_PERIPHCLK_LPTIM1)      == RCC_PERIPHCLK_LPTIM1)  || \\r
3243                 (((SELECTION) & RCC_PERIPHCLK_SAI1)        == RCC_PERIPHCLK_SAI1)    || \\r
3244                 (((SELECTION) & RCC_PERIPHCLK_SAI2)        == RCC_PERIPHCLK_SAI2)    || \\r
3245                 (((SELECTION) & RCC_PERIPHCLK_CLK48)       == RCC_PERIPHCLK_CLK48)   || \\r
3246                 (((SELECTION) & RCC_PERIPHCLK_CEC)         == RCC_PERIPHCLK_CEC)     || \\r
3247                 (((SELECTION) & RCC_PERIPHCLK_SDMMC1)      == RCC_PERIPHCLK_SDMMC1)  || \\r
3248                 (((SELECTION) & RCC_PERIPHCLK_SPDIFRX)     == RCC_PERIPHCLK_SPDIFRX) || \\r
3249                 (((SELECTION) & RCC_PERIPHCLK_RTC)         == RCC_PERIPHCLK_RTC))\r
3250 #elif defined(STM32F745xx)\r
3251 #define IS_RCC_PERIPHCLOCK(SELECTION)  \\r
3252                ((((SELECTION) & RCC_PERIPHCLK_I2S)         == RCC_PERIPHCLK_I2S)     || \\r
3253                 (((SELECTION) & RCC_PERIPHCLK_TIM)         == RCC_PERIPHCLK_TIM)     || \\r
3254                 (((SELECTION) & RCC_PERIPHCLK_USART1)      == RCC_PERIPHCLK_USART1)  || \\r
3255                 (((SELECTION) & RCC_PERIPHCLK_USART2)      == RCC_PERIPHCLK_USART2)  || \\r
3256                 (((SELECTION) & RCC_PERIPHCLK_USART3)      == RCC_PERIPHCLK_USART3)  || \\r
3257                 (((SELECTION) & RCC_PERIPHCLK_UART4)       == RCC_PERIPHCLK_UART4)   || \\r
3258                 (((SELECTION) & RCC_PERIPHCLK_UART5)       == RCC_PERIPHCLK_UART5)   || \\r
3259                 (((SELECTION) & RCC_PERIPHCLK_USART6)      == RCC_PERIPHCLK_USART6)  || \\r
3260                 (((SELECTION) & RCC_PERIPHCLK_UART7)       == RCC_PERIPHCLK_UART7)   || \\r
3261                 (((SELECTION) & RCC_PERIPHCLK_UART8)       == RCC_PERIPHCLK_UART8)   || \\r
3262                 (((SELECTION) & RCC_PERIPHCLK_I2C1)        == RCC_PERIPHCLK_I2C1)    || \\r
3263                 (((SELECTION) & RCC_PERIPHCLK_I2C2)        == RCC_PERIPHCLK_I2C2)    || \\r
3264                 (((SELECTION) & RCC_PERIPHCLK_I2C3)        == RCC_PERIPHCLK_I2C3)    || \\r
3265                 (((SELECTION) & RCC_PERIPHCLK_I2C4)        == RCC_PERIPHCLK_I2C4)    || \\r
3266                 (((SELECTION) & RCC_PERIPHCLK_LPTIM1)      == RCC_PERIPHCLK_LPTIM1)  || \\r
3267                 (((SELECTION) & RCC_PERIPHCLK_SAI1)        == RCC_PERIPHCLK_SAI1)    || \\r
3268                 (((SELECTION) & RCC_PERIPHCLK_SAI2)        == RCC_PERIPHCLK_SAI2)    || \\r
3269                 (((SELECTION) & RCC_PERIPHCLK_CLK48)       == RCC_PERIPHCLK_CLK48)   || \\r
3270                 (((SELECTION) & RCC_PERIPHCLK_CEC)         == RCC_PERIPHCLK_CEC)     || \\r
3271                 (((SELECTION) & RCC_PERIPHCLK_SDMMC1)      == RCC_PERIPHCLK_SDMMC1)  || \\r
3272                 (((SELECTION) & RCC_PERIPHCLK_SPDIFRX)     == RCC_PERIPHCLK_SPDIFRX) || \\r
3273                 (((SELECTION) & RCC_PERIPHCLK_RTC)         == RCC_PERIPHCLK_RTC))\r
3274 #elif defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
3275 #define IS_RCC_PERIPHCLOCK(SELECTION)  \\r
3276                ((((SELECTION) & RCC_PERIPHCLK_I2S)         == RCC_PERIPHCLK_I2S)     || \\r
3277                 (((SELECTION) & RCC_PERIPHCLK_LTDC)        == RCC_PERIPHCLK_LTDC)    || \\r
3278                 (((SELECTION) & RCC_PERIPHCLK_TIM)         == RCC_PERIPHCLK_TIM)     || \\r
3279                 (((SELECTION) & RCC_PERIPHCLK_USART1)      == RCC_PERIPHCLK_USART1)  || \\r
3280                 (((SELECTION) & RCC_PERIPHCLK_USART2)      == RCC_PERIPHCLK_USART2)  || \\r
3281                 (((SELECTION) & RCC_PERIPHCLK_USART3)      == RCC_PERIPHCLK_USART3)  || \\r
3282                 (((SELECTION) & RCC_PERIPHCLK_UART4)       == RCC_PERIPHCLK_UART4)   || \\r
3283                 (((SELECTION) & RCC_PERIPHCLK_UART5)       == RCC_PERIPHCLK_UART5)   || \\r
3284                 (((SELECTION) & RCC_PERIPHCLK_USART6)      == RCC_PERIPHCLK_USART6)  || \\r
3285                 (((SELECTION) & RCC_PERIPHCLK_UART7)       == RCC_PERIPHCLK_UART7)   || \\r
3286                 (((SELECTION) & RCC_PERIPHCLK_UART8)       == RCC_PERIPHCLK_UART8)   || \\r
3287                 (((SELECTION) & RCC_PERIPHCLK_I2C1)        == RCC_PERIPHCLK_I2C1)    || \\r
3288                 (((SELECTION) & RCC_PERIPHCLK_I2C2)        == RCC_PERIPHCLK_I2C2)    || \\r
3289                 (((SELECTION) & RCC_PERIPHCLK_I2C3)        == RCC_PERIPHCLK_I2C3)    || \\r
3290                 (((SELECTION) & RCC_PERIPHCLK_I2C4)        == RCC_PERIPHCLK_I2C4)    || \\r
3291                 (((SELECTION) & RCC_PERIPHCLK_LPTIM1)      == RCC_PERIPHCLK_LPTIM1)  || \\r
3292                 (((SELECTION) & RCC_PERIPHCLK_SAI1)        == RCC_PERIPHCLK_SAI1)    || \\r
3293                 (((SELECTION) & RCC_PERIPHCLK_SAI2)        == RCC_PERIPHCLK_SAI2)    || \\r
3294                 (((SELECTION) & RCC_PERIPHCLK_CLK48)       == RCC_PERIPHCLK_CLK48)   || \\r
3295                 (((SELECTION) & RCC_PERIPHCLK_CEC)         == RCC_PERIPHCLK_CEC)     || \\r
3296                 (((SELECTION) & RCC_PERIPHCLK_SDMMC1)      == RCC_PERIPHCLK_SDMMC1)  || \\r
3297                 (((SELECTION) & RCC_PERIPHCLK_SDMMC2)      == RCC_PERIPHCLK_SDMMC2)  || \\r
3298                 (((SELECTION) & RCC_PERIPHCLK_DFSDM1)       == RCC_PERIPHCLK_DFSDM1)   || \\r
3299                 (((SELECTION) & RCC_PERIPHCLK_DFSDM1_AUDIO) == RCC_PERIPHCLK_DFSDM1_AUDIO) || \\r
3300                 (((SELECTION) & RCC_PERIPHCLK_SPDIFRX)     == RCC_PERIPHCLK_SPDIFRX) || \\r
3301                 (((SELECTION) & RCC_PERIPHCLK_RTC)         == RCC_PERIPHCLK_RTC))\r
3302 #elif defined (STM32F765xx)\r
3303 #define IS_RCC_PERIPHCLOCK(SELECTION)  \\r
3304                ((((SELECTION) & RCC_PERIPHCLK_I2S)         == RCC_PERIPHCLK_I2S)     || \\r
3305                 (((SELECTION) & RCC_PERIPHCLK_TIM)         == RCC_PERIPHCLK_TIM)     || \\r
3306                 (((SELECTION) & RCC_PERIPHCLK_USART1)      == RCC_PERIPHCLK_USART1)  || \\r
3307                 (((SELECTION) & RCC_PERIPHCLK_USART2)      == RCC_PERIPHCLK_USART2)  || \\r
3308                 (((SELECTION) & RCC_PERIPHCLK_USART3)      == RCC_PERIPHCLK_USART3)  || \\r
3309                 (((SELECTION) & RCC_PERIPHCLK_UART4)       == RCC_PERIPHCLK_UART4)   || \\r
3310                 (((SELECTION) & RCC_PERIPHCLK_UART5)       == RCC_PERIPHCLK_UART5)   || \\r
3311                 (((SELECTION) & RCC_PERIPHCLK_USART6)      == RCC_PERIPHCLK_USART6)  || \\r
3312                 (((SELECTION) & RCC_PERIPHCLK_UART7)       == RCC_PERIPHCLK_UART7)   || \\r
3313                 (((SELECTION) & RCC_PERIPHCLK_UART8)       == RCC_PERIPHCLK_UART8)   || \\r
3314                 (((SELECTION) & RCC_PERIPHCLK_I2C1)        == RCC_PERIPHCLK_I2C1)    || \\r
3315                 (((SELECTION) & RCC_PERIPHCLK_I2C2)        == RCC_PERIPHCLK_I2C2)    || \\r
3316                 (((SELECTION) & RCC_PERIPHCLK_I2C3)        == RCC_PERIPHCLK_I2C3)    || \\r
3317                 (((SELECTION) & RCC_PERIPHCLK_I2C4)        == RCC_PERIPHCLK_I2C4)    || \\r
3318                 (((SELECTION) & RCC_PERIPHCLK_LPTIM1)      == RCC_PERIPHCLK_LPTIM1)  || \\r
3319                 (((SELECTION) & RCC_PERIPHCLK_SAI1)        == RCC_PERIPHCLK_SAI1)    || \\r
3320                 (((SELECTION) & RCC_PERIPHCLK_SAI2)        == RCC_PERIPHCLK_SAI2)    || \\r
3321                 (((SELECTION) & RCC_PERIPHCLK_CLK48)       == RCC_PERIPHCLK_CLK48)   || \\r
3322                 (((SELECTION) & RCC_PERIPHCLK_CEC)         == RCC_PERIPHCLK_CEC)     || \\r
3323                 (((SELECTION) & RCC_PERIPHCLK_SDMMC1)      == RCC_PERIPHCLK_SDMMC1)  || \\r
3324                 (((SELECTION) & RCC_PERIPHCLK_SDMMC2)      == RCC_PERIPHCLK_SDMMC2)  || \\r
3325                 (((SELECTION) & RCC_PERIPHCLK_DFSDM1)       == RCC_PERIPHCLK_DFSDM1)   || \\r
3326                 (((SELECTION) & RCC_PERIPHCLK_DFSDM1_AUDIO) == RCC_PERIPHCLK_DFSDM1_AUDIO) || \\r
3327                 (((SELECTION) & RCC_PERIPHCLK_SPDIFRX)     == RCC_PERIPHCLK_SPDIFRX) || \\r
3328                 (((SELECTION) & RCC_PERIPHCLK_RTC)         == RCC_PERIPHCLK_RTC))\r
3329 #elif defined (STM32F722xx) || defined (STM32F723xx) || defined (STM32F732xx) || defined (STM32F733xx) || defined (STM32F730xx)\r
3330 #define IS_RCC_PERIPHCLOCK(SELECTION)  \\r
3331                ((((SELECTION) & RCC_PERIPHCLK_I2S)         == RCC_PERIPHCLK_I2S)     || \\r
3332                 (((SELECTION) & RCC_PERIPHCLK_TIM)         == RCC_PERIPHCLK_TIM)     || \\r
3333                 (((SELECTION) & RCC_PERIPHCLK_USART1)      == RCC_PERIPHCLK_USART1)  || \\r
3334                 (((SELECTION) & RCC_PERIPHCLK_USART2)      == RCC_PERIPHCLK_USART2)  || \\r
3335                 (((SELECTION) & RCC_PERIPHCLK_USART3)      == RCC_PERIPHCLK_USART3)  || \\r
3336                 (((SELECTION) & RCC_PERIPHCLK_UART4)       == RCC_PERIPHCLK_UART4)   || \\r
3337                 (((SELECTION) & RCC_PERIPHCLK_UART5)       == RCC_PERIPHCLK_UART5)   || \\r
3338                 (((SELECTION) & RCC_PERIPHCLK_USART6)      == RCC_PERIPHCLK_USART6)  || \\r
3339                 (((SELECTION) & RCC_PERIPHCLK_UART7)       == RCC_PERIPHCLK_UART7)   || \\r
3340                 (((SELECTION) & RCC_PERIPHCLK_UART8)       == RCC_PERIPHCLK_UART8)   || \\r
3341                 (((SELECTION) & RCC_PERIPHCLK_I2C1)        == RCC_PERIPHCLK_I2C1)    || \\r
3342                 (((SELECTION) & RCC_PERIPHCLK_I2C2)        == RCC_PERIPHCLK_I2C2)    || \\r
3343                 (((SELECTION) & RCC_PERIPHCLK_I2C3)        == RCC_PERIPHCLK_I2C3)    || \\r
3344                 (((SELECTION) & RCC_PERIPHCLK_LPTIM1)      == RCC_PERIPHCLK_LPTIM1)  || \\r
3345                 (((SELECTION) & RCC_PERIPHCLK_SAI1)        == RCC_PERIPHCLK_SAI1)    || \\r
3346                 (((SELECTION) & RCC_PERIPHCLK_SAI2)        == RCC_PERIPHCLK_SAI2)    || \\r
3347                 (((SELECTION) & RCC_PERIPHCLK_CLK48)       == RCC_PERIPHCLK_CLK48)   || \\r
3348                 (((SELECTION) & RCC_PERIPHCLK_SDMMC1)      == RCC_PERIPHCLK_SDMMC1)  || \\r
3349                 (((SELECTION) & RCC_PERIPHCLK_SDMMC2)      == RCC_PERIPHCLK_SDMMC2)  || \\r
3350                 (((SELECTION) & RCC_PERIPHCLK_RTC)         == RCC_PERIPHCLK_RTC))\r
3351 #endif /* STM32F746xx || STM32F756xx || STM32F750xx */\r
3352 #define IS_RCC_PLLI2SN_VALUE(VALUE) ((50 <= (VALUE)) && ((VALUE) <= 432))\r
3353 #if defined (STM32F745xx) || defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F765xx) || defined (STM32F767xx) || \\r
3354     defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F750xx)\r
3355 #define IS_RCC_PLLI2SP_VALUE(VALUE) (((VALUE) == RCC_PLLI2SP_DIV2) ||\\r
3356                                      ((VALUE) == RCC_PLLI2SP_DIV4) ||\\r
3357                                      ((VALUE) == RCC_PLLI2SP_DIV6) ||\\r
3358                                      ((VALUE) == RCC_PLLI2SP_DIV8))\r
3359 #endif /* STM32F745xx || STM32F746xx || STM32F756xx || STM32F765xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F750xx */\r
3360 #define IS_RCC_PLLI2SQ_VALUE(VALUE) ((2 <= (VALUE)) && ((VALUE) <= 15))\r
3361 #define IS_RCC_PLLI2SR_VALUE(VALUE) ((2 <= (VALUE)) && ((VALUE) <= 7))\r
3362 \r
3363 #define IS_RCC_PLLSAIN_VALUE(VALUE) ((50 <= (VALUE)) && ((VALUE) <= 432))\r
3364 #define IS_RCC_PLLSAIP_VALUE(VALUE) (((VALUE) == RCC_PLLSAIP_DIV2) ||\\r
3365                                      ((VALUE) == RCC_PLLSAIP_DIV4) ||\\r
3366                                      ((VALUE) == RCC_PLLSAIP_DIV6) ||\\r
3367                                      ((VALUE) == RCC_PLLSAIP_DIV8))\r
3368 #define IS_RCC_PLLSAIQ_VALUE(VALUE) ((2 <= (VALUE)) && ((VALUE) <= 15))\r
3369 #define IS_RCC_PLLSAIR_VALUE(VALUE) ((2 <= (VALUE)) && ((VALUE) <= 7))\r
3370 \r
3371 #define IS_RCC_PLLSAI_DIVQ_VALUE(VALUE) ((1 <= (VALUE)) && ((VALUE) <= 32))\r
3372 \r
3373 #define IS_RCC_PLLI2S_DIVQ_VALUE(VALUE) ((1 <= (VALUE)) && ((VALUE) <= 32))\r
3374 \r
3375 #define IS_RCC_PLLSAI_DIVR_VALUE(VALUE) (((VALUE) == RCC_PLLSAIDIVR_2) ||\\r
3376                                          ((VALUE) == RCC_PLLSAIDIVR_4) ||\\r
3377                                          ((VALUE) == RCC_PLLSAIDIVR_8) ||\\r
3378                                          ((VALUE) == RCC_PLLSAIDIVR_16))\r
3379 #define IS_RCC_I2SCLKSOURCE(SOURCE)  (((SOURCE) == RCC_I2SCLKSOURCE_PLLI2S) || \\r
3380                                       ((SOURCE) == RCC_I2SCLKSOURCE_EXT))\r
3381 \r
3382 #define IS_RCC_SDMMC1CLKSOURCE(SOURCE) (((SOURCE) == RCC_SDMMC1CLKSOURCE_SYSCLK) || \\r
3383                                         ((SOURCE) == RCC_SDMMC1CLKSOURCE_CLK48))\r
3384 \r
3385 #define IS_RCC_CECCLKSOURCE(SOURCE)  (((SOURCE) == RCC_CECCLKSOURCE_HSI) || \\r
3386                                       ((SOURCE) == RCC_CECCLKSOURCE_LSE))\r
3387 #define IS_RCC_USART1CLKSOURCE(SOURCE)  \\r
3388                (((SOURCE) == RCC_USART1CLKSOURCE_PCLK2)  || \\r
3389                 ((SOURCE) == RCC_USART1CLKSOURCE_SYSCLK) || \\r
3390                 ((SOURCE) == RCC_USART1CLKSOURCE_LSE)    || \\r
3391                 ((SOURCE) == RCC_USART1CLKSOURCE_HSI))\r
3392 \r
3393 #define IS_RCC_USART2CLKSOURCE(SOURCE)  \\r
3394                (((SOURCE) == RCC_USART2CLKSOURCE_PCLK1)  || \\r
3395                 ((SOURCE) == RCC_USART2CLKSOURCE_SYSCLK) || \\r
3396                 ((SOURCE) == RCC_USART2CLKSOURCE_LSE)    || \\r
3397                 ((SOURCE) == RCC_USART2CLKSOURCE_HSI))\r
3398 #define IS_RCC_USART3CLKSOURCE(SOURCE)  \\r
3399                (((SOURCE) == RCC_USART3CLKSOURCE_PCLK1)  || \\r
3400                 ((SOURCE) == RCC_USART3CLKSOURCE_SYSCLK) || \\r
3401                 ((SOURCE) == RCC_USART3CLKSOURCE_LSE)    || \\r
3402                 ((SOURCE) == RCC_USART3CLKSOURCE_HSI))\r
3403 \r
3404 #define IS_RCC_UART4CLKSOURCE(SOURCE)  \\r
3405                (((SOURCE) == RCC_UART4CLKSOURCE_PCLK1)  || \\r
3406                 ((SOURCE) == RCC_UART4CLKSOURCE_SYSCLK) || \\r
3407                 ((SOURCE) == RCC_UART4CLKSOURCE_LSE)    || \\r
3408                 ((SOURCE) == RCC_UART4CLKSOURCE_HSI))\r
3409 \r
3410 #define IS_RCC_UART5CLKSOURCE(SOURCE)  \\r
3411                (((SOURCE) == RCC_UART5CLKSOURCE_PCLK1)  || \\r
3412                 ((SOURCE) == RCC_UART5CLKSOURCE_SYSCLK) || \\r
3413                 ((SOURCE) == RCC_UART5CLKSOURCE_LSE)    || \\r
3414                 ((SOURCE) == RCC_UART5CLKSOURCE_HSI))\r
3415 \r
3416 #define IS_RCC_USART6CLKSOURCE(SOURCE)  \\r
3417                (((SOURCE) == RCC_USART6CLKSOURCE_PCLK2)  || \\r
3418                 ((SOURCE) == RCC_USART6CLKSOURCE_SYSCLK) || \\r
3419                 ((SOURCE) == RCC_USART6CLKSOURCE_LSE)    || \\r
3420                 ((SOURCE) == RCC_USART6CLKSOURCE_HSI))\r
3421 \r
3422 #define IS_RCC_UART7CLKSOURCE(SOURCE)  \\r
3423                (((SOURCE) == RCC_UART7CLKSOURCE_PCLK1)  || \\r
3424                 ((SOURCE) == RCC_UART7CLKSOURCE_SYSCLK) || \\r
3425                 ((SOURCE) == RCC_UART7CLKSOURCE_LSE)    || \\r
3426                 ((SOURCE) == RCC_UART7CLKSOURCE_HSI))\r
3427 \r
3428 #define IS_RCC_UART8CLKSOURCE(SOURCE)  \\r
3429                (((SOURCE) == RCC_UART8CLKSOURCE_PCLK1)  || \\r
3430                 ((SOURCE) == RCC_UART8CLKSOURCE_SYSCLK) || \\r
3431                 ((SOURCE) == RCC_UART8CLKSOURCE_LSE)    || \\r
3432                 ((SOURCE) == RCC_UART8CLKSOURCE_HSI))\r
3433 #define IS_RCC_I2C1CLKSOURCE(SOURCE)   \\r
3434                (((SOURCE) == RCC_I2C1CLKSOURCE_PCLK1) || \\r
3435                 ((SOURCE) == RCC_I2C1CLKSOURCE_SYSCLK)|| \\r
3436                 ((SOURCE) == RCC_I2C1CLKSOURCE_HSI))\r
3437 #define IS_RCC_I2C2CLKSOURCE(SOURCE)   \\r
3438                (((SOURCE) == RCC_I2C2CLKSOURCE_PCLK1) || \\r
3439                 ((SOURCE) == RCC_I2C2CLKSOURCE_SYSCLK)|| \\r
3440                 ((SOURCE) == RCC_I2C2CLKSOURCE_HSI))\r
3441 \r
3442 #define IS_RCC_I2C3CLKSOURCE(SOURCE)   \\r
3443                (((SOURCE) == RCC_I2C3CLKSOURCE_PCLK1) || \\r
3444                 ((SOURCE) == RCC_I2C3CLKSOURCE_SYSCLK)|| \\r
3445                 ((SOURCE) == RCC_I2C3CLKSOURCE_HSI))\r
3446 #define IS_RCC_I2C4CLKSOURCE(SOURCE)   \\r
3447                (((SOURCE) == RCC_I2C4CLKSOURCE_PCLK1) || \\r
3448                 ((SOURCE) == RCC_I2C4CLKSOURCE_SYSCLK)|| \\r
3449                 ((SOURCE) == RCC_I2C4CLKSOURCE_HSI))\r
3450 #define IS_RCC_LPTIM1CLK(SOURCE)  \\r
3451                (((SOURCE) == RCC_LPTIM1CLKSOURCE_PCLK1) || \\r
3452                 ((SOURCE) == RCC_LPTIM1CLKSOURCE_LSI)  || \\r
3453                 ((SOURCE) == RCC_LPTIM1CLKSOURCE_HSI)  || \\r
3454                 ((SOURCE) == RCC_LPTIM1CLKSOURCE_LSE))\r
3455 #define IS_RCC_CLK48SOURCE(SOURCE)  \\r
3456                (((SOURCE) == RCC_CLK48SOURCE_PLLSAIP) || \\r
3457                 ((SOURCE) == RCC_CLK48SOURCE_PLL))\r
3458 #define IS_RCC_TIMPRES(VALUE)  \\r
3459                (((VALUE) == RCC_TIMPRES_DESACTIVATED) || \\r
3460                 ((VALUE) == RCC_TIMPRES_ACTIVATED))\r
3461 \r
3462 #if defined (STM32F722xx) || defined (STM32F723xx) || defined (STM32F732xx) || defined (STM32F733xx) || defined (STM32F745xx) ||\\r
3463     defined (STM32F746xx) || defined (STM32F756xx) || defined (STM32F730xx) || defined (STM32F750xx)\r
3464 #define IS_RCC_SAI1CLKSOURCE(SOURCE)  (((SOURCE) == RCC_SAI1CLKSOURCE_PLLSAI) || \\r
3465                                        ((SOURCE) == RCC_SAI1CLKSOURCE_PLLI2S) || \\r
3466                                        ((SOURCE) == RCC_SAI1CLKSOURCE_PIN))\r
3467 #define IS_RCC_SAI2CLKSOURCE(SOURCE)  (((SOURCE) == RCC_SAI2CLKSOURCE_PLLSAI) || \\r
3468                                        ((SOURCE) == RCC_SAI2CLKSOURCE_PLLI2S) || \\r
3469                                        ((SOURCE) == RCC_SAI2CLKSOURCE_PIN))\r
3470 #endif /* STM32F722xx || STM32F723xx || STM32F732xx || STM32F733xx || STM32F745xx || STM32F746xx || STM32F756xx || STM32F750xx || STM32F730xx */\r
3471 \r
3472 #if defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
3473 #define IS_RCC_PLLR_VALUE(VALUE)            ((2 <= (VALUE)) && ((VALUE) <= 7))\r
3474 \r
3475 #define IS_RCC_SAI1CLKSOURCE(SOURCE)  (((SOURCE) == RCC_SAI1CLKSOURCE_PLLSAI) || \\r
3476                                        ((SOURCE) == RCC_SAI1CLKSOURCE_PLLI2S) || \\r
3477                                        ((SOURCE) == RCC_SAI1CLKSOURCE_PIN)    || \\r
3478                                        ((SOURCE) == RCC_SAI1CLKSOURCE_PLLSRC))\r
3479 \r
3480 #define IS_RCC_SAI2CLKSOURCE(SOURCE)  (((SOURCE) == RCC_SAI2CLKSOURCE_PLLSAI) || \\r
3481                                        ((SOURCE) == RCC_SAI2CLKSOURCE_PLLI2S) || \\r
3482                                        ((SOURCE) == RCC_SAI2CLKSOURCE_PIN)    || \\r
3483                                        ((SOURCE) == RCC_SAI2CLKSOURCE_PLLSRC))\r
3484 \r
3485 #define IS_RCC_DFSDM1CLKSOURCE(SOURCE)  (((SOURCE) == RCC_DFSDM1CLKSOURCE_PCLK2) || \\r
3486                                         ((SOURCE) == RCC_DFSDM1CLKSOURCE_SYSCLK))\r
3487 \r
3488 #define IS_RCC_DFSDM1AUDIOCLKSOURCE(SOURCE)  (((SOURCE) == RCC_DFSDM1AUDIOCLKSOURCE_SAI1) || \\r
3489                                              ((SOURCE) == RCC_DFSDM1AUDIOCLKSOURCE_SAI2))\r
3490 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
3491 \r
3492 #if defined (STM32F722xx) || defined (STM32F723xx) || defined (STM32F732xx) || defined (STM32F733xx) || defined (STM32F765xx) ||\\r
3493     defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx) || defined (STM32F730xx)\r
3494 #define IS_RCC_SDMMC2CLKSOURCE(SOURCE)  (((SOURCE) == RCC_SDMMC2CLKSOURCE_SYSCLK) || \\r
3495                                          ((SOURCE) == RCC_SDMMC2CLKSOURCE_CLK48))\r
3496 #endif /* STM32F722xx || STM32F723xx || STM32F732xx || STM32F733xx || STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx || STM32F730xx */\r
3497 \r
3498 #if defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) || defined (STM32F779xx)\r
3499 #define IS_RCC_DSIBYTELANECLKSOURCE(SOURCE) (((SOURCE) == RCC_DSICLKSOURCE_PLLR)  ||\\r
3500                                              ((SOURCE) == RCC_DSICLKSOURCE_DSIPHY))\r
3501 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */\r
3502 \r
3503 /**\r
3504   * @}\r
3505   */\r
3506 \r
3507 /**\r
3508   * @}\r
3509   */\r
3510 \r
3511 /**\r
3512   * @}\r
3513   */\r
3514 \r
3515 /**\r
3516   * @}\r
3517   */\r
3518 #ifdef __cplusplus\r
3519 }\r
3520 #endif\r
3521 \r
3522 #endif /* __STM32F7xx_HAL_RCC_EX_H */\r
3523 \r
3524 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r