mbed official / mbed

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

Committer:
Kojto
Date:
Thu Jul 07 14:34:11 2016 +0100
Revision:
122:f9eeca106725
Parent:
117:99a22ba036c9
Release 122 of the mbed library

Changes:
- new targets - Nucleo L432KC, Beetle, Nucleo F446ZE, Nucleo L011K4
- Thread safety addition - mbed API should contain a statement about thread safety
- critical section API addition
- CAS API (core_util_atomic_incr/decr)
- DEVICE_ are generated from targets.json file, device.h deprecated
- Callback replaces FunctionPointer to provide std like interface
- mbed HAL API docs improvements
- toolchain - prexif attributes with MBED_
- add new attributes - packed, weak, forcedinline, align
- target.json - contains targets definitions
- ST - L1XX - Cube update to 1.5
- SPI clock selection fix (clock from APB domain)
- F7 - Cube update v1.4.0
- L0 - baudrate init fix
- L1 - Cube update v1.5
- F3 - baudrate init fix, 3 targets CAN support
- F4 - Cube update v1.12.0, 3 targets CAN support
- L4XX - Cube update v1.5.1
- F0 - update Cube to v1.5.0
- L4 - 2 targets (L476RG/VG) CAN support
- NXP - pwm clock fix for KSDK2 MCU
- LPC2368 - remove ARM toolchain support - due to regression
- KSDK2 - fix SPI , I2C address and repeat start
- Silabs - some fixes backported from mbed 3
- Renesas - RZ_A1H - SystemCoreClockUpdate addition

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 107:4f6c30876dfa 1 /**
Kojto 107:4f6c30876dfa 2 ******************************************************************************
Kojto 107:4f6c30876dfa 3 * @file stm32l4xx_hal_rcc.h
Kojto 107:4f6c30876dfa 4 * @author MCD Application Team
Kojto 122:f9eeca106725 5 * @version V1.5.1
Kojto 122:f9eeca106725 6 * @date 31-May-2016
Kojto 107:4f6c30876dfa 7 * @brief Header file of RCC HAL module.
Kojto 107:4f6c30876dfa 8 ******************************************************************************
Kojto 107:4f6c30876dfa 9 * @attention
Kojto 107:4f6c30876dfa 10 *
Kojto 122:f9eeca106725 11 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
Kojto 107:4f6c30876dfa 12 *
Kojto 107:4f6c30876dfa 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 107:4f6c30876dfa 14 * are permitted provided that the following conditions are met:
Kojto 107:4f6c30876dfa 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 107:4f6c30876dfa 16 * this list of conditions and the following disclaimer.
Kojto 107:4f6c30876dfa 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 107:4f6c30876dfa 18 * this list of conditions and the following disclaimer in the documentation
Kojto 107:4f6c30876dfa 19 * and/or other materials provided with the distribution.
Kojto 107:4f6c30876dfa 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 107:4f6c30876dfa 21 * may be used to endorse or promote products derived from this software
Kojto 107:4f6c30876dfa 22 * without specific prior written permission.
Kojto 107:4f6c30876dfa 23 *
Kojto 107:4f6c30876dfa 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 107:4f6c30876dfa 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 107:4f6c30876dfa 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 107:4f6c30876dfa 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 107:4f6c30876dfa 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 107:4f6c30876dfa 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 107:4f6c30876dfa 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 107:4f6c30876dfa 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 107:4f6c30876dfa 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 107:4f6c30876dfa 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 107:4f6c30876dfa 34 *
Kojto 107:4f6c30876dfa 35 ******************************************************************************
Kojto 107:4f6c30876dfa 36 */
Kojto 107:4f6c30876dfa 37
Kojto 107:4f6c30876dfa 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 107:4f6c30876dfa 39 #ifndef __STM32L4xx_HAL_RCC_H
Kojto 107:4f6c30876dfa 40 #define __STM32L4xx_HAL_RCC_H
Kojto 107:4f6c30876dfa 41
Kojto 107:4f6c30876dfa 42 #ifdef __cplusplus
Kojto 107:4f6c30876dfa 43 extern "C" {
Kojto 107:4f6c30876dfa 44 #endif
Kojto 107:4f6c30876dfa 45
Kojto 107:4f6c30876dfa 46 /* Includes ------------------------------------------------------------------*/
Kojto 107:4f6c30876dfa 47 #include "stm32l4xx_hal_def.h"
Kojto 107:4f6c30876dfa 48
Kojto 107:4f6c30876dfa 49 /** @addtogroup STM32L4xx_HAL_Driver
Kojto 107:4f6c30876dfa 50 * @{
Kojto 107:4f6c30876dfa 51 */
Kojto 107:4f6c30876dfa 52
Kojto 107:4f6c30876dfa 53 /** @addtogroup RCC
Kojto 107:4f6c30876dfa 54 * @{
Kojto 107:4f6c30876dfa 55 */
Kojto 107:4f6c30876dfa 56
Kojto 107:4f6c30876dfa 57 /* Exported types ------------------------------------------------------------*/
Kojto 107:4f6c30876dfa 58 /** @defgroup RCC_Exported_Types RCC Exported Types
Kojto 107:4f6c30876dfa 59 * @{
Kojto 107:4f6c30876dfa 60 */
Kojto 107:4f6c30876dfa 61
Kojto 107:4f6c30876dfa 62 /**
Kojto 107:4f6c30876dfa 63 * @brief RCC PLL configuration structure definition
Kojto 107:4f6c30876dfa 64 */
Kojto 107:4f6c30876dfa 65 typedef struct
Kojto 107:4f6c30876dfa 66 {
Kojto 107:4f6c30876dfa 67 uint32_t PLLState; /*!< The new state of the PLL.
Kojto 107:4f6c30876dfa 68 This parameter can be a value of @ref RCC_PLL_Config */
Kojto 107:4f6c30876dfa 69
Kojto 107:4f6c30876dfa 70 uint32_t PLLSource; /*!< RCC_PLLSource: PLL entry clock source.
Kojto 107:4f6c30876dfa 71 This parameter must be a value of @ref RCC_PLL_Clock_Source */
Kojto 107:4f6c30876dfa 72
Kojto 107:4f6c30876dfa 73 uint32_t PLLM; /*!< PLLM: Division factor for PLL VCO input clock.
Kojto 122:f9eeca106725 74 This parameter must be a number between Min_Data = 1 and Max_Data = 8 */
Kojto 107:4f6c30876dfa 75
Kojto 107:4f6c30876dfa 76 uint32_t PLLN; /*!< PLLN: Multiplication factor for PLL VCO output clock.
Kojto 107:4f6c30876dfa 77 This parameter must be a number between Min_Data = 8 and Max_Data = 86 */
Kojto 107:4f6c30876dfa 78
Kojto 107:4f6c30876dfa 79 uint32_t PLLP; /*!< PLLP: Division factor for SAI clock.
Kojto 107:4f6c30876dfa 80 This parameter must be a value of @ref RCC_PLLP_Clock_Divider */
Kojto 107:4f6c30876dfa 81
Kojto 107:4f6c30876dfa 82 uint32_t PLLQ; /*!< PLLQ: Division factor for SDMMC1, RNG and USB clocks.
Kojto 107:4f6c30876dfa 83 This parameter must be a value of @ref RCC_PLLQ_Clock_Divider */
Kojto 107:4f6c30876dfa 84
Kojto 107:4f6c30876dfa 85 uint32_t PLLR; /*!< PLLR: Division for the main system clock.
Kojto 107:4f6c30876dfa 86 User have to set the PLLR parameter correctly to not exceed max frequency 80MHZ.
Kojto 107:4f6c30876dfa 87 This parameter must be a value of @ref RCC_PLLR_Clock_Divider */
Kojto 107:4f6c30876dfa 88
Kojto 107:4f6c30876dfa 89 }RCC_PLLInitTypeDef;
Kojto 107:4f6c30876dfa 90
Kojto 107:4f6c30876dfa 91 /**
Kojto 107:4f6c30876dfa 92 * @brief RCC Internal/External Oscillator (HSE, HSI, MSI, LSE and LSI) configuration structure definition
Kojto 107:4f6c30876dfa 93 */
Kojto 107:4f6c30876dfa 94 typedef struct
Kojto 107:4f6c30876dfa 95 {
Kojto 107:4f6c30876dfa 96 uint32_t OscillatorType; /*!< The oscillators to be configured.
Kojto 107:4f6c30876dfa 97 This parameter can be a value of @ref RCC_Oscillator_Type */
Kojto 107:4f6c30876dfa 98
Kojto 107:4f6c30876dfa 99 uint32_t HSEState; /*!< The new state of the HSE.
Kojto 107:4f6c30876dfa 100 This parameter can be a value of @ref RCC_HSE_Config */
Kojto 107:4f6c30876dfa 101
Kojto 107:4f6c30876dfa 102 uint32_t LSEState; /*!< The new state of the LSE.
Kojto 107:4f6c30876dfa 103 This parameter can be a value of @ref RCC_LSE_Config */
Kojto 107:4f6c30876dfa 104
Kojto 107:4f6c30876dfa 105 uint32_t HSIState; /*!< The new state of the HSI.
Kojto 107:4f6c30876dfa 106 This parameter can be a value of @ref RCC_HSI_Config */
Kojto 107:4f6c30876dfa 107
Kojto 107:4f6c30876dfa 108 uint32_t HSICalibrationValue; /*!< The calibration trimming value (default is RCC_HSICALIBRATION_DEFAULT).
Kojto 122:f9eeca106725 109 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x1F on STM32L47x/STM32L48x devices.
Kojto 122:f9eeca106725 110 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7F on STM32L43x/STM32L44x/STM32L49x/STM32L4Ax/ devices */
Kojto 107:4f6c30876dfa 111
Kojto 107:4f6c30876dfa 112 uint32_t LSIState; /*!< The new state of the LSI.
Kojto 107:4f6c30876dfa 113 This parameter can be a value of @ref RCC_LSI_Config */
Kojto 107:4f6c30876dfa 114
Kojto 107:4f6c30876dfa 115 uint32_t MSIState; /*!< The new state of the MSI.
Kojto 107:4f6c30876dfa 116 This parameter can be a value of @ref RCC_MSI_Config */
Kojto 107:4f6c30876dfa 117
Kojto 107:4f6c30876dfa 118 uint32_t MSICalibrationValue; /*!< The calibration trimming value (default is RCC_MSICALIBRATION_DEFAULT).
Kojto 107:4f6c30876dfa 119 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF */
Kojto 107:4f6c30876dfa 120
Kojto 107:4f6c30876dfa 121 uint32_t MSIClockRange; /*!< The MSI frequency range.
Kojto 107:4f6c30876dfa 122 This parameter can be a value of @ref RCC_MSI_Clock_Range */
Kojto 107:4f6c30876dfa 123
Kojto 122:f9eeca106725 124 uint32_t HSI48State; /*!< The new state of the HSI48 (only applicable to STM32L43x/STM32L44x/STM32L49x/STM32L4Ax devices).
Kojto 122:f9eeca106725 125 This parameter can be a value of @ref RCC_HSI48_Config */
Kojto 122:f9eeca106725 126
Kojto 107:4f6c30876dfa 127 RCC_PLLInitTypeDef PLL; /*!< Main PLL structure parameters */
Kojto 107:4f6c30876dfa 128
Kojto 107:4f6c30876dfa 129 }RCC_OscInitTypeDef;
Kojto 107:4f6c30876dfa 130
Kojto 107:4f6c30876dfa 131 /**
Kojto 107:4f6c30876dfa 132 * @brief RCC System, AHB and APB busses clock configuration structure definition
Kojto 107:4f6c30876dfa 133 */
Kojto 107:4f6c30876dfa 134 typedef struct
Kojto 107:4f6c30876dfa 135 {
Kojto 107:4f6c30876dfa 136 uint32_t ClockType; /*!< The clock to be configured.
Kojto 107:4f6c30876dfa 137 This parameter can be a value of @ref RCC_System_Clock_Type */
Kojto 107:4f6c30876dfa 138
Kojto 107:4f6c30876dfa 139 uint32_t SYSCLKSource; /*!< The clock source used as system clock (SYSCLK).
Kojto 107:4f6c30876dfa 140 This parameter can be a value of @ref RCC_System_Clock_Source */
Kojto 107:4f6c30876dfa 141
Kojto 107:4f6c30876dfa 142 uint32_t AHBCLKDivider; /*!< The AHB clock (HCLK) divider. This clock is derived from the system clock (SYSCLK).
Kojto 107:4f6c30876dfa 143 This parameter can be a value of @ref RCC_AHB_Clock_Source */
Kojto 107:4f6c30876dfa 144
Kojto 107:4f6c30876dfa 145 uint32_t APB1CLKDivider; /*!< The APB1 clock (PCLK1) divider. This clock is derived from the AHB clock (HCLK).
Kojto 107:4f6c30876dfa 146 This parameter can be a value of @ref RCC_APB1_APB2_Clock_Source */
Kojto 107:4f6c30876dfa 147
Kojto 107:4f6c30876dfa 148 uint32_t APB2CLKDivider; /*!< The APB2 clock (PCLK2) divider. This clock is derived from the AHB clock (HCLK).
Kojto 107:4f6c30876dfa 149 This parameter can be a value of @ref RCC_APB1_APB2_Clock_Source */
Kojto 107:4f6c30876dfa 150
Kojto 107:4f6c30876dfa 151 }RCC_ClkInitTypeDef;
Kojto 107:4f6c30876dfa 152
Kojto 107:4f6c30876dfa 153 /**
Kojto 107:4f6c30876dfa 154 * @}
Kojto 107:4f6c30876dfa 155 */
Kojto 107:4f6c30876dfa 156
Kojto 107:4f6c30876dfa 157 /* Exported constants --------------------------------------------------------*/
Kojto 107:4f6c30876dfa 158 /** @defgroup RCC_Exported_Constants RCC Exported Constants
Kojto 107:4f6c30876dfa 159 * @{
Kojto 107:4f6c30876dfa 160 */
Kojto 107:4f6c30876dfa 161
Kojto 107:4f6c30876dfa 162 /** @defgroup RCC_Timeout_Value Timeout Values
Kojto 107:4f6c30876dfa 163 * @{
Kojto 107:4f6c30876dfa 164 */
Kojto 122:f9eeca106725 165 #define RCC_DBP_TIMEOUT_VALUE ((uint32_t)2U) /* 2 ms (minimum Tick + 1) */
Kojto 117:99a22ba036c9 166 #define RCC_LSE_TIMEOUT_VALUE LSE_STARTUP_TIMEOUT
Kojto 107:4f6c30876dfa 167 /**
Kojto 107:4f6c30876dfa 168 * @}
Kojto 107:4f6c30876dfa 169 */
Kojto 107:4f6c30876dfa 170
Kojto 107:4f6c30876dfa 171 /** @defgroup RCC_Oscillator_Type Oscillator Type
Kojto 107:4f6c30876dfa 172 * @{
Kojto 107:4f6c30876dfa 173 */
Kojto 122:f9eeca106725 174 #define RCC_OSCILLATORTYPE_NONE ((uint32_t)0x00000000U) /*!< Oscillator configuration unchanged */
Kojto 122:f9eeca106725 175 #define RCC_OSCILLATORTYPE_HSE ((uint32_t)0x00000001U) /*!< HSE to configure */
Kojto 122:f9eeca106725 176 #define RCC_OSCILLATORTYPE_HSI ((uint32_t)0x00000002U) /*!< HSI to configure */
Kojto 122:f9eeca106725 177 #define RCC_OSCILLATORTYPE_LSE ((uint32_t)0x00000004U) /*!< LSE to configure */
Kojto 122:f9eeca106725 178 #define RCC_OSCILLATORTYPE_LSI ((uint32_t)0x00000008U) /*!< LSI to configure */
Kojto 122:f9eeca106725 179 #define RCC_OSCILLATORTYPE_MSI ((uint32_t)0x00000010U) /*!< MSI to configure */
Kojto 122:f9eeca106725 180 #if defined(RCC_HSI48_SUPPORT)
Kojto 122:f9eeca106725 181 #define RCC_OSCILLATORTYPE_HSI48 ((uint32_t)0x00000020U) /*!< HSI48 to configure */
Kojto 122:f9eeca106725 182 #endif /* RCC_HSI48_SUPPORT */
Kojto 107:4f6c30876dfa 183 /**
Kojto 107:4f6c30876dfa 184 * @}
Kojto 107:4f6c30876dfa 185 */
Kojto 107:4f6c30876dfa 186
Kojto 107:4f6c30876dfa 187 /** @defgroup RCC_HSE_Config HSE Config
Kojto 107:4f6c30876dfa 188 * @{
Kojto 107:4f6c30876dfa 189 */
Kojto 122:f9eeca106725 190 #define RCC_HSE_OFF ((uint32_t)0x00000000U) /*!< HSE clock deactivation */
Kojto 107:4f6c30876dfa 191 #define RCC_HSE_ON RCC_CR_HSEON /*!< HSE clock activation */
Kojto 107:4f6c30876dfa 192 #define RCC_HSE_BYPASS ((uint32_t)(RCC_CR_HSEBYP | RCC_CR_HSEON)) /*!< External clock source for HSE clock */
Kojto 107:4f6c30876dfa 193 /**
Kojto 107:4f6c30876dfa 194 * @}
Kojto 107:4f6c30876dfa 195 */
Kojto 107:4f6c30876dfa 196
Kojto 107:4f6c30876dfa 197 /** @defgroup RCC_LSE_Config LSE Config
Kojto 107:4f6c30876dfa 198 * @{
Kojto 107:4f6c30876dfa 199 */
Kojto 122:f9eeca106725 200 #define RCC_LSE_OFF ((uint32_t)0x00000000U) /*!< LSE clock deactivation */
Kojto 107:4f6c30876dfa 201 #define RCC_LSE_ON RCC_BDCR_LSEON /*!< LSE clock activation */
Kojto 107:4f6c30876dfa 202 #define RCC_LSE_BYPASS ((uint32_t)(RCC_BDCR_LSEBYP | RCC_BDCR_LSEON)) /*!< External clock source for LSE clock */
Kojto 107:4f6c30876dfa 203 /**
Kojto 107:4f6c30876dfa 204 * @}
Kojto 107:4f6c30876dfa 205 */
Kojto 107:4f6c30876dfa 206
Kojto 107:4f6c30876dfa 207 /** @defgroup RCC_HSI_Config HSI Config
Kojto 107:4f6c30876dfa 208 * @{
Kojto 107:4f6c30876dfa 209 */
Kojto 122:f9eeca106725 210 #define RCC_HSI_OFF ((uint32_t)0x00000000U) /*!< HSI clock deactivation */
Kojto 107:4f6c30876dfa 211 #define RCC_HSI_ON RCC_CR_HSION /*!< HSI clock activation */
Kojto 107:4f6c30876dfa 212
Kojto 107:4f6c30876dfa 213 #define RCC_HSICALIBRATION_DEFAULT ((uint32_t)16) /*!< Default HSI calibration trimming value */
Kojto 107:4f6c30876dfa 214 /**
Kojto 107:4f6c30876dfa 215 * @}
Kojto 107:4f6c30876dfa 216 */
Kojto 107:4f6c30876dfa 217
Kojto 107:4f6c30876dfa 218 /** @defgroup RCC_LSI_Config LSI Config
Kojto 107:4f6c30876dfa 219 * @{
Kojto 107:4f6c30876dfa 220 */
Kojto 122:f9eeca106725 221 #define RCC_LSI_OFF ((uint32_t)0x00000000U) /*!< LSI clock deactivation */
Kojto 107:4f6c30876dfa 222 #define RCC_LSI_ON RCC_CSR_LSION /*!< LSI clock activation */
Kojto 107:4f6c30876dfa 223 /**
Kojto 107:4f6c30876dfa 224 * @}
Kojto 107:4f6c30876dfa 225 */
Kojto 107:4f6c30876dfa 226
Kojto 107:4f6c30876dfa 227 /** @defgroup RCC_MSI_Config MSI Config
Kojto 107:4f6c30876dfa 228 * @{
Kojto 107:4f6c30876dfa 229 */
Kojto 122:f9eeca106725 230 #define RCC_MSI_OFF ((uint32_t)0x00000000U) /*!< MSI clock deactivation */
Kojto 107:4f6c30876dfa 231 #define RCC_MSI_ON RCC_CR_MSION /*!< MSI clock activation */
Kojto 107:4f6c30876dfa 232
Kojto 107:4f6c30876dfa 233 #define RCC_MSICALIBRATION_DEFAULT ((uint32_t)0) /*!< Default MSI calibration trimming value */
Kojto 107:4f6c30876dfa 234 /**
Kojto 107:4f6c30876dfa 235 * @}
Kojto 107:4f6c30876dfa 236 */
Kojto 107:4f6c30876dfa 237
Kojto 122:f9eeca106725 238 #if defined(RCC_HSI48_SUPPORT)
Kojto 122:f9eeca106725 239 /** @defgroup RCC_HSI48_Config HSI48 Config
Kojto 122:f9eeca106725 240 * @{
Kojto 122:f9eeca106725 241 */
Kojto 122:f9eeca106725 242 #define RCC_HSI48_OFF ((uint32_t)0x00000000U) /*!< HSI48 clock deactivation */
Kojto 122:f9eeca106725 243 #define RCC_HSI48_ON RCC_CRRCR_HSI48ON /*!< HSI48 clock activation */
Kojto 122:f9eeca106725 244 /**
Kojto 122:f9eeca106725 245 * @}
Kojto 122:f9eeca106725 246 */
Kojto 122:f9eeca106725 247 #else
Kojto 122:f9eeca106725 248 /** @defgroup RCC_HSI48_Config HSI48 Config
Kojto 122:f9eeca106725 249 * @{
Kojto 122:f9eeca106725 250 */
Kojto 122:f9eeca106725 251 #define RCC_HSI48_OFF ((uint32_t)0x00000000U) /*!< HSI48 clock deactivation */
Kojto 122:f9eeca106725 252 /**
Kojto 122:f9eeca106725 253 * @}
Kojto 122:f9eeca106725 254 */
Kojto 122:f9eeca106725 255 #endif /* RCC_HSI48_SUPPORT */
Kojto 122:f9eeca106725 256
Kojto 107:4f6c30876dfa 257 /** @defgroup RCC_PLL_Config PLL Config
Kojto 107:4f6c30876dfa 258 * @{
Kojto 107:4f6c30876dfa 259 */
Kojto 122:f9eeca106725 260 #define RCC_PLL_NONE ((uint32_t)0x00000000U) /*!< PLL configuration unchanged */
Kojto 122:f9eeca106725 261 #define RCC_PLL_OFF ((uint32_t)0x00000001U) /*!< PLL deactivation */
Kojto 122:f9eeca106725 262 #define RCC_PLL_ON ((uint32_t)0x00000002U) /*!< PLL activation */
Kojto 107:4f6c30876dfa 263 /**
Kojto 107:4f6c30876dfa 264 * @}
Kojto 107:4f6c30876dfa 265 */
Kojto 107:4f6c30876dfa 266
Kojto 107:4f6c30876dfa 267 /** @defgroup RCC_PLLP_Clock_Divider PLLP Clock Divider
Kojto 107:4f6c30876dfa 268 * @{
Kojto 107:4f6c30876dfa 269 */
Kojto 122:f9eeca106725 270 #if defined(RCC_PLLP_DIV_2_31_SUPPORT)
Kojto 122:f9eeca106725 271 #define RCC_PLLP_DIV2 ((uint32_t)0x00000002U) /*!< PLLP division factor = 2 */
Kojto 122:f9eeca106725 272 #define RCC_PLLP_DIV3 ((uint32_t)0x00000003U) /*!< PLLP division factor = 3 */
Kojto 122:f9eeca106725 273 #define RCC_PLLP_DIV4 ((uint32_t)0x00000004U) /*!< PLLP division factor = 4 */
Kojto 122:f9eeca106725 274 #define RCC_PLLP_DIV5 ((uint32_t)0x00000005U) /*!< PLLP division factor = 5 */
Kojto 122:f9eeca106725 275 #define RCC_PLLP_DIV6 ((uint32_t)0x00000006U) /*!< PLLP division factor = 6 */
Kojto 122:f9eeca106725 276 #define RCC_PLLP_DIV7 ((uint32_t)0x00000007U) /*!< PLLP division factor = 7 */
Kojto 122:f9eeca106725 277 #define RCC_PLLP_DIV8 ((uint32_t)0x00000008U) /*!< PLLP division factor = 8 */
Kojto 122:f9eeca106725 278 #define RCC_PLLP_DIV9 ((uint32_t)0x00000009U) /*!< PLLP division factor = 9 */
Kojto 122:f9eeca106725 279 #define RCC_PLLP_DIV10 ((uint32_t)0x0000000AU) /*!< PLLP division factor = 10 */
Kojto 122:f9eeca106725 280 #define RCC_PLLP_DIV11 ((uint32_t)0x0000000BU) /*!< PLLP division factor = 11 */
Kojto 122:f9eeca106725 281 #define RCC_PLLP_DIV12 ((uint32_t)0x0000000CU) /*!< PLLP division factor = 12 */
Kojto 122:f9eeca106725 282 #define RCC_PLLP_DIV13 ((uint32_t)0x0000000DU) /*!< PLLP division factor = 13 */
Kojto 122:f9eeca106725 283 #define RCC_PLLP_DIV14 ((uint32_t)0x0000000EU) /*!< PLLP division factor = 14 */
Kojto 122:f9eeca106725 284 #define RCC_PLLP_DIV15 ((uint32_t)0x0000000FU) /*!< PLLP division factor = 15 */
Kojto 122:f9eeca106725 285 #define RCC_PLLP_DIV16 ((uint32_t)0x00000010U) /*!< PLLP division factor = 16 */
Kojto 122:f9eeca106725 286 #define RCC_PLLP_DIV17 ((uint32_t)0x00000011U) /*!< PLLP division factor = 17 */
Kojto 122:f9eeca106725 287 #define RCC_PLLP_DIV18 ((uint32_t)0x00000012U) /*!< PLLP division factor = 18 */
Kojto 122:f9eeca106725 288 #define RCC_PLLP_DIV19 ((uint32_t)0x00000013U) /*!< PLLP division factor = 19 */
Kojto 122:f9eeca106725 289 #define RCC_PLLP_DIV20 ((uint32_t)0x00000014U) /*!< PLLP division factor = 20 */
Kojto 122:f9eeca106725 290 #define RCC_PLLP_DIV21 ((uint32_t)0x00000015U) /*!< PLLP division factor = 21 */
Kojto 122:f9eeca106725 291 #define RCC_PLLP_DIV22 ((uint32_t)0x00000016U) /*!< PLLP division factor = 22 */
Kojto 122:f9eeca106725 292 #define RCC_PLLP_DIV23 ((uint32_t)0x00000017U) /*!< PLLP division factor = 23 */
Kojto 122:f9eeca106725 293 #define RCC_PLLP_DIV24 ((uint32_t)0x00000018U) /*!< PLLP division factor = 24 */
Kojto 122:f9eeca106725 294 #define RCC_PLLP_DIV25 ((uint32_t)0x00000019U) /*!< PLLP division factor = 25 */
Kojto 122:f9eeca106725 295 #define RCC_PLLP_DIV26 ((uint32_t)0x0000001AU) /*!< PLLP division factor = 26 */
Kojto 122:f9eeca106725 296 #define RCC_PLLP_DIV27 ((uint32_t)0x0000001BU) /*!< PLLP division factor = 27 */
Kojto 122:f9eeca106725 297 #define RCC_PLLP_DIV28 ((uint32_t)0x0000001CU) /*!< PLLP division factor = 28 */
Kojto 122:f9eeca106725 298 #define RCC_PLLP_DIV29 ((uint32_t)0x0000001DU) /*!< PLLP division factor = 29 */
Kojto 122:f9eeca106725 299 #define RCC_PLLP_DIV30 ((uint32_t)0x0000001EU) /*!< PLLP division factor = 30 */
Kojto 122:f9eeca106725 300 #define RCC_PLLP_DIV31 ((uint32_t)0x0000001FU) /*!< PLLP division factor = 31 */
Kojto 122:f9eeca106725 301 #else
Kojto 122:f9eeca106725 302 #define RCC_PLLP_DIV7 ((uint32_t)0x00000007U) /*!< PLLP division factor = 7 */
Kojto 122:f9eeca106725 303 #define RCC_PLLP_DIV17 ((uint32_t)0x00000011U) /*!< PLLP division factor = 17 */
Kojto 122:f9eeca106725 304 #endif /* RCC_PLLP_DIV_2_31_SUPPORT */
Kojto 107:4f6c30876dfa 305 /**
Kojto 107:4f6c30876dfa 306 * @}
Kojto 107:4f6c30876dfa 307 */
Kojto 107:4f6c30876dfa 308
Kojto 107:4f6c30876dfa 309 /** @defgroup RCC_PLLQ_Clock_Divider PLLQ Clock Divider
Kojto 107:4f6c30876dfa 310 * @{
Kojto 107:4f6c30876dfa 311 */
Kojto 122:f9eeca106725 312 #define RCC_PLLQ_DIV2 ((uint32_t)0x00000002U) /*!< PLLQ division factor = 2 */
Kojto 122:f9eeca106725 313 #define RCC_PLLQ_DIV4 ((uint32_t)0x00000004U) /*!< PLLQ division factor = 4 */
Kojto 122:f9eeca106725 314 #define RCC_PLLQ_DIV6 ((uint32_t)0x00000006U) /*!< PLLQ division factor = 6 */
Kojto 122:f9eeca106725 315 #define RCC_PLLQ_DIV8 ((uint32_t)0x00000008U) /*!< PLLQ division factor = 8 */
Kojto 107:4f6c30876dfa 316 /**
Kojto 107:4f6c30876dfa 317 * @}
Kojto 107:4f6c30876dfa 318 */
Kojto 107:4f6c30876dfa 319
Kojto 107:4f6c30876dfa 320 /** @defgroup RCC_PLLR_Clock_Divider PLLR Clock Divider
Kojto 107:4f6c30876dfa 321 * @{
Kojto 107:4f6c30876dfa 322 */
Kojto 122:f9eeca106725 323 #define RCC_PLLR_DIV2 ((uint32_t)0x00000002U) /*!< PLLR division factor = 2 */
Kojto 122:f9eeca106725 324 #define RCC_PLLR_DIV4 ((uint32_t)0x00000004U) /*!< PLLR division factor = 4 */
Kojto 122:f9eeca106725 325 #define RCC_PLLR_DIV6 ((uint32_t)0x00000006U) /*!< PLLR division factor = 6 */
Kojto 122:f9eeca106725 326 #define RCC_PLLR_DIV8 ((uint32_t)0x00000008U) /*!< PLLR division factor = 8 */
Kojto 107:4f6c30876dfa 327 /**
Kojto 107:4f6c30876dfa 328 * @}
Kojto 107:4f6c30876dfa 329 */
Kojto 107:4f6c30876dfa 330
Kojto 107:4f6c30876dfa 331 /** @defgroup RCC_PLL_Clock_Source PLL Clock Source
Kojto 107:4f6c30876dfa 332 * @{
Kojto 107:4f6c30876dfa 333 */
Kojto 122:f9eeca106725 334 #define RCC_PLLSOURCE_NONE ((uint32_t)0x00000000U) /*!< No clock selected as PLL entry clock source */
Kojto 107:4f6c30876dfa 335 #define RCC_PLLSOURCE_MSI RCC_PLLCFGR_PLLSRC_MSI /*!< MSI clock selected as PLL entry clock source */
Kojto 107:4f6c30876dfa 336 #define RCC_PLLSOURCE_HSI RCC_PLLCFGR_PLLSRC_HSI /*!< HSI clock selected as PLL entry clock source */
Kojto 107:4f6c30876dfa 337 #define RCC_PLLSOURCE_HSE RCC_PLLCFGR_PLLSRC_HSE /*!< HSE clock selected as PLL entry clock source */
Kojto 107:4f6c30876dfa 338 /**
Kojto 107:4f6c30876dfa 339 * @}
Kojto 107:4f6c30876dfa 340 */
Kojto 107:4f6c30876dfa 341
Kojto 107:4f6c30876dfa 342 /** @defgroup RCC_PLL_Clock_Output PLL Clock Output
Kojto 107:4f6c30876dfa 343 * @{
Kojto 107:4f6c30876dfa 344 */
Kojto 122:f9eeca106725 345 #if defined(RCC_PLLSAI2_SUPPORT)
Kojto 122:f9eeca106725 346 #define RCC_PLL_SAI3CLK RCC_PLLCFGR_PLLPEN /*!< PLLSAI3CLK selection from main PLL (for devices with PLLSAI2) */
Kojto 122:f9eeca106725 347 #else
Kojto 122:f9eeca106725 348 #define RCC_PLL_SAI2CLK RCC_PLLCFGR_PLLPEN /*!< PLLSAI2CLK selection from main PLL (for devices without PLLSAI2) */
Kojto 122:f9eeca106725 349 #endif /* RCC_PLLSAI2_SUPPORT */
Kojto 107:4f6c30876dfa 350 #define RCC_PLL_48M1CLK RCC_PLLCFGR_PLLQEN /*!< PLL48M1CLK selection from main PLL */
Kojto 107:4f6c30876dfa 351 #define RCC_PLL_SYSCLK RCC_PLLCFGR_PLLREN /*!< PLLCLK selection from main PLL */
Kojto 107:4f6c30876dfa 352 /**
Kojto 107:4f6c30876dfa 353 * @}
Kojto 107:4f6c30876dfa 354 */
Kojto 107:4f6c30876dfa 355
Kojto 107:4f6c30876dfa 356 /** @defgroup RCC_PLLSAI1_Clock_Output PLLSAI1 Clock Output
Kojto 107:4f6c30876dfa 357 * @{
Kojto 107:4f6c30876dfa 358 */
Kojto 107:4f6c30876dfa 359 #define RCC_PLLSAI1_SAI1CLK RCC_PLLSAI1CFGR_PLLSAI1PEN /*!< PLLSAI1CLK selection from PLLSAI1 */
Kojto 107:4f6c30876dfa 360 #define RCC_PLLSAI1_48M2CLK RCC_PLLSAI1CFGR_PLLSAI1QEN /*!< PLL48M2CLK selection from PLLSAI1 */
Kojto 107:4f6c30876dfa 361 #define RCC_PLLSAI1_ADC1CLK RCC_PLLSAI1CFGR_PLLSAI1REN /*!< PLLADC1CLK selection from PLLSAI1 */
Kojto 107:4f6c30876dfa 362 /**
Kojto 107:4f6c30876dfa 363 * @}
Kojto 107:4f6c30876dfa 364 */
Kojto 107:4f6c30876dfa 365
Kojto 122:f9eeca106725 366 #if defined(RCC_PLLSAI2_SUPPORT)
Kojto 122:f9eeca106725 367
Kojto 107:4f6c30876dfa 368 /** @defgroup RCC_PLLSAI2_Clock_Output PLLSAI2 Clock Output
Kojto 107:4f6c30876dfa 369 * @{
Kojto 107:4f6c30876dfa 370 */
Kojto 107:4f6c30876dfa 371 #define RCC_PLLSAI2_SAI2CLK RCC_PLLSAI2CFGR_PLLSAI2PEN /*!< PLLSAI2CLK selection from PLLSAI2 */
Kojto 107:4f6c30876dfa 372 #define RCC_PLLSAI2_ADC2CLK RCC_PLLSAI2CFGR_PLLSAI2REN /*!< PLLADC2CLK selection from PLLSAI2 */
Kojto 107:4f6c30876dfa 373 /**
Kojto 107:4f6c30876dfa 374 * @}
Kojto 107:4f6c30876dfa 375 */
Kojto 107:4f6c30876dfa 376
Kojto 122:f9eeca106725 377 #endif /* RCC_PLLSAI2_SUPPORT */
Kojto 122:f9eeca106725 378
Kojto 107:4f6c30876dfa 379 /** @defgroup RCC_MSI_Clock_Range MSI Clock Range
Kojto 107:4f6c30876dfa 380 * @{
Kojto 107:4f6c30876dfa 381 */
Kojto 107:4f6c30876dfa 382 #define RCC_MSIRANGE_0 RCC_CR_MSIRANGE_0 /*!< MSI = 100 KHz */
Kojto 107:4f6c30876dfa 383 #define RCC_MSIRANGE_1 RCC_CR_MSIRANGE_1 /*!< MSI = 200 KHz */
Kojto 107:4f6c30876dfa 384 #define RCC_MSIRANGE_2 RCC_CR_MSIRANGE_2 /*!< MSI = 400 KHz */
Kojto 107:4f6c30876dfa 385 #define RCC_MSIRANGE_3 RCC_CR_MSIRANGE_3 /*!< MSI = 800 KHz */
Kojto 107:4f6c30876dfa 386 #define RCC_MSIRANGE_4 RCC_CR_MSIRANGE_4 /*!< MSI = 1 MHz */
Kojto 107:4f6c30876dfa 387 #define RCC_MSIRANGE_5 RCC_CR_MSIRANGE_5 /*!< MSI = 2 MHz */
Kojto 107:4f6c30876dfa 388 #define RCC_MSIRANGE_6 RCC_CR_MSIRANGE_6 /*!< MSI = 4 MHz */
Kojto 107:4f6c30876dfa 389 #define RCC_MSIRANGE_7 RCC_CR_MSIRANGE_7 /*!< MSI = 8 MHz */
Kojto 107:4f6c30876dfa 390 #define RCC_MSIRANGE_8 RCC_CR_MSIRANGE_8 /*!< MSI = 16 MHz */
Kojto 107:4f6c30876dfa 391 #define RCC_MSIRANGE_9 RCC_CR_MSIRANGE_9 /*!< MSI = 24 MHz */
Kojto 107:4f6c30876dfa 392 #define RCC_MSIRANGE_10 RCC_CR_MSIRANGE_10 /*!< MSI = 32 MHz */
Kojto 107:4f6c30876dfa 393 #define RCC_MSIRANGE_11 RCC_CR_MSIRANGE_11 /*!< MSI = 48 MHz */
Kojto 107:4f6c30876dfa 394 /**
Kojto 107:4f6c30876dfa 395 * @}
Kojto 107:4f6c30876dfa 396 */
Kojto 107:4f6c30876dfa 397
Kojto 107:4f6c30876dfa 398 /** @defgroup RCC_System_Clock_Type System Clock Type
Kojto 107:4f6c30876dfa 399 * @{
Kojto 107:4f6c30876dfa 400 */
Kojto 122:f9eeca106725 401 #define RCC_CLOCKTYPE_SYSCLK ((uint32_t)0x00000001U) /*!< SYSCLK to configure */
Kojto 122:f9eeca106725 402 #define RCC_CLOCKTYPE_HCLK ((uint32_t)0x00000002U) /*!< HCLK to configure */
Kojto 122:f9eeca106725 403 #define RCC_CLOCKTYPE_PCLK1 ((uint32_t)0x00000004U) /*!< PCLK1 to configure */
Kojto 122:f9eeca106725 404 #define RCC_CLOCKTYPE_PCLK2 ((uint32_t)0x00000008U) /*!< PCLK2 to configure */
Kojto 107:4f6c30876dfa 405 /**
Kojto 107:4f6c30876dfa 406 * @}
Kojto 107:4f6c30876dfa 407 */
Kojto 107:4f6c30876dfa 408
Kojto 107:4f6c30876dfa 409 /** @defgroup RCC_System_Clock_Source System Clock Source
Kojto 107:4f6c30876dfa 410 * @{
Kojto 107:4f6c30876dfa 411 */
Kojto 107:4f6c30876dfa 412 #define RCC_SYSCLKSOURCE_MSI RCC_CFGR_SW_MSI /*!< MSI selection as system clock */
Kojto 107:4f6c30876dfa 413 #define RCC_SYSCLKSOURCE_HSI RCC_CFGR_SW_HSI /*!< HSI selection as system clock */
Kojto 107:4f6c30876dfa 414 #define RCC_SYSCLKSOURCE_HSE RCC_CFGR_SW_HSE /*!< HSE selection as system clock */
Kojto 107:4f6c30876dfa 415 #define RCC_SYSCLKSOURCE_PLLCLK RCC_CFGR_SW_PLL /*!< PLL selection as system clock */
Kojto 107:4f6c30876dfa 416 /**
Kojto 107:4f6c30876dfa 417 * @}
Kojto 107:4f6c30876dfa 418 */
Kojto 107:4f6c30876dfa 419
Kojto 107:4f6c30876dfa 420 /** @defgroup RCC_System_Clock_Source_Status System Clock Source Status
Kojto 107:4f6c30876dfa 421 * @{
Kojto 107:4f6c30876dfa 422 */
Kojto 107:4f6c30876dfa 423 #define RCC_SYSCLKSOURCE_STATUS_MSI RCC_CFGR_SWS_MSI /*!< MSI used as system clock */
Kojto 107:4f6c30876dfa 424 #define RCC_SYSCLKSOURCE_STATUS_HSI RCC_CFGR_SWS_HSI /*!< HSI used as system clock */
Kojto 107:4f6c30876dfa 425 #define RCC_SYSCLKSOURCE_STATUS_HSE RCC_CFGR_SWS_HSE /*!< HSE used as system clock */
Kojto 107:4f6c30876dfa 426 #define RCC_SYSCLKSOURCE_STATUS_PLLCLK RCC_CFGR_SWS_PLL /*!< PLL used as system clock */
Kojto 107:4f6c30876dfa 427 /**
Kojto 107:4f6c30876dfa 428 * @}
Kojto 107:4f6c30876dfa 429 */
Kojto 107:4f6c30876dfa 430
Kojto 107:4f6c30876dfa 431 /** @defgroup RCC_AHB_Clock_Source AHB Clock Source
Kojto 107:4f6c30876dfa 432 * @{
Kojto 107:4f6c30876dfa 433 */
Kojto 107:4f6c30876dfa 434 #define RCC_SYSCLK_DIV1 RCC_CFGR_HPRE_DIV1 /*!< SYSCLK not divided */
Kojto 107:4f6c30876dfa 435 #define RCC_SYSCLK_DIV2 RCC_CFGR_HPRE_DIV2 /*!< SYSCLK divided by 2 */
Kojto 107:4f6c30876dfa 436 #define RCC_SYSCLK_DIV4 RCC_CFGR_HPRE_DIV4 /*!< SYSCLK divided by 4 */
Kojto 107:4f6c30876dfa 437 #define RCC_SYSCLK_DIV8 RCC_CFGR_HPRE_DIV8 /*!< SYSCLK divided by 8 */
Kojto 107:4f6c30876dfa 438 #define RCC_SYSCLK_DIV16 RCC_CFGR_HPRE_DIV16 /*!< SYSCLK divided by 16 */
Kojto 107:4f6c30876dfa 439 #define RCC_SYSCLK_DIV64 RCC_CFGR_HPRE_DIV64 /*!< SYSCLK divided by 64 */
Kojto 107:4f6c30876dfa 440 #define RCC_SYSCLK_DIV128 RCC_CFGR_HPRE_DIV128 /*!< SYSCLK divided by 128 */
Kojto 107:4f6c30876dfa 441 #define RCC_SYSCLK_DIV256 RCC_CFGR_HPRE_DIV256 /*!< SYSCLK divided by 256 */
Kojto 107:4f6c30876dfa 442 #define RCC_SYSCLK_DIV512 RCC_CFGR_HPRE_DIV512 /*!< SYSCLK divided by 512 */
Kojto 107:4f6c30876dfa 443 /**
Kojto 107:4f6c30876dfa 444 * @}
Kojto 107:4f6c30876dfa 445 */
Kojto 107:4f6c30876dfa 446
Kojto 107:4f6c30876dfa 447 /** @defgroup RCC_APB1_APB2_Clock_Source APB1 APB2 Clock Source
Kojto 107:4f6c30876dfa 448 * @{
Kojto 107:4f6c30876dfa 449 */
Kojto 107:4f6c30876dfa 450 #define RCC_HCLK_DIV1 RCC_CFGR_PPRE1_DIV1 /*!< HCLK not divided */
Kojto 107:4f6c30876dfa 451 #define RCC_HCLK_DIV2 RCC_CFGR_PPRE1_DIV2 /*!< HCLK divided by 2 */
Kojto 107:4f6c30876dfa 452 #define RCC_HCLK_DIV4 RCC_CFGR_PPRE1_DIV4 /*!< HCLK divided by 4 */
Kojto 107:4f6c30876dfa 453 #define RCC_HCLK_DIV8 RCC_CFGR_PPRE1_DIV8 /*!< HCLK divided by 8 */
Kojto 107:4f6c30876dfa 454 #define RCC_HCLK_DIV16 RCC_CFGR_PPRE1_DIV16 /*!< HCLK divided by 16 */
Kojto 107:4f6c30876dfa 455 /**
Kojto 107:4f6c30876dfa 456 * @}
Kojto 107:4f6c30876dfa 457 */
Kojto 107:4f6c30876dfa 458
Kojto 107:4f6c30876dfa 459 /** @defgroup RCC_RTC_Clock_Source RTC Clock Source
Kojto 107:4f6c30876dfa 460 * @{
Kojto 107:4f6c30876dfa 461 */
Kojto 122:f9eeca106725 462 #define RCC_RTCCLKSOURCE_NO_CLK ((uint32_t)0x00000000U) /*!< No clock used as RTC clock */
Kojto 122:f9eeca106725 463 #define RCC_RTCCLKSOURCE_LSE RCC_BDCR_RTCSEL_0 /*!< LSE oscillator clock used as RTC clock */
Kojto 122:f9eeca106725 464 #define RCC_RTCCLKSOURCE_LSI RCC_BDCR_RTCSEL_1 /*!< LSI oscillator clock used as RTC clock */
Kojto 122:f9eeca106725 465 #define RCC_RTCCLKSOURCE_HSE_DIV32 RCC_BDCR_RTCSEL /*!< HSE oscillator clock divided by 32 used as RTC clock */
Kojto 107:4f6c30876dfa 466 /**
Kojto 107:4f6c30876dfa 467 * @}
Kojto 107:4f6c30876dfa 468 */
Kojto 107:4f6c30876dfa 469
Kojto 107:4f6c30876dfa 470 /** @defgroup RCC_MCO_Index MCO Index
Kojto 107:4f6c30876dfa 471 * @{
Kojto 107:4f6c30876dfa 472 */
Kojto 122:f9eeca106725 473 #define RCC_MCO1 ((uint32_t)0x00000000U)
Kojto 107:4f6c30876dfa 474 #define RCC_MCO RCC_MCO1 /*!< MCO1 to be compliant with other families with 2 MCOs*/
Kojto 107:4f6c30876dfa 475 /**
Kojto 107:4f6c30876dfa 476 * @}
Kojto 107:4f6c30876dfa 477 */
Kojto 107:4f6c30876dfa 478
Kojto 107:4f6c30876dfa 479 /** @defgroup RCC_MCO1_Clock_Source MCO1 Clock Source
Kojto 107:4f6c30876dfa 480 * @{
Kojto 107:4f6c30876dfa 481 */
Kojto 122:f9eeca106725 482 #define RCC_MCO1SOURCE_NOCLOCK ((uint32_t)0x00000000U) /*!< MCO1 output disabled, no clock on MCO1 */
Kojto 107:4f6c30876dfa 483 #define RCC_MCO1SOURCE_SYSCLK RCC_CFGR_MCOSEL_0 /*!< SYSCLK selection as MCO1 source */
Kojto 107:4f6c30876dfa 484 #define RCC_MCO1SOURCE_MSI RCC_CFGR_MCOSEL_1 /*!< MSI selection as MCO1 source */
Kojto 107:4f6c30876dfa 485 #define RCC_MCO1SOURCE_HSI (RCC_CFGR_MCOSEL_0| RCC_CFGR_MCOSEL_1) /*!< HSI selection as MCO1 source */
Kojto 107:4f6c30876dfa 486 #define RCC_MCO1SOURCE_HSE RCC_CFGR_MCOSEL_2 /*!< HSE selection as MCO1 source */
Kojto 107:4f6c30876dfa 487 #define RCC_MCO1SOURCE_PLLCLK (RCC_CFGR_MCOSEL_0|RCC_CFGR_MCOSEL_2) /*!< PLLCLK selection as MCO1 source */
Kojto 107:4f6c30876dfa 488 #define RCC_MCO1SOURCE_LSI (RCC_CFGR_MCOSEL_1|RCC_CFGR_MCOSEL_2) /*!< LSI selection as MCO1 source */
Kojto 122:f9eeca106725 489 #define RCC_MCO1SOURCE_LSE (RCC_CFGR_MCOSEL_0|RCC_CFGR_MCOSEL_1|RCC_CFGR_MCOSEL_2) /*!< LSE selection as MCO1 source */
Kojto 122:f9eeca106725 490 #if defined(RCC_HSI48_SUPPORT)
Kojto 122:f9eeca106725 491 #define RCC_MCO1SOURCE_HSI48 RCC_CFGR_MCOSEL_3 /*!< HSI48 selection as MCO1 source (STM32L43x/STM32L44x devices) */
Kojto 122:f9eeca106725 492 #endif /* RCC_HSI48_SUPPORT */
Kojto 107:4f6c30876dfa 493 /**
Kojto 107:4f6c30876dfa 494 * @}
Kojto 107:4f6c30876dfa 495 */
Kojto 107:4f6c30876dfa 496
Kojto 107:4f6c30876dfa 497 /** @defgroup RCC_MCOx_Clock_Prescaler MCO1 Clock Prescaler
Kojto 107:4f6c30876dfa 498 * @{
Kojto 107:4f6c30876dfa 499 */
Kojto 122:f9eeca106725 500 #define RCC_MCODIV_1 RCC_CFGR_MCOPRE_DIV1 /*!< MCO not divided */
Kojto 122:f9eeca106725 501 #define RCC_MCODIV_2 RCC_CFGR_MCOPRE_DIV2 /*!< MCO divided by 2 */
Kojto 122:f9eeca106725 502 #define RCC_MCODIV_4 RCC_CFGR_MCOPRE_DIV4 /*!< MCO divided by 4 */
Kojto 122:f9eeca106725 503 #define RCC_MCODIV_8 RCC_CFGR_MCOPRE_DIV8 /*!< MCO divided by 8 */
Kojto 122:f9eeca106725 504 #define RCC_MCODIV_16 RCC_CFGR_MCOPRE_DIV16 /*!< MCO divided by 16 */
Kojto 107:4f6c30876dfa 505 /**
Kojto 107:4f6c30876dfa 506 * @}
Kojto 107:4f6c30876dfa 507 */
Kojto 107:4f6c30876dfa 508
Kojto 107:4f6c30876dfa 509 /** @defgroup RCC_Interrupt Interrupts
Kojto 107:4f6c30876dfa 510 * @{
Kojto 107:4f6c30876dfa 511 */
Kojto 122:f9eeca106725 512 #define RCC_IT_LSIRDY RCC_CIFR_LSIRDYF /*!< LSI Ready Interrupt flag */
Kojto 122:f9eeca106725 513 #define RCC_IT_LSERDY RCC_CIFR_LSERDYF /*!< LSE Ready Interrupt flag */
Kojto 122:f9eeca106725 514 #define RCC_IT_MSIRDY RCC_CIFR_MSIRDYF /*!< MSI Ready Interrupt flag */
Kojto 122:f9eeca106725 515 #define RCC_IT_HSIRDY RCC_CIFR_HSIRDYF /*!< HSI16 Ready Interrupt flag */
Kojto 122:f9eeca106725 516 #define RCC_IT_HSERDY RCC_CIFR_HSERDYF /*!< HSE Ready Interrupt flag */
Kojto 122:f9eeca106725 517 #define RCC_IT_PLLRDY RCC_CIFR_PLLRDYF /*!< PLL Ready Interrupt flag */
Kojto 122:f9eeca106725 518 #define RCC_IT_PLLSAI1RDY RCC_CIFR_PLLSAI1RDYF /*!< PLLSAI1 Ready Interrupt flag */
Kojto 122:f9eeca106725 519 #if defined(RCC_PLLSAI2_SUPPORT)
Kojto 122:f9eeca106725 520 #define RCC_IT_PLLSAI2RDY RCC_CIFR_PLLSAI2RDYF /*!< PLLSAI2 Ready Interrupt flag */
Kojto 122:f9eeca106725 521 #endif /* RCC_PLLSAI2_SUPPORT */
Kojto 122:f9eeca106725 522 #define RCC_IT_CSS RCC_CIFR_CSSF /*!< Clock Security System Interrupt flag */
Kojto 122:f9eeca106725 523 #define RCC_IT_LSECSS RCC_CIFR_LSECSSF /*!< LSE Clock Security System Interrupt flag */
Kojto 122:f9eeca106725 524 #if defined(RCC_HSI48_SUPPORT)
Kojto 122:f9eeca106725 525 #define RCC_IT_HSI48RDY RCC_CIFR_HSI48RDYF /*!< HSI48 Ready Interrupt flag */
Kojto 122:f9eeca106725 526 #endif /* RCC_HSI48_SUPPORT */
Kojto 107:4f6c30876dfa 527 /**
Kojto 107:4f6c30876dfa 528 * @}
Kojto 107:4f6c30876dfa 529 */
Kojto 107:4f6c30876dfa 530
Kojto 107:4f6c30876dfa 531 /** @defgroup RCC_Flag Flags
Kojto 122:f9eeca106725 532 * Elements values convention: XXXYYYYYb
Kojto 107:4f6c30876dfa 533 * - YYYYY : Flag position in the register
Kojto 122:f9eeca106725 534 * - XXX : Register index
Kojto 122:f9eeca106725 535 * - 001: CR register
Kojto 122:f9eeca106725 536 * - 010: BDCR register
Kojto 122:f9eeca106725 537 * - 011: CSR register
Kojto 122:f9eeca106725 538 * - 100: CRRCR register
Kojto 107:4f6c30876dfa 539 * @{
Kojto 107:4f6c30876dfa 540 */
Kojto 107:4f6c30876dfa 541 /* Flags in the CR register */
Kojto 122:f9eeca106725 542 #define RCC_FLAG_MSIRDY ((uint32_t)((CR_REG_INDEX << 5U) | POSITION_VAL(RCC_CR_MSIRDY))) /*!< MSI Ready flag */
Kojto 122:f9eeca106725 543 #define RCC_FLAG_HSIRDY ((uint32_t)((CR_REG_INDEX << 5U) | POSITION_VAL(RCC_CR_HSIRDY))) /*!< HSI Ready flag */
Kojto 122:f9eeca106725 544 #define RCC_FLAG_HSERDY ((uint32_t)((CR_REG_INDEX << 5U) | POSITION_VAL(RCC_CR_HSERDY))) /*!< HSE Ready flag */
Kojto 122:f9eeca106725 545 #define RCC_FLAG_PLLRDY ((uint32_t)((CR_REG_INDEX << 5U) | POSITION_VAL(RCC_CR_PLLRDY))) /*!< PLL Ready flag */
Kojto 122:f9eeca106725 546 #define RCC_FLAG_PLLSAI1RDY ((uint32_t)((CR_REG_INDEX << 5U) | POSITION_VAL(RCC_CR_PLLSAI1RDY))) /*!< PLLSAI1 Ready flag */
Kojto 122:f9eeca106725 547 #if defined(RCC_PLLSAI2_SUPPORT)
Kojto 122:f9eeca106725 548 #define RCC_FLAG_PLLSAI2RDY ((uint32_t)((CR_REG_INDEX << 5U) | POSITION_VAL(RCC_CR_PLLSAI2RDY))) /*!< PLLSAI2 Ready flag */
Kojto 122:f9eeca106725 549 #endif /* RCC_PLLSAI2_SUPPORT */
Kojto 107:4f6c30876dfa 550
Kojto 107:4f6c30876dfa 551 /* Flags in the BDCR register */
Kojto 122:f9eeca106725 552 #define RCC_FLAG_LSERDY ((uint32_t)((BDCR_REG_INDEX << 5U) | POSITION_VAL(RCC_BDCR_LSERDY))) /*!< LSE Ready flag */
Kojto 122:f9eeca106725 553 #define RCC_FLAG_LSECSSD ((uint32_t)((BDCR_REG_INDEX << 5U) | POSITION_VAL(RCC_BDCR_LSECSSD))) /*!< LSE Clock Security System Interrupt flag */
Kojto 107:4f6c30876dfa 554
Kojto 107:4f6c30876dfa 555 /* Flags in the CSR register */
Kojto 122:f9eeca106725 556 #define RCC_FLAG_LSIRDY ((uint32_t)((CSR_REG_INDEX << 5U) | POSITION_VAL(RCC_CSR_LSIRDY))) /*!< LSI Ready flag */
Kojto 122:f9eeca106725 557 #define RCC_FLAG_RMVF ((uint32_t)((CSR_REG_INDEX << 5U) | POSITION_VAL(RCC_CSR_RMVF))) /*!< Remove reset flag */
Kojto 122:f9eeca106725 558 #define RCC_FLAG_FWRST ((uint32_t)((CSR_REG_INDEX << 5U) | POSITION_VAL(RCC_CSR_FWRSTF))) /*!< Firewall reset flag */
Kojto 122:f9eeca106725 559 #define RCC_FLAG_OBLRST ((uint32_t)((CSR_REG_INDEX << 5U) | POSITION_VAL(RCC_CSR_OBLRSTF))) /*!< Option Byte Loader reset flag */
Kojto 122:f9eeca106725 560 #define RCC_FLAG_PINRST ((uint32_t)((CSR_REG_INDEX << 5U) | POSITION_VAL(RCC_CSR_PINRSTF))) /*!< PIN reset flag */
Kojto 122:f9eeca106725 561 #define RCC_FLAG_BORRST ((uint32_t)((CSR_REG_INDEX << 5U) | POSITION_VAL(RCC_CSR_BORRSTF))) /*!< BOR reset flag */
Kojto 122:f9eeca106725 562 #define RCC_FLAG_SFTRST ((uint32_t)((CSR_REG_INDEX << 5U) | POSITION_VAL(RCC_CSR_SFTRSTF))) /*!< Software Reset flag */
Kojto 122:f9eeca106725 563 #define RCC_FLAG_IWDGRST ((uint32_t)((CSR_REG_INDEX << 5U) | POSITION_VAL(RCC_CSR_IWDGRSTF))) /*!< Independent Watchdog reset flag */
Kojto 122:f9eeca106725 564 #define RCC_FLAG_WWDGRST ((uint32_t)((CSR_REG_INDEX << 5U) | POSITION_VAL(RCC_CSR_WWDGRSTF))) /*!< Window watchdog reset flag */
Kojto 122:f9eeca106725 565 #define RCC_FLAG_LPWRRST ((uint32_t)((CSR_REG_INDEX << 5U) | POSITION_VAL(RCC_CSR_LPWRRSTF))) /*!< Low-Power reset flag */
Kojto 122:f9eeca106725 566
Kojto 122:f9eeca106725 567 #if defined(RCC_HSI48_SUPPORT)
Kojto 122:f9eeca106725 568 /* Flags in the CRRCR register */
Kojto 122:f9eeca106725 569 #define RCC_FLAG_HSI48RDY ((uint32_t)((CRRCR_REG_INDEX << 5U) | POSITION_VAL(RCC_CRRCR_HSI48RDY))) /*!< HSI48 Ready flag */
Kojto 122:f9eeca106725 570 #endif /* RCC_HSI48_SUPPORT */
Kojto 107:4f6c30876dfa 571 /**
Kojto 107:4f6c30876dfa 572 * @}
Kojto 107:4f6c30876dfa 573 */
Kojto 107:4f6c30876dfa 574
Kojto 107:4f6c30876dfa 575 /** @defgroup RCC_LSEDrive_Config LSE Drive Config
Kojto 107:4f6c30876dfa 576 * @{
Kojto 107:4f6c30876dfa 577 */
Kojto 122:f9eeca106725 578 #define RCC_LSEDRIVE_LOW ((uint32_t)0x00000000U) /*!< LSE low drive capability */
Kojto 122:f9eeca106725 579 #define RCC_LSEDRIVE_MEDIUMLOW RCC_BDCR_LSEDRV_0 /*!< LSE medium low drive capability */
Kojto 122:f9eeca106725 580 #define RCC_LSEDRIVE_MEDIUMHIGH RCC_BDCR_LSEDRV_1 /*!< LSE medium high drive capability */
Kojto 107:4f6c30876dfa 581 #define RCC_LSEDRIVE_HIGH RCC_BDCR_LSEDRV /*!< LSE high drive capability */
Kojto 107:4f6c30876dfa 582 /**
Kojto 107:4f6c30876dfa 583 * @}
Kojto 107:4f6c30876dfa 584 */
Kojto 107:4f6c30876dfa 585
Kojto 107:4f6c30876dfa 586 /** @defgroup RCC_Stop_WakeUpClock Wake-Up from STOP Clock
Kojto 107:4f6c30876dfa 587 * @{
Kojto 107:4f6c30876dfa 588 */
Kojto 122:f9eeca106725 589 #define RCC_STOP_WAKEUPCLOCK_MSI ((uint32_t)0x00000000U) /*!< MSI selection after wake-up from STOP */
Kojto 107:4f6c30876dfa 590 #define RCC_STOP_WAKEUPCLOCK_HSI RCC_CFGR_STOPWUCK /*!< HSI selection after wake-up from STOP */
Kojto 107:4f6c30876dfa 591 /**
Kojto 107:4f6c30876dfa 592 * @}
Kojto 107:4f6c30876dfa 593 */
Kojto 107:4f6c30876dfa 594
Kojto 107:4f6c30876dfa 595 /**
Kojto 107:4f6c30876dfa 596 * @}
Kojto 107:4f6c30876dfa 597 */
Kojto 107:4f6c30876dfa 598
Kojto 107:4f6c30876dfa 599 /* Exported macros -----------------------------------------------------------*/
Kojto 107:4f6c30876dfa 600
Kojto 107:4f6c30876dfa 601 /** @defgroup RCC_Exported_Macros RCC Exported Macros
Kojto 107:4f6c30876dfa 602 * @{
Kojto 107:4f6c30876dfa 603 */
Kojto 107:4f6c30876dfa 604
Kojto 107:4f6c30876dfa 605 /** @defgroup RCC_AHB1_Peripheral_Clock_Enable_Disable AHB1 Peripheral Clock Enable Disable
Kojto 107:4f6c30876dfa 606 * @brief Enable or disable the AHB1 peripheral clock.
Kojto 107:4f6c30876dfa 607 * @note After reset, the peripheral clock (used for registers read/write access)
Kojto 107:4f6c30876dfa 608 * is disabled and the application software has to enable this clock before
Kojto 107:4f6c30876dfa 609 * using it.
Kojto 107:4f6c30876dfa 610 * @{
Kojto 107:4f6c30876dfa 611 */
Kojto 107:4f6c30876dfa 612
Kojto 107:4f6c30876dfa 613 #define __HAL_RCC_DMA1_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 614 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 615 SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA1EN); \
Kojto 107:4f6c30876dfa 616 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 617 tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA1EN); \
Kojto 107:4f6c30876dfa 618 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 619 } while(0)
Kojto 107:4f6c30876dfa 620
Kojto 107:4f6c30876dfa 621 #define __HAL_RCC_DMA2_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 622 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 623 SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA2EN); \
Kojto 107:4f6c30876dfa 624 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 625 tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA2EN); \
Kojto 107:4f6c30876dfa 626 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 627 } while(0)
Kojto 107:4f6c30876dfa 628
Kojto 107:4f6c30876dfa 629 #define __HAL_RCC_FLASH_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 630 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 631 SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_FLASHEN); \
Kojto 107:4f6c30876dfa 632 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 633 tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_FLASHEN); \
Kojto 107:4f6c30876dfa 634 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 635 } while(0)
Kojto 107:4f6c30876dfa 636
Kojto 107:4f6c30876dfa 637 #define __HAL_RCC_CRC_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 638 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 639 SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_CRCEN); \
Kojto 107:4f6c30876dfa 640 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 641 tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_CRCEN); \
Kojto 107:4f6c30876dfa 642 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 643 } while(0)
Kojto 107:4f6c30876dfa 644
Kojto 107:4f6c30876dfa 645 #define __HAL_RCC_TSC_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 646 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 647 SET_BIT(RCC->AHB1ENR, RCC_AHB1ENR_TSCEN); \
Kojto 107:4f6c30876dfa 648 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 649 tmpreg = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_TSCEN); \
Kojto 107:4f6c30876dfa 650 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 651 } while(0)
Kojto 107:4f6c30876dfa 652
Kojto 122:f9eeca106725 653
Kojto 107:4f6c30876dfa 654 #define __HAL_RCC_DMA1_CLK_DISABLE() CLEAR_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA1EN)
Kojto 107:4f6c30876dfa 655
Kojto 107:4f6c30876dfa 656 #define __HAL_RCC_DMA2_CLK_DISABLE() CLEAR_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA2EN)
Kojto 107:4f6c30876dfa 657
Kojto 107:4f6c30876dfa 658 #define __HAL_RCC_FLASH_CLK_DISABLE() CLEAR_BIT(RCC->AHB1ENR, RCC_AHB1ENR_FLASHEN)
Kojto 107:4f6c30876dfa 659
Kojto 107:4f6c30876dfa 660 #define __HAL_RCC_CRC_CLK_DISABLE() CLEAR_BIT(RCC->AHB1ENR, RCC_AHB1ENR_CRCEN)
Kojto 107:4f6c30876dfa 661
Kojto 107:4f6c30876dfa 662 #define __HAL_RCC_TSC_CLK_DISABLE() CLEAR_BIT(RCC->AHB1ENR, RCC_AHB1ENR_TSCEN)
Kojto 107:4f6c30876dfa 663
Kojto 107:4f6c30876dfa 664 /**
Kojto 107:4f6c30876dfa 665 * @}
Kojto 107:4f6c30876dfa 666 */
Kojto 107:4f6c30876dfa 667
Kojto 122:f9eeca106725 668 /** @defgroup RCC_AHB2_Peripheral_Clock_Enable_Disable AHB2 Peripheral Clock Enable Disable
Kojto 107:4f6c30876dfa 669 * @brief Enable or disable the AHB2 peripheral clock.
Kojto 107:4f6c30876dfa 670 * @note After reset, the peripheral clock (used for registers read/write access)
Kojto 107:4f6c30876dfa 671 * is disabled and the application software has to enable this clock before
Kojto 107:4f6c30876dfa 672 * using it.
Kojto 107:4f6c30876dfa 673 * @{
Kojto 107:4f6c30876dfa 674 */
Kojto 107:4f6c30876dfa 675
Kojto 107:4f6c30876dfa 676 #define __HAL_RCC_GPIOA_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 677 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 678 SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOAEN); \
Kojto 107:4f6c30876dfa 679 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 680 tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOAEN); \
Kojto 107:4f6c30876dfa 681 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 682 } while(0)
Kojto 107:4f6c30876dfa 683
Kojto 107:4f6c30876dfa 684 #define __HAL_RCC_GPIOB_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 685 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 686 SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOBEN); \
Kojto 107:4f6c30876dfa 687 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 688 tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOBEN); \
Kojto 107:4f6c30876dfa 689 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 690 } while(0)
Kojto 107:4f6c30876dfa 691
Kojto 107:4f6c30876dfa 692 #define __HAL_RCC_GPIOC_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 693 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 694 SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOCEN); \
Kojto 107:4f6c30876dfa 695 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 696 tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOCEN); \
Kojto 107:4f6c30876dfa 697 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 698 } while(0)
Kojto 107:4f6c30876dfa 699
Kojto 122:f9eeca106725 700 #if defined(GPIOD)
Kojto 107:4f6c30876dfa 701 #define __HAL_RCC_GPIOD_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 702 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 703 SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIODEN); \
Kojto 107:4f6c30876dfa 704 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 705 tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIODEN); \
Kojto 107:4f6c30876dfa 706 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 707 } while(0)
Kojto 122:f9eeca106725 708 #endif /* GPIOD */
Kojto 122:f9eeca106725 709
Kojto 122:f9eeca106725 710 #if defined(GPIOE)
Kojto 107:4f6c30876dfa 711 #define __HAL_RCC_GPIOE_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 712 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 713 SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOEEN); \
Kojto 107:4f6c30876dfa 714 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 715 tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOEEN); \
Kojto 107:4f6c30876dfa 716 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 717 } while(0)
Kojto 122:f9eeca106725 718 #endif /* GPIOE */
Kojto 122:f9eeca106725 719
Kojto 122:f9eeca106725 720 #if defined(GPIOF)
Kojto 107:4f6c30876dfa 721 #define __HAL_RCC_GPIOF_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 722 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 723 SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOFEN); \
Kojto 107:4f6c30876dfa 724 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 725 tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOFEN); \
Kojto 107:4f6c30876dfa 726 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 727 } while(0)
Kojto 122:f9eeca106725 728 #endif /* GPIOF */
Kojto 122:f9eeca106725 729
Kojto 122:f9eeca106725 730 #if defined(GPIOG)
Kojto 107:4f6c30876dfa 731 #define __HAL_RCC_GPIOG_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 732 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 733 SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOGEN); \
Kojto 107:4f6c30876dfa 734 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 735 tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOGEN); \
Kojto 107:4f6c30876dfa 736 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 737 } while(0)
Kojto 122:f9eeca106725 738 #endif /* GPIOG */
Kojto 107:4f6c30876dfa 739
Kojto 107:4f6c30876dfa 740 #define __HAL_RCC_GPIOH_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 741 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 742 SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOHEN); \
Kojto 107:4f6c30876dfa 743 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 744 tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOHEN); \
Kojto 107:4f6c30876dfa 745 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 746 } while(0)
Kojto 107:4f6c30876dfa 747
Kojto 122:f9eeca106725 748 #if defined(USB_OTG_FS)
Kojto 122:f9eeca106725 749 #define __HAL_RCC_USB_OTG_FS_CLK_ENABLE() do { \
Kojto 122:f9eeca106725 750 __IO uint32_t tmpreg; \
Kojto 122:f9eeca106725 751 SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_OTGFSEN); \
Kojto 122:f9eeca106725 752 /* Delay after an RCC peripheral clock enabling */ \
Kojto 122:f9eeca106725 753 tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_OTGFSEN); \
Kojto 122:f9eeca106725 754 UNUSED(tmpreg); \
Kojto 122:f9eeca106725 755 } while(0)
Kojto 122:f9eeca106725 756 #endif /* USB_OTG_FS */
Kojto 122:f9eeca106725 757
Kojto 107:4f6c30876dfa 758 #define __HAL_RCC_ADC_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 759 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 760 SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_ADCEN); \
Kojto 107:4f6c30876dfa 761 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 762 tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_ADCEN); \
Kojto 107:4f6c30876dfa 763 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 764 } while(0)
Kojto 107:4f6c30876dfa 765
Kojto 122:f9eeca106725 766 #if defined(AES)
Kojto 122:f9eeca106725 767 #define __HAL_RCC_AES_CLK_ENABLE() do { \
Kojto 122:f9eeca106725 768 __IO uint32_t tmpreg; \
Kojto 122:f9eeca106725 769 SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_AESEN); \
Kojto 122:f9eeca106725 770 /* Delay after an RCC peripheral clock enabling */ \
Kojto 122:f9eeca106725 771 tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_AESEN); \
Kojto 122:f9eeca106725 772 UNUSED(tmpreg); \
Kojto 122:f9eeca106725 773 } while(0)
Kojto 122:f9eeca106725 774 #endif /* AES */
Kojto 122:f9eeca106725 775
Kojto 107:4f6c30876dfa 776 #define __HAL_RCC_RNG_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 777 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 778 SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_RNGEN); \
Kojto 107:4f6c30876dfa 779 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 780 tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_RNGEN); \
Kojto 107:4f6c30876dfa 781 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 782 } while(0)
Kojto 107:4f6c30876dfa 783
Kojto 122:f9eeca106725 784
Kojto 107:4f6c30876dfa 785 #define __HAL_RCC_GPIOA_CLK_DISABLE() CLEAR_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOAEN)
Kojto 107:4f6c30876dfa 786
Kojto 107:4f6c30876dfa 787 #define __HAL_RCC_GPIOB_CLK_DISABLE() CLEAR_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOBEN)
Kojto 107:4f6c30876dfa 788
Kojto 107:4f6c30876dfa 789 #define __HAL_RCC_GPIOC_CLK_DISABLE() CLEAR_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOCEN)
Kojto 107:4f6c30876dfa 790
Kojto 122:f9eeca106725 791 #if defined(GPIOD)
Kojto 107:4f6c30876dfa 792 #define __HAL_RCC_GPIOD_CLK_DISABLE() CLEAR_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIODEN)
Kojto 122:f9eeca106725 793 #endif /* GPIOD */
Kojto 122:f9eeca106725 794
Kojto 122:f9eeca106725 795 #if defined(GPIOE)
Kojto 107:4f6c30876dfa 796 #define __HAL_RCC_GPIOE_CLK_DISABLE() CLEAR_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOEEN)
Kojto 122:f9eeca106725 797 #endif /* GPIOE */
Kojto 122:f9eeca106725 798
Kojto 122:f9eeca106725 799 #if defined(GPIOF)
Kojto 107:4f6c30876dfa 800 #define __HAL_RCC_GPIOF_CLK_DISABLE() CLEAR_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOFEN)
Kojto 122:f9eeca106725 801 #endif /* GPIOF */
Kojto 122:f9eeca106725 802
Kojto 122:f9eeca106725 803 #if defined(GPIOG)
Kojto 107:4f6c30876dfa 804 #define __HAL_RCC_GPIOG_CLK_DISABLE() CLEAR_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOGEN)
Kojto 122:f9eeca106725 805 #endif /* GPIOG */
Kojto 107:4f6c30876dfa 806
Kojto 107:4f6c30876dfa 807 #define __HAL_RCC_GPIOH_CLK_DISABLE() CLEAR_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOHEN)
Kojto 107:4f6c30876dfa 808
Kojto 122:f9eeca106725 809 #if defined(USB_OTG_FS)
Kojto 122:f9eeca106725 810 #define __HAL_RCC_USB_OTG_FS_CLK_DISABLE() CLEAR_BIT(RCC->AHB2ENR, RCC_AHB2ENR_OTGFSEN);
Kojto 122:f9eeca106725 811 #endif /* USB_OTG_FS */
Kojto 122:f9eeca106725 812
Kojto 107:4f6c30876dfa 813 #define __HAL_RCC_ADC_CLK_DISABLE() CLEAR_BIT(RCC->AHB2ENR, RCC_AHB2ENR_ADCEN)
Kojto 107:4f6c30876dfa 814
Kojto 122:f9eeca106725 815 #if defined(AES)
Kojto 122:f9eeca106725 816 #define __HAL_RCC_AES_CLK_DISABLE() CLEAR_BIT(RCC->AHB2ENR, RCC_AHB2ENR_AESEN);
Kojto 122:f9eeca106725 817 #endif /* AES */
Kojto 122:f9eeca106725 818
Kojto 107:4f6c30876dfa 819 #define __HAL_RCC_RNG_CLK_DISABLE() CLEAR_BIT(RCC->AHB2ENR, RCC_AHB2ENR_RNGEN)
Kojto 107:4f6c30876dfa 820
Kojto 107:4f6c30876dfa 821 /**
Kojto 107:4f6c30876dfa 822 * @}
Kojto 107:4f6c30876dfa 823 */
Kojto 107:4f6c30876dfa 824
Kojto 107:4f6c30876dfa 825 /** @defgroup RCC_AHB3_Clock_Enable_Disable AHB3 Peripheral Clock Enable Disable
Kojto 107:4f6c30876dfa 826 * @brief Enable or disable the AHB3 peripheral clock.
Kojto 107:4f6c30876dfa 827 * @note After reset, the peripheral clock (used for registers read/write access)
Kojto 107:4f6c30876dfa 828 * is disabled and the application software has to enable this clock before
Kojto 107:4f6c30876dfa 829 * using it.
Kojto 107:4f6c30876dfa 830 * @{
Kojto 107:4f6c30876dfa 831 */
Kojto 107:4f6c30876dfa 832
Kojto 122:f9eeca106725 833 #if defined(FMC_BANK1)
Kojto 107:4f6c30876dfa 834 #define __HAL_RCC_FMC_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 835 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 836 SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); \
Kojto 107:4f6c30876dfa 837 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 838 tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); \
Kojto 107:4f6c30876dfa 839 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 840 } while(0)
Kojto 122:f9eeca106725 841 #endif /* FMC_BANK1 */
Kojto 122:f9eeca106725 842
Kojto 122:f9eeca106725 843 #if defined(QUADSPI)
Kojto 107:4f6c30876dfa 844 #define __HAL_RCC_QSPI_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 845 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 846 SET_BIT(RCC->AHB3ENR, RCC_AHB3ENR_QSPIEN); \
Kojto 107:4f6c30876dfa 847 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 848 tmpreg = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_QSPIEN); \
Kojto 107:4f6c30876dfa 849 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 850 } while(0)
Kojto 122:f9eeca106725 851 #endif /* QUADSPI */
Kojto 122:f9eeca106725 852
Kojto 122:f9eeca106725 853
Kojto 122:f9eeca106725 854 #if defined(FMC_BANK1)
Kojto 107:4f6c30876dfa 855 #define __HAL_RCC_FMC_CLK_DISABLE() CLEAR_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN)
Kojto 122:f9eeca106725 856 #endif /* FMC_BANK1 */
Kojto 122:f9eeca106725 857
Kojto 122:f9eeca106725 858 #if defined(QUADSPI)
Kojto 107:4f6c30876dfa 859 #define __HAL_RCC_QSPI_CLK_DISABLE() CLEAR_BIT(RCC->AHB3ENR, RCC_AHB3ENR_QSPIEN)
Kojto 122:f9eeca106725 860 #endif /* QUADSPI */
Kojto 107:4f6c30876dfa 861
Kojto 107:4f6c30876dfa 862 /**
Kojto 107:4f6c30876dfa 863 * @}
Kojto 107:4f6c30876dfa 864 */
Kojto 107:4f6c30876dfa 865
Kojto 107:4f6c30876dfa 866 /** @defgroup RCC_APB1_Clock_Enable_Disable APB1 Peripheral Clock Enable Disable
Kojto 107:4f6c30876dfa 867 * @brief Enable or disable the APB1 peripheral clock.
Kojto 107:4f6c30876dfa 868 * @note After reset, the peripheral clock (used for registers read/write access)
Kojto 107:4f6c30876dfa 869 * is disabled and the application software has to enable this clock before
Kojto 107:4f6c30876dfa 870 * using it.
Kojto 107:4f6c30876dfa 871 * @{
Kojto 107:4f6c30876dfa 872 */
Kojto 107:4f6c30876dfa 873
Kojto 107:4f6c30876dfa 874 #define __HAL_RCC_TIM2_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 875 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 876 SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM2EN); \
Kojto 107:4f6c30876dfa 877 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 878 tmpreg = READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM2EN); \
Kojto 107:4f6c30876dfa 879 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 880 } while(0)
Kojto 107:4f6c30876dfa 881
Kojto 122:f9eeca106725 882 #if defined(TIM3)
Kojto 107:4f6c30876dfa 883 #define __HAL_RCC_TIM3_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 884 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 885 SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM3EN); \
Kojto 107:4f6c30876dfa 886 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 887 tmpreg = READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM3EN); \
Kojto 107:4f6c30876dfa 888 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 889 } while(0)
Kojto 122:f9eeca106725 890 #endif /* TIM3 */
Kojto 122:f9eeca106725 891
Kojto 122:f9eeca106725 892 #if defined(TIM4)
Kojto 107:4f6c30876dfa 893 #define __HAL_RCC_TIM4_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 894 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 895 SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM4EN); \
Kojto 107:4f6c30876dfa 896 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 897 tmpreg = READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM4EN); \
Kojto 107:4f6c30876dfa 898 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 899 } while(0)
Kojto 122:f9eeca106725 900 #endif /* TIM4 */
Kojto 122:f9eeca106725 901
Kojto 122:f9eeca106725 902 #if defined(TIM5)
Kojto 107:4f6c30876dfa 903 #define __HAL_RCC_TIM5_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 904 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 905 SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM5EN); \
Kojto 107:4f6c30876dfa 906 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 907 tmpreg = READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM5EN); \
Kojto 107:4f6c30876dfa 908 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 909 } while(0)
Kojto 122:f9eeca106725 910 #endif /* TIM5 */
Kojto 107:4f6c30876dfa 911
Kojto 107:4f6c30876dfa 912 #define __HAL_RCC_TIM6_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 913 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 914 SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM6EN); \
Kojto 107:4f6c30876dfa 915 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 916 tmpreg = READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM6EN); \
Kojto 107:4f6c30876dfa 917 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 918 } while(0)
Kojto 107:4f6c30876dfa 919
Kojto 107:4f6c30876dfa 920 #define __HAL_RCC_TIM7_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 921 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 922 SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM7EN); \
Kojto 107:4f6c30876dfa 923 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 924 tmpreg = READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM7EN); \
Kojto 107:4f6c30876dfa 925 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 926 } while(0)
Kojto 107:4f6c30876dfa 927
Kojto 122:f9eeca106725 928 #if defined(LCD)
Kojto 122:f9eeca106725 929 #define __HAL_RCC_LCD_CLK_ENABLE() do { \
Kojto 122:f9eeca106725 930 __IO uint32_t tmpreg; \
Kojto 122:f9eeca106725 931 SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_LCDEN); \
Kojto 122:f9eeca106725 932 /* Delay after an RCC peripheral clock enabling */ \
Kojto 122:f9eeca106725 933 tmpreg = READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_LCDEN); \
Kojto 122:f9eeca106725 934 UNUSED(tmpreg); \
Kojto 122:f9eeca106725 935 } while(0)
Kojto 122:f9eeca106725 936 #endif /* LCD */
Kojto 122:f9eeca106725 937
Kojto 122:f9eeca106725 938 #if defined(RCC_APB1ENR1_RTCAPBEN)
Kojto 122:f9eeca106725 939 #define __HAL_RCC_RTCAPB_CLK_ENABLE() do { \
Kojto 122:f9eeca106725 940 __IO uint32_t tmpreg; \
Kojto 122:f9eeca106725 941 SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_RTCAPBEN); \
Kojto 122:f9eeca106725 942 /* Delay after an RCC peripheral clock enabling */ \
Kojto 122:f9eeca106725 943 tmpreg = READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_RTCAPBEN); \
Kojto 122:f9eeca106725 944 UNUSED(tmpreg); \
Kojto 122:f9eeca106725 945 } while(0)
Kojto 122:f9eeca106725 946 #endif /* RCC_APB1ENR1_RTCAPBEN */
Kojto 122:f9eeca106725 947
Kojto 107:4f6c30876dfa 948 #define __HAL_RCC_WWDG_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 949 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 950 SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_WWDGEN); \
Kojto 107:4f6c30876dfa 951 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 952 tmpreg = READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_WWDGEN); \
Kojto 107:4f6c30876dfa 953 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 954 } while(0)
Kojto 107:4f6c30876dfa 955
Kojto 122:f9eeca106725 956 #if defined(SPI2)
Kojto 107:4f6c30876dfa 957 #define __HAL_RCC_SPI2_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 958 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 959 SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_SPI2EN); \
Kojto 107:4f6c30876dfa 960 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 961 tmpreg = READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_SPI2EN); \
Kojto 107:4f6c30876dfa 962 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 963 } while(0)
Kojto 122:f9eeca106725 964 #endif /* SPI2 */
Kojto 107:4f6c30876dfa 965
Kojto 107:4f6c30876dfa 966 #define __HAL_RCC_SPI3_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 967 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 968 SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_SPI3EN); \
Kojto 107:4f6c30876dfa 969 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 970 tmpreg = READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_SPI3EN); \
Kojto 107:4f6c30876dfa 971 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 972 } while(0)
Kojto 107:4f6c30876dfa 973
Kojto 107:4f6c30876dfa 974 #define __HAL_RCC_USART2_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 975 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 976 SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_USART2EN); \
Kojto 107:4f6c30876dfa 977 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 978 tmpreg = READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_USART2EN); \
Kojto 107:4f6c30876dfa 979 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 980 } while(0)
Kojto 107:4f6c30876dfa 981
Kojto 122:f9eeca106725 982 #if defined(USART3)
Kojto 107:4f6c30876dfa 983 #define __HAL_RCC_USART3_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 984 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 985 SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_USART3EN); \
Kojto 107:4f6c30876dfa 986 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 987 tmpreg = READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_USART3EN); \
Kojto 107:4f6c30876dfa 988 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 989 } while(0)
Kojto 122:f9eeca106725 990 #endif /* USART3 */
Kojto 122:f9eeca106725 991
Kojto 122:f9eeca106725 992 #if defined(UART4)
Kojto 107:4f6c30876dfa 993 #define __HAL_RCC_UART4_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 994 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 995 SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_UART4EN); \
Kojto 107:4f6c30876dfa 996 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 997 tmpreg = READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_UART4EN); \
Kojto 107:4f6c30876dfa 998 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 999 } while(0)
Kojto 122:f9eeca106725 1000 #endif /* UART4 */
Kojto 122:f9eeca106725 1001
Kojto 122:f9eeca106725 1002 #if defined(UART5)
Kojto 107:4f6c30876dfa 1003 #define __HAL_RCC_UART5_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 1004 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 1005 SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_UART5EN); \
Kojto 107:4f6c30876dfa 1006 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 1007 tmpreg = READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_UART5EN); \
Kojto 107:4f6c30876dfa 1008 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 1009 } while(0)
Kojto 122:f9eeca106725 1010 #endif /* UART5 */
Kojto 107:4f6c30876dfa 1011
Kojto 107:4f6c30876dfa 1012 #define __HAL_RCC_I2C1_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 1013 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 1014 SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_I2C1EN); \
Kojto 107:4f6c30876dfa 1015 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 1016 tmpreg = READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_I2C1EN); \
Kojto 107:4f6c30876dfa 1017 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 1018 } while(0)
Kojto 107:4f6c30876dfa 1019
Kojto 122:f9eeca106725 1020 #if defined(I2C2)
Kojto 107:4f6c30876dfa 1021 #define __HAL_RCC_I2C2_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 1022 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 1023 SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_I2C2EN); \
Kojto 107:4f6c30876dfa 1024 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 1025 tmpreg = READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_I2C2EN); \
Kojto 107:4f6c30876dfa 1026 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 1027 } while(0)
Kojto 122:f9eeca106725 1028 #endif /* I2C2 */
Kojto 107:4f6c30876dfa 1029
Kojto 107:4f6c30876dfa 1030 #define __HAL_RCC_I2C3_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 1031 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 1032 SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_I2C3EN); \
Kojto 107:4f6c30876dfa 1033 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 1034 tmpreg = READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_I2C3EN); \
Kojto 107:4f6c30876dfa 1035 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 1036 } while(0)
Kojto 107:4f6c30876dfa 1037
Kojto 122:f9eeca106725 1038 #if defined(CRS)
Kojto 122:f9eeca106725 1039 #define __HAL_RCC_CRS_CLK_ENABLE() do { \
Kojto 122:f9eeca106725 1040 __IO uint32_t tmpreg; \
Kojto 122:f9eeca106725 1041 SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_CRSEN); \
Kojto 122:f9eeca106725 1042 /* Delay after an RCC peripheral clock enabling */ \
Kojto 122:f9eeca106725 1043 tmpreg = READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_CRSEN); \
Kojto 122:f9eeca106725 1044 UNUSED(tmpreg); \
Kojto 122:f9eeca106725 1045 } while(0)
Kojto 122:f9eeca106725 1046 #endif /* CRS */
Kojto 122:f9eeca106725 1047
Kojto 107:4f6c30876dfa 1048 #define __HAL_RCC_CAN1_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 1049 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 1050 SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_CAN1EN); \
Kojto 107:4f6c30876dfa 1051 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 1052 tmpreg = READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_CAN1EN); \
Kojto 107:4f6c30876dfa 1053 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 1054 } while(0)
Kojto 107:4f6c30876dfa 1055
Kojto 122:f9eeca106725 1056 #if defined(USB)
Kojto 122:f9eeca106725 1057 #define __HAL_RCC_USB_CLK_ENABLE() do { \
Kojto 122:f9eeca106725 1058 __IO uint32_t tmpreg; \
Kojto 122:f9eeca106725 1059 SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_USBFSEN); \
Kojto 122:f9eeca106725 1060 /* Delay after an RCC peripheral clock enabling */ \
Kojto 122:f9eeca106725 1061 tmpreg = READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_USBFSEN); \
Kojto 122:f9eeca106725 1062 UNUSED(tmpreg); \
Kojto 122:f9eeca106725 1063 } while(0)
Kojto 122:f9eeca106725 1064 #endif /* USB */
Kojto 122:f9eeca106725 1065
Kojto 107:4f6c30876dfa 1066 #define __HAL_RCC_PWR_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 1067 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 1068 SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_PWREN); \
Kojto 107:4f6c30876dfa 1069 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 1070 tmpreg = READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_PWREN); \
Kojto 107:4f6c30876dfa 1071 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 1072 } while(0)
Kojto 107:4f6c30876dfa 1073
Kojto 107:4f6c30876dfa 1074 #define __HAL_RCC_DAC1_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 1075 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 1076 SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_DAC1EN); \
Kojto 107:4f6c30876dfa 1077 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 1078 tmpreg = READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_DAC1EN); \
Kojto 107:4f6c30876dfa 1079 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 1080 } while(0)
Kojto 107:4f6c30876dfa 1081
Kojto 107:4f6c30876dfa 1082 #define __HAL_RCC_OPAMP_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 1083 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 1084 SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_OPAMPEN); \
Kojto 107:4f6c30876dfa 1085 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 1086 tmpreg = READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_OPAMPEN); \
Kojto 107:4f6c30876dfa 1087 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 1088 } while(0)
Kojto 107:4f6c30876dfa 1089
Kojto 107:4f6c30876dfa 1090 #define __HAL_RCC_LPTIM1_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 1091 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 1092 SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_LPTIM1EN); \
Kojto 107:4f6c30876dfa 1093 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 1094 tmpreg = READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_LPTIM1EN); \
Kojto 107:4f6c30876dfa 1095 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 1096 } while(0)
Kojto 107:4f6c30876dfa 1097
Kojto 107:4f6c30876dfa 1098 #define __HAL_RCC_LPUART1_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 1099 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 1100 SET_BIT(RCC->APB1ENR2, RCC_APB1ENR2_LPUART1EN); \
Kojto 107:4f6c30876dfa 1101 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 1102 tmpreg = READ_BIT(RCC->APB1ENR2, RCC_APB1ENR2_LPUART1EN); \
Kojto 107:4f6c30876dfa 1103 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 1104 } while(0)
Kojto 107:4f6c30876dfa 1105
Kojto 107:4f6c30876dfa 1106 #define __HAL_RCC_SWPMI1_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 1107 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 1108 SET_BIT(RCC->APB1ENR2, RCC_APB1ENR2_SWPMI1EN); \
Kojto 107:4f6c30876dfa 1109 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 1110 tmpreg = READ_BIT(RCC->APB1ENR2, RCC_APB1ENR2_SWPMI1EN); \
Kojto 107:4f6c30876dfa 1111 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 1112 } while(0)
Kojto 107:4f6c30876dfa 1113
Kojto 107:4f6c30876dfa 1114 #define __HAL_RCC_LPTIM2_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 1115 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 1116 SET_BIT(RCC->APB1ENR2, RCC_APB1ENR2_LPTIM2EN); \
Kojto 107:4f6c30876dfa 1117 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 1118 tmpreg = READ_BIT(RCC->APB1ENR2, RCC_APB1ENR2_LPTIM2EN); \
Kojto 107:4f6c30876dfa 1119 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 1120 } while(0)
Kojto 107:4f6c30876dfa 1121
Kojto 122:f9eeca106725 1122
Kojto 107:4f6c30876dfa 1123 #define __HAL_RCC_TIM2_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM2EN)
Kojto 107:4f6c30876dfa 1124
Kojto 122:f9eeca106725 1125 #if defined(TIM3)
Kojto 107:4f6c30876dfa 1126 #define __HAL_RCC_TIM3_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM3EN)
Kojto 122:f9eeca106725 1127 #endif /* TIM3 */
Kojto 122:f9eeca106725 1128
Kojto 122:f9eeca106725 1129 #if defined(TIM4)
Kojto 107:4f6c30876dfa 1130 #define __HAL_RCC_TIM4_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM4EN)
Kojto 122:f9eeca106725 1131 #endif /* TIM4 */
Kojto 122:f9eeca106725 1132
Kojto 122:f9eeca106725 1133 #if defined(TIM5)
Kojto 107:4f6c30876dfa 1134 #define __HAL_RCC_TIM5_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM5EN)
Kojto 122:f9eeca106725 1135 #endif /* TIM5 */
Kojto 107:4f6c30876dfa 1136
Kojto 107:4f6c30876dfa 1137 #define __HAL_RCC_TIM6_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM6EN)
Kojto 107:4f6c30876dfa 1138
Kojto 107:4f6c30876dfa 1139 #define __HAL_RCC_TIM7_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM7EN)
Kojto 107:4f6c30876dfa 1140
Kojto 122:f9eeca106725 1141 #if defined(LCD)
Kojto 122:f9eeca106725 1142 #define __HAL_RCC_LCD_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR1, RCC_APB1ENR1_LCDEN);
Kojto 122:f9eeca106725 1143 #endif /* LCD */
Kojto 122:f9eeca106725 1144
Kojto 122:f9eeca106725 1145 #if defined(RCC_APB1ENR1_RTCAPBEN)
Kojto 122:f9eeca106725 1146 #define __HAL_RCC_RTCAPB_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR1, RCC_APB1ENR1_RTCAPBEN);
Kojto 122:f9eeca106725 1147 #endif /* RCC_APB1ENR1_RTCAPBEN */
Kojto 122:f9eeca106725 1148
Kojto 122:f9eeca106725 1149 #if defined(SPI2)
Kojto 107:4f6c30876dfa 1150 #define __HAL_RCC_SPI2_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR1, RCC_APB1ENR1_SPI2EN)
Kojto 122:f9eeca106725 1151 #endif /* SPI2 */
Kojto 107:4f6c30876dfa 1152
Kojto 107:4f6c30876dfa 1153 #define __HAL_RCC_SPI3_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR1, RCC_APB1ENR1_SPI3EN)
Kojto 107:4f6c30876dfa 1154
Kojto 107:4f6c30876dfa 1155 #define __HAL_RCC_USART2_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR1, RCC_APB1ENR1_USART2EN)
Kojto 107:4f6c30876dfa 1156
Kojto 122:f9eeca106725 1157 #if defined(USART3)
Kojto 107:4f6c30876dfa 1158 #define __HAL_RCC_USART3_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR1, RCC_APB1ENR1_USART3EN)
Kojto 122:f9eeca106725 1159 #endif /* USART3 */
Kojto 122:f9eeca106725 1160
Kojto 122:f9eeca106725 1161 #if defined(UART4)
Kojto 107:4f6c30876dfa 1162 #define __HAL_RCC_UART4_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR1, RCC_APB1ENR1_UART4EN)
Kojto 122:f9eeca106725 1163 #endif /* UART4 */
Kojto 122:f9eeca106725 1164
Kojto 122:f9eeca106725 1165 #if defined(UART5)
Kojto 107:4f6c30876dfa 1166 #define __HAL_RCC_UART5_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR1, RCC_APB1ENR1_UART5EN)
Kojto 122:f9eeca106725 1167 #endif /* UART5 */
Kojto 107:4f6c30876dfa 1168
Kojto 107:4f6c30876dfa 1169 #define __HAL_RCC_I2C1_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR1, RCC_APB1ENR1_I2C1EN)
Kojto 107:4f6c30876dfa 1170
Kojto 122:f9eeca106725 1171 #if defined(I2C2)
Kojto 107:4f6c30876dfa 1172 #define __HAL_RCC_I2C2_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR1, RCC_APB1ENR1_I2C2EN)
Kojto 122:f9eeca106725 1173 #endif /* I2C2 */
Kojto 107:4f6c30876dfa 1174
Kojto 107:4f6c30876dfa 1175 #define __HAL_RCC_I2C3_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR1, RCC_APB1ENR1_I2C3EN)
Kojto 107:4f6c30876dfa 1176
Kojto 122:f9eeca106725 1177 #if defined(CRS)
Kojto 122:f9eeca106725 1178 #define __HAL_RCC_CRS_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR1, RCC_APB1ENR1_CRSEN);
Kojto 122:f9eeca106725 1179 #endif /* CRS */
Kojto 122:f9eeca106725 1180
Kojto 107:4f6c30876dfa 1181 #define __HAL_RCC_CAN1_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR1, RCC_APB1ENR1_CAN1EN)
Kojto 107:4f6c30876dfa 1182
Kojto 122:f9eeca106725 1183 #if defined(USB)
Kojto 122:f9eeca106725 1184 #define __HAL_RCC_USB_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR1, RCC_APB1ENR1_USBFSEN);
Kojto 122:f9eeca106725 1185 #endif /* USB */
Kojto 122:f9eeca106725 1186
Kojto 107:4f6c30876dfa 1187 #define __HAL_RCC_PWR_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR1, RCC_APB1ENR1_PWREN)
Kojto 107:4f6c30876dfa 1188
Kojto 107:4f6c30876dfa 1189 #define __HAL_RCC_DAC1_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR1, RCC_APB1ENR1_DAC1EN)
Kojto 107:4f6c30876dfa 1190
Kojto 107:4f6c30876dfa 1191 #define __HAL_RCC_OPAMP_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR1, RCC_APB1ENR1_OPAMPEN)
Kojto 107:4f6c30876dfa 1192
Kojto 107:4f6c30876dfa 1193 #define __HAL_RCC_LPTIM1_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR1, RCC_APB1ENR1_LPTIM1EN)
Kojto 107:4f6c30876dfa 1194
Kojto 107:4f6c30876dfa 1195 #define __HAL_RCC_LPUART1_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR2, RCC_APB1ENR2_LPUART1EN)
Kojto 107:4f6c30876dfa 1196
Kojto 107:4f6c30876dfa 1197 #define __HAL_RCC_SWPMI1_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR2, RCC_APB1ENR2_SWPMI1EN)
Kojto 107:4f6c30876dfa 1198
Kojto 107:4f6c30876dfa 1199 #define __HAL_RCC_LPTIM2_CLK_DISABLE() CLEAR_BIT(RCC->APB1ENR2, RCC_APB1ENR2_LPTIM2EN)
Kojto 107:4f6c30876dfa 1200
Kojto 107:4f6c30876dfa 1201 /**
Kojto 107:4f6c30876dfa 1202 * @}
Kojto 107:4f6c30876dfa 1203 */
Kojto 107:4f6c30876dfa 1204
Kojto 107:4f6c30876dfa 1205 /** @defgroup RCC_APB2_Clock_Enable_Disable APB2 Peripheral Clock Enable Disable
Kojto 107:4f6c30876dfa 1206 * @brief Enable or disable the APB2 peripheral clock.
Kojto 107:4f6c30876dfa 1207 * @note After reset, the peripheral clock (used for registers read/write access)
Kojto 107:4f6c30876dfa 1208 * is disabled and the application software has to enable this clock before
Kojto 107:4f6c30876dfa 1209 * using it.
Kojto 107:4f6c30876dfa 1210 * @{
Kojto 107:4f6c30876dfa 1211 */
Kojto 107:4f6c30876dfa 1212
Kojto 107:4f6c30876dfa 1213 #define __HAL_RCC_SYSCFG_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 1214 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 1215 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SYSCFGEN); \
Kojto 107:4f6c30876dfa 1216 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 1217 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SYSCFGEN); \
Kojto 107:4f6c30876dfa 1218 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 1219 } while(0)
Kojto 107:4f6c30876dfa 1220
Kojto 107:4f6c30876dfa 1221 #define __HAL_RCC_FIREWALL_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 1222 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 1223 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_FWEN); \
Kojto 107:4f6c30876dfa 1224 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 1225 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_FWEN); \
Kojto 107:4f6c30876dfa 1226 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 1227 } while(0)
Kojto 107:4f6c30876dfa 1228
Kojto 122:f9eeca106725 1229 #if defined(SDMMC1) && defined(RCC_APB2ENR_SDMMC1EN)
Kojto 107:4f6c30876dfa 1230 #define __HAL_RCC_SDMMC1_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 1231 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 1232 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SDMMC1EN); \
Kojto 107:4f6c30876dfa 1233 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 1234 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SDMMC1EN); \
Kojto 107:4f6c30876dfa 1235 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 1236 } while(0)
Kojto 122:f9eeca106725 1237 #endif /* SDMMC1 && RCC_APB2ENR_SDMMC1EN */
Kojto 107:4f6c30876dfa 1238
Kojto 107:4f6c30876dfa 1239 #define __HAL_RCC_TIM1_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 1240 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 1241 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM1EN); \
Kojto 107:4f6c30876dfa 1242 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 1243 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM1EN); \
Kojto 107:4f6c30876dfa 1244 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 1245 } while(0)
Kojto 107:4f6c30876dfa 1246
Kojto 107:4f6c30876dfa 1247 #define __HAL_RCC_SPI1_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 1248 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 1249 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI1EN); \
Kojto 107:4f6c30876dfa 1250 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 1251 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI1EN); \
Kojto 107:4f6c30876dfa 1252 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 1253 } while(0)
Kojto 107:4f6c30876dfa 1254
Kojto 122:f9eeca106725 1255 #if defined(TIM8)
Kojto 107:4f6c30876dfa 1256 #define __HAL_RCC_TIM8_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 1257 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 1258 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM8EN); \
Kojto 107:4f6c30876dfa 1259 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 1260 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM8EN); \
Kojto 107:4f6c30876dfa 1261 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 1262 } while(0)
Kojto 122:f9eeca106725 1263 #endif /* TIM8 */
Kojto 107:4f6c30876dfa 1264
Kojto 107:4f6c30876dfa 1265 #define __HAL_RCC_USART1_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 1266 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 1267 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_USART1EN); \
Kojto 107:4f6c30876dfa 1268 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 1269 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_USART1EN); \
Kojto 107:4f6c30876dfa 1270 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 1271 } while(0)
Kojto 107:4f6c30876dfa 1272
Kojto 107:4f6c30876dfa 1273
Kojto 107:4f6c30876dfa 1274 #define __HAL_RCC_TIM15_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 1275 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 1276 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM15EN); \
Kojto 107:4f6c30876dfa 1277 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 1278 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM15EN); \
Kojto 107:4f6c30876dfa 1279 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 1280 } while(0)
Kojto 107:4f6c30876dfa 1281
Kojto 107:4f6c30876dfa 1282 #define __HAL_RCC_TIM16_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 1283 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 1284 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM16EN); \
Kojto 107:4f6c30876dfa 1285 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 1286 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM16EN); \
Kojto 107:4f6c30876dfa 1287 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 1288 } while(0)
Kojto 107:4f6c30876dfa 1289
Kojto 122:f9eeca106725 1290 #if defined(TIM17)
Kojto 107:4f6c30876dfa 1291 #define __HAL_RCC_TIM17_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 1292 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 1293 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM17EN); \
Kojto 107:4f6c30876dfa 1294 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 1295 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM17EN); \
Kojto 107:4f6c30876dfa 1296 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 1297 } while(0)
Kojto 122:f9eeca106725 1298 #endif /* TIM17 */
Kojto 107:4f6c30876dfa 1299
Kojto 107:4f6c30876dfa 1300 #define __HAL_RCC_SAI1_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 1301 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 1302 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI1EN); \
Kojto 107:4f6c30876dfa 1303 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 1304 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI1EN); \
Kojto 107:4f6c30876dfa 1305 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 1306 } while(0)
Kojto 107:4f6c30876dfa 1307
Kojto 122:f9eeca106725 1308 #if defined(SAI2)
Kojto 107:4f6c30876dfa 1309 #define __HAL_RCC_SAI2_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 1310 __IO uint32_t tmpreg; \
Kojto 107:4f6c30876dfa 1311 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI2EN); \
Kojto 107:4f6c30876dfa 1312 /* Delay after an RCC peripheral clock enabling */ \
Kojto 107:4f6c30876dfa 1313 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI2EN); \
Kojto 107:4f6c30876dfa 1314 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 1315 } while(0)
Kojto 122:f9eeca106725 1316 #endif /* SAI2 */
Kojto 122:f9eeca106725 1317
Kojto 122:f9eeca106725 1318 #if defined(DFSDM1_Filter0)
Kojto 122:f9eeca106725 1319 #define __HAL_RCC_DFSDM1_CLK_ENABLE() do { \
Kojto 107:4f6c30876dfa 1320 __IO uint32_t tmpreg; \
Kojto 122:f9eeca106725 1321 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_DFSDM1EN); \
Kojto 107:4f6c30876dfa 1322 /* Delay after an RCC peripheral clock enabling */ \
Kojto 122:f9eeca106725 1323 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_DFSDM1EN); \
Kojto 107:4f6c30876dfa 1324 UNUSED(tmpreg); \
Kojto 107:4f6c30876dfa 1325 } while(0)
Kojto 122:f9eeca106725 1326 #endif /* DFSDM1_Filter0 */
Kojto 122:f9eeca106725 1327
Kojto 107:4f6c30876dfa 1328
Kojto 107:4f6c30876dfa 1329 #define __HAL_RCC_SYSCFG_CLK_DISABLE() CLEAR_BIT(RCC->APB2ENR, RCC_APB2ENR_SYSCFGEN)
Kojto 107:4f6c30876dfa 1330
Kojto 122:f9eeca106725 1331 #if defined(SDMMC1) && defined(RCC_APB2ENR_SDMMC1EN)
Kojto 107:4f6c30876dfa 1332 #define __HAL_RCC_SDMMC1_CLK_DISABLE() CLEAR_BIT(RCC->APB2ENR, RCC_APB2ENR_SDMMC1EN)
Kojto 122:f9eeca106725 1333 #endif /* SDMMC1 && RCC_APB2ENR_SDMMC1EN */
Kojto 107:4f6c30876dfa 1334
Kojto 107:4f6c30876dfa 1335 #define __HAL_RCC_TIM1_CLK_DISABLE() CLEAR_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM1EN)
Kojto 107:4f6c30876dfa 1336
Kojto 107:4f6c30876dfa 1337 #define __HAL_RCC_SPI1_CLK_DISABLE() CLEAR_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI1EN)
Kojto 107:4f6c30876dfa 1338
Kojto 122:f9eeca106725 1339 #if defined(TIM8)
Kojto 107:4f6c30876dfa 1340 #define __HAL_RCC_TIM8_CLK_DISABLE() CLEAR_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM8EN)
Kojto 122:f9eeca106725 1341 #endif /* TIM8 */
Kojto 107:4f6c30876dfa 1342
Kojto 107:4f6c30876dfa 1343 #define __HAL_RCC_USART1_CLK_DISABLE() CLEAR_BIT(RCC->APB2ENR, RCC_APB2ENR_USART1EN)
Kojto 107:4f6c30876dfa 1344
Kojto 107:4f6c30876dfa 1345 #define __HAL_RCC_TIM15_CLK_DISABLE() CLEAR_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM15EN)
Kojto 107:4f6c30876dfa 1346
Kojto 107:4f6c30876dfa 1347 #define __HAL_RCC_TIM16_CLK_DISABLE() CLEAR_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM16EN)
Kojto 107:4f6c30876dfa 1348
Kojto 122:f9eeca106725 1349 #if defined(TIM17)
Kojto 107:4f6c30876dfa 1350 #define __HAL_RCC_TIM17_CLK_DISABLE() CLEAR_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM17EN)
Kojto 122:f9eeca106725 1351 #endif /* TIM17 */
Kojto 107:4f6c30876dfa 1352
Kojto 107:4f6c30876dfa 1353 #define __HAL_RCC_SAI1_CLK_DISABLE() CLEAR_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI1EN)
Kojto 107:4f6c30876dfa 1354
Kojto 122:f9eeca106725 1355 #if defined(SAI2)
Kojto 107:4f6c30876dfa 1356 #define __HAL_RCC_SAI2_CLK_DISABLE() CLEAR_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI2EN)
Kojto 122:f9eeca106725 1357 #endif /* SAI2 */
Kojto 122:f9eeca106725 1358
Kojto 122:f9eeca106725 1359 #if defined(DFSDM1_Filter0)
Kojto 122:f9eeca106725 1360 #define __HAL_RCC_DFSDM1_CLK_DISABLE() CLEAR_BIT(RCC->APB2ENR, RCC_APB2ENR_DFSDM1EN)
Kojto 122:f9eeca106725 1361 #endif /* DFSDM1_Filter0 */
Kojto 107:4f6c30876dfa 1362
Kojto 107:4f6c30876dfa 1363 /**
Kojto 107:4f6c30876dfa 1364 * @}
Kojto 107:4f6c30876dfa 1365 */
Kojto 107:4f6c30876dfa 1366
Kojto 107:4f6c30876dfa 1367 /** @defgroup RCC_AHB1_Peripheral_Clock_Enable_Disable_Status AHB1 Peripheral Clock Enabled or Disabled Status
Kojto 107:4f6c30876dfa 1368 * @brief Check whether the AHB1 peripheral clock is enabled or not.
Kojto 107:4f6c30876dfa 1369 * @note After reset, the peripheral clock (used for registers read/write access)
Kojto 107:4f6c30876dfa 1370 * is disabled and the application software has to enable this clock before
Kojto 107:4f6c30876dfa 1371 * using it.
Kojto 107:4f6c30876dfa 1372 * @{
Kojto 107:4f6c30876dfa 1373 */
Kojto 107:4f6c30876dfa 1374
Kojto 107:4f6c30876dfa 1375 #define __HAL_RCC_DMA1_IS_CLK_ENABLED() (READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA1EN) != RESET)
Kojto 107:4f6c30876dfa 1376
Kojto 107:4f6c30876dfa 1377 #define __HAL_RCC_DMA2_IS_CLK_ENABLED() (READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA2EN) != RESET)
Kojto 107:4f6c30876dfa 1378
Kojto 107:4f6c30876dfa 1379 #define __HAL_RCC_FLASH_IS_CLK_ENABLED() (READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_FLASHEN) != RESET)
Kojto 107:4f6c30876dfa 1380
Kojto 107:4f6c30876dfa 1381 #define __HAL_RCC_CRC_IS_CLK_ENABLED() (READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_CRCEN) != RESET)
Kojto 107:4f6c30876dfa 1382
Kojto 107:4f6c30876dfa 1383 #define __HAL_RCC_TSC_IS_CLK_ENABLED() (READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_TSCEN) != RESET)
Kojto 107:4f6c30876dfa 1384
Kojto 122:f9eeca106725 1385
Kojto 107:4f6c30876dfa 1386 #define __HAL_RCC_DMA1_IS_CLK_DISABLED() (READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA1EN) == RESET)
Kojto 107:4f6c30876dfa 1387
Kojto 107:4f6c30876dfa 1388 #define __HAL_RCC_DMA2_IS_CLK_DISABLED() (READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_DMA2EN) == RESET)
Kojto 107:4f6c30876dfa 1389
Kojto 107:4f6c30876dfa 1390 #define __HAL_RCC_FLASH_IS_CLK_DISABLED() (READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_FLASHEN) == RESET)
Kojto 107:4f6c30876dfa 1391
Kojto 107:4f6c30876dfa 1392 #define __HAL_RCC_CRC_IS_CLK_DISABLED() (READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_CRCEN) == RESET)
Kojto 107:4f6c30876dfa 1393
Kojto 107:4f6c30876dfa 1394 #define __HAL_RCC_TSC_IS_CLK_DISABLED() (READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_TSCEN) == RESET)
Kojto 107:4f6c30876dfa 1395
Kojto 107:4f6c30876dfa 1396 /**
Kojto 107:4f6c30876dfa 1397 * @}
Kojto 107:4f6c30876dfa 1398 */
Kojto 107:4f6c30876dfa 1399
Kojto 107:4f6c30876dfa 1400 /** @defgroup RCC_AHB2_Clock_Enable_Disable_Status AHB2 Peripheral Clock Enabled or Disabled Status
Kojto 107:4f6c30876dfa 1401 * @brief Check whether the AHB2 peripheral clock is enabled or not.
Kojto 107:4f6c30876dfa 1402 * @note After reset, the peripheral clock (used for registers read/write access)
Kojto 107:4f6c30876dfa 1403 * is disabled and the application software has to enable this clock before
Kojto 107:4f6c30876dfa 1404 * using it.
Kojto 107:4f6c30876dfa 1405 * @{
Kojto 107:4f6c30876dfa 1406 */
Kojto 107:4f6c30876dfa 1407
Kojto 107:4f6c30876dfa 1408 #define __HAL_RCC_GPIOA_IS_CLK_ENABLED() (READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOAEN) != RESET)
Kojto 107:4f6c30876dfa 1409
Kojto 107:4f6c30876dfa 1410 #define __HAL_RCC_GPIOB_IS_CLK_ENABLED() (READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOCEN) != RESET)
Kojto 107:4f6c30876dfa 1411
Kojto 107:4f6c30876dfa 1412 #define __HAL_RCC_GPIOC_IS_CLK_ENABLED() (READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOCEN) != RESET)
Kojto 107:4f6c30876dfa 1413
Kojto 122:f9eeca106725 1414 #if defined(GPIOD)
Kojto 107:4f6c30876dfa 1415 #define __HAL_RCC_GPIOD_IS_CLK_ENABLED() (READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIODEN) != RESET)
Kojto 122:f9eeca106725 1416 #endif /* GPIOD */
Kojto 122:f9eeca106725 1417
Kojto 122:f9eeca106725 1418 #if defined(GPIOE)
Kojto 107:4f6c30876dfa 1419 #define __HAL_RCC_GPIOE_IS_CLK_ENABLED() (READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOEEN) != RESET)
Kojto 122:f9eeca106725 1420 #endif /* GPIOE */
Kojto 122:f9eeca106725 1421
Kojto 122:f9eeca106725 1422 #if defined(GPIOF)
Kojto 107:4f6c30876dfa 1423 #define __HAL_RCC_GPIOF_IS_CLK_ENABLED() (READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOFEN) != RESET)
Kojto 122:f9eeca106725 1424 #endif /* GPIOF */
Kojto 122:f9eeca106725 1425
Kojto 122:f9eeca106725 1426 #if defined(GPIOG)
Kojto 107:4f6c30876dfa 1427 #define __HAL_RCC_GPIOG_IS_CLK_ENABLED() (READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOGEN) != RESET)
Kojto 122:f9eeca106725 1428 #endif /* GPIOG */
Kojto 107:4f6c30876dfa 1429
Kojto 107:4f6c30876dfa 1430 #define __HAL_RCC_GPIOH_IS_CLK_ENABLED() (READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOHEN) != RESET)
Kojto 107:4f6c30876dfa 1431
Kojto 122:f9eeca106725 1432 #if defined(USB_OTG_FS)
Kojto 122:f9eeca106725 1433 #define __HAL_RCC_USB_OTG_FS_IS_CLK_ENABLED() (READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_OTGFSEN) != RESET)
Kojto 122:f9eeca106725 1434 #endif /* USB_OTG_FS */
Kojto 122:f9eeca106725 1435
Kojto 107:4f6c30876dfa 1436 #define __HAL_RCC_ADC_IS_CLK_ENABLED() (READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_ADCEN) != RESET)
Kojto 107:4f6c30876dfa 1437
Kojto 122:f9eeca106725 1438 #if defined(AES)
Kojto 122:f9eeca106725 1439 #define __HAL_RCC_AES_IS_CLK_ENABLED() (READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_AESEN) != RESET)
Kojto 122:f9eeca106725 1440 #endif /* AES */
Kojto 122:f9eeca106725 1441
Kojto 107:4f6c30876dfa 1442 #define __HAL_RCC_RNG_IS_CLK_ENABLED() (READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_RNGEN) != RESET)
Kojto 107:4f6c30876dfa 1443
Kojto 122:f9eeca106725 1444
Kojto 107:4f6c30876dfa 1445 #define __HAL_RCC_GPIOA_IS_CLK_DISABLED() (READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOAEN) == RESET)
Kojto 107:4f6c30876dfa 1446
Kojto 107:4f6c30876dfa 1447 #define __HAL_RCC_GPIOB_IS_CLK_DISABLED() (READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOBEN) == RESET)
Kojto 107:4f6c30876dfa 1448
Kojto 107:4f6c30876dfa 1449 #define __HAL_RCC_GPIOC_IS_CLK_DISABLED() (READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOCEN) == RESET)
Kojto 107:4f6c30876dfa 1450
Kojto 122:f9eeca106725 1451 #if defined(GPIOD)
Kojto 107:4f6c30876dfa 1452 #define __HAL_RCC_GPIOD_IS_CLK_DISABLED() (READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIODEN) == RESET)
Kojto 122:f9eeca106725 1453 #endif /* GPIOD */
Kojto 122:f9eeca106725 1454
Kojto 122:f9eeca106725 1455 #if defined(GPIOE)
Kojto 107:4f6c30876dfa 1456 #define __HAL_RCC_GPIOE_IS_CLK_DISABLED() (READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOEEN) == RESET)
Kojto 122:f9eeca106725 1457 #endif /* GPIOE */
Kojto 122:f9eeca106725 1458
Kojto 122:f9eeca106725 1459 #if defined(GPIOF)
Kojto 107:4f6c30876dfa 1460 #define __HAL_RCC_GPIOF_IS_CLK_DISABLED() (READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOFEN) == RESET)
Kojto 122:f9eeca106725 1461 #endif /* GPIOF */
Kojto 122:f9eeca106725 1462
Kojto 122:f9eeca106725 1463 #if defined(GPIOG)
Kojto 107:4f6c30876dfa 1464 #define __HAL_RCC_GPIOG_IS_CLK_DISABLED() (READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOGEN) == RESET)
Kojto 122:f9eeca106725 1465 #endif /* GPIOG */
Kojto 107:4f6c30876dfa 1466
Kojto 107:4f6c30876dfa 1467 #define __HAL_RCC_GPIOH_IS_CLK_DISABLED() (READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOHEN) == RESET)
Kojto 107:4f6c30876dfa 1468
Kojto 122:f9eeca106725 1469 #if defined(USB_OTG_FS)
Kojto 122:f9eeca106725 1470 #define __HAL_RCC_USB_OTG_FS_IS_CLK_DISABLED() (READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_OTGFSEN) == RESET)
Kojto 122:f9eeca106725 1471 #endif /* USB_OTG_FS */
Kojto 122:f9eeca106725 1472
Kojto 107:4f6c30876dfa 1473 #define __HAL_RCC_ADC_IS_CLK_DISABLED() (READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_ADCEN) == RESET)
Kojto 107:4f6c30876dfa 1474
Kojto 122:f9eeca106725 1475 #if defined(AES)
Kojto 122:f9eeca106725 1476 #define __HAL_RCC_AES_IS_CLK_DISABLED() (READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_AESEN) == RESET)
Kojto 122:f9eeca106725 1477 #endif /* AES */
Kojto 122:f9eeca106725 1478
Kojto 107:4f6c30876dfa 1479 #define __HAL_RCC_RNG_IS_CLK_DISABLED() (READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_RNGEN) == RESET)
Kojto 107:4f6c30876dfa 1480
Kojto 107:4f6c30876dfa 1481 /**
Kojto 107:4f6c30876dfa 1482 * @}
Kojto 107:4f6c30876dfa 1483 */
Kojto 107:4f6c30876dfa 1484
Kojto 107:4f6c30876dfa 1485 /** @defgroup RCC_AHB3_Clock_Enable_Disable_Status AHB3 Peripheral Clock Enabled or Disabled Status
Kojto 107:4f6c30876dfa 1486 * @brief Check whether the AHB3 peripheral clock is enabled or not.
Kojto 107:4f6c30876dfa 1487 * @note After reset, the peripheral clock (used for registers read/write access)
Kojto 107:4f6c30876dfa 1488 * is disabled and the application software has to enable this clock before
Kojto 107:4f6c30876dfa 1489 * using it.
Kojto 107:4f6c30876dfa 1490 * @{
Kojto 107:4f6c30876dfa 1491 */
Kojto 107:4f6c30876dfa 1492
Kojto 122:f9eeca106725 1493 #if defined(FMC_BANK1)
Kojto 107:4f6c30876dfa 1494 #define __HAL_RCC_FMC_IS_CLK_ENABLED() (READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN) != RESET)
Kojto 122:f9eeca106725 1495 #endif /* FMC_BANK1 */
Kojto 122:f9eeca106725 1496
Kojto 122:f9eeca106725 1497 #if defined(QUADSPI)
Kojto 107:4f6c30876dfa 1498 #define __HAL_RCC_QSPI_IS_CLK_ENABLED() (READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_QSPIEN) != RESET)
Kojto 122:f9eeca106725 1499 #endif /* QUADSPI */
Kojto 122:f9eeca106725 1500
Kojto 122:f9eeca106725 1501 #if defined(FMC_BANK1)
Kojto 107:4f6c30876dfa 1502 #define __HAL_RCC_FMC_IS_CLK_DISABLED() (READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN) == RESET)
Kojto 122:f9eeca106725 1503 #endif /* FMC_BANK1 */
Kojto 122:f9eeca106725 1504
Kojto 122:f9eeca106725 1505 #if defined(QUADSPI)
Kojto 107:4f6c30876dfa 1506 #define __HAL_RCC_QSPI_IS_CLK_DISABLED() (READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_QSPIEN) == RESET)
Kojto 122:f9eeca106725 1507 #endif /* QUADSPI */
Kojto 107:4f6c30876dfa 1508
Kojto 107:4f6c30876dfa 1509 /**
Kojto 107:4f6c30876dfa 1510 * @}
Kojto 107:4f6c30876dfa 1511 */
Kojto 107:4f6c30876dfa 1512
Kojto 107:4f6c30876dfa 1513 /** @defgroup RCC_APB1_Clock_Enable_Disable_Status APB1 Peripheral Clock Enabled or Disabled Status
Kojto 107:4f6c30876dfa 1514 * @brief Check whether the APB1 peripheral clock is enabled or not.
Kojto 107:4f6c30876dfa 1515 * @note After reset, the peripheral clock (used for registers read/write access)
Kojto 107:4f6c30876dfa 1516 * is disabled and the application software has to enable this clock before
Kojto 107:4f6c30876dfa 1517 * using it.
Kojto 107:4f6c30876dfa 1518 * @{
Kojto 107:4f6c30876dfa 1519 */
Kojto 107:4f6c30876dfa 1520
Kojto 107:4f6c30876dfa 1521 #define __HAL_RCC_TIM2_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM2EN) != RESET)
Kojto 107:4f6c30876dfa 1522
Kojto 122:f9eeca106725 1523 #if defined(TIM3)
Kojto 107:4f6c30876dfa 1524 #define __HAL_RCC_TIM3_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM3EN) != RESET)
Kojto 122:f9eeca106725 1525 #endif /* TIM3 */
Kojto 122:f9eeca106725 1526
Kojto 122:f9eeca106725 1527 #if defined(TIM4)
Kojto 107:4f6c30876dfa 1528 #define __HAL_RCC_TIM4_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM4EN) != RESET)
Kojto 122:f9eeca106725 1529 #endif /* TIM4 */
Kojto 122:f9eeca106725 1530
Kojto 122:f9eeca106725 1531 #if defined(TIM5)
Kojto 107:4f6c30876dfa 1532 #define __HAL_RCC_TIM5_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM5EN) != RESET)
Kojto 122:f9eeca106725 1533 #endif /* TIM5 */
Kojto 107:4f6c30876dfa 1534
Kojto 107:4f6c30876dfa 1535 #define __HAL_RCC_TIM6_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM6EN) != RESET)
Kojto 107:4f6c30876dfa 1536
Kojto 107:4f6c30876dfa 1537 #define __HAL_RCC_TIM7_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM7EN) != RESET)
Kojto 107:4f6c30876dfa 1538
Kojto 122:f9eeca106725 1539 #if defined(LCD)
Kojto 122:f9eeca106725 1540 #define __HAL_RCC_LCD_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_LCDEN) != RESET)
Kojto 122:f9eeca106725 1541 #endif /* LCD */
Kojto 122:f9eeca106725 1542
Kojto 122:f9eeca106725 1543 #if defined(RCC_APB1ENR1_RTCAPBEN)
Kojto 122:f9eeca106725 1544 #define __HAL_RCC_RTCAPB_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_RTCAPBEN) != RESET)
Kojto 122:f9eeca106725 1545 #endif /* RCC_APB1ENR1_RTCAPBEN */
Kojto 122:f9eeca106725 1546
Kojto 107:4f6c30876dfa 1547 #define __HAL_RCC_WWDG_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_WWDGEN) != RESET)
Kojto 107:4f6c30876dfa 1548
Kojto 122:f9eeca106725 1549 #if defined(SPI2)
Kojto 107:4f6c30876dfa 1550 #define __HAL_RCC_SPI2_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_SPI2EN) != RESET)
Kojto 122:f9eeca106725 1551 #endif /* SPI2 */
Kojto 107:4f6c30876dfa 1552
Kojto 107:4f6c30876dfa 1553 #define __HAL_RCC_SPI3_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_SPI3EN) != RESET)
Kojto 107:4f6c30876dfa 1554
Kojto 107:4f6c30876dfa 1555 #define __HAL_RCC_USART2_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_USART2EN) != RESET)
Kojto 107:4f6c30876dfa 1556
Kojto 122:f9eeca106725 1557 #if defined(USART3)
Kojto 107:4f6c30876dfa 1558 #define __HAL_RCC_USART3_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_USART3EN) != RESET)
Kojto 122:f9eeca106725 1559 #endif /* USART3 */
Kojto 122:f9eeca106725 1560
Kojto 122:f9eeca106725 1561 #if defined(UART4)
Kojto 107:4f6c30876dfa 1562 #define __HAL_RCC_UART4_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_UART4EN) != RESET)
Kojto 122:f9eeca106725 1563 #endif /* UART4 */
Kojto 122:f9eeca106725 1564
Kojto 122:f9eeca106725 1565 #if defined(UART5)
Kojto 107:4f6c30876dfa 1566 #define __HAL_RCC_UART5_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_UART5EN) != RESET)
Kojto 122:f9eeca106725 1567 #endif /* UART5 */
Kojto 107:4f6c30876dfa 1568
Kojto 107:4f6c30876dfa 1569 #define __HAL_RCC_I2C1_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_I2C1EN) != RESET)
Kojto 107:4f6c30876dfa 1570
Kojto 122:f9eeca106725 1571 #if defined(I2C2)
Kojto 107:4f6c30876dfa 1572 #define __HAL_RCC_I2C2_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_I2C2EN) != RESET)
Kojto 122:f9eeca106725 1573 #endif /* I2C2 */
Kojto 107:4f6c30876dfa 1574
Kojto 107:4f6c30876dfa 1575 #define __HAL_RCC_I2C3_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_I2C3EN) != RESET)
Kojto 107:4f6c30876dfa 1576
Kojto 122:f9eeca106725 1577 #if defined(CRS)
Kojto 122:f9eeca106725 1578 #define __HAL_RCC_CRS_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_CRSEN) != RESET)
Kojto 122:f9eeca106725 1579 #endif /* CRS */
Kojto 122:f9eeca106725 1580
Kojto 107:4f6c30876dfa 1581 #define __HAL_RCC_CAN1_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_CAN1EN) != RESET)
Kojto 107:4f6c30876dfa 1582
Kojto 122:f9eeca106725 1583 #if defined(USB)
Kojto 122:f9eeca106725 1584 #define __HAL_RCC_USB_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_USBFSEN) != RESET)
Kojto 122:f9eeca106725 1585 #endif /* USB */
Kojto 122:f9eeca106725 1586
Kojto 107:4f6c30876dfa 1587 #define __HAL_RCC_PWR_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_PWREN) != RESET)
Kojto 107:4f6c30876dfa 1588
Kojto 107:4f6c30876dfa 1589 #define __HAL_RCC_DAC1_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_DAC1EN) != RESET)
Kojto 107:4f6c30876dfa 1590
Kojto 107:4f6c30876dfa 1591 #define __HAL_RCC_OPAMP_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_OPAMPEN) != RESET)
Kojto 107:4f6c30876dfa 1592
Kojto 107:4f6c30876dfa 1593 #define __HAL_RCC_LPTIM1_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_LPTIM1EN) != RESET)
Kojto 107:4f6c30876dfa 1594
Kojto 107:4f6c30876dfa 1595 #define __HAL_RCC_LPUART1_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR2, RCC_APB1ENR2_LPUART1EN) != RESET)
Kojto 107:4f6c30876dfa 1596
Kojto 107:4f6c30876dfa 1597 #define __HAL_RCC_SWPMI1_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR2, RCC_APB1ENR2_SWPMI1EN) != RESET)
Kojto 107:4f6c30876dfa 1598
Kojto 107:4f6c30876dfa 1599 #define __HAL_RCC_LPTIM2_IS_CLK_ENABLED() (READ_BIT(RCC->APB1ENR2, RCC_APB1ENR2_LPTIM2EN) != RESET)
Kojto 107:4f6c30876dfa 1600
Kojto 122:f9eeca106725 1601
Kojto 107:4f6c30876dfa 1602 #define __HAL_RCC_TIM2_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM2EN) == RESET)
Kojto 107:4f6c30876dfa 1603
Kojto 122:f9eeca106725 1604 #if defined(TIM3)
Kojto 107:4f6c30876dfa 1605 #define __HAL_RCC_TIM3_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM3EN) == RESET)
Kojto 122:f9eeca106725 1606 #endif /* TIM3 */
Kojto 122:f9eeca106725 1607
Kojto 122:f9eeca106725 1608 #if defined(TIM4)
Kojto 107:4f6c30876dfa 1609 #define __HAL_RCC_TIM4_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM4EN) == RESET)
Kojto 122:f9eeca106725 1610 #endif /* TIM4 */
Kojto 122:f9eeca106725 1611
Kojto 122:f9eeca106725 1612 #if defined(TIM5)
Kojto 107:4f6c30876dfa 1613 #define __HAL_RCC_TIM5_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM5EN) == RESET)
Kojto 122:f9eeca106725 1614 #endif /* TIM5 */
Kojto 107:4f6c30876dfa 1615
Kojto 107:4f6c30876dfa 1616 #define __HAL_RCC_TIM6_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM6EN) == RESET)
Kojto 107:4f6c30876dfa 1617
Kojto 107:4f6c30876dfa 1618 #define __HAL_RCC_TIM7_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_TIM7EN) == RESET)
Kojto 107:4f6c30876dfa 1619
Kojto 122:f9eeca106725 1620 #if defined(LCD)
Kojto 122:f9eeca106725 1621 #define __HAL_RCC_LCD_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_LCDEN) == RESET)
Kojto 122:f9eeca106725 1622 #endif /* LCD */
Kojto 122:f9eeca106725 1623
Kojto 122:f9eeca106725 1624 #if defined(RCC_APB1ENR1_RTCAPBEN)
Kojto 122:f9eeca106725 1625 #define __HAL_RCC_RTCAPB_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_RTCAPBEN) == RESET)
Kojto 122:f9eeca106725 1626 #endif /* RCC_APB1ENR1_RTCAPBEN */
Kojto 122:f9eeca106725 1627
Kojto 107:4f6c30876dfa 1628 #define __HAL_RCC_WWDG_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_WWDGEN) == RESET)
Kojto 107:4f6c30876dfa 1629
Kojto 122:f9eeca106725 1630 #if defined(SPI2)
Kojto 107:4f6c30876dfa 1631 #define __HAL_RCC_SPI2_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_SPI2EN) == RESET)
Kojto 122:f9eeca106725 1632 #endif /* SPI2 */
Kojto 107:4f6c30876dfa 1633
Kojto 107:4f6c30876dfa 1634 #define __HAL_RCC_SPI3_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_SPI3EN) == RESET)
Kojto 107:4f6c30876dfa 1635
Kojto 107:4f6c30876dfa 1636 #define __HAL_RCC_USART2_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_USART2EN) == RESET)
Kojto 107:4f6c30876dfa 1637
Kojto 122:f9eeca106725 1638 #if defined(USART3)
Kojto 107:4f6c30876dfa 1639 #define __HAL_RCC_USART3_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_USART3EN) == RESET)
Kojto 122:f9eeca106725 1640 #endif /* USART3 */
Kojto 122:f9eeca106725 1641
Kojto 122:f9eeca106725 1642 #if defined(UART4)
Kojto 107:4f6c30876dfa 1643 #define __HAL_RCC_UART4_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_UART4EN) == RESET)
Kojto 122:f9eeca106725 1644 #endif /* UART4 */
Kojto 122:f9eeca106725 1645
Kojto 122:f9eeca106725 1646 #if defined(UART5)
Kojto 107:4f6c30876dfa 1647 #define __HAL_RCC_UART5_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_UART5EN) == RESET)
Kojto 122:f9eeca106725 1648 #endif /* UART5 */
Kojto 107:4f6c30876dfa 1649
Kojto 107:4f6c30876dfa 1650 #define __HAL_RCC_I2C1_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_I2C1EN) == RESET)
Kojto 107:4f6c30876dfa 1651
Kojto 122:f9eeca106725 1652 #if defined(I2C2)
Kojto 107:4f6c30876dfa 1653 #define __HAL_RCC_I2C2_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_I2C2EN) == RESET)
Kojto 122:f9eeca106725 1654 #endif /* I2C2 */
Kojto 107:4f6c30876dfa 1655
Kojto 107:4f6c30876dfa 1656 #define __HAL_RCC_I2C3_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_I2C3EN) == RESET)
Kojto 107:4f6c30876dfa 1657
Kojto 122:f9eeca106725 1658 #if defined(CRS)
Kojto 122:f9eeca106725 1659 #define __HAL_RCC_CRS_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_CRSEN) == RESET)
Kojto 122:f9eeca106725 1660 #endif /* CRS */
Kojto 122:f9eeca106725 1661
Kojto 107:4f6c30876dfa 1662 #define __HAL_RCC_CAN1_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_CAN1EN) == RESET)
Kojto 107:4f6c30876dfa 1663
Kojto 122:f9eeca106725 1664 #if defined(USB)
Kojto 122:f9eeca106725 1665 #define __HAL_RCC_USB_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_USBFSEN) == RESET)
Kojto 122:f9eeca106725 1666 #endif /* USB */
Kojto 122:f9eeca106725 1667
Kojto 107:4f6c30876dfa 1668 #define __HAL_RCC_PWR_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_PWREN) == RESET)
Kojto 107:4f6c30876dfa 1669
Kojto 107:4f6c30876dfa 1670 #define __HAL_RCC_DAC1_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_DAC1EN) == RESET)
Kojto 107:4f6c30876dfa 1671
Kojto 107:4f6c30876dfa 1672 #define __HAL_RCC_OPAMP_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_OPAMPEN) == RESET)
Kojto 107:4f6c30876dfa 1673
Kojto 107:4f6c30876dfa 1674 #define __HAL_RCC_LPTIM1_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR1, RCC_APB1ENR1_LPTIM1EN) == RESET)
Kojto 107:4f6c30876dfa 1675
Kojto 107:4f6c30876dfa 1676 #define __HAL_RCC_LPUART1_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR2, RCC_APB1ENR2_LPUART1EN) == RESET)
Kojto 107:4f6c30876dfa 1677
Kojto 107:4f6c30876dfa 1678 #define __HAL_RCC_SWPMI1_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR2, RCC_APB1ENR2_SWPMI1EN) == RESET)
Kojto 107:4f6c30876dfa 1679
Kojto 107:4f6c30876dfa 1680 #define __HAL_RCC_LPTIM2_IS_CLK_DISABLED() (READ_BIT(RCC->APB1ENR2, RCC_APB1ENR2_LPTIM2EN) == RESET)
Kojto 107:4f6c30876dfa 1681
Kojto 107:4f6c30876dfa 1682 /**
Kojto 107:4f6c30876dfa 1683 * @}
Kojto 107:4f6c30876dfa 1684 */
Kojto 107:4f6c30876dfa 1685
Kojto 107:4f6c30876dfa 1686 /** @defgroup RCC_APB2_Clock_Enable_Disable_Status APB2 Peripheral Clock Enabled or Disabled Status
Kojto 107:4f6c30876dfa 1687 * @brief Check whether the APB2 peripheral clock is enabled or not.
Kojto 107:4f6c30876dfa 1688 * @note After reset, the peripheral clock (used for registers read/write access)
Kojto 107:4f6c30876dfa 1689 * is disabled and the application software has to enable this clock before
Kojto 107:4f6c30876dfa 1690 * using it.
Kojto 107:4f6c30876dfa 1691 * @{
Kojto 107:4f6c30876dfa 1692 */
Kojto 107:4f6c30876dfa 1693
Kojto 107:4f6c30876dfa 1694 #define __HAL_RCC_SYSCFG_IS_CLK_ENABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SYSCFGEN) != RESET)
Kojto 107:4f6c30876dfa 1695
Kojto 107:4f6c30876dfa 1696 #define __HAL_RCC_FIREWALL_IS_CLK_ENABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_FWEN) != RESET)
Kojto 107:4f6c30876dfa 1697
Kojto 122:f9eeca106725 1698 #if defined(SDMMC1) && defined(RCC_APB2ENR_SDMMC1EN)
Kojto 107:4f6c30876dfa 1699 #define __HAL_RCC_SDMMC1_IS_CLK_ENABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SDMMC1EN) != RESET)
Kojto 122:f9eeca106725 1700 #endif /* SDMMC1 && RCC_APB2ENR_SDMMC1EN */
Kojto 107:4f6c30876dfa 1701
Kojto 107:4f6c30876dfa 1702 #define __HAL_RCC_TIM1_IS_CLK_ENABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM1EN) != RESET)
Kojto 107:4f6c30876dfa 1703
Kojto 107:4f6c30876dfa 1704 #define __HAL_RCC_SPI1_IS_CLK_ENABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI1EN) != RESET)
Kojto 107:4f6c30876dfa 1705
Kojto 122:f9eeca106725 1706 #if defined(TIM8)
Kojto 107:4f6c30876dfa 1707 #define __HAL_RCC_TIM8_IS_CLK_ENABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM8EN) != RESET)
Kojto 122:f9eeca106725 1708 #endif /* TIM8 */
Kojto 107:4f6c30876dfa 1709
Kojto 107:4f6c30876dfa 1710 #define __HAL_RCC_USART1_IS_CLK_ENABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_USART1EN) != RESET)
Kojto 107:4f6c30876dfa 1711
Kojto 107:4f6c30876dfa 1712 #define __HAL_RCC_TIM15_IS_CLK_ENABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM15EN) != RESET)
Kojto 107:4f6c30876dfa 1713
Kojto 107:4f6c30876dfa 1714 #define __HAL_RCC_TIM16_IS_CLK_ENABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM16EN) != RESET)
Kojto 107:4f6c30876dfa 1715
Kojto 122:f9eeca106725 1716 #if defined(TIM17)
Kojto 107:4f6c30876dfa 1717 #define __HAL_RCC_TIM17_IS_CLK_ENABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM17EN) != RESET)
Kojto 122:f9eeca106725 1718 #endif /* TIM17 */
Kojto 107:4f6c30876dfa 1719
Kojto 107:4f6c30876dfa 1720 #define __HAL_RCC_SAI1_IS_CLK_ENABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI1EN) != RESET)
Kojto 107:4f6c30876dfa 1721
Kojto 122:f9eeca106725 1722 #if defined(SAI2)
Kojto 107:4f6c30876dfa 1723 #define __HAL_RCC_SAI2_IS_CLK_ENABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI2EN) != RESET)
Kojto 122:f9eeca106725 1724 #endif /* SAI2 */
Kojto 122:f9eeca106725 1725
Kojto 122:f9eeca106725 1726 #if defined(DFSDM1_Filter0)
Kojto 122:f9eeca106725 1727 #define __HAL_RCC_DFSDM1_IS_CLK_ENABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_DFSDM1EN) != RESET)
Kojto 122:f9eeca106725 1728 #endif /* DFSDM1_Filter0 */
Kojto 122:f9eeca106725 1729
Kojto 107:4f6c30876dfa 1730
Kojto 107:4f6c30876dfa 1731 #define __HAL_RCC_SYSCFG_IS_CLK_DISABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SYSCFGEN) == RESET)
Kojto 107:4f6c30876dfa 1732
Kojto 122:f9eeca106725 1733 #if defined(SDMMC1) && defined(RCC_APB2ENR_SDMMC1EN)
Kojto 107:4f6c30876dfa 1734 #define __HAL_RCC_SDMMC1_IS_CLK_DISABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SDMMC1EN) == RESET)
Kojto 122:f9eeca106725 1735 #endif /* SDMMC1 && RCC_APB2ENR_SDMMC1EN */
Kojto 107:4f6c30876dfa 1736
Kojto 107:4f6c30876dfa 1737 #define __HAL_RCC_TIM1_IS_CLK_DISABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM1EN) == RESET)
Kojto 107:4f6c30876dfa 1738
Kojto 107:4f6c30876dfa 1739 #define __HAL_RCC_SPI1_IS_CLK_DISABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI1EN) == RESET)
Kojto 107:4f6c30876dfa 1740
Kojto 122:f9eeca106725 1741 #if defined(TIM8)
Kojto 107:4f6c30876dfa 1742 #define __HAL_RCC_TIM8_IS_CLK_DISABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM8EN) == RESET)
Kojto 122:f9eeca106725 1743 #endif /* TIM8 */
Kojto 107:4f6c30876dfa 1744
Kojto 107:4f6c30876dfa 1745 #define __HAL_RCC_USART1_IS_CLK_DISABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_USART1EN) == RESET)
Kojto 107:4f6c30876dfa 1746
Kojto 107:4f6c30876dfa 1747 #define __HAL_RCC_TIM15_IS_CLK_DISABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM15EN) == RESET)
Kojto 107:4f6c30876dfa 1748
Kojto 107:4f6c30876dfa 1749 #define __HAL_RCC_TIM16_IS_CLK_DISABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM16EN) == RESET)
Kojto 107:4f6c30876dfa 1750
Kojto 122:f9eeca106725 1751 #if defined(TIM17)
Kojto 107:4f6c30876dfa 1752 #define __HAL_RCC_TIM17_IS_CLK_DISABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM17EN) == RESET)
Kojto 122:f9eeca106725 1753 #endif /* TIM17 */
Kojto 107:4f6c30876dfa 1754
Kojto 107:4f6c30876dfa 1755 #define __HAL_RCC_SAI1_IS_CLK_DISABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI1EN) == RESET)
Kojto 107:4f6c30876dfa 1756
Kojto 122:f9eeca106725 1757 #if defined(SAI2)
Kojto 107:4f6c30876dfa 1758 #define __HAL_RCC_SAI2_IS_CLK_DISABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SAI2EN) == RESET)
Kojto 122:f9eeca106725 1759 #endif /* SAI2 */
Kojto 122:f9eeca106725 1760
Kojto 122:f9eeca106725 1761 #if defined(DFSDM1_Filter0)
Kojto 122:f9eeca106725 1762 #define __HAL_RCC_DFSDM1_IS_CLK_DISABLED() (READ_BIT(RCC->APB2ENR, RCC_APB2ENR_DFSDM1EN) == RESET)
Kojto 122:f9eeca106725 1763 #endif /* DFSDM1_Filter0 */
Kojto 107:4f6c30876dfa 1764
Kojto 107:4f6c30876dfa 1765 /**
Kojto 107:4f6c30876dfa 1766 * @}
Kojto 107:4f6c30876dfa 1767 */
Kojto 107:4f6c30876dfa 1768
Kojto 107:4f6c30876dfa 1769 /** @defgroup RCC_AHB1_Force_Release_Reset AHB1 Peripheral Force Release Reset
Kojto 107:4f6c30876dfa 1770 * @brief Force or release AHB1 peripheral reset.
Kojto 107:4f6c30876dfa 1771 * @{
Kojto 107:4f6c30876dfa 1772 */
Kojto 122:f9eeca106725 1773 #define __HAL_RCC_AHB1_FORCE_RESET() WRITE_REG(RCC->AHB1RSTR, 0xFFFFFFFFU)
Kojto 107:4f6c30876dfa 1774
Kojto 107:4f6c30876dfa 1775 #define __HAL_RCC_DMA1_FORCE_RESET() SET_BIT(RCC->AHB1RSTR, RCC_AHB1RSTR_DMA1RST)
Kojto 107:4f6c30876dfa 1776
Kojto 107:4f6c30876dfa 1777 #define __HAL_RCC_DMA2_FORCE_RESET() SET_BIT(RCC->AHB1RSTR, RCC_AHB1RSTR_DMA2RST)
Kojto 107:4f6c30876dfa 1778
Kojto 107:4f6c30876dfa 1779 #define __HAL_RCC_FLASH_FORCE_RESET() SET_BIT(RCC->AHB1RSTR, RCC_AHB1RSTR_FLASHRST)
Kojto 107:4f6c30876dfa 1780
Kojto 107:4f6c30876dfa 1781 #define __HAL_RCC_CRC_FORCE_RESET() SET_BIT(RCC->AHB1RSTR, RCC_AHB1RSTR_CRCRST)
Kojto 107:4f6c30876dfa 1782
Kojto 107:4f6c30876dfa 1783 #define __HAL_RCC_TSC_FORCE_RESET() SET_BIT(RCC->AHB1RSTR, RCC_AHB1RSTR_TSCRST)
Kojto 107:4f6c30876dfa 1784
Kojto 122:f9eeca106725 1785
Kojto 122:f9eeca106725 1786 #define __HAL_RCC_AHB1_RELEASE_RESET() WRITE_REG(RCC->AHB1RSTR, 0x00000000U)
Kojto 107:4f6c30876dfa 1787
Kojto 107:4f6c30876dfa 1788 #define __HAL_RCC_DMA1_RELEASE_RESET() CLEAR_BIT(RCC->AHB1RSTR, RCC_AHB1RSTR_DMA1RST)
Kojto 107:4f6c30876dfa 1789
Kojto 107:4f6c30876dfa 1790 #define __HAL_RCC_DMA2_RELEASE_RESET() CLEAR_BIT(RCC->AHB1RSTR, RCC_AHB1RSTR_DMA2RST)
Kojto 107:4f6c30876dfa 1791
Kojto 107:4f6c30876dfa 1792 #define __HAL_RCC_FLASH_RELEASE_RESET() CLEAR_BIT(RCC->AHB1RSTR, RCC_AHB1RSTR_FLASHRST)
Kojto 107:4f6c30876dfa 1793
Kojto 107:4f6c30876dfa 1794 #define __HAL_RCC_CRC_RELEASE_RESET() CLEAR_BIT(RCC->AHB1RSTR, RCC_AHB1RSTR_CRCRST)
Kojto 107:4f6c30876dfa 1795
Kojto 107:4f6c30876dfa 1796 #define __HAL_RCC_TSC_RELEASE_RESET() CLEAR_BIT(RCC->AHB1RSTR, RCC_AHB1RSTR_TSCRST)
Kojto 107:4f6c30876dfa 1797
Kojto 107:4f6c30876dfa 1798 /**
Kojto 107:4f6c30876dfa 1799 * @}
Kojto 107:4f6c30876dfa 1800 */
Kojto 107:4f6c30876dfa 1801
Kojto 107:4f6c30876dfa 1802 /** @defgroup RCC_AHB2_Force_Release_Reset AHB2 Peripheral Force Release Reset
Kojto 107:4f6c30876dfa 1803 * @brief Force or release AHB2 peripheral reset.
Kojto 107:4f6c30876dfa 1804 * @{
Kojto 107:4f6c30876dfa 1805 */
Kojto 122:f9eeca106725 1806 #define __HAL_RCC_AHB2_FORCE_RESET() WRITE_REG(RCC->AHB2RSTR, 0xFFFFFFFFU)
Kojto 107:4f6c30876dfa 1807
Kojto 107:4f6c30876dfa 1808 #define __HAL_RCC_GPIOA_FORCE_RESET() SET_BIT(RCC->AHB2RSTR, RCC_AHB2RSTR_GPIOARST)
Kojto 107:4f6c30876dfa 1809
Kojto 107:4f6c30876dfa 1810 #define __HAL_RCC_GPIOB_FORCE_RESET() SET_BIT(RCC->AHB2RSTR, RCC_AHB2RSTR_GPIOBRST)
Kojto 107:4f6c30876dfa 1811
Kojto 107:4f6c30876dfa 1812 #define __HAL_RCC_GPIOC_FORCE_RESET() SET_BIT(RCC->AHB2RSTR, RCC_AHB2RSTR_GPIOCRST)
Kojto 107:4f6c30876dfa 1813
Kojto 122:f9eeca106725 1814 #if defined(GPIOD)
Kojto 107:4f6c30876dfa 1815 #define __HAL_RCC_GPIOD_FORCE_RESET() SET_BIT(RCC->AHB2RSTR, RCC_AHB2RSTR_GPIODRST)
Kojto 122:f9eeca106725 1816 #endif /* GPIOD */
Kojto 122:f9eeca106725 1817
Kojto 122:f9eeca106725 1818 #if defined(GPIOE)
Kojto 107:4f6c30876dfa 1819 #define __HAL_RCC_GPIOE_FORCE_RESET() SET_BIT(RCC->AHB2RSTR, RCC_AHB2RSTR_GPIOERST)
Kojto 122:f9eeca106725 1820 #endif /* GPIOE */
Kojto 122:f9eeca106725 1821
Kojto 122:f9eeca106725 1822 #if defined(GPIOF)
Kojto 107:4f6c30876dfa 1823 #define __HAL_RCC_GPIOF_FORCE_RESET() SET_BIT(RCC->AHB2RSTR, RCC_AHB2RSTR_GPIOFRST)
Kojto 122:f9eeca106725 1824 #endif /* GPIOF */
Kojto 122:f9eeca106725 1825
Kojto 122:f9eeca106725 1826 #if defined(GPIOG)
Kojto 107:4f6c30876dfa 1827 #define __HAL_RCC_GPIOG_FORCE_RESET() SET_BIT(RCC->AHB2RSTR, RCC_AHB2RSTR_GPIOGRST)
Kojto 122:f9eeca106725 1828 #endif /* GPIOG */
Kojto 107:4f6c30876dfa 1829
Kojto 107:4f6c30876dfa 1830 #define __HAL_RCC_GPIOH_FORCE_RESET() SET_BIT(RCC->AHB2RSTR, RCC_AHB2RSTR_GPIOHRST)
Kojto 107:4f6c30876dfa 1831
Kojto 122:f9eeca106725 1832 #if defined(USB_OTG_FS)
Kojto 122:f9eeca106725 1833 #define __HAL_RCC_USB_OTG_FS_FORCE_RESET() SET_BIT(RCC->AHB2RSTR, RCC_AHB2RSTR_OTGFSRST)
Kojto 122:f9eeca106725 1834 #endif /* USB_OTG_FS */
Kojto 122:f9eeca106725 1835
Kojto 107:4f6c30876dfa 1836 #define __HAL_RCC_ADC_FORCE_RESET() SET_BIT(RCC->AHB2RSTR, RCC_AHB2RSTR_ADCRST)
Kojto 107:4f6c30876dfa 1837
Kojto 122:f9eeca106725 1838 #if defined(AES)
Kojto 122:f9eeca106725 1839 #define __HAL_RCC_AES_FORCE_RESET() SET_BIT(RCC->AHB2RSTR, RCC_AHB2RSTR_AESRST)
Kojto 122:f9eeca106725 1840 #endif /* AES */
Kojto 122:f9eeca106725 1841
Kojto 107:4f6c30876dfa 1842 #define __HAL_RCC_RNG_FORCE_RESET() SET_BIT(RCC->AHB2RSTR, RCC_AHB2RSTR_RNGRST)
Kojto 107:4f6c30876dfa 1843
Kojto 122:f9eeca106725 1844
Kojto 122:f9eeca106725 1845 #define __HAL_RCC_AHB2_RELEASE_RESET() WRITE_REG(RCC->AHB2RSTR, 0x00000000U)
Kojto 107:4f6c30876dfa 1846
Kojto 107:4f6c30876dfa 1847 #define __HAL_RCC_GPIOA_RELEASE_RESET() CLEAR_BIT(RCC->AHB2RSTR, RCC_AHB2RSTR_GPIOARST)
Kojto 107:4f6c30876dfa 1848
Kojto 107:4f6c30876dfa 1849 #define __HAL_RCC_GPIOB_RELEASE_RESET() CLEAR_BIT(RCC->AHB2RSTR, RCC_AHB2RSTR_GPIOBRST)
Kojto 107:4f6c30876dfa 1850
Kojto 107:4f6c30876dfa 1851 #define __HAL_RCC_GPIOC_RELEASE_RESET() CLEAR_BIT(RCC->AHB2RSTR, RCC_AHB2RSTR_GPIOCRST)
Kojto 107:4f6c30876dfa 1852
Kojto 122:f9eeca106725 1853 #if defined(GPIOD)
Kojto 107:4f6c30876dfa 1854 #define __HAL_RCC_GPIOD_RELEASE_RESET() CLEAR_BIT(RCC->AHB2RSTR, RCC_AHB2RSTR_GPIODRST)
Kojto 122:f9eeca106725 1855 #endif /* GPIOD */
Kojto 122:f9eeca106725 1856
Kojto 122:f9eeca106725 1857 #if defined(GPIOE)
Kojto 107:4f6c30876dfa 1858 #define __HAL_RCC_GPIOE_RELEASE_RESET() CLEAR_BIT(RCC->AHB2RSTR, RCC_AHB2RSTR_GPIOERST)
Kojto 122:f9eeca106725 1859 #endif /* GPIOE */
Kojto 122:f9eeca106725 1860
Kojto 122:f9eeca106725 1861 #if defined(GPIOF)
Kojto 107:4f6c30876dfa 1862 #define __HAL_RCC_GPIOF_RELEASE_RESET() CLEAR_BIT(RCC->AHB2RSTR, RCC_AHB2RSTR_GPIOFRST)
Kojto 122:f9eeca106725 1863 #endif /* GPIOF */
Kojto 122:f9eeca106725 1864
Kojto 122:f9eeca106725 1865 #if defined(GPIOG)
Kojto 107:4f6c30876dfa 1866 #define __HAL_RCC_GPIOG_RELEASE_RESET() CLEAR_BIT(RCC->AHB2RSTR, RCC_AHB2RSTR_GPIOGRST)
Kojto 122:f9eeca106725 1867 #endif /* GPIOG */
Kojto 107:4f6c30876dfa 1868
Kojto 107:4f6c30876dfa 1869 #define __HAL_RCC_GPIOH_RELEASE_RESET() CLEAR_BIT(RCC->AHB2RSTR, RCC_AHB2RSTR_GPIOHRST)
Kojto 107:4f6c30876dfa 1870
Kojto 122:f9eeca106725 1871 #if defined(USB_OTG_FS)
Kojto 122:f9eeca106725 1872 #define __HAL_RCC_USB_OTG_FS_RELEASE_RESET() CLEAR_BIT(RCC->AHB2RSTR, RCC_AHB2RSTR_OTGFSRST)
Kojto 122:f9eeca106725 1873 #endif /* USB_OTG_FS */
Kojto 122:f9eeca106725 1874
Kojto 107:4f6c30876dfa 1875 #define __HAL_RCC_ADC_RELEASE_RESET() CLEAR_BIT(RCC->AHB2RSTR, RCC_AHB2RSTR_ADCRST)
Kojto 107:4f6c30876dfa 1876
Kojto 122:f9eeca106725 1877 #if defined(AES)
Kojto 122:f9eeca106725 1878 #define __HAL_RCC_AES_RELEASE_RESET() CLEAR_BIT(RCC->AHB2RSTR, RCC_AHB2RSTR_AESRST)
Kojto 122:f9eeca106725 1879 #endif /* AES */
Kojto 122:f9eeca106725 1880
Kojto 107:4f6c30876dfa 1881 #define __HAL_RCC_RNG_RELEASE_RESET() CLEAR_BIT(RCC->AHB2RSTR, RCC_AHB2RSTR_RNGRST)
Kojto 107:4f6c30876dfa 1882
Kojto 107:4f6c30876dfa 1883 /**
Kojto 107:4f6c30876dfa 1884 * @}
Kojto 107:4f6c30876dfa 1885 */
Kojto 107:4f6c30876dfa 1886
Kojto 107:4f6c30876dfa 1887 /** @defgroup RCC_AHB3_Force_Release_Reset AHB3 Peripheral Force Release Reset
Kojto 107:4f6c30876dfa 1888 * @brief Force or release AHB3 peripheral reset.
Kojto 107:4f6c30876dfa 1889 * @{
Kojto 107:4f6c30876dfa 1890 */
Kojto 122:f9eeca106725 1891 #define __HAL_RCC_AHB3_FORCE_RESET() WRITE_REG(RCC->AHB3RSTR, 0xFFFFFFFFU)
Kojto 122:f9eeca106725 1892
Kojto 122:f9eeca106725 1893 #if defined(FMC_BANK1)
Kojto 107:4f6c30876dfa 1894 #define __HAL_RCC_FMC_FORCE_RESET() SET_BIT(RCC->AHB3RSTR, RCC_AHB3RSTR_FMCRST)
Kojto 122:f9eeca106725 1895 #endif /* FMC_BANK1 */
Kojto 122:f9eeca106725 1896
Kojto 122:f9eeca106725 1897 #if defined(QUADSPI)
Kojto 107:4f6c30876dfa 1898 #define __HAL_RCC_QSPI_FORCE_RESET() SET_BIT(RCC->AHB3RSTR, RCC_AHB3RSTR_QSPIRST)
Kojto 122:f9eeca106725 1899 #endif /* QUADSPI */
Kojto 122:f9eeca106725 1900
Kojto 122:f9eeca106725 1901
Kojto 122:f9eeca106725 1902 #define __HAL_RCC_AHB3_RELEASE_RESET() WRITE_REG(RCC->AHB3RSTR, 0x00000000U)
Kojto 122:f9eeca106725 1903
Kojto 122:f9eeca106725 1904 #if defined(FMC_BANK1)
Kojto 107:4f6c30876dfa 1905 #define __HAL_RCC_FMC_RELEASE_RESET() CLEAR_BIT(RCC->AHB3RSTR, RCC_AHB3RSTR_FMCRST)
Kojto 122:f9eeca106725 1906 #endif /* FMC_BANK1 */
Kojto 122:f9eeca106725 1907
Kojto 122:f9eeca106725 1908 #if defined(QUADSPI)
Kojto 107:4f6c30876dfa 1909 #define __HAL_RCC_QSPI_RELEASE_RESET() CLEAR_BIT(RCC->AHB3RSTR, RCC_AHB3RSTR_QSPIRST)
Kojto 122:f9eeca106725 1910 #endif /* QUADSPI */
Kojto 107:4f6c30876dfa 1911
Kojto 107:4f6c30876dfa 1912 /**
Kojto 107:4f6c30876dfa 1913 * @}
Kojto 107:4f6c30876dfa 1914 */
Kojto 107:4f6c30876dfa 1915
Kojto 107:4f6c30876dfa 1916 /** @defgroup RCC_APB1_Force_Release_Reset APB1 Peripheral Force Release Reset
Kojto 107:4f6c30876dfa 1917 * @brief Force or release APB1 peripheral reset.
Kojto 107:4f6c30876dfa 1918 * @{
Kojto 107:4f6c30876dfa 1919 */
Kojto 122:f9eeca106725 1920 #define __HAL_RCC_APB1_FORCE_RESET() WRITE_REG(RCC->APB1RSTR1, 0xFFFFFFFFU)
Kojto 107:4f6c30876dfa 1921
Kojto 107:4f6c30876dfa 1922 #define __HAL_RCC_TIM2_FORCE_RESET() SET_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_TIM2RST)
Kojto 107:4f6c30876dfa 1923
Kojto 122:f9eeca106725 1924 #if defined(TIM3)
Kojto 107:4f6c30876dfa 1925 #define __HAL_RCC_TIM3_FORCE_RESET() SET_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_TIM3RST)
Kojto 122:f9eeca106725 1926 #endif /* TIM3 */
Kojto 122:f9eeca106725 1927
Kojto 122:f9eeca106725 1928 #if defined(TIM4)
Kojto 107:4f6c30876dfa 1929 #define __HAL_RCC_TIM4_FORCE_RESET() SET_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_TIM4RST)
Kojto 122:f9eeca106725 1930 #endif /* TIM4 */
Kojto 122:f9eeca106725 1931
Kojto 122:f9eeca106725 1932 #if defined(TIM5)
Kojto 107:4f6c30876dfa 1933 #define __HAL_RCC_TIM5_FORCE_RESET() SET_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_TIM5RST)
Kojto 122:f9eeca106725 1934 #endif /* TIM5 */
Kojto 107:4f6c30876dfa 1935
Kojto 107:4f6c30876dfa 1936 #define __HAL_RCC_TIM6_FORCE_RESET() SET_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_TIM6RST)
Kojto 107:4f6c30876dfa 1937
Kojto 107:4f6c30876dfa 1938 #define __HAL_RCC_TIM7_FORCE_RESET() SET_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_TIM7RST)
Kojto 107:4f6c30876dfa 1939
Kojto 122:f9eeca106725 1940 #if defined(LCD)
Kojto 122:f9eeca106725 1941 #define __HAL_RCC_LCD_FORCE_RESET() SET_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_LCDRST)
Kojto 122:f9eeca106725 1942 #endif /* LCD */
Kojto 122:f9eeca106725 1943
Kojto 122:f9eeca106725 1944 #if defined(SPI2)
Kojto 107:4f6c30876dfa 1945 #define __HAL_RCC_SPI2_FORCE_RESET() SET_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_SPI2RST)
Kojto 122:f9eeca106725 1946 #endif /* SPI2 */
Kojto 107:4f6c30876dfa 1947
Kojto 107:4f6c30876dfa 1948 #define __HAL_RCC_SPI3_FORCE_RESET() SET_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_SPI3RST)
Kojto 107:4f6c30876dfa 1949
Kojto 107:4f6c30876dfa 1950 #define __HAL_RCC_USART2_FORCE_RESET() SET_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_USART2RST)
Kojto 107:4f6c30876dfa 1951
Kojto 122:f9eeca106725 1952 #if defined(USART3)
Kojto 107:4f6c30876dfa 1953 #define __HAL_RCC_USART3_FORCE_RESET() SET_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_USART3RST)
Kojto 122:f9eeca106725 1954 #endif /* USART3 */
Kojto 122:f9eeca106725 1955
Kojto 122:f9eeca106725 1956 #if defined(UART4)
Kojto 107:4f6c30876dfa 1957 #define __HAL_RCC_UART4_FORCE_RESET() SET_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_UART4RST)
Kojto 122:f9eeca106725 1958 #endif /* UART4 */
Kojto 122:f9eeca106725 1959
Kojto 122:f9eeca106725 1960 #if defined(UART5)
Kojto 107:4f6c30876dfa 1961 #define __HAL_RCC_UART5_FORCE_RESET() SET_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_UART5RST)
Kojto 122:f9eeca106725 1962 #endif /* UART5 */
Kojto 107:4f6c30876dfa 1963
Kojto 107:4f6c30876dfa 1964 #define __HAL_RCC_I2C1_FORCE_RESET() SET_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_I2C1RST)
Kojto 107:4f6c30876dfa 1965
Kojto 122:f9eeca106725 1966 #if defined(I2C2)
Kojto 107:4f6c30876dfa 1967 #define __HAL_RCC_I2C2_FORCE_RESET() SET_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_I2C2RST)
Kojto 122:f9eeca106725 1968 #endif /* I2C2 */
Kojto 107:4f6c30876dfa 1969
Kojto 107:4f6c30876dfa 1970 #define __HAL_RCC_I2C3_FORCE_RESET() SET_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_I2C3RST)
Kojto 107:4f6c30876dfa 1971
Kojto 122:f9eeca106725 1972 #if defined(CRS)
Kojto 122:f9eeca106725 1973 #define __HAL_RCC_CRS_FORCE_RESET() SET_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_CRSRST)
Kojto 122:f9eeca106725 1974 #endif /* CRS */
Kojto 122:f9eeca106725 1975
Kojto 107:4f6c30876dfa 1976 #define __HAL_RCC_CAN1_FORCE_RESET() SET_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_CAN1RST)
Kojto 107:4f6c30876dfa 1977
Kojto 122:f9eeca106725 1978 #if defined(USB)
Kojto 122:f9eeca106725 1979 #define __HAL_RCC_USB_FORCE_RESET() SET_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_USBFSRST)
Kojto 122:f9eeca106725 1980 #endif /* USB */
Kojto 122:f9eeca106725 1981
Kojto 107:4f6c30876dfa 1982 #define __HAL_RCC_PWR_FORCE_RESET() SET_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_PWRRST)
Kojto 107:4f6c30876dfa 1983
Kojto 107:4f6c30876dfa 1984 #define __HAL_RCC_DAC1_FORCE_RESET() SET_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_DAC1RST)
Kojto 107:4f6c30876dfa 1985
Kojto 107:4f6c30876dfa 1986 #define __HAL_RCC_OPAMP_FORCE_RESET() SET_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_OPAMPRST)
Kojto 107:4f6c30876dfa 1987
Kojto 107:4f6c30876dfa 1988 #define __HAL_RCC_LPTIM1_FORCE_RESET() SET_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_LPTIM1RST)
Kojto 107:4f6c30876dfa 1989
Kojto 107:4f6c30876dfa 1990 #define __HAL_RCC_LPUART1_FORCE_RESET() SET_BIT(RCC->APB1RSTR2, RCC_APB1RSTR2_LPUART1RST)
Kojto 107:4f6c30876dfa 1991
Kojto 107:4f6c30876dfa 1992 #define __HAL_RCC_SWPMI1_FORCE_RESET() SET_BIT(RCC->APB1RSTR2, RCC_APB1RSTR2_SWPMI1RST)
Kojto 107:4f6c30876dfa 1993
Kojto 107:4f6c30876dfa 1994 #define __HAL_RCC_LPTIM2_FORCE_RESET() SET_BIT(RCC->APB1RSTR2, RCC_APB1RSTR2_LPTIM2RST)
Kojto 107:4f6c30876dfa 1995
Kojto 122:f9eeca106725 1996
Kojto 122:f9eeca106725 1997 #define __HAL_RCC_APB1_RELEASE_RESET() WRITE_REG(RCC->APB1RSTR1, 0x00000000U)
Kojto 107:4f6c30876dfa 1998
Kojto 107:4f6c30876dfa 1999 #define __HAL_RCC_TIM2_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_TIM2RST)
Kojto 107:4f6c30876dfa 2000
Kojto 122:f9eeca106725 2001 #if defined(TIM3)
Kojto 107:4f6c30876dfa 2002 #define __HAL_RCC_TIM3_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_TIM3RST)
Kojto 122:f9eeca106725 2003 #endif /* TIM3 */
Kojto 122:f9eeca106725 2004
Kojto 122:f9eeca106725 2005 #if defined(TIM4)
Kojto 107:4f6c30876dfa 2006 #define __HAL_RCC_TIM4_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_TIM4RST)
Kojto 122:f9eeca106725 2007 #endif /* TIM4 */
Kojto 122:f9eeca106725 2008
Kojto 122:f9eeca106725 2009 #if defined(TIM5)
Kojto 107:4f6c30876dfa 2010 #define __HAL_RCC_TIM5_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_TIM5RST)
Kojto 122:f9eeca106725 2011 #endif /* TIM5 */
Kojto 107:4f6c30876dfa 2012
Kojto 107:4f6c30876dfa 2013 #define __HAL_RCC_TIM6_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_TIM6RST)
Kojto 107:4f6c30876dfa 2014
Kojto 107:4f6c30876dfa 2015 #define __HAL_RCC_TIM7_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_TIM7RST)
Kojto 107:4f6c30876dfa 2016
Kojto 122:f9eeca106725 2017 #if defined(LCD)
Kojto 122:f9eeca106725 2018 #define __HAL_RCC_LCD_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_LCDRST)
Kojto 122:f9eeca106725 2019 #endif /* LCD */
Kojto 122:f9eeca106725 2020
Kojto 122:f9eeca106725 2021 #if defined(SPI2)
Kojto 107:4f6c30876dfa 2022 #define __HAL_RCC_SPI2_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_SPI2RST)
Kojto 122:f9eeca106725 2023 #endif /* SPI2 */
Kojto 107:4f6c30876dfa 2024
Kojto 107:4f6c30876dfa 2025 #define __HAL_RCC_SPI3_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_SPI3RST)
Kojto 107:4f6c30876dfa 2026
Kojto 107:4f6c30876dfa 2027 #define __HAL_RCC_USART2_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_USART2RST)
Kojto 107:4f6c30876dfa 2028
Kojto 122:f9eeca106725 2029 #if defined(USART3)
Kojto 107:4f6c30876dfa 2030 #define __HAL_RCC_USART3_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_USART3RST)
Kojto 122:f9eeca106725 2031 #endif /* USART3 */
Kojto 122:f9eeca106725 2032
Kojto 122:f9eeca106725 2033 #if defined(UART4)
Kojto 107:4f6c30876dfa 2034 #define __HAL_RCC_UART4_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_UART4RST)
Kojto 122:f9eeca106725 2035 #endif /* UART4 */
Kojto 122:f9eeca106725 2036
Kojto 122:f9eeca106725 2037 #if defined(UART5)
Kojto 107:4f6c30876dfa 2038 #define __HAL_RCC_UART5_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_UART5RST)
Kojto 122:f9eeca106725 2039 #endif /* UART5 */
Kojto 107:4f6c30876dfa 2040
Kojto 107:4f6c30876dfa 2041 #define __HAL_RCC_I2C1_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_I2C1RST)
Kojto 107:4f6c30876dfa 2042
Kojto 122:f9eeca106725 2043 #if defined(I2C2)
Kojto 107:4f6c30876dfa 2044 #define __HAL_RCC_I2C2_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_I2C2RST)
Kojto 122:f9eeca106725 2045 #endif /* I2C2 */
Kojto 107:4f6c30876dfa 2046
Kojto 107:4f6c30876dfa 2047 #define __HAL_RCC_I2C3_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_I2C3RST)
Kojto 107:4f6c30876dfa 2048
Kojto 122:f9eeca106725 2049 #if defined(CRS)
Kojto 122:f9eeca106725 2050 #define __HAL_RCC_CRS_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_CRSRST)
Kojto 122:f9eeca106725 2051 #endif /* CRS */
Kojto 122:f9eeca106725 2052
Kojto 107:4f6c30876dfa 2053 #define __HAL_RCC_CAN1_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_CAN1RST)
Kojto 107:4f6c30876dfa 2054
Kojto 122:f9eeca106725 2055 #if defined(USB)
Kojto 122:f9eeca106725 2056 #define __HAL_RCC_USB_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_USBFSRST)
Kojto 122:f9eeca106725 2057 #endif /* USB */
Kojto 122:f9eeca106725 2058
Kojto 107:4f6c30876dfa 2059 #define __HAL_RCC_PWR_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_PWRRST)
Kojto 107:4f6c30876dfa 2060
Kojto 107:4f6c30876dfa 2061 #define __HAL_RCC_DAC1_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_DAC1RST)
Kojto 107:4f6c30876dfa 2062
Kojto 107:4f6c30876dfa 2063 #define __HAL_RCC_OPAMP_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_OPAMPRST)
Kojto 107:4f6c30876dfa 2064
Kojto 107:4f6c30876dfa 2065 #define __HAL_RCC_LPTIM1_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR1, RCC_APB1RSTR1_LPTIM1RST)
Kojto 107:4f6c30876dfa 2066
Kojto 107:4f6c30876dfa 2067 #define __HAL_RCC_LPUART1_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR2, RCC_APB1RSTR2_LPUART1RST)
Kojto 107:4f6c30876dfa 2068
Kojto 107:4f6c30876dfa 2069 #define __HAL_RCC_SWPMI1_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR2, RCC_APB1RSTR2_SWPMI1RST)
Kojto 107:4f6c30876dfa 2070
Kojto 107:4f6c30876dfa 2071 #define __HAL_RCC_LPTIM2_RELEASE_RESET() CLEAR_BIT(RCC->APB1RSTR2, RCC_APB1RSTR2_LPTIM2RST)
Kojto 107:4f6c30876dfa 2072
Kojto 107:4f6c30876dfa 2073 /**
Kojto 107:4f6c30876dfa 2074 * @}
Kojto 107:4f6c30876dfa 2075 */
Kojto 107:4f6c30876dfa 2076
Kojto 107:4f6c30876dfa 2077 /** @defgroup RCC_APB2_Force_Release_Reset APB2 Peripheral Force Release Reset
Kojto 107:4f6c30876dfa 2078 * @brief Force or release APB2 peripheral reset.
Kojto 107:4f6c30876dfa 2079 * @{
Kojto 107:4f6c30876dfa 2080 */
Kojto 122:f9eeca106725 2081 #define __HAL_RCC_APB2_FORCE_RESET() WRITE_REG(RCC->APB2RSTR, 0xFFFFFFFFU)
Kojto 107:4f6c30876dfa 2082
Kojto 107:4f6c30876dfa 2083 #define __HAL_RCC_SYSCFG_FORCE_RESET() SET_BIT(RCC->APB2RSTR, RCC_APB2RSTR_SYSCFGRST)
Kojto 107:4f6c30876dfa 2084
Kojto 122:f9eeca106725 2085 #if defined(SDMMC1) && defined(RCC_APB2RSTR_SDMMC1RST)
Kojto 107:4f6c30876dfa 2086 #define __HAL_RCC_SDMMC1_FORCE_RESET() SET_BIT(RCC->APB2RSTR, RCC_APB2RSTR_SDMMC1RST)
Kojto 122:f9eeca106725 2087 #endif /* SDMMC1 && RCC_APB2RSTR_SDMMC1RST */
Kojto 107:4f6c30876dfa 2088
Kojto 107:4f6c30876dfa 2089 #define __HAL_RCC_TIM1_FORCE_RESET() SET_BIT(RCC->APB2RSTR, RCC_APB2RSTR_TIM1RST)
Kojto 107:4f6c30876dfa 2090
Kojto 107:4f6c30876dfa 2091 #define __HAL_RCC_SPI1_FORCE_RESET() SET_BIT(RCC->APB2RSTR, RCC_APB2RSTR_SPI1RST)
Kojto 107:4f6c30876dfa 2092
Kojto 122:f9eeca106725 2093 #if defined(TIM8)
Kojto 107:4f6c30876dfa 2094 #define __HAL_RCC_TIM8_FORCE_RESET() SET_BIT(RCC->APB2RSTR, RCC_APB2RSTR_TIM8RST)
Kojto 122:f9eeca106725 2095 #endif /* TIM8 */
Kojto 107:4f6c30876dfa 2096
Kojto 107:4f6c30876dfa 2097 #define __HAL_RCC_USART1_FORCE_RESET() SET_BIT(RCC->APB2RSTR, RCC_APB2RSTR_USART1RST)
Kojto 107:4f6c30876dfa 2098
Kojto 107:4f6c30876dfa 2099 #define __HAL_RCC_TIM15_FORCE_RESET() SET_BIT(RCC->APB2RSTR, RCC_APB2RSTR_TIM15RST)
Kojto 107:4f6c30876dfa 2100
Kojto 107:4f6c30876dfa 2101 #define __HAL_RCC_TIM16_FORCE_RESET() SET_BIT(RCC->APB2RSTR, RCC_APB2RSTR_TIM16RST)
Kojto 107:4f6c30876dfa 2102
Kojto 122:f9eeca106725 2103 #if defined(TIM17)
Kojto 107:4f6c30876dfa 2104 #define __HAL_RCC_TIM17_FORCE_RESET() SET_BIT(RCC->APB2RSTR, RCC_APB2RSTR_TIM17RST)
Kojto 122:f9eeca106725 2105 #endif /* TIM17 */
Kojto 107:4f6c30876dfa 2106
Kojto 107:4f6c30876dfa 2107 #define __HAL_RCC_SAI1_FORCE_RESET() SET_BIT(RCC->APB2RSTR, RCC_APB2RSTR_SAI1RST)
Kojto 107:4f6c30876dfa 2108
Kojto 122:f9eeca106725 2109 #if defined(SAI2)
Kojto 107:4f6c30876dfa 2110 #define __HAL_RCC_SAI2_FORCE_RESET() SET_BIT(RCC->APB2RSTR, RCC_APB2RSTR_SAI2RST)
Kojto 122:f9eeca106725 2111 #endif /* SAI2 */
Kojto 122:f9eeca106725 2112
Kojto 122:f9eeca106725 2113 #if defined(DFSDM1_Filter0)
Kojto 122:f9eeca106725 2114 #define __HAL_RCC_DFSDM1_FORCE_RESET() SET_BIT(RCC->APB2RSTR, RCC_APB2RSTR_DFSDM1RST)
Kojto 122:f9eeca106725 2115 #endif /* DFSDM1_Filter0 */
Kojto 122:f9eeca106725 2116
Kojto 122:f9eeca106725 2117
Kojto 122:f9eeca106725 2118 #define __HAL_RCC_APB2_RELEASE_RESET() WRITE_REG(RCC->APB2RSTR, 0x00000000U)
Kojto 107:4f6c30876dfa 2119
Kojto 107:4f6c30876dfa 2120 #define __HAL_RCC_SYSCFG_RELEASE_RESET() CLEAR_BIT(RCC->APB2RSTR, RCC_APB2RSTR_SYSCFGRST)
Kojto 107:4f6c30876dfa 2121
Kojto 122:f9eeca106725 2122 #if defined(SDMMC1) && defined(RCC_APB2RSTR_SDMMC1RST)
Kojto 107:4f6c30876dfa 2123 #define __HAL_RCC_SDMMC1_RELEASE_RESET() CLEAR_BIT(RCC->APB2RSTR, RCC_APB2RSTR_SDMMC1RST)
Kojto 122:f9eeca106725 2124 #endif /* SDMMC1 && RCC_APB2RSTR_SDMMC1RST */
Kojto 107:4f6c30876dfa 2125
Kojto 107:4f6c30876dfa 2126 #define __HAL_RCC_TIM1_RELEASE_RESET() CLEAR_BIT(RCC->APB2RSTR, RCC_APB2RSTR_TIM1RST)
Kojto 107:4f6c30876dfa 2127
Kojto 107:4f6c30876dfa 2128 #define __HAL_RCC_SPI1_RELEASE_RESET() CLEAR_BIT(RCC->APB2RSTR, RCC_APB2RSTR_SPI1RST)
Kojto 107:4f6c30876dfa 2129
Kojto 122:f9eeca106725 2130 #if defined(TIM8)
Kojto 107:4f6c30876dfa 2131 #define __HAL_RCC_TIM8_RELEASE_RESET() CLEAR_BIT(RCC->APB2RSTR, RCC_APB2RSTR_TIM8RST)
Kojto 122:f9eeca106725 2132 #endif /* TIM8 */
Kojto 107:4f6c30876dfa 2133
Kojto 107:4f6c30876dfa 2134 #define __HAL_RCC_USART1_RELEASE_RESET() CLEAR_BIT(RCC->APB2RSTR, RCC_APB2RSTR_USART1RST)
Kojto 107:4f6c30876dfa 2135
Kojto 107:4f6c30876dfa 2136 #define __HAL_RCC_TIM15_RELEASE_RESET() CLEAR_BIT(RCC->APB2RSTR, RCC_APB2RSTR_TIM15RST)
Kojto 107:4f6c30876dfa 2137
Kojto 107:4f6c30876dfa 2138 #define __HAL_RCC_TIM16_RELEASE_RESET() CLEAR_BIT(RCC->APB2RSTR, RCC_APB2RSTR_TIM16RST)
Kojto 107:4f6c30876dfa 2139
Kojto 122:f9eeca106725 2140 #if defined(TIM17)
Kojto 107:4f6c30876dfa 2141 #define __HAL_RCC_TIM17_RELEASE_RESET() CLEAR_BIT(RCC->APB2RSTR, RCC_APB2RSTR_TIM17RST)
Kojto 122:f9eeca106725 2142 #endif /* TIM17 */
Kojto 107:4f6c30876dfa 2143
Kojto 107:4f6c30876dfa 2144 #define __HAL_RCC_SAI1_RELEASE_RESET() CLEAR_BIT(RCC->APB2RSTR, RCC_APB2RSTR_SAI1RST)
Kojto 107:4f6c30876dfa 2145
Kojto 122:f9eeca106725 2146 #if defined(SAI2)
Kojto 107:4f6c30876dfa 2147 #define __HAL_RCC_SAI2_RELEASE_RESET() CLEAR_BIT(RCC->APB2RSTR, RCC_APB2RSTR_SAI2RST)
Kojto 122:f9eeca106725 2148 #endif /* SAI2 */
Kojto 122:f9eeca106725 2149
Kojto 122:f9eeca106725 2150 #if defined(DFSDM1_Filter0)
Kojto 122:f9eeca106725 2151 #define __HAL_RCC_DFSDM1_RELEASE_RESET() CLEAR_BIT(RCC->APB2RSTR, RCC_APB2RSTR_DFSDM1RST)
Kojto 122:f9eeca106725 2152 #endif /* DFSDM1_Filter0 */
Kojto 107:4f6c30876dfa 2153
Kojto 107:4f6c30876dfa 2154 /**
Kojto 107:4f6c30876dfa 2155 * @}
Kojto 107:4f6c30876dfa 2156 */
Kojto 107:4f6c30876dfa 2157
Kojto 107:4f6c30876dfa 2158 /** @defgroup RCC_AHB1_Clock_Sleep_Enable_Disable AHB1 Peripheral Clock Sleep Enable Disable
Kojto 107:4f6c30876dfa 2159 * @brief Enable or disable the AHB1 peripheral clock during Low Power (Sleep) mode.
Kojto 107:4f6c30876dfa 2160 * @note Peripheral clock gating in SLEEP mode can be used to further reduce
Kojto 107:4f6c30876dfa 2161 * power consumption.
Kojto 107:4f6c30876dfa 2162 * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
Kojto 107:4f6c30876dfa 2163 * @note By default, all peripheral clocks are enabled during SLEEP mode.
Kojto 107:4f6c30876dfa 2164 * @{
Kojto 107:4f6c30876dfa 2165 */
Kojto 107:4f6c30876dfa 2166
Kojto 107:4f6c30876dfa 2167 #define __HAL_RCC_DMA1_CLK_SLEEP_ENABLE() SET_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_DMA1SMEN)
Kojto 107:4f6c30876dfa 2168
Kojto 107:4f6c30876dfa 2169 #define __HAL_RCC_DMA2_CLK_SLEEP_ENABLE() SET_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_DMA2SMEN)
Kojto 107:4f6c30876dfa 2170
Kojto 107:4f6c30876dfa 2171 #define __HAL_RCC_FLASH_CLK_SLEEP_ENABLE() SET_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_FLASHSMEN)
Kojto 107:4f6c30876dfa 2172
Kojto 107:4f6c30876dfa 2173 #define __HAL_RCC_SRAM1_CLK_SLEEP_ENABLE() SET_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_SRAM1SMEN)
Kojto 107:4f6c30876dfa 2174
Kojto 107:4f6c30876dfa 2175 #define __HAL_RCC_CRC_CLK_SLEEP_ENABLE() SET_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_CRCSMEN)
Kojto 107:4f6c30876dfa 2176
Kojto 107:4f6c30876dfa 2177 #define __HAL_RCC_TSC_CLK_SLEEP_ENABLE() SET_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_TSCSMEN)
Kojto 107:4f6c30876dfa 2178
Kojto 122:f9eeca106725 2179
Kojto 107:4f6c30876dfa 2180 #define __HAL_RCC_DMA1_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_DMA1SMEN)
Kojto 107:4f6c30876dfa 2181
Kojto 107:4f6c30876dfa 2182 #define __HAL_RCC_DMA2_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_DMA2SMEN)
Kojto 107:4f6c30876dfa 2183
Kojto 107:4f6c30876dfa 2184 #define __HAL_RCC_FLASH_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_FLASHSMEN)
Kojto 107:4f6c30876dfa 2185
Kojto 107:4f6c30876dfa 2186 #define __HAL_RCC_SRAM1_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_SRAM1SMEN)
Kojto 107:4f6c30876dfa 2187
Kojto 107:4f6c30876dfa 2188 #define __HAL_RCC_CRC_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_CRCSMEN)
Kojto 107:4f6c30876dfa 2189
Kojto 107:4f6c30876dfa 2190 #define __HAL_RCC_TSC_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_TSCSMEN)
Kojto 107:4f6c30876dfa 2191
Kojto 107:4f6c30876dfa 2192 /**
Kojto 107:4f6c30876dfa 2193 * @}
Kojto 107:4f6c30876dfa 2194 */
Kojto 107:4f6c30876dfa 2195
Kojto 107:4f6c30876dfa 2196 /** @defgroup RCC_AHB2_Clock_Sleep_Enable_Disable AHB2 Peripheral Clock Sleep Enable Disable
Kojto 107:4f6c30876dfa 2197 * @brief Enable or disable the AHB2 peripheral clock during Low Power (Sleep) mode.
Kojto 107:4f6c30876dfa 2198 * @note Peripheral clock gating in SLEEP mode can be used to further reduce
Kojto 107:4f6c30876dfa 2199 * power consumption.
Kojto 107:4f6c30876dfa 2200 * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
Kojto 107:4f6c30876dfa 2201 * @note By default, all peripheral clocks are enabled during SLEEP mode.
Kojto 107:4f6c30876dfa 2202 * @{
Kojto 107:4f6c30876dfa 2203 */
Kojto 107:4f6c30876dfa 2204
Kojto 107:4f6c30876dfa 2205 #define __HAL_RCC_GPIOA_CLK_SLEEP_ENABLE() SET_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOASMEN)
Kojto 107:4f6c30876dfa 2206
Kojto 107:4f6c30876dfa 2207 #define __HAL_RCC_GPIOB_CLK_SLEEP_ENABLE() SET_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOBSMEN)
Kojto 107:4f6c30876dfa 2208
Kojto 107:4f6c30876dfa 2209 #define __HAL_RCC_GPIOC_CLK_SLEEP_ENABLE() SET_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOCSMEN)
Kojto 107:4f6c30876dfa 2210
Kojto 122:f9eeca106725 2211 #if defined(GPIOD)
Kojto 107:4f6c30876dfa 2212 #define __HAL_RCC_GPIOD_CLK_SLEEP_ENABLE() SET_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIODSMEN)
Kojto 122:f9eeca106725 2213 #endif /* GPIOD */
Kojto 122:f9eeca106725 2214
Kojto 122:f9eeca106725 2215 #if defined(GPIOE)
Kojto 107:4f6c30876dfa 2216 #define __HAL_RCC_GPIOE_CLK_SLEEP_ENABLE() SET_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOESMEN)
Kojto 122:f9eeca106725 2217 #endif /* GPIOE */
Kojto 122:f9eeca106725 2218
Kojto 122:f9eeca106725 2219 #if defined(GPIOF)
Kojto 107:4f6c30876dfa 2220 #define __HAL_RCC_GPIOF_CLK_SLEEP_ENABLE() SET_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOFSMEN)
Kojto 122:f9eeca106725 2221 #endif /* GPIOF */
Kojto 122:f9eeca106725 2222
Kojto 122:f9eeca106725 2223 #if defined(GPIOG)
Kojto 107:4f6c30876dfa 2224 #define __HAL_RCC_GPIOG_CLK_SLEEP_ENABLE() SET_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOGSMEN)
Kojto 122:f9eeca106725 2225 #endif /* GPIOG */
Kojto 107:4f6c30876dfa 2226
Kojto 107:4f6c30876dfa 2227 #define __HAL_RCC_GPIOH_CLK_SLEEP_ENABLE() SET_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOHSMEN)
Kojto 107:4f6c30876dfa 2228
Kojto 107:4f6c30876dfa 2229 #define __HAL_RCC_SRAM2_CLK_SLEEP_ENABLE() SET_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_SRAM2SMEN)
Kojto 107:4f6c30876dfa 2230
Kojto 122:f9eeca106725 2231 #if defined(USB_OTG_FS)
Kojto 122:f9eeca106725 2232 #define __HAL_RCC_USB_OTG_FS_CLK_SLEEP_ENABLE() SET_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_OTGFSSMEN)
Kojto 122:f9eeca106725 2233 #endif /* USB_OTG_FS */
Kojto 122:f9eeca106725 2234
Kojto 107:4f6c30876dfa 2235 #define __HAL_RCC_ADC_CLK_SLEEP_ENABLE() SET_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_ADCSMEN)
Kojto 107:4f6c30876dfa 2236
Kojto 122:f9eeca106725 2237 #if defined(AES)
Kojto 122:f9eeca106725 2238 #define __HAL_RCC_AES_CLK_SLEEP_ENABLE() SET_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_AESSMEN)
Kojto 122:f9eeca106725 2239 #endif /* AES */
Kojto 122:f9eeca106725 2240
Kojto 107:4f6c30876dfa 2241 #define __HAL_RCC_RNG_CLK_SLEEP_ENABLE() SET_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_RNGSMEN)
Kojto 107:4f6c30876dfa 2242
Kojto 122:f9eeca106725 2243
Kojto 107:4f6c30876dfa 2244 #define __HAL_RCC_GPIOA_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOASMEN)
Kojto 107:4f6c30876dfa 2245
Kojto 107:4f6c30876dfa 2246 #define __HAL_RCC_GPIOB_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOBSMEN)
Kojto 107:4f6c30876dfa 2247
Kojto 107:4f6c30876dfa 2248 #define __HAL_RCC_GPIOC_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOCSMEN)
Kojto 107:4f6c30876dfa 2249
Kojto 122:f9eeca106725 2250 #if defined(GPIOD)
Kojto 107:4f6c30876dfa 2251 #define __HAL_RCC_GPIOD_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIODSMEN)
Kojto 122:f9eeca106725 2252 #endif /* GPIOD */
Kojto 122:f9eeca106725 2253
Kojto 122:f9eeca106725 2254 #if defined(GPIOE)
Kojto 107:4f6c30876dfa 2255 #define __HAL_RCC_GPIOE_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOESMEN)
Kojto 122:f9eeca106725 2256 #endif /* GPIOE */
Kojto 122:f9eeca106725 2257
Kojto 122:f9eeca106725 2258 #if defined(GPIOF)
Kojto 107:4f6c30876dfa 2259 #define __HAL_RCC_GPIOF_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOFSMEN)
Kojto 122:f9eeca106725 2260 #endif /* GPIOF */
Kojto 122:f9eeca106725 2261
Kojto 122:f9eeca106725 2262 #if defined(GPIOG)
Kojto 107:4f6c30876dfa 2263 #define __HAL_RCC_GPIOG_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOGSMEN)
Kojto 122:f9eeca106725 2264 #endif /* GPIOG */
Kojto 107:4f6c30876dfa 2265
Kojto 107:4f6c30876dfa 2266 #define __HAL_RCC_GPIOH_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOHSMEN)
Kojto 107:4f6c30876dfa 2267
Kojto 122:f9eeca106725 2268 #define __HAL_RCC_SRAM2_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_SRAM2SMEN)
Kojto 122:f9eeca106725 2269
Kojto 122:f9eeca106725 2270 #if defined(USB_OTG_FS)
Kojto 122:f9eeca106725 2271 #define __HAL_RCC_USB_OTG_FS_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_OTGFSSMEN)
Kojto 122:f9eeca106725 2272 #endif /* USB_OTG_FS */
Kojto 122:f9eeca106725 2273
Kojto 107:4f6c30876dfa 2274 #define __HAL_RCC_ADC_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_ADCSMEN)
Kojto 107:4f6c30876dfa 2275
Kojto 122:f9eeca106725 2276 #if defined(AES)
Kojto 122:f9eeca106725 2277 #define __HAL_RCC_AES_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_AESSMEN)
Kojto 122:f9eeca106725 2278 #endif /* AES */
Kojto 107:4f6c30876dfa 2279
Kojto 107:4f6c30876dfa 2280 #define __HAL_RCC_RNG_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_RNGSMEN)
Kojto 107:4f6c30876dfa 2281
Kojto 107:4f6c30876dfa 2282 /**
Kojto 107:4f6c30876dfa 2283 * @}
Kojto 107:4f6c30876dfa 2284 */
Kojto 107:4f6c30876dfa 2285
Kojto 107:4f6c30876dfa 2286 /** @defgroup RCC_AHB3_Clock_Sleep_Enable_Disable AHB3 Peripheral Clock Sleep Enable Disable
Kojto 107:4f6c30876dfa 2287 * @brief Enable or disable the AHB3 peripheral clock during Low Power (Sleep) mode.
Kojto 107:4f6c30876dfa 2288 * @note Peripheral clock gating in SLEEP mode can be used to further reduce
Kojto 107:4f6c30876dfa 2289 * power consumption.
Kojto 107:4f6c30876dfa 2290 * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
Kojto 107:4f6c30876dfa 2291 * @note By default, all peripheral clocks are enabled during SLEEP mode.
Kojto 107:4f6c30876dfa 2292 * @{
Kojto 107:4f6c30876dfa 2293 */
Kojto 107:4f6c30876dfa 2294
Kojto 122:f9eeca106725 2295 #if defined(QUADSPI)
Kojto 107:4f6c30876dfa 2296 #define __HAL_RCC_QSPI_CLK_SLEEP_ENABLE() SET_BIT(RCC->AHB3SMENR, RCC_AHB3SMENR_QSPISMEN)
Kojto 122:f9eeca106725 2297 #endif /* QUADSPI */
Kojto 122:f9eeca106725 2298
Kojto 122:f9eeca106725 2299 #if defined(FMC_BANK1)
Kojto 107:4f6c30876dfa 2300 #define __HAL_RCC_FMC_CLK_SLEEP_ENABLE() SET_BIT(RCC->AHB3SMENR, RCC_AHB3SMENR_FMCSMEN)
Kojto 122:f9eeca106725 2301 #endif /* FMC_BANK1 */
Kojto 122:f9eeca106725 2302
Kojto 122:f9eeca106725 2303
Kojto 122:f9eeca106725 2304 #if defined(QUADSPI)
Kojto 107:4f6c30876dfa 2305 #define __HAL_RCC_QSPI_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->AHB3SMENR, RCC_AHB3SMENR_QSPISMEN)
Kojto 122:f9eeca106725 2306 #endif /* QUADSPI */
Kojto 122:f9eeca106725 2307
Kojto 122:f9eeca106725 2308 #if defined(FMC_BANK1)
Kojto 107:4f6c30876dfa 2309 #define __HAL_RCC_FMC_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->AHB3SMENR, RCC_AHB3SMENR_FMCSMEN)
Kojto 122:f9eeca106725 2310 #endif /* FMC_BANK1 */
Kojto 107:4f6c30876dfa 2311
Kojto 107:4f6c30876dfa 2312 /**
Kojto 107:4f6c30876dfa 2313 * @}
Kojto 107:4f6c30876dfa 2314 */
Kojto 107:4f6c30876dfa 2315
Kojto 107:4f6c30876dfa 2316 /** @defgroup RCC_APB1_Clock_Sleep_Enable_Disable APB1 Peripheral Clock Sleep Enable Disable
Kojto 107:4f6c30876dfa 2317 * @brief Enable or disable the APB1 peripheral clock during Low Power (Sleep) mode.
Kojto 107:4f6c30876dfa 2318 * @note Peripheral clock gating in SLEEP mode can be used to further reduce
Kojto 107:4f6c30876dfa 2319 * power consumption.
Kojto 107:4f6c30876dfa 2320 * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
Kojto 107:4f6c30876dfa 2321 * @note By default, all peripheral clocks are enabled during SLEEP mode.
Kojto 107:4f6c30876dfa 2322 * @{
Kojto 107:4f6c30876dfa 2323 */
Kojto 107:4f6c30876dfa 2324
Kojto 107:4f6c30876dfa 2325 #define __HAL_RCC_TIM2_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_TIM2SMEN)
Kojto 107:4f6c30876dfa 2326
Kojto 122:f9eeca106725 2327 #if defined(TIM3)
Kojto 107:4f6c30876dfa 2328 #define __HAL_RCC_TIM3_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_TIM3SMEN)
Kojto 122:f9eeca106725 2329 #endif /* TIM3 */
Kojto 122:f9eeca106725 2330
Kojto 122:f9eeca106725 2331 #if defined(TIM4)
Kojto 107:4f6c30876dfa 2332 #define __HAL_RCC_TIM4_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_TIM4SMEN)
Kojto 122:f9eeca106725 2333 #endif /* TIM4 */
Kojto 122:f9eeca106725 2334
Kojto 122:f9eeca106725 2335 #if defined(TIM5)
Kojto 107:4f6c30876dfa 2336 #define __HAL_RCC_TIM5_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_TIM5SMEN)
Kojto 122:f9eeca106725 2337 #endif /* TIM5 */
Kojto 107:4f6c30876dfa 2338
Kojto 107:4f6c30876dfa 2339 #define __HAL_RCC_TIM6_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_TIM6SMEN)
Kojto 107:4f6c30876dfa 2340
Kojto 107:4f6c30876dfa 2341 #define __HAL_RCC_TIM7_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_TIM7SMEN)
Kojto 107:4f6c30876dfa 2342
Kojto 122:f9eeca106725 2343 #if defined(LCD)
Kojto 122:f9eeca106725 2344 #define __HAL_RCC_LCD_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_LCDSMEN)
Kojto 122:f9eeca106725 2345 #endif /* LCD */
Kojto 122:f9eeca106725 2346
Kojto 122:f9eeca106725 2347 #if defined(RCC_APB1SMENR1_RTCAPBSMEN)
Kojto 122:f9eeca106725 2348 #define __HAL_RCC_RTCAPB_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_RTCAPBSMEN)
Kojto 122:f9eeca106725 2349 #endif /* RCC_APB1SMENR1_RTCAPBSMEN */
Kojto 122:f9eeca106725 2350
Kojto 107:4f6c30876dfa 2351 #define __HAL_RCC_WWDG_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_WWDGSMEN)
Kojto 107:4f6c30876dfa 2352
Kojto 122:f9eeca106725 2353 #if defined(SPI2)
Kojto 107:4f6c30876dfa 2354 #define __HAL_RCC_SPI2_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_SPI2SMEN)
Kojto 122:f9eeca106725 2355 #endif /* SPI2 */
Kojto 107:4f6c30876dfa 2356
Kojto 107:4f6c30876dfa 2357 #define __HAL_RCC_SPI3_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_SPI3SMEN)
Kojto 107:4f6c30876dfa 2358
Kojto 107:4f6c30876dfa 2359 #define __HAL_RCC_USART2_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_USART2SMEN)
Kojto 107:4f6c30876dfa 2360
Kojto 122:f9eeca106725 2361 #if defined(USART3)
Kojto 107:4f6c30876dfa 2362 #define __HAL_RCC_USART3_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_USART3SMEN)
Kojto 122:f9eeca106725 2363 #endif /* USART3 */
Kojto 122:f9eeca106725 2364
Kojto 122:f9eeca106725 2365 #if defined(UART4)
Kojto 107:4f6c30876dfa 2366 #define __HAL_RCC_UART4_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_UART4SMEN)
Kojto 122:f9eeca106725 2367 #endif /* UART4 */
Kojto 122:f9eeca106725 2368
Kojto 122:f9eeca106725 2369 #if defined(UART5)
Kojto 107:4f6c30876dfa 2370 #define __HAL_RCC_UART5_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_UART5SMEN)
Kojto 122:f9eeca106725 2371 #endif /* UART5 */
Kojto 107:4f6c30876dfa 2372
Kojto 107:4f6c30876dfa 2373 #define __HAL_RCC_I2C1_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_I2C1SMEN)
Kojto 107:4f6c30876dfa 2374
Kojto 122:f9eeca106725 2375 #if defined(I2C2)
Kojto 107:4f6c30876dfa 2376 #define __HAL_RCC_I2C2_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_I2C2SMEN)
Kojto 122:f9eeca106725 2377 #endif /* I2C2 */
Kojto 107:4f6c30876dfa 2378
Kojto 107:4f6c30876dfa 2379 #define __HAL_RCC_I2C3_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_I2C3SMEN)
Kojto 107:4f6c30876dfa 2380
Kojto 122:f9eeca106725 2381 #if defined(CRS)
Kojto 122:f9eeca106725 2382 #define __HAL_RCC_CRS_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_CRSSMEN)
Kojto 122:f9eeca106725 2383 #endif /* CRS */
Kojto 122:f9eeca106725 2384
Kojto 107:4f6c30876dfa 2385 #define __HAL_RCC_CAN1_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_CAN1SMEN)
Kojto 107:4f6c30876dfa 2386
Kojto 122:f9eeca106725 2387 #if defined(USB)
Kojto 122:f9eeca106725 2388 #define __HAL_RCC_USB_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_USBFSSMEN)
Kojto 122:f9eeca106725 2389 #endif /* USB */
Kojto 122:f9eeca106725 2390
Kojto 107:4f6c30876dfa 2391 #define __HAL_RCC_PWR_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_PWRSMEN)
Kojto 107:4f6c30876dfa 2392
Kojto 107:4f6c30876dfa 2393 #define __HAL_RCC_DAC1_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_DAC1SMEN)
Kojto 107:4f6c30876dfa 2394
Kojto 107:4f6c30876dfa 2395 #define __HAL_RCC_OPAMP_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_OPAMPSMEN)
Kojto 107:4f6c30876dfa 2396
Kojto 107:4f6c30876dfa 2397 #define __HAL_RCC_LPTIM1_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_LPTIM1SMEN)
Kojto 107:4f6c30876dfa 2398
Kojto 107:4f6c30876dfa 2399 #define __HAL_RCC_LPUART1_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR2, RCC_APB1SMENR2_LPUART1SMEN)
Kojto 107:4f6c30876dfa 2400
Kojto 107:4f6c30876dfa 2401 #define __HAL_RCC_SWPMI1_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR2, RCC_APB1SMENR2_SWPMI1SMEN)
Kojto 107:4f6c30876dfa 2402
Kojto 107:4f6c30876dfa 2403 #define __HAL_RCC_LPTIM2_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB1SMENR2, RCC_APB1SMENR2_LPTIM2SMEN)
Kojto 107:4f6c30876dfa 2404
Kojto 122:f9eeca106725 2405
Kojto 107:4f6c30876dfa 2406 #define __HAL_RCC_TIM2_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_TIM2SMEN)
Kojto 107:4f6c30876dfa 2407
Kojto 122:f9eeca106725 2408 #if defined(TIM3)
Kojto 107:4f6c30876dfa 2409 #define __HAL_RCC_TIM3_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_TIM3SMEN)
Kojto 122:f9eeca106725 2410 #endif /* TIM3 */
Kojto 122:f9eeca106725 2411
Kojto 122:f9eeca106725 2412 #if defined(TIM4)
Kojto 107:4f6c30876dfa 2413 #define __HAL_RCC_TIM4_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_TIM4SMEN)
Kojto 122:f9eeca106725 2414 #endif /* TIM4 */
Kojto 122:f9eeca106725 2415
Kojto 122:f9eeca106725 2416 #if defined(TIM5)
Kojto 107:4f6c30876dfa 2417 #define __HAL_RCC_TIM5_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_TIM5SMEN)
Kojto 122:f9eeca106725 2418 #endif /* TIM5 */
Kojto 107:4f6c30876dfa 2419
Kojto 107:4f6c30876dfa 2420 #define __HAL_RCC_TIM6_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_TIM6SMEN)
Kojto 107:4f6c30876dfa 2421
Kojto 107:4f6c30876dfa 2422 #define __HAL_RCC_TIM7_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_TIM7SMEN)
Kojto 107:4f6c30876dfa 2423
Kojto 122:f9eeca106725 2424 #if defined(LCD)
Kojto 122:f9eeca106725 2425 #define __HAL_RCC_LCD_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_LCDSMEN)
Kojto 122:f9eeca106725 2426 #endif /* LCD */
Kojto 122:f9eeca106725 2427
Kojto 122:f9eeca106725 2428 #if defined(RCC_APB1SMENR1_RTCAPBSMEN)
Kojto 122:f9eeca106725 2429 #define __HAL_RCC_RTCAPB_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_RTCAPBSMEN)
Kojto 122:f9eeca106725 2430 #endif /* RCC_APB1SMENR1_RTCAPBSMEN */
Kojto 122:f9eeca106725 2431
Kojto 107:4f6c30876dfa 2432 #define __HAL_RCC_WWDG_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_WWDGSMEN)
Kojto 107:4f6c30876dfa 2433
Kojto 122:f9eeca106725 2434 #if defined(SPI2)
Kojto 107:4f6c30876dfa 2435 #define __HAL_RCC_SPI2_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_SPI2SMEN)
Kojto 122:f9eeca106725 2436 #endif /* SPI2 */
Kojto 107:4f6c30876dfa 2437
Kojto 107:4f6c30876dfa 2438 #define __HAL_RCC_SPI3_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_SPI3SMEN)
Kojto 107:4f6c30876dfa 2439
Kojto 107:4f6c30876dfa 2440 #define __HAL_RCC_USART2_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_USART2SMEN)
Kojto 107:4f6c30876dfa 2441
Kojto 122:f9eeca106725 2442 #if defined(USART3)
Kojto 107:4f6c30876dfa 2443 #define __HAL_RCC_USART3_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_USART3SMEN)
Kojto 122:f9eeca106725 2444 #endif /* USART3 */
Kojto 122:f9eeca106725 2445
Kojto 122:f9eeca106725 2446 #if defined(UART4)
Kojto 107:4f6c30876dfa 2447 #define __HAL_RCC_UART4_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_UART4SMEN)
Kojto 122:f9eeca106725 2448 #endif /* UART4 */
Kojto 122:f9eeca106725 2449
Kojto 122:f9eeca106725 2450 #if defined(UART5)
Kojto 107:4f6c30876dfa 2451 #define __HAL_RCC_UART5_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_UART5SMEN)
Kojto 122:f9eeca106725 2452 #endif /* UART5 */
Kojto 107:4f6c30876dfa 2453
Kojto 107:4f6c30876dfa 2454 #define __HAL_RCC_I2C1_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_I2C1SMEN)
Kojto 107:4f6c30876dfa 2455
Kojto 122:f9eeca106725 2456 #if defined(I2C2)
Kojto 107:4f6c30876dfa 2457 #define __HAL_RCC_I2C2_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_I2C2SMEN)
Kojto 122:f9eeca106725 2458 #endif /* I2C2 */
Kojto 107:4f6c30876dfa 2459
Kojto 107:4f6c30876dfa 2460 #define __HAL_RCC_I2C3_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_I2C3SMEN)
Kojto 107:4f6c30876dfa 2461
Kojto 122:f9eeca106725 2462 #if defined(CRS)
Kojto 122:f9eeca106725 2463 #define __HAL_RCC_CRS_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_CRSSMEN)
Kojto 122:f9eeca106725 2464 #endif /* CRS */
Kojto 122:f9eeca106725 2465
Kojto 107:4f6c30876dfa 2466 #define __HAL_RCC_CAN1_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_CAN1SMEN)
Kojto 107:4f6c30876dfa 2467
Kojto 122:f9eeca106725 2468 #if defined(USB)
Kojto 122:f9eeca106725 2469 #define __HAL_RCC_USB_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_USBFSSMEN)
Kojto 122:f9eeca106725 2470 #endif /* USB */
Kojto 122:f9eeca106725 2471
Kojto 107:4f6c30876dfa 2472 #define __HAL_RCC_PWR_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_PWRSMEN)
Kojto 107:4f6c30876dfa 2473
Kojto 107:4f6c30876dfa 2474 #define __HAL_RCC_DAC1_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_DAC1SMEN)
Kojto 107:4f6c30876dfa 2475
Kojto 107:4f6c30876dfa 2476 #define __HAL_RCC_OPAMP_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_OPAMPSMEN)
Kojto 107:4f6c30876dfa 2477
Kojto 107:4f6c30876dfa 2478 #define __HAL_RCC_LPTIM1_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_LPTIM1SMEN)
Kojto 107:4f6c30876dfa 2479
Kojto 107:4f6c30876dfa 2480 #define __HAL_RCC_LPUART1_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR2, RCC_APB1SMENR2_LPUART1SMEN)
Kojto 107:4f6c30876dfa 2481
Kojto 107:4f6c30876dfa 2482 #define __HAL_RCC_SWPMI1_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR2, RCC_APB1SMENR2_SWPMI1SMEN)
Kojto 107:4f6c30876dfa 2483
Kojto 107:4f6c30876dfa 2484 #define __HAL_RCC_LPTIM2_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB1SMENR2, RCC_APB1SMENR2_LPTIM2SMEN)
Kojto 107:4f6c30876dfa 2485
Kojto 107:4f6c30876dfa 2486 /**
Kojto 107:4f6c30876dfa 2487 * @}
Kojto 107:4f6c30876dfa 2488 */
Kojto 107:4f6c30876dfa 2489
Kojto 107:4f6c30876dfa 2490 /** @defgroup RCC_APB2_Clock_Sleep_Enable_Disable APB2 Peripheral Clock Sleep Enable Disable
Kojto 107:4f6c30876dfa 2491 * @brief Enable or disable the APB2 peripheral clock during Low Power (Sleep) mode.
Kojto 107:4f6c30876dfa 2492 * @note Peripheral clock gating in SLEEP mode can be used to further reduce
Kojto 107:4f6c30876dfa 2493 * power consumption.
Kojto 107:4f6c30876dfa 2494 * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
Kojto 107:4f6c30876dfa 2495 * @note By default, all peripheral clocks are enabled during SLEEP mode.
Kojto 107:4f6c30876dfa 2496 * @{
Kojto 107:4f6c30876dfa 2497 */
Kojto 107:4f6c30876dfa 2498
Kojto 107:4f6c30876dfa 2499 #define __HAL_RCC_SYSCFG_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB2SMENR, RCC_APB2SMENR_SYSCFGSMEN)
Kojto 107:4f6c30876dfa 2500
Kojto 122:f9eeca106725 2501 #if defined(SDMMC1) && defined(RCC_APB2SMENR_SDMMC1SMEN)
Kojto 107:4f6c30876dfa 2502 #define __HAL_RCC_SDMMC1_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB2SMENR, RCC_APB2SMENR_SDMMC1SMEN)
Kojto 122:f9eeca106725 2503 #endif /* SDMMC1 && RCC_APB2SMENR_SDMMC1SMEN */
Kojto 107:4f6c30876dfa 2504
Kojto 107:4f6c30876dfa 2505 #define __HAL_RCC_TIM1_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB2SMENR, RCC_APB2SMENR_TIM1SMEN)
Kojto 107:4f6c30876dfa 2506
Kojto 107:4f6c30876dfa 2507 #define __HAL_RCC_SPI1_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB2SMENR, RCC_APB2SMENR_SPI1SMEN)
Kojto 107:4f6c30876dfa 2508
Kojto 122:f9eeca106725 2509 #if defined(TIM8)
Kojto 107:4f6c30876dfa 2510 #define __HAL_RCC_TIM8_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB2SMENR, RCC_APB2SMENR_TIM8SMEN)
Kojto 122:f9eeca106725 2511 #endif /* TIM8 */
Kojto 107:4f6c30876dfa 2512
Kojto 107:4f6c30876dfa 2513 #define __HAL_RCC_USART1_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB2SMENR, RCC_APB2SMENR_USART1SMEN)
Kojto 107:4f6c30876dfa 2514
Kojto 107:4f6c30876dfa 2515 #define __HAL_RCC_TIM15_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB2SMENR, RCC_APB2SMENR_TIM15SMEN)
Kojto 107:4f6c30876dfa 2516
Kojto 107:4f6c30876dfa 2517 #define __HAL_RCC_TIM16_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB2SMENR, RCC_APB2SMENR_TIM16SMEN)
Kojto 107:4f6c30876dfa 2518
Kojto 122:f9eeca106725 2519 #if defined(TIM17)
Kojto 107:4f6c30876dfa 2520 #define __HAL_RCC_TIM17_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB2SMENR, RCC_APB2SMENR_TIM17SMEN)
Kojto 122:f9eeca106725 2521 #endif /* TIM17 */
Kojto 107:4f6c30876dfa 2522
Kojto 107:4f6c30876dfa 2523 #define __HAL_RCC_SAI1_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB2SMENR, RCC_APB2SMENR_SAI1SMEN)
Kojto 107:4f6c30876dfa 2524
Kojto 122:f9eeca106725 2525 #if defined(SAI2)
Kojto 107:4f6c30876dfa 2526 #define __HAL_RCC_SAI2_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB2SMENR, RCC_APB2SMENR_SAI2SMEN)
Kojto 122:f9eeca106725 2527 #endif /* SAI2 */
Kojto 122:f9eeca106725 2528
Kojto 122:f9eeca106725 2529 #if defined(DFSDM1_Filter0)
Kojto 122:f9eeca106725 2530 #define __HAL_RCC_DFSDM1_CLK_SLEEP_ENABLE() SET_BIT(RCC->APB2SMENR, RCC_APB2SMENR_DFSDM1SMEN)
Kojto 122:f9eeca106725 2531 #endif /* DFSDM1_Filter0 */
Kojto 122:f9eeca106725 2532
Kojto 107:4f6c30876dfa 2533
Kojto 107:4f6c30876dfa 2534 #define __HAL_RCC_SYSCFG_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB2SMENR, RCC_APB2SMENR_SYSCFGSMEN)
Kojto 107:4f6c30876dfa 2535
Kojto 122:f9eeca106725 2536 #if defined(SDMMC1) && defined(RCC_APB2SMENR_SDMMC1SMEN)
Kojto 107:4f6c30876dfa 2537 #define __HAL_RCC_SDMMC1_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB2SMENR, RCC_APB2SMENR_SDMMC1SMEN)
Kojto 122:f9eeca106725 2538 #endif /* SDMMC1 && RCC_APB2SMENR_SDMMC1SMEN */
Kojto 107:4f6c30876dfa 2539
Kojto 107:4f6c30876dfa 2540 #define __HAL_RCC_TIM1_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB2SMENR, RCC_APB2SMENR_TIM1SMEN)
Kojto 107:4f6c30876dfa 2541
Kojto 107:4f6c30876dfa 2542 #define __HAL_RCC_SPI1_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB2SMENR, RCC_APB2SMENR_SPI1SMEN)
Kojto 107:4f6c30876dfa 2543
Kojto 122:f9eeca106725 2544 #if defined(TIM8)
Kojto 107:4f6c30876dfa 2545 #define __HAL_RCC_TIM8_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB2SMENR, RCC_APB2SMENR_TIM8SMEN)
Kojto 122:f9eeca106725 2546 #endif /* TIM8 */
Kojto 107:4f6c30876dfa 2547
Kojto 107:4f6c30876dfa 2548 #define __HAL_RCC_USART1_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB2SMENR, RCC_APB2SMENR_USART1SMEN)
Kojto 107:4f6c30876dfa 2549
Kojto 107:4f6c30876dfa 2550 #define __HAL_RCC_TIM15_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB2SMENR, RCC_APB2SMENR_TIM15SMEN)
Kojto 107:4f6c30876dfa 2551
Kojto 107:4f6c30876dfa 2552 #define __HAL_RCC_TIM16_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB2SMENR, RCC_APB2SMENR_TIM16SMEN)
Kojto 107:4f6c30876dfa 2553
Kojto 122:f9eeca106725 2554 #if defined(TIM17)
Kojto 107:4f6c30876dfa 2555 #define __HAL_RCC_TIM17_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB2SMENR, RCC_APB2SMENR_TIM17SMEN)
Kojto 122:f9eeca106725 2556 #endif /* TIM17 */
Kojto 107:4f6c30876dfa 2557
Kojto 107:4f6c30876dfa 2558 #define __HAL_RCC_SAI1_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB2SMENR, RCC_APB2SMENR_SAI1SMEN)
Kojto 107:4f6c30876dfa 2559
Kojto 122:f9eeca106725 2560 #if defined(SAI2)
Kojto 107:4f6c30876dfa 2561 #define __HAL_RCC_SAI2_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB2SMENR, RCC_APB2SMENR_SAI2SMEN)
Kojto 122:f9eeca106725 2562 #endif /* SAI2 */
Kojto 122:f9eeca106725 2563
Kojto 122:f9eeca106725 2564 #if defined(DFSDM1_Filter0)
Kojto 122:f9eeca106725 2565 #define __HAL_RCC_DFSDM1_CLK_SLEEP_DISABLE() CLEAR_BIT(RCC->APB2SMENR, RCC_APB2SMENR_DFSDM1SMEN)
Kojto 122:f9eeca106725 2566 #endif /* DFSDM1_Filter0 */
Kojto 107:4f6c30876dfa 2567
Kojto 107:4f6c30876dfa 2568 /**
Kojto 107:4f6c30876dfa 2569 * @}
Kojto 107:4f6c30876dfa 2570 */
Kojto 107:4f6c30876dfa 2571
Kojto 107:4f6c30876dfa 2572 /** @defgroup RCC_AHB1_Clock_Sleep_Enable_Disable_Status AHB1 Peripheral Clock Sleep Enabled or Disabled Status
Kojto 107:4f6c30876dfa 2573 * @brief Check whether the AHB1 peripheral clock during Low Power (Sleep) mode is enabled or not.
Kojto 107:4f6c30876dfa 2574 * @note Peripheral clock gating in SLEEP mode can be used to further reduce
Kojto 107:4f6c30876dfa 2575 * power consumption.
Kojto 107:4f6c30876dfa 2576 * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
Kojto 107:4f6c30876dfa 2577 * @note By default, all peripheral clocks are enabled during SLEEP mode.
Kojto 107:4f6c30876dfa 2578 * @{
Kojto 107:4f6c30876dfa 2579 */
Kojto 107:4f6c30876dfa 2580
Kojto 107:4f6c30876dfa 2581 #define __HAL_RCC_DMA1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_DMA1SMEN) != RESET)
Kojto 107:4f6c30876dfa 2582
Kojto 107:4f6c30876dfa 2583 #define __HAL_RCC_DMA2_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_DMA2SMEN) != RESET)
Kojto 107:4f6c30876dfa 2584
Kojto 107:4f6c30876dfa 2585 #define __HAL_RCC_FLASH_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_FLASHSMEN) != RESET)
Kojto 107:4f6c30876dfa 2586
Kojto 107:4f6c30876dfa 2587 #define __HAL_RCC_SRAM1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_SRAM1SMEN) != RESET)
Kojto 107:4f6c30876dfa 2588
Kojto 107:4f6c30876dfa 2589 #define __HAL_RCC_CRC_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_CRCSMEN) != RESET)
Kojto 107:4f6c30876dfa 2590
Kojto 107:4f6c30876dfa 2591 #define __HAL_RCC_TSC_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_TSCSMEN) != RESET)
Kojto 107:4f6c30876dfa 2592
Kojto 122:f9eeca106725 2593
Kojto 107:4f6c30876dfa 2594 #define __HAL_RCC_DMA1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_DMA1SMEN) == RESET)
Kojto 107:4f6c30876dfa 2595
Kojto 107:4f6c30876dfa 2596 #define __HAL_RCC_DMA2_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_DMA2SMEN) == RESET)
Kojto 107:4f6c30876dfa 2597
Kojto 107:4f6c30876dfa 2598 #define __HAL_RCC_FLASH_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_FLASHSMEN) == RESET)
Kojto 107:4f6c30876dfa 2599
Kojto 107:4f6c30876dfa 2600 #define __HAL_RCC_SRAM1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_SRAM1SMEN) == RESET)
Kojto 107:4f6c30876dfa 2601
Kojto 107:4f6c30876dfa 2602 #define __HAL_RCC_CRC_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_CRCSMEN) == RESET)
Kojto 107:4f6c30876dfa 2603
Kojto 107:4f6c30876dfa 2604 #define __HAL_RCC_TSC_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB1SMENR, RCC_AHB1SMENR_TSCSMEN) == RESET)
Kojto 107:4f6c30876dfa 2605
Kojto 107:4f6c30876dfa 2606 /**
Kojto 107:4f6c30876dfa 2607 * @}
Kojto 107:4f6c30876dfa 2608 */
Kojto 107:4f6c30876dfa 2609
Kojto 107:4f6c30876dfa 2610 /** @defgroup RCC_AHB2_Clock_Sleep_Enable_Disable_Status AHB2 Peripheral Clock Sleep Enabled or Disabled Status
Kojto 107:4f6c30876dfa 2611 * @brief Check whether the AHB2 peripheral clock during Low Power (Sleep) mode is enabled or not.
Kojto 107:4f6c30876dfa 2612 * @note Peripheral clock gating in SLEEP mode can be used to further reduce
Kojto 107:4f6c30876dfa 2613 * power consumption.
Kojto 107:4f6c30876dfa 2614 * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
Kojto 107:4f6c30876dfa 2615 * @note By default, all peripheral clocks are enabled during SLEEP mode.
Kojto 107:4f6c30876dfa 2616 * @{
Kojto 107:4f6c30876dfa 2617 */
Kojto 107:4f6c30876dfa 2618
Kojto 107:4f6c30876dfa 2619 #define __HAL_RCC_GPIOA_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOASMEN) != RESET)
Kojto 107:4f6c30876dfa 2620
Kojto 107:4f6c30876dfa 2621 #define __HAL_RCC_GPIOB_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOBSMEN) != RESET)
Kojto 107:4f6c30876dfa 2622
Kojto 107:4f6c30876dfa 2623 #define __HAL_RCC_GPIOC_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOCSMEN) != RESET)
Kojto 107:4f6c30876dfa 2624
Kojto 122:f9eeca106725 2625 #if defined(GPIOD)
Kojto 107:4f6c30876dfa 2626 #define __HAL_RCC_GPIOD_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIODSMEN) != RESET)
Kojto 122:f9eeca106725 2627 #endif /* GPIOD */
Kojto 122:f9eeca106725 2628
Kojto 122:f9eeca106725 2629 #if defined(GPIOE)
Kojto 107:4f6c30876dfa 2630 #define __HAL_RCC_GPIOE_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOESMEN) != RESET)
Kojto 122:f9eeca106725 2631 #endif /* GPIOE */
Kojto 122:f9eeca106725 2632
Kojto 122:f9eeca106725 2633 #if defined(GPIOF)
Kojto 107:4f6c30876dfa 2634 #define __HAL_RCC_GPIOF_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOFSMEN) != RESET)
Kojto 122:f9eeca106725 2635 #endif /* GPIOF */
Kojto 122:f9eeca106725 2636
Kojto 122:f9eeca106725 2637 #if defined(GPIOG)
Kojto 107:4f6c30876dfa 2638 #define __HAL_RCC_GPIOG_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOGSMEN) != RESET)
Kojto 122:f9eeca106725 2639 #endif /* GPIOG */
Kojto 107:4f6c30876dfa 2640
Kojto 107:4f6c30876dfa 2641 #define __HAL_RCC_GPIOH_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOHSMEN) != RESET)
Kojto 107:4f6c30876dfa 2642
Kojto 107:4f6c30876dfa 2643 #define __HAL_RCC_SRAM2_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_SRAM2SMEN) != RESET)
Kojto 107:4f6c30876dfa 2644
Kojto 122:f9eeca106725 2645 #if defined(USB_OTG_FS)
Kojto 122:f9eeca106725 2646 #define __HAL_RCC_USB_OTG_FS_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_OTGFSSMEN) != RESET)
Kojto 122:f9eeca106725 2647 #endif /* USB_OTG_FS */
Kojto 122:f9eeca106725 2648
Kojto 107:4f6c30876dfa 2649 #define __HAL_RCC_ADC_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_ADCSMEN) != RESET)
Kojto 107:4f6c30876dfa 2650
Kojto 122:f9eeca106725 2651 #if defined(AES)
Kojto 122:f9eeca106725 2652 #define __HAL_RCC_AES_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_AESSMEN) != RESET)
Kojto 122:f9eeca106725 2653 #endif /* AES */
Kojto 122:f9eeca106725 2654
Kojto 107:4f6c30876dfa 2655 #define __HAL_RCC_RNG_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_RNGSMEN) != RESET)
Kojto 107:4f6c30876dfa 2656
Kojto 122:f9eeca106725 2657
Kojto 107:4f6c30876dfa 2658 #define __HAL_RCC_GPIOA_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOASMEN) == RESET)
Kojto 107:4f6c30876dfa 2659
Kojto 107:4f6c30876dfa 2660 #define __HAL_RCC_GPIOB_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOBSMEN) == RESET)
Kojto 107:4f6c30876dfa 2661
Kojto 107:4f6c30876dfa 2662 #define __HAL_RCC_GPIOC_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOCSMEN) == RESET)
Kojto 107:4f6c30876dfa 2663
Kojto 122:f9eeca106725 2664 #if defined(GPIOD)
Kojto 107:4f6c30876dfa 2665 #define __HAL_RCC_GPIOD_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIODSMEN) == RESET)
Kojto 122:f9eeca106725 2666 #endif /* GPIOD */
Kojto 122:f9eeca106725 2667
Kojto 122:f9eeca106725 2668 #if defined(GPIOE)
Kojto 107:4f6c30876dfa 2669 #define __HAL_RCC_GPIOE_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOESMEN) == RESET)
Kojto 122:f9eeca106725 2670 #endif /* GPIOE */
Kojto 122:f9eeca106725 2671
Kojto 122:f9eeca106725 2672 #if defined(GPIOF)
Kojto 107:4f6c30876dfa 2673 #define __HAL_RCC_GPIOF_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOFSMEN) == RESET)
Kojto 122:f9eeca106725 2674 #endif /* GPIOF */
Kojto 122:f9eeca106725 2675
Kojto 122:f9eeca106725 2676 #if defined(GPIOG)
Kojto 107:4f6c30876dfa 2677 #define __HAL_RCC_GPIOG_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOGSMEN) == RESET)
Kojto 122:f9eeca106725 2678 #endif /* GPIOG */
Kojto 107:4f6c30876dfa 2679
Kojto 107:4f6c30876dfa 2680 #define __HAL_RCC_GPIOH_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_GPIOHSMEN) == RESET)
Kojto 107:4f6c30876dfa 2681
Kojto 122:f9eeca106725 2682 #define __HAL_RCC_SRAM2_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_SRAM2SMEN) == RESET)
Kojto 122:f9eeca106725 2683
Kojto 122:f9eeca106725 2684 #if defined(USB_OTG_FS)
Kojto 122:f9eeca106725 2685 #define __HAL_RCC_USB_OTG_FS_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_OTGFSSMEN) == RESET)
Kojto 122:f9eeca106725 2686 #endif /* USB_OTG_FS */
Kojto 122:f9eeca106725 2687
Kojto 107:4f6c30876dfa 2688 #define __HAL_RCC_ADC_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_ADCSMEN) == RESET)
Kojto 107:4f6c30876dfa 2689
Kojto 122:f9eeca106725 2690 #if defined(AES)
Kojto 122:f9eeca106725 2691 #define __HAL_RCC_AES_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_AESSMEN) == RESET)
Kojto 122:f9eeca106725 2692 #endif /* AES */
Kojto 107:4f6c30876dfa 2693
Kojto 107:4f6c30876dfa 2694 #define __HAL_RCC_RNG_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB2SMENR, RCC_AHB2SMENR_RNGSMEN) == RESET)
Kojto 107:4f6c30876dfa 2695
Kojto 107:4f6c30876dfa 2696 /**
Kojto 107:4f6c30876dfa 2697 * @}
Kojto 107:4f6c30876dfa 2698 */
Kojto 107:4f6c30876dfa 2699
Kojto 107:4f6c30876dfa 2700 /** @defgroup RCC_AHB3_Clock_Sleep_Enable_Disable_Status AHB3 Peripheral Clock Sleep Enabled or Disabled Status
Kojto 107:4f6c30876dfa 2701 * @brief Check whether the AHB3 peripheral clock during Low Power (Sleep) mode is enabled or not.
Kojto 107:4f6c30876dfa 2702 * @note Peripheral clock gating in SLEEP mode can be used to further reduce
Kojto 107:4f6c30876dfa 2703 * power consumption.
Kojto 107:4f6c30876dfa 2704 * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
Kojto 107:4f6c30876dfa 2705 * @note By default, all peripheral clocks are enabled during SLEEP mode.
Kojto 107:4f6c30876dfa 2706 * @{
Kojto 107:4f6c30876dfa 2707 */
Kojto 107:4f6c30876dfa 2708
Kojto 122:f9eeca106725 2709 #if defined(QUADSPI)
Kojto 107:4f6c30876dfa 2710 #define __HAL_RCC_QSPI_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB3SMENR, RCC_AHB3SMENR_QSPISMEN) != RESET)
Kojto 122:f9eeca106725 2711 #endif /* QUADSPI */
Kojto 122:f9eeca106725 2712
Kojto 122:f9eeca106725 2713 #if defined(FMC_BANK1)
Kojto 107:4f6c30876dfa 2714 #define __HAL_RCC_FMC_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->AHB3SMENR, RCC_AHB3SMENR_FMCSMEN) != RESET)
Kojto 122:f9eeca106725 2715 #endif /* FMC_BANK1 */
Kojto 122:f9eeca106725 2716
Kojto 122:f9eeca106725 2717 #if defined(QUADSPI)
Kojto 107:4f6c30876dfa 2718 #define __HAL_RCC_QSPI_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB3SMENR, RCC_AHB3SMENR_QSPISMEN) == RESET)
Kojto 122:f9eeca106725 2719 #endif /* QUADSPI */
Kojto 122:f9eeca106725 2720
Kojto 122:f9eeca106725 2721 #if defined(FMC_BANK1)
Kojto 107:4f6c30876dfa 2722 #define __HAL_RCC_FMC_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->AHB3SMENR, RCC_AHB3SMENR_FMCSMEN) == RESET)
Kojto 122:f9eeca106725 2723 #endif /* FMC_BANK1 */
Kojto 107:4f6c30876dfa 2724
Kojto 107:4f6c30876dfa 2725 /**
Kojto 107:4f6c30876dfa 2726 * @}
Kojto 107:4f6c30876dfa 2727 */
Kojto 107:4f6c30876dfa 2728
Kojto 107:4f6c30876dfa 2729 /** @defgroup RCC_APB1_Clock_Sleep_Enable_Disable_Status APB1 Peripheral Clock Sleep Enabled or Disabled Status
Kojto 107:4f6c30876dfa 2730 * @brief Check whether the APB1 peripheral clock during Low Power (Sleep) mode is enabled or not.
Kojto 107:4f6c30876dfa 2731 * @note Peripheral clock gating in SLEEP mode can be used to further reduce
Kojto 107:4f6c30876dfa 2732 * power consumption.
Kojto 107:4f6c30876dfa 2733 * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
Kojto 107:4f6c30876dfa 2734 * @note By default, all peripheral clocks are enabled during SLEEP mode.
Kojto 107:4f6c30876dfa 2735 * @{
Kojto 107:4f6c30876dfa 2736 */
Kojto 107:4f6c30876dfa 2737
Kojto 107:4f6c30876dfa 2738 #define __HAL_RCC_TIM2_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_TIM2SMEN) != RESET)
Kojto 107:4f6c30876dfa 2739
Kojto 122:f9eeca106725 2740 #if defined(TIM3)
Kojto 107:4f6c30876dfa 2741 #define __HAL_RCC_TIM3_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_TIM3SMEN) != RESET)
Kojto 122:f9eeca106725 2742 #endif /* TIM3 */
Kojto 122:f9eeca106725 2743
Kojto 122:f9eeca106725 2744 #if defined(TIM4)
Kojto 107:4f6c30876dfa 2745 #define __HAL_RCC_TIM4_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_TIM4SMEN) != RESET)
Kojto 122:f9eeca106725 2746 #endif /* TIM4 */
Kojto 122:f9eeca106725 2747
Kojto 122:f9eeca106725 2748 #if defined(TIM5)
Kojto 107:4f6c30876dfa 2749 #define __HAL_RCC_TIM5_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_TIM5SMEN) != RESET)
Kojto 122:f9eeca106725 2750 #endif /* TIM5 */
Kojto 107:4f6c30876dfa 2751
Kojto 107:4f6c30876dfa 2752 #define __HAL_RCC_TIM6_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_TIM6SMEN) != RESET)
Kojto 107:4f6c30876dfa 2753
Kojto 107:4f6c30876dfa 2754 #define __HAL_RCC_TIM7_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_TIM7SMEN) != RESET)
Kojto 107:4f6c30876dfa 2755
Kojto 122:f9eeca106725 2756 #if defined(LCD)
Kojto 122:f9eeca106725 2757 #define __HAL_RCC_LCD_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_LCDSMEN) != RESET)
Kojto 122:f9eeca106725 2758 #endif /* LCD */
Kojto 122:f9eeca106725 2759
Kojto 122:f9eeca106725 2760 #if defined(RCC_APB1SMENR1_RTCAPBSMEN)
Kojto 122:f9eeca106725 2761 #define __HAL_RCC_RTCAPB_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_RTCAPBSMEN) != RESET)
Kojto 122:f9eeca106725 2762 #endif /* RCC_APB1SMENR1_RTCAPBSMEN */
Kojto 122:f9eeca106725 2763
Kojto 107:4f6c30876dfa 2764 #define __HAL_RCC_WWDG_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_WWDGSMEN) != RESET)
Kojto 107:4f6c30876dfa 2765
Kojto 122:f9eeca106725 2766 #if defined(SPI2)
Kojto 107:4f6c30876dfa 2767 #define __HAL_RCC_SPI2_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_SPI2SMEN) != RESET)
Kojto 122:f9eeca106725 2768 #endif /* SPI2 */
Kojto 107:4f6c30876dfa 2769
Kojto 107:4f6c30876dfa 2770 #define __HAL_RCC_SPI3_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_SPI3SMEN) != RESET)
Kojto 107:4f6c30876dfa 2771
Kojto 107:4f6c30876dfa 2772 #define __HAL_RCC_USART2_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_USART2SMEN) != RESET)
Kojto 107:4f6c30876dfa 2773
Kojto 122:f9eeca106725 2774 #if defined(USART3)
Kojto 107:4f6c30876dfa 2775 #define __HAL_RCC_USART3_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_USART3SMEN) != RESET)
Kojto 122:f9eeca106725 2776 #endif /* USART3 */
Kojto 122:f9eeca106725 2777
Kojto 122:f9eeca106725 2778 #if defined(UART4)
Kojto 107:4f6c30876dfa 2779 #define __HAL_RCC_UART4_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_UART4SMEN) != RESET)
Kojto 122:f9eeca106725 2780 #endif /* UART4 */
Kojto 122:f9eeca106725 2781
Kojto 122:f9eeca106725 2782 #if defined(UART5)
Kojto 107:4f6c30876dfa 2783 #define __HAL_RCC_UART5_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_UART5SMEN) != RESET)
Kojto 122:f9eeca106725 2784 #endif /* UART5 */
Kojto 107:4f6c30876dfa 2785
Kojto 107:4f6c30876dfa 2786 #define __HAL_RCC_I2C1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_I2C1SMEN) != RESET)
Kojto 107:4f6c30876dfa 2787
Kojto 122:f9eeca106725 2788 #if defined(I2C2)
Kojto 107:4f6c30876dfa 2789 #define __HAL_RCC_I2C2_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_I2C2SMEN) != RESET)
Kojto 122:f9eeca106725 2790 #endif /* I2C2 */
Kojto 107:4f6c30876dfa 2791
Kojto 107:4f6c30876dfa 2792 #define __HAL_RCC_I2C3_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_I2C3SMEN) != RESET)
Kojto 107:4f6c30876dfa 2793
Kojto 122:f9eeca106725 2794 #if defined(CRS)
Kojto 122:f9eeca106725 2795 #define __HAL_RCC_CRS_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_CRSSMEN) != RESET)
Kojto 122:f9eeca106725 2796 #endif /* CRS */
Kojto 122:f9eeca106725 2797
Kojto 107:4f6c30876dfa 2798 #define __HAL_RCC_CAN1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_CAN1SMEN) != RESET)
Kojto 107:4f6c30876dfa 2799
Kojto 122:f9eeca106725 2800 #if defined(USB)
Kojto 122:f9eeca106725 2801 #define __HAL_RCC_USB_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_USBFSSMEN) != RESET)
Kojto 122:f9eeca106725 2802 #endif /* USB */
Kojto 122:f9eeca106725 2803
Kojto 107:4f6c30876dfa 2804 #define __HAL_RCC_PWR_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_PWRSMEN) != RESET)
Kojto 107:4f6c30876dfa 2805
Kojto 107:4f6c30876dfa 2806 #define __HAL_RCC_DAC1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_DAC1SMEN) != RESET)
Kojto 107:4f6c30876dfa 2807
Kojto 107:4f6c30876dfa 2808 #define __HAL_RCC_OPAMP_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_OPAMPSMEN) != RESET)
Kojto 107:4f6c30876dfa 2809
Kojto 107:4f6c30876dfa 2810 #define __HAL_RCC_LPTIM1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_LPTIM1SMEN) != RESET)
Kojto 107:4f6c30876dfa 2811
Kojto 107:4f6c30876dfa 2812 #define __HAL_RCC_LPUART1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR2, RCC_APB1SMENR2_LPUART1SMEN) != RESET)
Kojto 107:4f6c30876dfa 2813
Kojto 107:4f6c30876dfa 2814 #define __HAL_RCC_SWPMI1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR2, RCC_APB1SMENR2_SWPMI1SMEN) != RESET)
Kojto 107:4f6c30876dfa 2815
Kojto 107:4f6c30876dfa 2816 #define __HAL_RCC_LPTIM2_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB1SMENR2, RCC_APB1SMENR2_LPTIM2SMEN) != RESET)
Kojto 107:4f6c30876dfa 2817
Kojto 122:f9eeca106725 2818
Kojto 107:4f6c30876dfa 2819 #define __HAL_RCC_TIM2_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_TIM2SMEN) == RESET)
Kojto 107:4f6c30876dfa 2820
Kojto 122:f9eeca106725 2821 #if defined(TIM3)
Kojto 107:4f6c30876dfa 2822 #define __HAL_RCC_TIM3_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_TIM3SMEN) == RESET)
Kojto 122:f9eeca106725 2823 #endif /* TIM3 */
Kojto 122:f9eeca106725 2824
Kojto 122:f9eeca106725 2825 #if defined(TIM4)
Kojto 107:4f6c30876dfa 2826 #define __HAL_RCC_TIM4_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_TIM4SMEN) == RESET)
Kojto 122:f9eeca106725 2827 #endif /* TIM4 */
Kojto 122:f9eeca106725 2828
Kojto 122:f9eeca106725 2829 #if defined(TIM5)
Kojto 107:4f6c30876dfa 2830 #define __HAL_RCC_TIM5_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_TIM5SMEN) == RESET)
Kojto 122:f9eeca106725 2831 #endif /* TIM5 */
Kojto 107:4f6c30876dfa 2832
Kojto 107:4f6c30876dfa 2833 #define __HAL_RCC_TIM6_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_TIM6SMEN) == RESET)
Kojto 107:4f6c30876dfa 2834
Kojto 107:4f6c30876dfa 2835 #define __HAL_RCC_TIM7_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_TIM7SMEN) == RESET)
Kojto 107:4f6c30876dfa 2836
Kojto 122:f9eeca106725 2837 #if defined(LCD)
Kojto 122:f9eeca106725 2838 #define __HAL_RCC_LCD_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_LCDSMEN) == RESET)
Kojto 122:f9eeca106725 2839 #endif /* LCD */
Kojto 122:f9eeca106725 2840
Kojto 122:f9eeca106725 2841 #if defined(RCC_APB1SMENR1_RTCAPBSMEN)
Kojto 122:f9eeca106725 2842 #define __HAL_RCC_RTCAPB_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_RTCAPBSMEN) == RESET)
Kojto 122:f9eeca106725 2843 #endif /* RCC_APB1SMENR1_RTCAPBSMEN */
Kojto 122:f9eeca106725 2844
Kojto 107:4f6c30876dfa 2845 #define __HAL_RCC_WWDG_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_WWDGSMEN) == RESET)
Kojto 107:4f6c30876dfa 2846
Kojto 122:f9eeca106725 2847 #if defined(SPI2)
Kojto 107:4f6c30876dfa 2848 #define __HAL_RCC_SPI2_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_SPI2SMEN) == RESET)
Kojto 122:f9eeca106725 2849 #endif /* SPI2 */
Kojto 107:4f6c30876dfa 2850
Kojto 107:4f6c30876dfa 2851 #define __HAL_RCC_SPI3_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_SPI3SMEN) == RESET)
Kojto 107:4f6c30876dfa 2852
Kojto 107:4f6c30876dfa 2853 #define __HAL_RCC_USART2_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_USART2SMEN) == RESET)
Kojto 107:4f6c30876dfa 2854
Kojto 122:f9eeca106725 2855 #if defined(USART3)
Kojto 107:4f6c30876dfa 2856 #define __HAL_RCC_USART3_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_USART3SMEN) == RESET)
Kojto 122:f9eeca106725 2857 #endif /* USART3 */
Kojto 122:f9eeca106725 2858
Kojto 122:f9eeca106725 2859 #if defined(UART4)
Kojto 107:4f6c30876dfa 2860 #define __HAL_RCC_UART4_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_UART4SMEN) == RESET)
Kojto 122:f9eeca106725 2861 #endif /* UART4 */
Kojto 122:f9eeca106725 2862
Kojto 122:f9eeca106725 2863 #if defined(UART5)
Kojto 107:4f6c30876dfa 2864 #define __HAL_RCC_UART5_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_UART5SMEN) == RESET)
Kojto 122:f9eeca106725 2865 #endif /* UART5 */
Kojto 107:4f6c30876dfa 2866
Kojto 107:4f6c30876dfa 2867 #define __HAL_RCC_I2C1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_I2C1SMEN) == RESET)
Kojto 107:4f6c30876dfa 2868
Kojto 122:f9eeca106725 2869 #if defined(I2C2)
Kojto 107:4f6c30876dfa 2870 #define __HAL_RCC_I2C2_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_I2C2SMEN) == RESET)
Kojto 122:f9eeca106725 2871 #endif /* I2C2 */
Kojto 107:4f6c30876dfa 2872
Kojto 107:4f6c30876dfa 2873 #define __HAL_RCC_I2C3_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_I2C3SMEN) == RESET)
Kojto 107:4f6c30876dfa 2874
Kojto 122:f9eeca106725 2875 #if defined(CRS)
Kojto 122:f9eeca106725 2876 #define __HAL_RCC_CRS_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_CRSSMEN) == RESET)
Kojto 122:f9eeca106725 2877 #endif /* CRS */
Kojto 122:f9eeca106725 2878
Kojto 107:4f6c30876dfa 2879 #define __HAL_RCC_CAN1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_CAN1SMEN) == RESET)
Kojto 107:4f6c30876dfa 2880
Kojto 122:f9eeca106725 2881 #if defined(USB)
Kojto 122:f9eeca106725 2882 #define __HAL_RCC_USB_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_USBFSSMEN) == RESET)
Kojto 122:f9eeca106725 2883 #endif /* USB */
Kojto 122:f9eeca106725 2884
Kojto 107:4f6c30876dfa 2885 #define __HAL_RCC_PWR_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_PWRSMEN) == RESET)
Kojto 107:4f6c30876dfa 2886
Kojto 107:4f6c30876dfa 2887 #define __HAL_RCC_DAC1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_DAC1SMEN) == RESET)
Kojto 107:4f6c30876dfa 2888
Kojto 107:4f6c30876dfa 2889 #define __HAL_RCC_OPAMP_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_OPAMPSMEN) == RESET)
Kojto 107:4f6c30876dfa 2890
Kojto 107:4f6c30876dfa 2891 #define __HAL_RCC_LPTIM1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR1, RCC_APB1SMENR1_LPTIM1SMEN) == RESET)
Kojto 107:4f6c30876dfa 2892
Kojto 107:4f6c30876dfa 2893 #define __HAL_RCC_LPUART1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR2, RCC_APB1SMENR2_LPUART1SMEN) == RESET)
Kojto 107:4f6c30876dfa 2894
Kojto 107:4f6c30876dfa 2895 #define __HAL_RCC_SWPMI1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR2, RCC_APB1SMENR2_SWPMI1SMEN) == RESET)
Kojto 107:4f6c30876dfa 2896
Kojto 107:4f6c30876dfa 2897 #define __HAL_RCC_LPTIM2_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB1SMENR2, RCC_APB1SMENR2_LPTIM2SMEN) == RESET)
Kojto 107:4f6c30876dfa 2898
Kojto 107:4f6c30876dfa 2899 /**
Kojto 107:4f6c30876dfa 2900 * @}
Kojto 107:4f6c30876dfa 2901 */
Kojto 107:4f6c30876dfa 2902
Kojto 107:4f6c30876dfa 2903 /** @defgroup RCC_APB2_Clock_Sleep_Enable_Disable_Status APB2 Peripheral Clock Sleep Enabled or Disabled Status
Kojto 107:4f6c30876dfa 2904 * @brief Check whether the APB2 peripheral clock during Low Power (Sleep) mode is enabled or not.
Kojto 107:4f6c30876dfa 2905 * @note Peripheral clock gating in SLEEP mode can be used to further reduce
Kojto 107:4f6c30876dfa 2906 * power consumption.
Kojto 107:4f6c30876dfa 2907 * @note After wakeup from SLEEP mode, the peripheral clock is enabled again.
Kojto 107:4f6c30876dfa 2908 * @note By default, all peripheral clocks are enabled during SLEEP mode.
Kojto 107:4f6c30876dfa 2909 * @{
Kojto 107:4f6c30876dfa 2910 */
Kojto 107:4f6c30876dfa 2911
Kojto 107:4f6c30876dfa 2912 #define __HAL_RCC_SYSCFG_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_SYSCFGSMEN) != RESET)
Kojto 107:4f6c30876dfa 2913
Kojto 122:f9eeca106725 2914 #if defined(SDMMC1) && defined(RCC_APB2SMENR_SDMMC1SMEN)
Kojto 107:4f6c30876dfa 2915 #define __HAL_RCC_SDMMC1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_SDMMC1SMEN) != RESET)
Kojto 122:f9eeca106725 2916 #endif /* SDMMC1 && RCC_APB2SMENR_SDMMC1SMEN */
Kojto 107:4f6c30876dfa 2917
Kojto 107:4f6c30876dfa 2918 #define __HAL_RCC_TIM1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_TIM1SMEN) != RESET)
Kojto 107:4f6c30876dfa 2919
Kojto 107:4f6c30876dfa 2920 #define __HAL_RCC_SPI1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_SPI1SMEN) != RESET)
Kojto 107:4f6c30876dfa 2921
Kojto 122:f9eeca106725 2922 #if defined(TIM8)
Kojto 107:4f6c30876dfa 2923 #define __HAL_RCC_TIM8_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_TIM8SMEN) != RESET)
Kojto 122:f9eeca106725 2924 #endif /* TIM8 */
Kojto 107:4f6c30876dfa 2925
Kojto 107:4f6c30876dfa 2926 #define __HAL_RCC_USART1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_USART1SMEN) != RESET)
Kojto 107:4f6c30876dfa 2927
Kojto 107:4f6c30876dfa 2928 #define __HAL_RCC_TIM15_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_TIM15SMEN) != RESET)
Kojto 107:4f6c30876dfa 2929
Kojto 107:4f6c30876dfa 2930 #define __HAL_RCC_TIM16_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_TIM16SMEN) != RESET)
Kojto 107:4f6c30876dfa 2931
Kojto 122:f9eeca106725 2932 #if defined(TIM17)
Kojto 107:4f6c30876dfa 2933 #define __HAL_RCC_TIM17_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_TIM17SMEN) != RESET)
Kojto 122:f9eeca106725 2934 #endif /* TIM17 */
Kojto 107:4f6c30876dfa 2935
Kojto 107:4f6c30876dfa 2936 #define __HAL_RCC_SAI1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_SAI1SMEN) != RESET)
Kojto 107:4f6c30876dfa 2937
Kojto 122:f9eeca106725 2938 #if defined(SAI2)
Kojto 107:4f6c30876dfa 2939 #define __HAL_RCC_SAI2_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_SAI2SMEN) != RESET)
Kojto 122:f9eeca106725 2940 #endif /* SAI2 */
Kojto 122:f9eeca106725 2941
Kojto 122:f9eeca106725 2942 #if defined(DFSDM1_Filter0)
Kojto 122:f9eeca106725 2943 #define __HAL_RCC_DFSDM1_IS_CLK_SLEEP_ENABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_DFSDM1SMEN) != RESET)
Kojto 122:f9eeca106725 2944 #endif /* DFSDM1_Filter0 */
Kojto 122:f9eeca106725 2945
Kojto 107:4f6c30876dfa 2946
Kojto 107:4f6c30876dfa 2947 #define __HAL_RCC_SYSCFG_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_SYSCFGSMEN) == RESET)
Kojto 107:4f6c30876dfa 2948
Kojto 122:f9eeca106725 2949 #if defined(SDMMC1) && defined(RCC_APB2SMENR_SDMMC1SMEN)
Kojto 107:4f6c30876dfa 2950 #define __HAL_RCC_SDMMC1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_SDMMC1SMEN) == RESET)
Kojto 122:f9eeca106725 2951 #endif /* SDMMC1 && RCC_APB2SMENR_SDMMC1SMEN */
Kojto 107:4f6c30876dfa 2952
Kojto 107:4f6c30876dfa 2953 #define __HAL_RCC_TIM1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_TIM1SMEN) == RESET)
Kojto 107:4f6c30876dfa 2954
Kojto 107:4f6c30876dfa 2955 #define __HAL_RCC_SPI1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_SPI1SMEN) == RESET)
Kojto 107:4f6c30876dfa 2956
Kojto 122:f9eeca106725 2957 #if defined(TIM8)
Kojto 107:4f6c30876dfa 2958 #define __HAL_RCC_TIM8_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_TIM8SMEN) == RESET)
Kojto 122:f9eeca106725 2959 #endif /* TIM8 */
Kojto 107:4f6c30876dfa 2960
Kojto 107:4f6c30876dfa 2961 #define __HAL_RCC_USART1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_USART1SMEN) == RESET)
Kojto 107:4f6c30876dfa 2962
Kojto 107:4f6c30876dfa 2963 #define __HAL_RCC_TIM15_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_TIM15SMEN) == RESET)
Kojto 107:4f6c30876dfa 2964
Kojto 107:4f6c30876dfa 2965 #define __HAL_RCC_TIM16_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_TIM16SMEN) == RESET)
Kojto 107:4f6c30876dfa 2966
Kojto 122:f9eeca106725 2967 #if defined(TIM17)
Kojto 107:4f6c30876dfa 2968 #define __HAL_RCC_TIM17_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_TIM17SMEN) == RESET)
Kojto 122:f9eeca106725 2969 #endif /* TIM17 */
Kojto 107:4f6c30876dfa 2970
Kojto 107:4f6c30876dfa 2971 #define __HAL_RCC_SAI1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_SAI1SMEN) == RESET)
Kojto 107:4f6c30876dfa 2972
Kojto 122:f9eeca106725 2973 #if defined(SAI2)
Kojto 107:4f6c30876dfa 2974 #define __HAL_RCC_SAI2_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_SAI2SMEN) == RESET)
Kojto 122:f9eeca106725 2975 #endif /* SAI2 */
Kojto 122:f9eeca106725 2976
Kojto 122:f9eeca106725 2977 #if defined(DFSDM1_Filter0)
Kojto 122:f9eeca106725 2978 #define __HAL_RCC_DFSDM1_IS_CLK_SLEEP_DISABLED() (READ_BIT(RCC->APB2SMENR, RCC_APB2SMENR_DFSDM1SMEN) == RESET)
Kojto 122:f9eeca106725 2979 #endif /* DFSDM1_Filter0 */
Kojto 107:4f6c30876dfa 2980
Kojto 107:4f6c30876dfa 2981 /**
Kojto 107:4f6c30876dfa 2982 * @}
Kojto 107:4f6c30876dfa 2983 */
Kojto 107:4f6c30876dfa 2984
Kojto 107:4f6c30876dfa 2985 /** @defgroup RCC_Backup_Domain_Reset RCC Backup Domain Reset
Kojto 107:4f6c30876dfa 2986 * @{
Kojto 107:4f6c30876dfa 2987 */
Kojto 107:4f6c30876dfa 2988
Kojto 107:4f6c30876dfa 2989 /** @brief Macros to force or release the Backup domain reset.
Kojto 107:4f6c30876dfa 2990 * @note This function resets the RTC peripheral (including the backup registers)
Kojto 107:4f6c30876dfa 2991 * and the RTC clock source selection in RCC_CSR register.
Kojto 107:4f6c30876dfa 2992 * @note The BKPSRAM is not affected by this reset.
Kojto 107:4f6c30876dfa 2993 * @retval None
Kojto 107:4f6c30876dfa 2994 */
Kojto 107:4f6c30876dfa 2995 #define __HAL_RCC_BACKUPRESET_FORCE() SET_BIT(RCC->BDCR, RCC_BDCR_BDRST)
Kojto 107:4f6c30876dfa 2996
Kojto 107:4f6c30876dfa 2997 #define __HAL_RCC_BACKUPRESET_RELEASE() CLEAR_BIT(RCC->BDCR, RCC_BDCR_BDRST)
Kojto 107:4f6c30876dfa 2998
Kojto 107:4f6c30876dfa 2999 /**
Kojto 107:4f6c30876dfa 3000 * @}
Kojto 107:4f6c30876dfa 3001 */
Kojto 107:4f6c30876dfa 3002
Kojto 107:4f6c30876dfa 3003 /** @defgroup RCC_RTC_Clock_Configuration RCC RTC Clock Configuration
Kojto 107:4f6c30876dfa 3004 * @{
Kojto 107:4f6c30876dfa 3005 */
Kojto 107:4f6c30876dfa 3006
Kojto 107:4f6c30876dfa 3007 /** @brief Macros to enable or disable the RTC clock.
Kojto 107:4f6c30876dfa 3008 * @note As the RTC is in the Backup domain and write access is denied to
Kojto 107:4f6c30876dfa 3009 * this domain after reset, you have to enable write access using
Kojto 107:4f6c30876dfa 3010 * HAL_PWR_EnableBkUpAccess() function before to configure the RTC
Kojto 107:4f6c30876dfa 3011 * (to be done once after reset).
Kojto 107:4f6c30876dfa 3012 * @note These macros must be used after the RTC clock source was selected.
Kojto 107:4f6c30876dfa 3013 * @retval None
Kojto 107:4f6c30876dfa 3014 */
Kojto 107:4f6c30876dfa 3015 #define __HAL_RCC_RTC_ENABLE() SET_BIT(RCC->BDCR, RCC_BDCR_RTCEN)
Kojto 107:4f6c30876dfa 3016
Kojto 107:4f6c30876dfa 3017 #define __HAL_RCC_RTC_DISABLE() CLEAR_BIT(RCC->BDCR, RCC_BDCR_RTCEN)
Kojto 107:4f6c30876dfa 3018
Kojto 107:4f6c30876dfa 3019 /**
Kojto 107:4f6c30876dfa 3020 * @}
Kojto 107:4f6c30876dfa 3021 */
Kojto 107:4f6c30876dfa 3022
Kojto 122:f9eeca106725 3023 /** @brief Macros to enable or disable the Internal High Speed 16MHz oscillator (HSI).
Kojto 107:4f6c30876dfa 3024 * @note The HSI is stopped by hardware when entering STOP and STANDBY modes.
Kojto 107:4f6c30876dfa 3025 * It is used (enabled by hardware) as system clock source after startup
Kojto 107:4f6c30876dfa 3026 * from Reset, wakeup from STOP and STANDBY mode, or in case of failure
Kojto 107:4f6c30876dfa 3027 * of the HSE used directly or indirectly as system clock (if the Clock
Kojto 107:4f6c30876dfa 3028 * Security System CSS is enabled).
Kojto 107:4f6c30876dfa 3029 * @note HSI can not be stopped if it is used as system clock source. In this case,
Kojto 107:4f6c30876dfa 3030 * you have to select another source of the system clock then stop the HSI.
Kojto 107:4f6c30876dfa 3031 * @note After enabling the HSI, the application software should wait on HSIRDY
Kojto 107:4f6c30876dfa 3032 * flag to be set indicating that HSI clock is stable and can be used as
Kojto 107:4f6c30876dfa 3033 * system clock source.
Kojto 107:4f6c30876dfa 3034 * This parameter can be: ENABLE or DISABLE.
Kojto 107:4f6c30876dfa 3035 * @note When the HSI is stopped, HSIRDY flag goes low after 6 HSI oscillator
Kojto 107:4f6c30876dfa 3036 * clock cycles.
Kojto 107:4f6c30876dfa 3037 * @retval None
Kojto 107:4f6c30876dfa 3038 */
Kojto 107:4f6c30876dfa 3039 #define __HAL_RCC_HSI_ENABLE() SET_BIT(RCC->CR, RCC_CR_HSION)
Kojto 107:4f6c30876dfa 3040
Kojto 107:4f6c30876dfa 3041 #define __HAL_RCC_HSI_DISABLE() CLEAR_BIT(RCC->CR, RCC_CR_HSION)
Kojto 107:4f6c30876dfa 3042
Kojto 122:f9eeca106725 3043 /** @brief Macro to adjust the Internal High Speed 16MHz oscillator (HSI) calibration value.
Kojto 107:4f6c30876dfa 3044 * @note The calibration is used to compensate for the variations in voltage
Kojto 107:4f6c30876dfa 3045 * and temperature that influence the frequency of the internal HSI RC.
Kojto 107:4f6c30876dfa 3046 * @param __HSICALIBRATIONVALUE__: specifies the calibration trimming value
Kojto 107:4f6c30876dfa 3047 * (default is RCC_HSICALIBRATION_DEFAULT).
Kojto 107:4f6c30876dfa 3048 * This parameter must be a number between 0 and 31.
Kojto 107:4f6c30876dfa 3049 * @retval None
Kojto 107:4f6c30876dfa 3050 */
Kojto 107:4f6c30876dfa 3051 #define __HAL_RCC_HSI_CALIBRATIONVALUE_ADJUST(__HSICALIBRATIONVALUE__) \
Kojto 107:4f6c30876dfa 3052 MODIFY_REG(RCC->ICSCR, RCC_ICSCR_HSITRIM, (uint32_t)(__HSICALIBRATIONVALUE__) << POSITION_VAL(RCC_ICSCR_HSITRIM))
Kojto 107:4f6c30876dfa 3053
Kojto 107:4f6c30876dfa 3054 /**
Kojto 107:4f6c30876dfa 3055 * @brief Macros to enable or disable the wakeup the Internal High Speed oscillator (HSI)
Kojto 107:4f6c30876dfa 3056 * in parallel to the Internal Multi Speed oscillator (MSI) used at system wakeup.
Kojto 107:4f6c30876dfa 3057 * @note The enable of this function has not effect on the HSION bit.
Kojto 107:4f6c30876dfa 3058 * This parameter can be: ENABLE or DISABLE.
Kojto 107:4f6c30876dfa 3059 * @retval None
Kojto 107:4f6c30876dfa 3060 */
Kojto 107:4f6c30876dfa 3061 #define __HAL_RCC_HSIAUTOMATIC_START_ENABLE() SET_BIT(RCC->CR, RCC_CR_HSIASFS)
Kojto 107:4f6c30876dfa 3062
Kojto 107:4f6c30876dfa 3063 #define __HAL_RCC_HSIAUTOMATIC_START_DISABLE() CLEAR_BIT(RCC->CR, RCC_CR_HSIASFS)
Kojto 107:4f6c30876dfa 3064
Kojto 107:4f6c30876dfa 3065 /**
Kojto 107:4f6c30876dfa 3066 * @brief Macros to enable or disable the force of the Internal High Speed oscillator (HSI)
Kojto 107:4f6c30876dfa 3067 * in STOP mode to be quickly available as kernel clock for USARTs and I2Cs.
Kojto 107:4f6c30876dfa 3068 * @note Keeping the HSI ON in STOP mode allows to avoid slowing down the communication
Kojto 107:4f6c30876dfa 3069 * speed because of the HSI startup time.
Kojto 107:4f6c30876dfa 3070 * @note The enable of this function has not effect on the HSION bit.
Kojto 107:4f6c30876dfa 3071 * This parameter can be: ENABLE or DISABLE.
Kojto 107:4f6c30876dfa 3072 * @retval None
Kojto 107:4f6c30876dfa 3073 */
Kojto 107:4f6c30876dfa 3074 #define __HAL_RCC_HSISTOP_ENABLE() SET_BIT(RCC->CR, RCC_CR_HSIKERON)
Kojto 107:4f6c30876dfa 3075
Kojto 107:4f6c30876dfa 3076 #define __HAL_RCC_HSISTOP_DISABLE() CLEAR_BIT(RCC->CR, RCC_CR_HSIKERON)
Kojto 107:4f6c30876dfa 3077
Kojto 107:4f6c30876dfa 3078 /**
Kojto 107:4f6c30876dfa 3079 * @brief Macros to enable or disable the Internal Multi Speed oscillator (MSI).
Kojto 107:4f6c30876dfa 3080 * @note The MSI is stopped by hardware when entering STOP and STANDBY modes.
Kojto 107:4f6c30876dfa 3081 * It is used (enabled by hardware) as system clock source after
Kojto 107:4f6c30876dfa 3082 * startup from Reset, wakeup from STOP and STANDBY mode, or in case
Kojto 107:4f6c30876dfa 3083 * of failure of the HSE used directly or indirectly as system clock
Kojto 107:4f6c30876dfa 3084 * (if the Clock Security System CSS is enabled).
Kojto 107:4f6c30876dfa 3085 * @note MSI can not be stopped if it is used as system clock source.
Kojto 107:4f6c30876dfa 3086 * In this case, you have to select another source of the system
Kojto 107:4f6c30876dfa 3087 * clock then stop the MSI.
Kojto 107:4f6c30876dfa 3088 * @note After enabling the MSI, the application software should wait on
Kojto 107:4f6c30876dfa 3089 * MSIRDY flag to be set indicating that MSI clock is stable and can
Kojto 107:4f6c30876dfa 3090 * be used as system clock source.
Kojto 107:4f6c30876dfa 3091 * @note When the MSI is stopped, MSIRDY flag goes low after 6 MSI oscillator
Kojto 107:4f6c30876dfa 3092 * clock cycles.
Kojto 107:4f6c30876dfa 3093 * @retval None
Kojto 107:4f6c30876dfa 3094 */
Kojto 107:4f6c30876dfa 3095 #define __HAL_RCC_MSI_ENABLE() SET_BIT(RCC->CR, RCC_CR_MSION)
Kojto 107:4f6c30876dfa 3096
Kojto 107:4f6c30876dfa 3097 #define __HAL_RCC_MSI_DISABLE() CLEAR_BIT(RCC->CR, RCC_CR_MSION)
Kojto 107:4f6c30876dfa 3098
Kojto 107:4f6c30876dfa 3099 /** @brief Macro Adjusts the Internal Multi Speed oscillator (MSI) calibration value.
Kojto 107:4f6c30876dfa 3100 * @note The calibration is used to compensate for the variations in voltage
Kojto 107:4f6c30876dfa 3101 * and temperature that influence the frequency of the internal MSI RC.
Kojto 107:4f6c30876dfa 3102 * Refer to the Application Note AN3300 for more details on how to
Kojto 107:4f6c30876dfa 3103 * calibrate the MSI.
Kojto 107:4f6c30876dfa 3104 * @param __MSICALIBRATIONVALUE__: specifies the calibration trimming value
Kojto 107:4f6c30876dfa 3105 * (default is RCC_MSICALIBRATION_DEFAULT).
Kojto 107:4f6c30876dfa 3106 * This parameter must be a number between 0 and 255.
Kojto 107:4f6c30876dfa 3107 * @retval None
Kojto 107:4f6c30876dfa 3108 */
Kojto 107:4f6c30876dfa 3109 #define __HAL_RCC_MSI_CALIBRATIONVALUE_ADJUST(__MSICALIBRATIONVALUE__) \
Kojto 107:4f6c30876dfa 3110 MODIFY_REG(RCC->ICSCR, RCC_ICSCR_MSITRIM, (uint32_t)(__MSICALIBRATIONVALUE__) << 8)
Kojto 107:4f6c30876dfa 3111
Kojto 107:4f6c30876dfa 3112 /**
Kojto 107:4f6c30876dfa 3113 * @brief Macro configures the Internal Multi Speed oscillator (MSI) clock range in run mode
Kojto 107:4f6c30876dfa 3114 * @note After restart from Reset , the MSI clock is around 4 MHz.
Kojto 107:4f6c30876dfa 3115 * After stop the startup clock can be MSI (at any of its possible
Kojto 107:4f6c30876dfa 3116 * frequencies, the one that was used before entering stop mode) or HSI.
Kojto 107:4f6c30876dfa 3117 * After Standby its frequency can be selected between 4 possible values
Kojto 107:4f6c30876dfa 3118 * (1, 2, 4 or 8 MHz).
Kojto 107:4f6c30876dfa 3119 * @note MSIRANGE can be modified when MSI is OFF (MSION=0) or when MSI is ready
Kojto 107:4f6c30876dfa 3120 * (MSIRDY=1).
Kojto 107:4f6c30876dfa 3121 * @note The MSI clock range after reset can be modified on the fly.
Kojto 107:4f6c30876dfa 3122 * @param __MSIRANGEVALUE__: specifies the MSI clock range.
Kojto 107:4f6c30876dfa 3123 * This parameter must be one of the following values:
Kojto 122:f9eeca106725 3124 * @arg @ref RCC_MSIRANGE_0 MSI clock is around 100 KHz
Kojto 122:f9eeca106725 3125 * @arg @ref RCC_MSIRANGE_1 MSI clock is around 200 KHz
Kojto 122:f9eeca106725 3126 * @arg @ref RCC_MSIRANGE_2 MSI clock is around 400 KHz
Kojto 122:f9eeca106725 3127 * @arg @ref RCC_MSIRANGE_3 MSI clock is around 800 KHz
Kojto 122:f9eeca106725 3128 * @arg @ref RCC_MSIRANGE_4 MSI clock is around 1 MHz
Kojto 122:f9eeca106725 3129 * @arg @ref RCC_MSIRANGE_5 MSI clock is around 2MHz
Kojto 122:f9eeca106725 3130 * @arg @ref RCC_MSIRANGE_6 MSI clock is around 4MHz (default after Reset)
Kojto 122:f9eeca106725 3131 * @arg @ref RCC_MSIRANGE_7 MSI clock is around 8 MHz
Kojto 122:f9eeca106725 3132 * @arg @ref RCC_MSIRANGE_8 MSI clock is around 16 MHz
Kojto 122:f9eeca106725 3133 * @arg @ref RCC_MSIRANGE_9 MSI clock is around 24 MHz
Kojto 122:f9eeca106725 3134 * @arg @ref RCC_MSIRANGE_10 MSI clock is around 32 MHz
Kojto 122:f9eeca106725 3135 * @arg @ref RCC_MSIRANGE_11 MSI clock is around 48 MHz
Kojto 107:4f6c30876dfa 3136 * @retval None
Kojto 107:4f6c30876dfa 3137 */
Kojto 107:4f6c30876dfa 3138 #define __HAL_RCC_MSI_RANGE_CONFIG(__MSIRANGEVALUE__) \
Kojto 107:4f6c30876dfa 3139 do { \
Kojto 107:4f6c30876dfa 3140 SET_BIT(RCC->CR, RCC_CR_MSIRGSEL); \
Kojto 107:4f6c30876dfa 3141 MODIFY_REG(RCC->CR, RCC_CR_MSIRANGE, (__MSIRANGEVALUE__)); \
Kojto 107:4f6c30876dfa 3142 } while(0)
Kojto 107:4f6c30876dfa 3143
Kojto 107:4f6c30876dfa 3144 /**
Kojto 107:4f6c30876dfa 3145 * @brief Macro configures the Internal Multi Speed oscillator (MSI) clock range after Standby mode
Kojto 107:4f6c30876dfa 3146 * After Standby its frequency can be selected between 4 possible values (1, 2, 4 or 8 MHz).
Kojto 107:4f6c30876dfa 3147 * @param __MSIRANGEVALUE__: specifies the MSI clock range.
Kojto 107:4f6c30876dfa 3148 * This parameter must be one of the following values:
Kojto 122:f9eeca106725 3149 * @arg @ref RCC_MSIRANGE_4 MSI clock is around 1 MHz
Kojto 122:f9eeca106725 3150 * @arg @ref RCC_MSIRANGE_5 MSI clock is around 2MHz
Kojto 122:f9eeca106725 3151 * @arg @ref RCC_MSIRANGE_6 MSI clock is around 4MHz (default after Reset)
Kojto 122:f9eeca106725 3152 * @arg @ref RCC_MSIRANGE_7 MSI clock is around 8 MHz
Kojto 107:4f6c30876dfa 3153 * @retval None
Kojto 107:4f6c30876dfa 3154 */
Kojto 107:4f6c30876dfa 3155 #define __HAL_RCC_MSI_STANDBY_RANGE_CONFIG(__MSIRANGEVALUE__) \
Kojto 107:4f6c30876dfa 3156 MODIFY_REG(RCC->CSR, RCC_CSR_MSISRANGE, (__MSIRANGEVALUE__) << 4U)
Kojto 107:4f6c30876dfa 3157
Kojto 107:4f6c30876dfa 3158 /** @brief Macro to get the Internal Multi Speed oscillator (MSI) clock range in run mode
Kojto 107:4f6c30876dfa 3159 * @retval MSI clock range.
Kojto 107:4f6c30876dfa 3160 * This parameter must be one of the following values:
Kojto 122:f9eeca106725 3161 * @arg @ref RCC_MSIRANGE_0 MSI clock is around 100 KHz
Kojto 122:f9eeca106725 3162 * @arg @ref RCC_MSIRANGE_1 MSI clock is around 200 KHz
Kojto 122:f9eeca106725 3163 * @arg @ref RCC_MSIRANGE_2 MSI clock is around 400 KHz
Kojto 122:f9eeca106725 3164 * @arg @ref RCC_MSIRANGE_3 MSI clock is around 800 KHz
Kojto 122:f9eeca106725 3165 * @arg @ref RCC_MSIRANGE_4 MSI clock is around 1 MHz
Kojto 122:f9eeca106725 3166 * @arg @ref RCC_MSIRANGE_5 MSI clock is around 2MHz
Kojto 122:f9eeca106725 3167 * @arg @ref RCC_MSIRANGE_6 MSI clock is around 4MHz (default after Reset)
Kojto 122:f9eeca106725 3168 * @arg @ref RCC_MSIRANGE_7 MSI clock is around 8 MHz
Kojto 122:f9eeca106725 3169 * @arg @ref RCC_MSIRANGE_8 MSI clock is around 16 MHz
Kojto 122:f9eeca106725 3170 * @arg @ref RCC_MSIRANGE_9 MSI clock is around 24 MHz
Kojto 122:f9eeca106725 3171 * @arg @ref RCC_MSIRANGE_10 MSI clock is around 32 MHz
Kojto 122:f9eeca106725 3172 * @arg @ref RCC_MSIRANGE_11 MSI clock is around 48 MHz
Kojto 107:4f6c30876dfa 3173 */
Kojto 107:4f6c30876dfa 3174 #define __HAL_RCC_GET_MSI_RANGE() \
Kojto 107:4f6c30876dfa 3175 ((READ_BIT(RCC->CR, RCC_CR_MSIRGSEL) != RESET) ? \
Kojto 107:4f6c30876dfa 3176 (uint32_t)(READ_BIT(RCC->CR, RCC_CR_MSIRANGE)) : \
Kojto 107:4f6c30876dfa 3177 (uint32_t)(READ_BIT(RCC->CSR, RCC_CSR_MSISRANGE) >> 4))
Kojto 107:4f6c30876dfa 3178
Kojto 107:4f6c30876dfa 3179 /** @brief Macros to enable or disable the Internal Low Speed oscillator (LSI).
Kojto 107:4f6c30876dfa 3180 * @note After enabling the LSI, the application software should wait on
Kojto 107:4f6c30876dfa 3181 * LSIRDY flag to be set indicating that LSI clock is stable and can
Kojto 107:4f6c30876dfa 3182 * be used to clock the IWDG and/or the RTC.
Kojto 107:4f6c30876dfa 3183 * @note LSI can not be disabled if the IWDG is running.
Kojto 107:4f6c30876dfa 3184 * @note When the LSI is stopped, LSIRDY flag goes low after 6 LSI oscillator
Kojto 107:4f6c30876dfa 3185 * clock cycles.
Kojto 107:4f6c30876dfa 3186 * @retval None
Kojto 107:4f6c30876dfa 3187 */
Kojto 107:4f6c30876dfa 3188 #define __HAL_RCC_LSI_ENABLE() SET_BIT(RCC->CSR, RCC_CSR_LSION)
Kojto 107:4f6c30876dfa 3189
Kojto 107:4f6c30876dfa 3190 #define __HAL_RCC_LSI_DISABLE() CLEAR_BIT(RCC->CSR, RCC_CSR_LSION)
Kojto 107:4f6c30876dfa 3191
Kojto 107:4f6c30876dfa 3192 /**
Kojto 107:4f6c30876dfa 3193 * @brief Macro to configure the External High Speed oscillator (HSE).
Kojto 107:4f6c30876dfa 3194 * @note Transition HSE Bypass to HSE On and HSE On to HSE Bypass are not
Kojto 107:4f6c30876dfa 3195 * supported by this macro. User should request a transition to HSE Off
Kojto 107:4f6c30876dfa 3196 * first and then HSE On or HSE Bypass.
Kojto 107:4f6c30876dfa 3197 * @note After enabling the HSE (RCC_HSE_ON or RCC_HSE_Bypass), the application
Kojto 107:4f6c30876dfa 3198 * software should wait on HSERDY flag to be set indicating that HSE clock
Kojto 107:4f6c30876dfa 3199 * is stable and can be used to clock the PLL and/or system clock.
Kojto 107:4f6c30876dfa 3200 * @note HSE state can not be changed if it is used directly or through the
Kojto 107:4f6c30876dfa 3201 * PLL as system clock. In this case, you have to select another source
Kojto 107:4f6c30876dfa 3202 * of the system clock then change the HSE state (ex. disable it).
Kojto 107:4f6c30876dfa 3203 * @note The HSE is stopped by hardware when entering STOP and STANDBY modes.
Kojto 107:4f6c30876dfa 3204 * @note This function reset the CSSON bit, so if the clock security system(CSS)
Kojto 107:4f6c30876dfa 3205 * was previously enabled you have to enable it again after calling this
Kojto 107:4f6c30876dfa 3206 * function.
Kojto 107:4f6c30876dfa 3207 * @param __STATE__: specifies the new state of the HSE.
Kojto 107:4f6c30876dfa 3208 * This parameter can be one of the following values:
Kojto 122:f9eeca106725 3209 * @arg @ref RCC_HSE_OFF Turn OFF the HSE oscillator, HSERDY flag goes low after
Kojto 107:4f6c30876dfa 3210 * 6 HSE oscillator clock cycles.
Kojto 122:f9eeca106725 3211 * @arg @ref RCC_HSE_ON Turn ON the HSE oscillator.
Kojto 122:f9eeca106725 3212 * @arg @ref RCC_HSE_BYPASS HSE oscillator bypassed with external clock.
Kojto 107:4f6c30876dfa 3213 * @retval None
Kojto 107:4f6c30876dfa 3214 */
Kojto 107:4f6c30876dfa 3215 #define __HAL_RCC_HSE_CONFIG(__STATE__) \
Kojto 107:4f6c30876dfa 3216 do { \
Kojto 107:4f6c30876dfa 3217 if((__STATE__) == RCC_HSE_ON) \
Kojto 107:4f6c30876dfa 3218 { \
Kojto 107:4f6c30876dfa 3219 SET_BIT(RCC->CR, RCC_CR_HSEON); \
Kojto 107:4f6c30876dfa 3220 } \
Kojto 107:4f6c30876dfa 3221 else if((__STATE__) == RCC_HSE_BYPASS) \
Kojto 107:4f6c30876dfa 3222 { \
Kojto 107:4f6c30876dfa 3223 SET_BIT(RCC->CR, RCC_CR_HSEBYP); \
Kojto 107:4f6c30876dfa 3224 SET_BIT(RCC->CR, RCC_CR_HSEON); \
Kojto 107:4f6c30876dfa 3225 } \
Kojto 107:4f6c30876dfa 3226 else \
Kojto 107:4f6c30876dfa 3227 { \
Kojto 107:4f6c30876dfa 3228 CLEAR_BIT(RCC->CR, RCC_CR_HSEON); \
Kojto 107:4f6c30876dfa 3229 CLEAR_BIT(RCC->CR, RCC_CR_HSEBYP); \
Kojto 107:4f6c30876dfa 3230 } \
Kojto 107:4f6c30876dfa 3231 } while(0)
Kojto 107:4f6c30876dfa 3232
Kojto 107:4f6c30876dfa 3233 /**
Kojto 107:4f6c30876dfa 3234 * @brief Macro to configure the External Low Speed oscillator (LSE).
Kojto 107:4f6c30876dfa 3235 * @note Transitions LSE Bypass to LSE On and LSE On to LSE Bypass are not
Kojto 107:4f6c30876dfa 3236 * supported by this macro. User should request a transition to LSE Off
Kojto 107:4f6c30876dfa 3237 * first and then LSE On or LSE Bypass.
Kojto 107:4f6c30876dfa 3238 * @note As the LSE is in the Backup domain and write access is denied to
Kojto 107:4f6c30876dfa 3239 * this domain after reset, you have to enable write access using
Kojto 107:4f6c30876dfa 3240 * HAL_PWR_EnableBkUpAccess() function before to configure the LSE
Kojto 107:4f6c30876dfa 3241 * (to be done once after reset).
Kojto 107:4f6c30876dfa 3242 * @note After enabling the LSE (RCC_LSE_ON or RCC_LSE_BYPASS), the application
Kojto 107:4f6c30876dfa 3243 * software should wait on LSERDY flag to be set indicating that LSE clock
Kojto 107:4f6c30876dfa 3244 * is stable and can be used to clock the RTC.
Kojto 107:4f6c30876dfa 3245 * @param __STATE__: specifies the new state of the LSE.
Kojto 107:4f6c30876dfa 3246 * This parameter can be one of the following values:
Kojto 122:f9eeca106725 3247 * @arg @ref RCC_LSE_OFF Turn OFF the LSE oscillator, LSERDY flag goes low after
Kojto 107:4f6c30876dfa 3248 * 6 LSE oscillator clock cycles.
Kojto 122:f9eeca106725 3249 * @arg @ref RCC_LSE_ON Turn ON the LSE oscillator.
Kojto 122:f9eeca106725 3250 * @arg @ref RCC_LSE_BYPASS LSE oscillator bypassed with external clock.
Kojto 107:4f6c30876dfa 3251 * @retval None
Kojto 107:4f6c30876dfa 3252 */
Kojto 107:4f6c30876dfa 3253 #define __HAL_RCC_LSE_CONFIG(__STATE__) \
Kojto 107:4f6c30876dfa 3254 do { \
Kojto 107:4f6c30876dfa 3255 if((__STATE__) == RCC_LSE_ON) \
Kojto 107:4f6c30876dfa 3256 { \
Kojto 107:4f6c30876dfa 3257 SET_BIT(RCC->BDCR, RCC_BDCR_LSEON); \
Kojto 107:4f6c30876dfa 3258 } \
Kojto 107:4f6c30876dfa 3259 else if((__STATE__) == RCC_LSE_BYPASS) \
Kojto 107:4f6c30876dfa 3260 { \
Kojto 107:4f6c30876dfa 3261 SET_BIT(RCC->BDCR, RCC_BDCR_LSEBYP); \
Kojto 107:4f6c30876dfa 3262 SET_BIT(RCC->BDCR, RCC_BDCR_LSEON); \
Kojto 107:4f6c30876dfa 3263 } \
Kojto 107:4f6c30876dfa 3264 else \
Kojto 107:4f6c30876dfa 3265 { \
Kojto 107:4f6c30876dfa 3266 CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEON); \
Kojto 107:4f6c30876dfa 3267 CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEBYP); \
Kojto 107:4f6c30876dfa 3268 } \
Kojto 107:4f6c30876dfa 3269 } while(0)
Kojto 107:4f6c30876dfa 3270
Kojto 122:f9eeca106725 3271 #if defined(RCC_HSI48_SUPPORT)
Kojto 122:f9eeca106725 3272
Kojto 122:f9eeca106725 3273 /** @brief Macros to enable or disable the Internal High Speed 48MHz oscillator (HSI48).
Kojto 122:f9eeca106725 3274 * @note The HSI48 is stopped by hardware when entering STOP and STANDBY modes.
Kojto 122:f9eeca106725 3275 * @note After enabling the HSI48, the application software should wait on HSI48RDY
Kojto 122:f9eeca106725 3276 * flag to be set indicating that HSI48 clock is stable.
Kojto 122:f9eeca106725 3277 * This parameter can be: ENABLE or DISABLE.
Kojto 122:f9eeca106725 3278 * @retval None
Kojto 122:f9eeca106725 3279 */
Kojto 122:f9eeca106725 3280 #define __HAL_RCC_HSI48_ENABLE() SET_BIT(RCC->CRRCR, RCC_CRRCR_HSI48ON)
Kojto 122:f9eeca106725 3281
Kojto 122:f9eeca106725 3282 #define __HAL_RCC_HSI48_DISABLE() CLEAR_BIT(RCC->CRRCR, RCC_CRRCR_HSI48ON)
Kojto 122:f9eeca106725 3283
Kojto 122:f9eeca106725 3284 #endif /* RCC_HSI48_SUPPORT */
Kojto 122:f9eeca106725 3285
Kojto 107:4f6c30876dfa 3286 /** @brief Macros to configure the RTC clock (RTCCLK).
Kojto 107:4f6c30876dfa 3287 * @note As the RTC clock configuration bits are in the Backup domain and write
Kojto 107:4f6c30876dfa 3288 * access is denied to this domain after reset, you have to enable write
Kojto 107:4f6c30876dfa 3289 * access using the Power Backup Access macro before to configure
Kojto 107:4f6c30876dfa 3290 * the RTC clock source (to be done once after reset).
Kojto 107:4f6c30876dfa 3291 * @note Once the RTC clock is configured it cannot be changed unless the
Kojto 107:4f6c30876dfa 3292 * Backup domain is reset using __HAL_RCC_BACKUPRESET_FORCE() macro, or by
Kojto 107:4f6c30876dfa 3293 * a Power On Reset (POR).
Kojto 107:4f6c30876dfa 3294 *
Kojto 107:4f6c30876dfa 3295 * @param __RTC_CLKSOURCE__: specifies the RTC clock source.
Kojto 107:4f6c30876dfa 3296 * This parameter can be one of the following values:
Kojto 122:f9eeca106725 3297 * @arg @ref RCC_RTCCLKSOURCE_NO_CLK No clock selected as RTC clock.
Kojto 122:f9eeca106725 3298 * @arg @ref RCC_RTCCLKSOURCE_LSE LSE selected as RTC clock.
Kojto 122:f9eeca106725 3299 * @arg @ref RCC_RTCCLKSOURCE_LSI LSI selected as RTC clock.
Kojto 122:f9eeca106725 3300 * @arg @ref RCC_RTCCLKSOURCE_HSE_DIV32 HSE clock divided by 32 selected
Kojto 107:4f6c30876dfa 3301 *
Kojto 107:4f6c30876dfa 3302 * @note If the LSE or LSI is used as RTC clock source, the RTC continues to
Kojto 107:4f6c30876dfa 3303 * work in STOP and STANDBY modes, and can be used as wakeup source.
Kojto 107:4f6c30876dfa 3304 * However, when the HSE clock is used as RTC clock source, the RTC
Kojto 107:4f6c30876dfa 3305 * cannot be used in STOP and STANDBY modes.
Kojto 107:4f6c30876dfa 3306 * @note The maximum input clock frequency for RTC is 1MHz (when using HSE as
Kojto 107:4f6c30876dfa 3307 * RTC clock source).
Kojto 107:4f6c30876dfa 3308 * @retval None
Kojto 107:4f6c30876dfa 3309 */
Kojto 107:4f6c30876dfa 3310 #define __HAL_RCC_RTC_CONFIG(__RTC_CLKSOURCE__) \
Kojto 107:4f6c30876dfa 3311 MODIFY_REG( RCC->BDCR, RCC_BDCR_RTCSEL, (__RTC_CLKSOURCE__))
Kojto 107:4f6c30876dfa 3312
Kojto 107:4f6c30876dfa 3313
Kojto 107:4f6c30876dfa 3314 /** @brief Macro to get the RTC clock source.
Kojto 107:4f6c30876dfa 3315 * @retval The returned value can be one of the following:
Kojto 122:f9eeca106725 3316 * @arg @ref RCC_RTCCLKSOURCE_NO_CLK No clock selected as RTC clock.
Kojto 122:f9eeca106725 3317 * @arg @ref RCC_RTCCLKSOURCE_LSE LSE selected as RTC clock.
Kojto 122:f9eeca106725 3318 * @arg @ref RCC_RTCCLKSOURCE_LSI LSI selected as RTC clock.
Kojto 122:f9eeca106725 3319 * @arg @ref RCC_RTCCLKSOURCE_HSE_DIV32 HSE clock divided by 32 selected
Kojto 107:4f6c30876dfa 3320 */
Kojto 107:4f6c30876dfa 3321 #define __HAL_RCC_GET_RTC_SOURCE() ((uint32_t)(READ_BIT(RCC->BDCR, RCC_BDCR_RTCSEL)))
Kojto 107:4f6c30876dfa 3322
Kojto 107:4f6c30876dfa 3323 /** @brief Macros to enable or disable the main PLL.
Kojto 107:4f6c30876dfa 3324 * @note After enabling the main PLL, the application software should wait on
Kojto 107:4f6c30876dfa 3325 * PLLRDY flag to be set indicating that PLL clock is stable and can
Kojto 107:4f6c30876dfa 3326 * be used as system clock source.
Kojto 107:4f6c30876dfa 3327 * @note The main PLL can not be disabled if it is used as system clock source
Kojto 107:4f6c30876dfa 3328 * @note The main PLL is disabled by hardware when entering STOP and STANDBY modes.
Kojto 107:4f6c30876dfa 3329 * @retval None
Kojto 107:4f6c30876dfa 3330 */
Kojto 107:4f6c30876dfa 3331 #define __HAL_RCC_PLL_ENABLE() SET_BIT(RCC->CR, RCC_CR_PLLON)
Kojto 107:4f6c30876dfa 3332
Kojto 107:4f6c30876dfa 3333 #define __HAL_RCC_PLL_DISABLE() CLEAR_BIT(RCC->CR, RCC_CR_PLLON)
Kojto 107:4f6c30876dfa 3334
Kojto 107:4f6c30876dfa 3335 /** @brief Macro to configure the PLL clock source.
Kojto 107:4f6c30876dfa 3336 * @note This function must be used only when the main PLL is disabled.
Kojto 107:4f6c30876dfa 3337 * @param __PLLSOURCE__: specifies the PLL entry clock source.
Kojto 107:4f6c30876dfa 3338 * This parameter can be one of the following values:
Kojto 122:f9eeca106725 3339 * @arg @ref RCC_PLLSOURCE_NONE No clock selected as PLL clock entry
Kojto 122:f9eeca106725 3340 * @arg @ref RCC_PLLSOURCE_MSI MSI oscillator clock selected as PLL clock entry
Kojto 122:f9eeca106725 3341 * @arg @ref RCC_PLLSOURCE_HSI HSI oscillator clock selected as PLL clock entry
Kojto 122:f9eeca106725 3342 * @arg @ref RCC_PLLSOURCE_HSE HSE oscillator clock selected as PLL clock entry
Kojto 107:4f6c30876dfa 3343 * @note This clock source is common for the main PLL and audio PLL (PLLSAI1 and PLLSAI2).
Kojto 107:4f6c30876dfa 3344 * @retval None
Kojto 107:4f6c30876dfa 3345 *
Kojto 107:4f6c30876dfa 3346 */
Kojto 107:4f6c30876dfa 3347 #define __HAL_RCC_PLL_PLLSOURCE_CONFIG(__PLLSOURCE__) \
Kojto 107:4f6c30876dfa 3348 MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC, (__PLLSOURCE__))
Kojto 107:4f6c30876dfa 3349
Kojto 122:f9eeca106725 3350 /** @brief Macro to configure the PLL source division factor M.
Kojto 107:4f6c30876dfa 3351 * @note This function must be used only when the main PLL is disabled.
Kojto 107:4f6c30876dfa 3352 * @param __PLLM__: specifies the division factor for PLL VCO input clock
Kojto 107:4f6c30876dfa 3353 * This parameter must be a number between Min_Data = 1 and Max_Data = 8.
Kojto 107:4f6c30876dfa 3354 * @note You have to set the PLLM parameter correctly to ensure that the VCO input
Kojto 107:4f6c30876dfa 3355 * frequency ranges from 4 to 16 MHz. It is recommended to select a frequency
Kojto 107:4f6c30876dfa 3356 * of 16 MHz to limit PLL jitter.
Kojto 107:4f6c30876dfa 3357 * @retval None
Kojto 107:4f6c30876dfa 3358 *
Kojto 107:4f6c30876dfa 3359 */
Kojto 107:4f6c30876dfa 3360 #define __HAL_RCC_PLL_PLLM_CONFIG(__PLLM__) \
Kojto 107:4f6c30876dfa 3361 MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLM, ((__PLLM__) - 1) << 4U)
Kojto 107:4f6c30876dfa 3362
Kojto 107:4f6c30876dfa 3363 /**
Kojto 107:4f6c30876dfa 3364 * @brief Macro to configure the main PLL clock source, multiplication and division factors.
Kojto 107:4f6c30876dfa 3365 * @note This function must be used only when the main PLL is disabled.
Kojto 107:4f6c30876dfa 3366 *
Kojto 107:4f6c30876dfa 3367 * @param __PLLSOURCE__: specifies the PLL entry clock source.
Kojto 107:4f6c30876dfa 3368 * This parameter can be one of the following values:
Kojto 122:f9eeca106725 3369 * @arg @ref RCC_PLLSOURCE_NONE No clock selected as PLL clock entry
Kojto 122:f9eeca106725 3370 * @arg @ref RCC_PLLSOURCE_MSI MSI oscillator clock selected as PLL clock entry
Kojto 122:f9eeca106725 3371 * @arg @ref RCC_PLLSOURCE_HSI HSI oscillator clock selected as PLL clock entry
Kojto 122:f9eeca106725 3372 * @arg @ref RCC_PLLSOURCE_HSE HSE oscillator clock selected as PLL clock entry
Kojto 107:4f6c30876dfa 3373 * @note This clock source is common for the main PLL and audio PLL (PLLSAI1 and PLLSAI2).
Kojto 107:4f6c30876dfa 3374 *
Kojto 107:4f6c30876dfa 3375 * @param __PLLM__: specifies the division factor for PLL VCO input clock.
Kojto 107:4f6c30876dfa 3376 * This parameter must be a number between 1 and 8.
Kojto 107:4f6c30876dfa 3377 * @note You have to set the PLLM parameter correctly to ensure that the VCO input
Kojto 107:4f6c30876dfa 3378 * frequency ranges from 4 to 16 MHz. It is recommended to select a frequency
Kojto 107:4f6c30876dfa 3379 * of 16 MHz to limit PLL jitter.
Kojto 107:4f6c30876dfa 3380 *
Kojto 107:4f6c30876dfa 3381 * @param __PLLN__: specifies the multiplication factor for PLL VCO output clock.
Kojto 107:4f6c30876dfa 3382 * This parameter must be a number between 8 and 86.
Kojto 107:4f6c30876dfa 3383 * @note You have to set the PLLN parameter correctly to ensure that the VCO
Kojto 107:4f6c30876dfa 3384 * output frequency is between 64 and 344 MHz.
Kojto 107:4f6c30876dfa 3385 *
Kojto 107:4f6c30876dfa 3386 * @param __PLLP__: specifies the division factor for SAI clock.
Kojto 122:f9eeca106725 3387 * This parameter must be a number in the range (7 or 17) for STM32L47x/STM32L48x
Kojto 122:f9eeca106725 3388 * else (2 to 31).
Kojto 107:4f6c30876dfa 3389 *
Kojto 107:4f6c30876dfa 3390 * @param __PLLQ__: specifies the division factor for OTG FS, SDMMC1 and RNG clocks.
Kojto 107:4f6c30876dfa 3391 * This parameter must be in the range (2, 4, 6 or 8).
Kojto 107:4f6c30876dfa 3392 * @note If the USB OTG FS is used in your application, you have to set the
Kojto 107:4f6c30876dfa 3393 * PLLQ parameter correctly to have 48 MHz clock for the USB. However,
Kojto 107:4f6c30876dfa 3394 * the SDMMC1 and RNG need a frequency lower than or equal to 48 MHz to work
Kojto 107:4f6c30876dfa 3395 * correctly.
Kojto 107:4f6c30876dfa 3396 * @param __PLLR__: specifies the division factor for the main system clock.
Kojto 107:4f6c30876dfa 3397 * @note You have to set the PLLR parameter correctly to not exceed 80MHZ.
Kojto 107:4f6c30876dfa 3398 * This parameter must be in the range (2, 4, 6 or 8).
Kojto 107:4f6c30876dfa 3399 * @retval None
Kojto 107:4f6c30876dfa 3400 */
Kojto 122:f9eeca106725 3401 #if defined(RCC_PLLP_DIV_2_31_SUPPORT)
Kojto 122:f9eeca106725 3402
Kojto 107:4f6c30876dfa 3403 #define __HAL_RCC_PLL_CONFIG(__PLLSOURCE__, __PLLM__, __PLLN__, __PLLP__, __PLLQ__,__PLLR__ ) \
Kojto 122:f9eeca106725 3404 (RCC->PLLCFGR = (uint32_t)(((__PLLM__) - 1U) << 4U) | (uint32_t)((__PLLN__) << 8U) | \
Kojto 122:f9eeca106725 3405 (uint32_t)(__PLLSOURCE__) | (uint32_t)((((__PLLQ__) >> 1U) - 1U) << 21U) | (uint32_t)((((__PLLR__) >> 1U) - 1U) << 25U) | \
Kojto 122:f9eeca106725 3406 (uint32_t)((__PLLP__) << 27U))
Kojto 122:f9eeca106725 3407
Kojto 122:f9eeca106725 3408 #else
Kojto 122:f9eeca106725 3409
Kojto 122:f9eeca106725 3410 #define __HAL_RCC_PLL_CONFIG(__PLLSOURCE__, __PLLM__, __PLLN__, __PLLP__, __PLLQ__,__PLLR__ ) \
Kojto 122:f9eeca106725 3411 (RCC->PLLCFGR = (uint32_t)(((__PLLM__) - 1U) << 4U) | (uint32_t)((__PLLN__) << 8U) | (uint32_t)(((__PLLP__) >> 4U ) << 17U) | \
Kojto 122:f9eeca106725 3412 (uint32_t)(__PLLSOURCE__) | (uint32_t)((((__PLLQ__) >> 1U) - 1U) << 21U) | (uint32_t)((((__PLLR__) >> 1U) - 1U) << 25U))
Kojto 122:f9eeca106725 3413
Kojto 122:f9eeca106725 3414 #endif /* RCC_PLLP_DIV_2_31_SUPPORT */
Kojto 107:4f6c30876dfa 3415
Kojto 107:4f6c30876dfa 3416 /** @brief Macro to get the oscillator used as PLL clock source.
Kojto 107:4f6c30876dfa 3417 * @retval The oscillator used as PLL clock source. The returned value can be one
Kojto 107:4f6c30876dfa 3418 * of the following:
Kojto 107:4f6c30876dfa 3419 * - RCC_PLLSOURCE_NONE: No oscillator is used as PLL clock source.
Kojto 107:4f6c30876dfa 3420 * - RCC_PLLSOURCE_MSI: MSI oscillator is used as PLL clock source.
Kojto 107:4f6c30876dfa 3421 * - RCC_PLLSOURCE_HSI: HSI oscillator is used as PLL clock source.
Kojto 107:4f6c30876dfa 3422 * - RCC_PLLSOURCE_HSE: HSE oscillator is used as PLL clock source.
Kojto 107:4f6c30876dfa 3423 */
Kojto 107:4f6c30876dfa 3424 #define __HAL_RCC_GET_PLL_OSCSOURCE() ((uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC))
Kojto 107:4f6c30876dfa 3425
Kojto 107:4f6c30876dfa 3426 /**
Kojto 107:4f6c30876dfa 3427 * @brief Enable or disable each clock output (RCC_PLL_SYSCLK, RCC_PLL_48M1CLK, RCC_PLL_SAI3CLK)
Kojto 107:4f6c30876dfa 3428 * @note Enabling/disabling clock outputs RCC_PLL_SAI3CLK and RCC_PLL_48M1CLK can be done at anytime
Kojto 107:4f6c30876dfa 3429 * without the need to stop the PLL in order to save power. But RCC_PLL_SYSCLK cannot
Kojto 107:4f6c30876dfa 3430 * be stopped if used as System Clock.
Kojto 107:4f6c30876dfa 3431 * @param __PLLCLOCKOUT__: specifies the PLL clock to be output.
Kojto 107:4f6c30876dfa 3432 * This parameter can be one or a combination of the following values:
Kojto 122:f9eeca106725 3433 * @arg @ref RCC_PLL_SAI3CLK This clock is used to generate an accurate clock to achieve
Kojto 107:4f6c30876dfa 3434 * high-quality audio performance on SAI interface in case.
Kojto 122:f9eeca106725 3435 * @arg @ref RCC_PLL_48M1CLK This Clock is used to generate the clock for the USB OTG FS (48 MHz),
Kojto 107:4f6c30876dfa 3436 * the random analog generator (<=48 MHz) and the SDMMC1 (<= 48 MHz).
Kojto 122:f9eeca106725 3437 * @arg @ref RCC_PLL_SYSCLK This Clock is used to generate the high speed system clock (up to 80MHz)
Kojto 107:4f6c30876dfa 3438 * @retval None
Kojto 107:4f6c30876dfa 3439 */
Kojto 107:4f6c30876dfa 3440 #define __HAL_RCC_PLLCLKOUT_ENABLE(__PLLCLOCKOUT__) SET_BIT(RCC->PLLCFGR, (__PLLCLOCKOUT__))
Kojto 107:4f6c30876dfa 3441
Kojto 107:4f6c30876dfa 3442 #define __HAL_RCC_PLLCLKOUT_DISABLE(__PLLCLOCKOUT__) CLEAR_BIT(RCC->PLLCFGR, (__PLLCLOCKOUT__))
Kojto 107:4f6c30876dfa 3443
Kojto 107:4f6c30876dfa 3444 /**
Kojto 107:4f6c30876dfa 3445 * @brief Get clock output enable status (RCC_PLL_SYSCLK, RCC_PLL_48M1CLK, RCC_PLL_SAI3CLK)
Kojto 107:4f6c30876dfa 3446 * @param __PLLCLOCKOUT__: specifies the output PLL clock to be checked.
Kojto 107:4f6c30876dfa 3447 * This parameter can be one of the following values:
Kojto 122:f9eeca106725 3448 * @arg @ref RCC_PLL_SAI3CLK This clock is used to generate an accurate clock to achieve
Kojto 107:4f6c30876dfa 3449 * high-quality audio performance on SAI interface in case.
Kojto 122:f9eeca106725 3450 * @arg @ref RCC_PLL_48M1CLK This Clock is used to generate the clock for the USB OTG FS (48 MHz),
Kojto 107:4f6c30876dfa 3451 * the random analog generator (<=48 MHz) and the SDMMC1 (<= 48 MHz).
Kojto 122:f9eeca106725 3452 * @arg @ref RCC_PLL_SYSCLK This Clock is used to generate the high speed system clock (up to 80MHz)
Kojto 107:4f6c30876dfa 3453 * @retval SET / RESET
Kojto 107:4f6c30876dfa 3454 */
Kojto 107:4f6c30876dfa 3455 #define __HAL_RCC_GET_PLLCLKOUT_CONFIG(__PLLCLOCKOUT__) READ_BIT(RCC->PLLCFGR, (__PLLCLOCKOUT__))
Kojto 107:4f6c30876dfa 3456
Kojto 107:4f6c30876dfa 3457 /**
Kojto 107:4f6c30876dfa 3458 * @brief Macro to configure the system clock source.
Kojto 107:4f6c30876dfa 3459 * @param __SYSCLKSOURCE__: specifies the system clock source.
Kojto 107:4f6c30876dfa 3460 * This parameter can be one of the following values:
Kojto 107:4f6c30876dfa 3461 * - RCC_SYSCLKSOURCE_MSI: MSI oscillator is used as system clock source.
Kojto 107:4f6c30876dfa 3462 * - RCC_SYSCLKSOURCE_HSI: HSI oscillator is used as system clock source.
Kojto 107:4f6c30876dfa 3463 * - RCC_SYSCLKSOURCE_HSE: HSE oscillator is used as system clock source.
Kojto 107:4f6c30876dfa 3464 * - RCC_SYSCLKSOURCE_PLLCLK: PLL output is used as system clock source.
Kojto 107:4f6c30876dfa 3465 * @retval None
Kojto 107:4f6c30876dfa 3466 */
Kojto 107:4f6c30876dfa 3467 #define __HAL_RCC_SYSCLK_CONFIG(__SYSCLKSOURCE__) \
Kojto 107:4f6c30876dfa 3468 MODIFY_REG(RCC->CFGR, RCC_CFGR_SW, (__SYSCLKSOURCE__))
Kojto 107:4f6c30876dfa 3469
Kojto 107:4f6c30876dfa 3470 /** @brief Macro to get the clock source used as system clock.
Kojto 107:4f6c30876dfa 3471 * @retval The clock source used as system clock. The returned value can be one
Kojto 107:4f6c30876dfa 3472 * of the following:
Kojto 107:4f6c30876dfa 3473 * - RCC_SYSCLKSOURCE_STATUS_MSI: MSI used as system clock.
Kojto 107:4f6c30876dfa 3474 * - RCC_SYSCLKSOURCE_STATUS_HSI: HSI used as system clock.
Kojto 107:4f6c30876dfa 3475 * - RCC_SYSCLKSOURCE_STATUS_HSE: HSE used as system clock.
Kojto 107:4f6c30876dfa 3476 * - RCC_SYSCLKSOURCE_STATUS_PLLCLK: PLL used as system clock.
Kojto 107:4f6c30876dfa 3477 */
Kojto 107:4f6c30876dfa 3478 #define __HAL_RCC_GET_SYSCLK_SOURCE() ((uint32_t)(RCC->CFGR & RCC_CFGR_SWS))
Kojto 107:4f6c30876dfa 3479
Kojto 107:4f6c30876dfa 3480 /**
Kojto 122:f9eeca106725 3481 * @brief Macro to configure the External Low Speed oscillator (LSE) drive capability.
Kojto 107:4f6c30876dfa 3482 * @note As the LSE is in the Backup domain and write access is denied to
Kojto 107:4f6c30876dfa 3483 * this domain after reset, you have to enable write access using
Kojto 107:4f6c30876dfa 3484 * HAL_PWR_EnableBkUpAccess() function before to configure the LSE
Kojto 107:4f6c30876dfa 3485 * (to be done once after reset).
Kojto 107:4f6c30876dfa 3486 * @param __LSEDRIVE__: specifies the new state of the LSE drive capability.
Kojto 107:4f6c30876dfa 3487 * This parameter can be one of the following values:
Kojto 122:f9eeca106725 3488 * @arg @ref RCC_LSEDRIVE_LOW LSE oscillator low drive capability.
Kojto 122:f9eeca106725 3489 * @arg @ref RCC_LSEDRIVE_MEDIUMLOW LSE oscillator medium low drive capability.
Kojto 122:f9eeca106725 3490 * @arg @ref RCC_LSEDRIVE_MEDIUMHIGH LSE oscillator medium high drive capability.
Kojto 122:f9eeca106725 3491 * @arg @ref RCC_LSEDRIVE_HIGH LSE oscillator high drive capability.
Kojto 107:4f6c30876dfa 3492 * @retval None
Kojto 107:4f6c30876dfa 3493 */
Kojto 107:4f6c30876dfa 3494 #define __HAL_RCC_LSEDRIVE_CONFIG(__LSEDRIVE__) \
Kojto 107:4f6c30876dfa 3495 MODIFY_REG(RCC->BDCR, RCC_BDCR_LSEDRV, (uint32_t)(__LSEDRIVE__))
Kojto 107:4f6c30876dfa 3496
Kojto 107:4f6c30876dfa 3497 /**
Kojto 122:f9eeca106725 3498 * @brief Macro to configure the wake up from stop clock.
Kojto 107:4f6c30876dfa 3499 * @param __STOPWUCLK__: specifies the clock source used after wake up from stop.
Kojto 107:4f6c30876dfa 3500 * This parameter can be one of the following values:
Kojto 122:f9eeca106725 3501 * @arg @ref RCC_STOP_WAKEUPCLOCK_MSI MSI selected as system clock source
Kojto 122:f9eeca106725 3502 * @arg @ref RCC_STOP_WAKEUPCLOCK_HSI HSI selected as system clock source
Kojto 107:4f6c30876dfa 3503 * @retval None
Kojto 107:4f6c30876dfa 3504 */
Kojto 107:4f6c30876dfa 3505 #define __HAL_RCC_WAKEUPSTOP_CLK_CONFIG(__STOPWUCLK__) \
Kojto 107:4f6c30876dfa 3506 MODIFY_REG(RCC->CFGR, RCC_CFGR_STOPWUCK, (__STOPWUCLK__))
Kojto 107:4f6c30876dfa 3507
Kojto 107:4f6c30876dfa 3508
Kojto 122:f9eeca106725 3509 /** @brief Macro to configure the MCO clock.
Kojto 122:f9eeca106725 3510 * @param __MCOCLKSOURCE__ specifies the MCO clock source.
Kojto 122:f9eeca106725 3511 * This parameter can be one of the following values:
Kojto 122:f9eeca106725 3512 * @arg @ref RCC_MCO1SOURCE_NOCLOCK MCO output disabled
Kojto 122:f9eeca106725 3513 * @arg @ref RCC_MCO1SOURCE_SYSCLK System clock selected as MCO source
Kojto 122:f9eeca106725 3514 * @arg @ref RCC_MCO1SOURCE_MSI MSI clock selected as MCO source
Kojto 122:f9eeca106725 3515 * @arg @ref RCC_MCO1SOURCE_HSI HSI clock selected as MCO source
Kojto 122:f9eeca106725 3516 * @arg @ref RCC_MCO1SOURCE_HSE HSE clock selected as MCO sourcee
Kojto 122:f9eeca106725 3517 * @arg @ref RCC_MCO1SOURCE_PLLCLK Main PLL clock selected as MCO source
Kojto 122:f9eeca106725 3518 * @arg @ref RCC_MCO1SOURCE_LSI LSI clock selected as MCO source
Kojto 122:f9eeca106725 3519 * @arg @ref RCC_MCO1SOURCE_LSE LSE clock selected as MCO source
Kojto 122:f9eeca106725 3520 @if STM32L443xx
Kojto 122:f9eeca106725 3521 * @arg @ref RCC_MCO1SOURCE_HSI48 HSI48 clock selected as MCO source for devices with HSI48
Kojto 122:f9eeca106725 3522 @endif
Kojto 122:f9eeca106725 3523 * @param __MCODIV__ specifies the MCO clock prescaler.
Kojto 122:f9eeca106725 3524 * This parameter can be one of the following values:
Kojto 122:f9eeca106725 3525 * @arg @ref RCC_MCODIV_1 MCO clock source is divided by 1
Kojto 122:f9eeca106725 3526 * @arg @ref RCC_MCODIV_2 MCO clock source is divided by 2
Kojto 122:f9eeca106725 3527 * @arg @ref RCC_MCODIV_4 MCO clock source is divided by 4
Kojto 122:f9eeca106725 3528 * @arg @ref RCC_MCODIV_8 MCO clock source is divided by 8
Kojto 122:f9eeca106725 3529 * @arg @ref RCC_MCODIV_16 MCO clock source is divided by 16
Kojto 122:f9eeca106725 3530 */
Kojto 122:f9eeca106725 3531 #define __HAL_RCC_MCO1_CONFIG(__MCOCLKSOURCE__, __MCODIV__) \
Kojto 122:f9eeca106725 3532 MODIFY_REG(RCC->CFGR, (RCC_CFGR_MCOSEL | RCC_CFGR_MCOPRE), ((__MCOCLKSOURCE__) | (__MCODIV__)))
Kojto 122:f9eeca106725 3533
Kojto 107:4f6c30876dfa 3534 /** @defgroup RCC_Flags_Interrupts_Management Flags Interrupts Management
Kojto 107:4f6c30876dfa 3535 * @brief macros to manage the specified RCC Flags and interrupts.
Kojto 107:4f6c30876dfa 3536 * @{
Kojto 107:4f6c30876dfa 3537 */
Kojto 107:4f6c30876dfa 3538
Kojto 107:4f6c30876dfa 3539 /** @brief Enable RCC interrupt (Perform Byte access to RCC_CIR[14:8] bits to enable
Kojto 107:4f6c30876dfa 3540 * the selected interrupts).
Kojto 107:4f6c30876dfa 3541 * @param __INTERRUPT__: specifies the RCC interrupt sources to be enabled.
Kojto 107:4f6c30876dfa 3542 * This parameter can be any combination of the following values:
Kojto 122:f9eeca106725 3543 * @arg @ref RCC_IT_LSIRDY LSI ready interrupt
Kojto 122:f9eeca106725 3544 * @arg @ref RCC_IT_LSERDY LSE ready interrupt
Kojto 122:f9eeca106725 3545 * @arg @ref RCC_IT_MSIRDY HSI ready interrupt
Kojto 122:f9eeca106725 3546 * @arg @ref RCC_IT_HSIRDY HSI ready interrupt
Kojto 122:f9eeca106725 3547 * @arg @ref RCC_IT_HSERDY HSE ready interrupt
Kojto 122:f9eeca106725 3548 * @arg @ref RCC_IT_PLLRDY Main PLL ready interrupt
Kojto 122:f9eeca106725 3549 * @arg @ref RCC_IT_PLLSAI1RDY PLLSAI1 ready interrupt
Kojto 122:f9eeca106725 3550 * @arg @ref RCC_IT_PLLSAI2RDY PLLSAI2 ready interrupt for devices with PLLSAI2
Kojto 122:f9eeca106725 3551 * @arg @ref RCC_IT_LSECSS LSE Clock security system interrupt
Kojto 122:f9eeca106725 3552 @if STM32L443xx
Kojto 122:f9eeca106725 3553 * @arg @ref RCC_IT_HSI48RDY HSI48 ready interrupt for devices with HSI48
Kojto 122:f9eeca106725 3554 @endif
Kojto 107:4f6c30876dfa 3555 * @retval None
Kojto 107:4f6c30876dfa 3556 */
Kojto 107:4f6c30876dfa 3557 #define __HAL_RCC_ENABLE_IT(__INTERRUPT__) SET_BIT(RCC->CIER, (__INTERRUPT__))
Kojto 107:4f6c30876dfa 3558
Kojto 107:4f6c30876dfa 3559 /** @brief Disable RCC interrupt (Perform Byte access to RCC_CIR[14:8] bits to disable
Kojto 107:4f6c30876dfa 3560 * the selected interrupts).
Kojto 107:4f6c30876dfa 3561 * @param __INTERRUPT__: specifies the RCC interrupt sources to be disabled.
Kojto 107:4f6c30876dfa 3562 * This parameter can be any combination of the following values:
Kojto 122:f9eeca106725 3563 * @arg @ref RCC_IT_LSIRDY LSI ready interrupt
Kojto 122:f9eeca106725 3564 * @arg @ref RCC_IT_LSERDY LSE ready interrupt
Kojto 122:f9eeca106725 3565 * @arg @ref RCC_IT_MSIRDY HSI ready interrupt
Kojto 122:f9eeca106725 3566 * @arg @ref RCC_IT_HSIRDY HSI ready interrupt
Kojto 122:f9eeca106725 3567 * @arg @ref RCC_IT_HSERDY HSE ready interrupt
Kojto 122:f9eeca106725 3568 * @arg @ref RCC_IT_PLLRDY Main PLL ready interrupt
Kojto 122:f9eeca106725 3569 * @arg @ref RCC_IT_PLLSAI1RDY PLLSAI1 ready interrupt
Kojto 122:f9eeca106725 3570 * @arg @ref RCC_IT_PLLSAI2RDY PLLSAI2 ready interrupt for devices with PLLSAI2
Kojto 122:f9eeca106725 3571 * @arg @ref RCC_IT_LSECSS LSE Clock security system interrupt
Kojto 122:f9eeca106725 3572 @if STM32L443xx
Kojto 122:f9eeca106725 3573 * @arg @ref RCC_IT_HSI48RDY HSI48 ready interrupt for devices with HSI48
Kojto 122:f9eeca106725 3574 @endif
Kojto 107:4f6c30876dfa 3575 * @retval None
Kojto 107:4f6c30876dfa 3576 */
Kojto 107:4f6c30876dfa 3577 #define __HAL_RCC_DISABLE_IT(__INTERRUPT__) CLEAR_BIT(RCC->CIER, (__INTERRUPT__))
Kojto 107:4f6c30876dfa 3578
Kojto 107:4f6c30876dfa 3579 /** @brief Clear the RCC's interrupt pending bits (Perform Byte access to RCC_CIR[23:16]
Kojto 107:4f6c30876dfa 3580 * bits to clear the selected interrupt pending bits.
Kojto 107:4f6c30876dfa 3581 * @param __INTERRUPT__: specifies the interrupt pending bit to clear.
Kojto 107:4f6c30876dfa 3582 * This parameter can be any combination of the following values:
Kojto 122:f9eeca106725 3583 * @arg @ref RCC_IT_LSIRDY LSI ready interrupt
Kojto 122:f9eeca106725 3584 * @arg @ref RCC_IT_LSERDY LSE ready interrupt
Kojto 122:f9eeca106725 3585 * @arg @ref RCC_IT_MSIRDY MSI ready interrupt
Kojto 122:f9eeca106725 3586 * @arg @ref RCC_IT_HSIRDY HSI ready interrupt
Kojto 122:f9eeca106725 3587 * @arg @ref RCC_IT_HSERDY HSE ready interrupt
Kojto 122:f9eeca106725 3588 * @arg @ref RCC_IT_PLLRDY Main PLL ready interrupt
Kojto 122:f9eeca106725 3589 * @arg @ref RCC_IT_PLLSAI1RDY PLLSAI1 ready interrupt
Kojto 122:f9eeca106725 3590 * @arg @ref RCC_IT_PLLSAI2RDY PLLSAI2 ready interrupt for devices with PLLSAI2
Kojto 122:f9eeca106725 3591 * @arg @ref RCC_IT_CSS HSE Clock security system interrupt
Kojto 122:f9eeca106725 3592 * @arg @ref RCC_IT_LSECSS LSE Clock security system interrupt
Kojto 122:f9eeca106725 3593 @if STM32L443xx
Kojto 122:f9eeca106725 3594 * @arg @ref RCC_IT_HSI48RDY HSI48 ready interrupt for devices with HSI48
Kojto 122:f9eeca106725 3595 @endif
Kojto 107:4f6c30876dfa 3596 * @retval None
Kojto 107:4f6c30876dfa 3597 */
Kojto 107:4f6c30876dfa 3598 #define __HAL_RCC_CLEAR_IT(__INTERRUPT__) (RCC->CICR = (__INTERRUPT__))
Kojto 107:4f6c30876dfa 3599
Kojto 107:4f6c30876dfa 3600 /** @brief Check whether the RCC interrupt has occurred or not.
Kojto 107:4f6c30876dfa 3601 * @param __INTERRUPT__: specifies the RCC interrupt source to check.
Kojto 107:4f6c30876dfa 3602 * This parameter can be one of the following values:
Kojto 122:f9eeca106725 3603 * @arg @ref RCC_IT_LSIRDY LSI ready interrupt
Kojto 122:f9eeca106725 3604 * @arg @ref RCC_IT_LSERDY LSE ready interrupt
Kojto 122:f9eeca106725 3605 * @arg @ref RCC_IT_MSIRDY MSI ready interrupt
Kojto 122:f9eeca106725 3606 * @arg @ref RCC_IT_HSIRDY HSI ready interrupt
Kojto 122:f9eeca106725 3607 * @arg @ref RCC_IT_HSERDY HSE ready interrupt
Kojto 122:f9eeca106725 3608 * @arg @ref RCC_IT_PLLRDY Main PLL ready interrupt
Kojto 122:f9eeca106725 3609 * @arg @ref RCC_IT_PLLSAI1RDY PLLSAI1 ready interrupt
Kojto 122:f9eeca106725 3610 * @arg @ref RCC_IT_PLLSAI2RDY PLLSAI2 ready interrupt for devices with PLLSAI2
Kojto 122:f9eeca106725 3611 * @arg @ref RCC_IT_CSS HSE Clock security system interrupt
Kojto 122:f9eeca106725 3612 * @arg @ref RCC_IT_LSECSS LSE Clock security system interrupt
Kojto 122:f9eeca106725 3613 @if STM32L443xx
Kojto 122:f9eeca106725 3614 * @arg @ref RCC_IT_HSI48RDY HSI48 ready interrupt for devices with HSI48
Kojto 122:f9eeca106725 3615 @endif
Kojto 107:4f6c30876dfa 3616 * @retval The new state of __INTERRUPT__ (TRUE or FALSE).
Kojto 107:4f6c30876dfa 3617 */
Kojto 122:f9eeca106725 3618 #define __HAL_RCC_GET_IT(__INTERRUPT__) ((RCC->CIFR & (__INTERRUPT__)) == (__INTERRUPT__))
Kojto 107:4f6c30876dfa 3619
Kojto 107:4f6c30876dfa 3620 /** @brief Set RMVF bit to clear the reset flags.
Kojto 107:4f6c30876dfa 3621 * The reset flags are: RCC_FLAG_FWRRST, RCC_FLAG_OBLRST, RCC_FLAG_PINRST, RCC_FLAG_BORRST,
Kojto 107:4f6c30876dfa 3622 * RCC_FLAG_SFTRST, RCC_FLAG_IWDGRST, RCC_FLAG_WWDGRST and RCC_FLAG_LPWRRST.
Kojto 107:4f6c30876dfa 3623 * @retval None
Kojto 107:4f6c30876dfa 3624 */
Kojto 107:4f6c30876dfa 3625 #define __HAL_RCC_CLEAR_RESET_FLAGS() (RCC->CSR |= RCC_CSR_RMVF)
Kojto 107:4f6c30876dfa 3626
Kojto 107:4f6c30876dfa 3627 /** @brief Check whether the selected RCC flag is set or not.
Kojto 107:4f6c30876dfa 3628 * @param __FLAG__: specifies the flag to check.
Kojto 107:4f6c30876dfa 3629 * This parameter can be one of the following values:
Kojto 122:f9eeca106725 3630 * @arg @ref RCC_FLAG_MSIRDY MSI oscillator clock ready
Kojto 122:f9eeca106725 3631 * @arg @ref RCC_FLAG_HSIRDY HSI oscillator clock ready
Kojto 122:f9eeca106725 3632 * @arg @ref RCC_FLAG_HSERDY HSE oscillator clock ready
Kojto 122:f9eeca106725 3633 * @arg @ref RCC_FLAG_PLLRDY Main PLL clock ready
Kojto 122:f9eeca106725 3634 * @arg @ref RCC_FLAG_PLLSAI1RDY PLLSAI1 clock ready
Kojto 122:f9eeca106725 3635 * @arg @ref RCC_FLAG_PLLSAI2RDY PLLSAI2 clock ready for devices with PLLSAI2
Kojto 122:f9eeca106725 3636 @if STM32L443xx
Kojto 122:f9eeca106725 3637 * @arg @ref RCC_FLAG_HSI48RDY HSI48 clock ready for devices with HSI48
Kojto 122:f9eeca106725 3638 @endif
Kojto 122:f9eeca106725 3639 * @arg @ref RCC_FLAG_LSERDY LSE oscillator clock ready
Kojto 122:f9eeca106725 3640 * @arg @ref RCC_FLAG_LSECSSD Clock security system failure on LSE oscillator detection
Kojto 122:f9eeca106725 3641 * @arg @ref RCC_FLAG_LSIRDY LSI oscillator clock ready
Kojto 122:f9eeca106725 3642 * @arg @ref RCC_FLAG_BORRST BOR reset
Kojto 122:f9eeca106725 3643 * @arg @ref RCC_FLAG_OBLRST OBLRST reset
Kojto 122:f9eeca106725 3644 * @arg @ref RCC_FLAG_PINRST Pin reset
Kojto 122:f9eeca106725 3645 * @arg @ref RCC_FLAG_FWRST FIREWALL reset
Kojto 122:f9eeca106725 3646 * @arg @ref RCC_FLAG_RMVF Remove reset Flag
Kojto 122:f9eeca106725 3647 * @arg @ref RCC_FLAG_SFTRST Software reset
Kojto 122:f9eeca106725 3648 * @arg @ref RCC_FLAG_IWDGRST Independent Watchdog reset
Kojto 122:f9eeca106725 3649 * @arg @ref RCC_FLAG_WWDGRST Window Watchdog reset
Kojto 122:f9eeca106725 3650 * @arg @ref RCC_FLAG_LPWRRST Low Power reset
Kojto 107:4f6c30876dfa 3651 * @retval The new state of __FLAG__ (TRUE or FALSE).
Kojto 107:4f6c30876dfa 3652 */
Kojto 122:f9eeca106725 3653 #if defined(RCC_HSI48_SUPPORT)
Kojto 122:f9eeca106725 3654 #define __HAL_RCC_GET_FLAG(__FLAG__) (((((((__FLAG__) >> 5U) == 1U) ? RCC->CR : \
Kojto 122:f9eeca106725 3655 ((((__FLAG__) >> 5U) == 4U) ? RCC->CRRCR : \
Kojto 122:f9eeca106725 3656 ((((__FLAG__) >> 5U) == 2U) ? RCC->BDCR : \
Kojto 122:f9eeca106725 3657 ((((__FLAG__) >> 5U) == 3U) ? RCC->CSR : RCC->CIFR)))) & \
Kojto 122:f9eeca106725 3658 ((uint32_t)1U << ((__FLAG__) & RCC_FLAG_MASK))) != RESET) \
Kojto 122:f9eeca106725 3659 ? 1U : 0U)
Kojto 122:f9eeca106725 3660 #else
Kojto 122:f9eeca106725 3661 #define __HAL_RCC_GET_FLAG(__FLAG__) (((((((__FLAG__) >> 5U) == 1U) ? RCC->CR : \
Kojto 122:f9eeca106725 3662 ((((__FLAG__) >> 5U) == 2U) ? RCC->BDCR : \
Kojto 122:f9eeca106725 3663 ((((__FLAG__) >> 5U) == 3U) ? RCC->CSR : RCC->CIFR))) & \
Kojto 122:f9eeca106725 3664 ((uint32_t)1 << ((__FLAG__) & RCC_FLAG_MASK))) != RESET) \
Kojto 122:f9eeca106725 3665 ? 1U : 0U)
Kojto 122:f9eeca106725 3666 #endif /* RCC_HSI48_SUPPORT */
Kojto 107:4f6c30876dfa 3667
Kojto 107:4f6c30876dfa 3668 /**
Kojto 107:4f6c30876dfa 3669 * @}
Kojto 107:4f6c30876dfa 3670 */
Kojto 107:4f6c30876dfa 3671
Kojto 107:4f6c30876dfa 3672 /**
Kojto 107:4f6c30876dfa 3673 * @}
Kojto 107:4f6c30876dfa 3674 */
Kojto 107:4f6c30876dfa 3675
Kojto 107:4f6c30876dfa 3676 /* Private constants ---------------------------------------------------------*/
Kojto 107:4f6c30876dfa 3677 /** @defgroup RCC_Private_Constants RCC Private Constants
Kojto 107:4f6c30876dfa 3678 * @{
Kojto 107:4f6c30876dfa 3679 */
Kojto 107:4f6c30876dfa 3680 /* Defines used for Flags */
Kojto 122:f9eeca106725 3681 #define CR_REG_INDEX ((uint32_t)1U)
Kojto 122:f9eeca106725 3682 #define BDCR_REG_INDEX ((uint32_t)2U)
Kojto 122:f9eeca106725 3683 #define CSR_REG_INDEX ((uint32_t)3U)
Kojto 122:f9eeca106725 3684 #if defined(RCC_HSI48_SUPPORT)
Kojto 122:f9eeca106725 3685 #define CRRCR_REG_INDEX ((uint32_t)4U)
Kojto 122:f9eeca106725 3686 #endif /* RCC_HSI48_SUPPORT */
Kojto 122:f9eeca106725 3687
Kojto 122:f9eeca106725 3688 #define RCC_FLAG_MASK ((uint32_t)0x1FU)
Kojto 107:4f6c30876dfa 3689 /**
Kojto 107:4f6c30876dfa 3690 * @}
Kojto 107:4f6c30876dfa 3691 */
Kojto 107:4f6c30876dfa 3692
Kojto 107:4f6c30876dfa 3693 /* Private macros ------------------------------------------------------------*/
Kojto 107:4f6c30876dfa 3694 /** @addtogroup RCC_Private_Macros
Kojto 107:4f6c30876dfa 3695 * @{
Kojto 107:4f6c30876dfa 3696 */
Kojto 107:4f6c30876dfa 3697
Kojto 122:f9eeca106725 3698 #if defined(RCC_HSI48_SUPPORT)
Kojto 122:f9eeca106725 3699 #define IS_RCC_OSCILLATORTYPE(__OSCILLATOR__) (((__OSCILLATOR__) == RCC_OSCILLATORTYPE_NONE) || \
Kojto 122:f9eeca106725 3700 (((__OSCILLATOR__) & RCC_OSCILLATORTYPE_HSE) == RCC_OSCILLATORTYPE_HSE) || \
Kojto 122:f9eeca106725 3701 (((__OSCILLATOR__) & RCC_OSCILLATORTYPE_HSI) == RCC_OSCILLATORTYPE_HSI) || \
Kojto 122:f9eeca106725 3702 (((__OSCILLATOR__) & RCC_OSCILLATORTYPE_HSI48) == RCC_OSCILLATORTYPE_HSI48) || \
Kojto 122:f9eeca106725 3703 (((__OSCILLATOR__) & RCC_OSCILLATORTYPE_MSI) == RCC_OSCILLATORTYPE_MSI) || \
Kojto 122:f9eeca106725 3704 (((__OSCILLATOR__) & RCC_OSCILLATORTYPE_LSI) == RCC_OSCILLATORTYPE_LSI) || \
Kojto 122:f9eeca106725 3705 (((__OSCILLATOR__) & RCC_OSCILLATORTYPE_LSE) == RCC_OSCILLATORTYPE_LSE))
Kojto 122:f9eeca106725 3706 #else
Kojto 107:4f6c30876dfa 3707 #define IS_RCC_OSCILLATORTYPE(__OSCILLATOR__) (((__OSCILLATOR__) == RCC_OSCILLATORTYPE_NONE) || \
Kojto 107:4f6c30876dfa 3708 (((__OSCILLATOR__) & RCC_OSCILLATORTYPE_HSE) == RCC_OSCILLATORTYPE_HSE) || \
Kojto 107:4f6c30876dfa 3709 (((__OSCILLATOR__) & RCC_OSCILLATORTYPE_HSI) == RCC_OSCILLATORTYPE_HSI) || \
Kojto 107:4f6c30876dfa 3710 (((__OSCILLATOR__) & RCC_OSCILLATORTYPE_MSI) == RCC_OSCILLATORTYPE_MSI) || \
Kojto 107:4f6c30876dfa 3711 (((__OSCILLATOR__) & RCC_OSCILLATORTYPE_LSI) == RCC_OSCILLATORTYPE_LSI) || \
Kojto 107:4f6c30876dfa 3712 (((__OSCILLATOR__) & RCC_OSCILLATORTYPE_LSE) == RCC_OSCILLATORTYPE_LSE))
Kojto 122:f9eeca106725 3713 #endif /* RCC_HSI48_SUPPORT */
Kojto 107:4f6c30876dfa 3714
Kojto 107:4f6c30876dfa 3715 #define IS_RCC_HSE(__HSE__) (((__HSE__) == RCC_HSE_OFF) || ((__HSE__) == RCC_HSE_ON) || \
Kojto 107:4f6c30876dfa 3716 ((__HSE__) == RCC_HSE_BYPASS))
Kojto 107:4f6c30876dfa 3717
Kojto 107:4f6c30876dfa 3718 #define IS_RCC_LSE(__LSE__) (((__LSE__) == RCC_LSE_OFF) || ((__LSE__) == RCC_LSE_ON) || \
Kojto 107:4f6c30876dfa 3719 ((__LSE__) == RCC_LSE_BYPASS))
Kojto 107:4f6c30876dfa 3720
Kojto 107:4f6c30876dfa 3721 #define IS_RCC_HSI(__HSI__) (((__HSI__) == RCC_HSI_OFF) || ((__HSI__) == RCC_HSI_ON))
Kojto 107:4f6c30876dfa 3722
Kojto 122:f9eeca106725 3723 #define IS_RCC_HSI_CALIBRATION_VALUE(__VALUE__) ((__VALUE__) <= (uint32_t)31U)
Kojto 107:4f6c30876dfa 3724
Kojto 107:4f6c30876dfa 3725 #define IS_RCC_LSI(__LSI__) (((__LSI__) == RCC_LSI_OFF) || ((__LSI__) == RCC_LSI_ON))
Kojto 107:4f6c30876dfa 3726
Kojto 107:4f6c30876dfa 3727 #define IS_RCC_MSI(__MSI__) (((__MSI__) == RCC_MSI_OFF) || ((__MSI__) == RCC_MSI_ON))
Kojto 107:4f6c30876dfa 3728
Kojto 122:f9eeca106725 3729 #define IS_RCC_MSICALIBRATION_VALUE(__VALUE__) ((__VALUE__) <= (uint32_t)255U)
Kojto 122:f9eeca106725 3730
Kojto 122:f9eeca106725 3731 #if defined(RCC_HSI48_SUPPORT)
Kojto 122:f9eeca106725 3732 #define IS_RCC_HSI48(__HSI48__) (((__HSI48__) == RCC_HSI48_OFF) || ((__HSI48__) == RCC_HSI48_ON))
Kojto 122:f9eeca106725 3733 #endif /* RCC_HSI48_SUPPORT */
Kojto 107:4f6c30876dfa 3734
Kojto 107:4f6c30876dfa 3735 #define IS_RCC_PLL(__PLL__) (((__PLL__) == RCC_PLL_NONE) ||((__PLL__) == RCC_PLL_OFF) || \
Kojto 107:4f6c30876dfa 3736 ((__PLL__) == RCC_PLL_ON))
Kojto 107:4f6c30876dfa 3737
Kojto 107:4f6c30876dfa 3738 #define IS_RCC_PLLSOURCE(__SOURCE__) (((__SOURCE__) == RCC_PLLSOURCE_NONE) || \
Kojto 107:4f6c30876dfa 3739 ((__SOURCE__) == RCC_PLLSOURCE_MSI) || \
Kojto 107:4f6c30876dfa 3740 ((__SOURCE__) == RCC_PLLSOURCE_HSI) || \
Kojto 107:4f6c30876dfa 3741 ((__SOURCE__) == RCC_PLLSOURCE_HSE))
Kojto 107:4f6c30876dfa 3742
Kojto 122:f9eeca106725 3743 #define IS_RCC_PLLM_VALUE(__VALUE__) ((1U <= (__VALUE__)) && ((__VALUE__) <= 8U))
Kojto 122:f9eeca106725 3744
Kojto 122:f9eeca106725 3745 #define IS_RCC_PLLN_VALUE(__VALUE__) ((8U <= (__VALUE__)) && ((__VALUE__) <= 86U))
Kojto 122:f9eeca106725 3746
Kojto 122:f9eeca106725 3747 #if defined(RCC_PLLP_DIV_2_31_SUPPORT)
Kojto 122:f9eeca106725 3748 #define IS_RCC_PLLP_VALUE(__VALUE__) (((__VALUE__) >= 2U) && ((__VALUE__) <= 31U))
Kojto 122:f9eeca106725 3749 #else
Kojto 122:f9eeca106725 3750 #define IS_RCC_PLLP_VALUE(__VALUE__) (((__VALUE__) == 7U) || ((__VALUE__) == 17U))
Kojto 122:f9eeca106725 3751 #endif /*RCC_PLLP_DIV_2_31_SUPPORT */
Kojto 122:f9eeca106725 3752
Kojto 122:f9eeca106725 3753 #define IS_RCC_PLLQ_VALUE(__VALUE__) (((__VALUE__) == 2U) || ((__VALUE__) == 4U) || \
Kojto 122:f9eeca106725 3754 ((__VALUE__) == 6U) || ((__VALUE__) == 8U))
Kojto 122:f9eeca106725 3755
Kojto 122:f9eeca106725 3756 #define IS_RCC_PLLR_VALUE(__VALUE__) (((__VALUE__) == 2U) || ((__VALUE__) == 4U) || \
Kojto 122:f9eeca106725 3757 ((__VALUE__) == 6U) || ((__VALUE__) == 8U))
Kojto 107:4f6c30876dfa 3758
Kojto 107:4f6c30876dfa 3759 #define IS_RCC_PLLSAI1CLOCKOUT_VALUE(__VALUE__) (((((__VALUE__) & RCC_PLLSAI1_SAI1CLK) == RCC_PLLSAI1_SAI1CLK) || \
Kojto 107:4f6c30876dfa 3760 (((__VALUE__) & RCC_PLLSAI1_48M2CLK) == RCC_PLLSAI1_48M2CLK) || \
Kojto 107:4f6c30876dfa 3761 (((__VALUE__) & RCC_PLLSAI1_ADC1CLK) == RCC_PLLSAI1_ADC1CLK)) && \
Kojto 122:f9eeca106725 3762 (((__VALUE__) & ~(RCC_PLLSAI1_SAI1CLK|RCC_PLLSAI1_48M2CLK|RCC_PLLSAI1_ADC1CLK)) == 0U))
Kojto 122:f9eeca106725 3763
Kojto 122:f9eeca106725 3764 #if defined(RCC_PLLSAI2_SUPPORT)
Kojto 122:f9eeca106725 3765 #define IS_RCC_PLLSAI2CLOCKOUT_VALUE(__VALUE__) (((((__VALUE__) & RCC_PLLSAI2_SAI2CLK) == RCC_PLLSAI2_SAI2CLK) || \
Kojto 107:4f6c30876dfa 3766 (((__VALUE__) & RCC_PLLSAI2_ADC2CLK) == RCC_PLLSAI2_ADC2CLK)) && \
Kojto 122:f9eeca106725 3767 (((__VALUE__) & ~(RCC_PLLSAI2_SAI2CLK|RCC_PLLSAI2_ADC2CLK)) == 0U))
Kojto 122:f9eeca106725 3768 #endif /* RCC_PLLSAI2_SUPPORT */
Kojto 107:4f6c30876dfa 3769
Kojto 107:4f6c30876dfa 3770 #define IS_RCC_MSI_CLOCK_RANGE(__RANGE__) (((__RANGE__) == RCC_MSIRANGE_0) || \
Kojto 107:4f6c30876dfa 3771 ((__RANGE__) == RCC_MSIRANGE_1) || \
Kojto 107:4f6c30876dfa 3772 ((__RANGE__) == RCC_MSIRANGE_2) || \
Kojto 107:4f6c30876dfa 3773 ((__RANGE__) == RCC_MSIRANGE_3) || \
Kojto 107:4f6c30876dfa 3774 ((__RANGE__) == RCC_MSIRANGE_4) || \
Kojto 107:4f6c30876dfa 3775 ((__RANGE__) == RCC_MSIRANGE_5) || \
Kojto 107:4f6c30876dfa 3776 ((__RANGE__) == RCC_MSIRANGE_6) || \
Kojto 107:4f6c30876dfa 3777 ((__RANGE__) == RCC_MSIRANGE_7) || \
Kojto 107:4f6c30876dfa 3778 ((__RANGE__) == RCC_MSIRANGE_8) || \
Kojto 107:4f6c30876dfa 3779 ((__RANGE__) == RCC_MSIRANGE_9) || \
Kojto 107:4f6c30876dfa 3780 ((__RANGE__) == RCC_MSIRANGE_10) || \
Kojto 107:4f6c30876dfa 3781 ((__RANGE__) == RCC_MSIRANGE_11))
Kojto 107:4f6c30876dfa 3782
Kojto 107:4f6c30876dfa 3783 #define IS_RCC_MSI_STANDBY_CLOCK_RANGE(__RANGE__) (((__RANGE__) == RCC_MSIRANGE_4) || \
Kojto 107:4f6c30876dfa 3784 ((__RANGE__) == RCC_MSIRANGE_5) || \
Kojto 107:4f6c30876dfa 3785 ((__RANGE__) == RCC_MSIRANGE_6) || \
Kojto 107:4f6c30876dfa 3786 ((__RANGE__) == RCC_MSIRANGE_7))
Kojto 107:4f6c30876dfa 3787
Kojto 122:f9eeca106725 3788 #define IS_RCC_CLOCKTYPE(__CLK__) ((1U <= (__CLK__)) && ((__CLK__) <= 15U))
Kojto 107:4f6c30876dfa 3789
Kojto 107:4f6c30876dfa 3790 #define IS_RCC_SYSCLKSOURCE(__SOURCE__) (((__SOURCE__) == RCC_SYSCLKSOURCE_MSI) || \
Kojto 107:4f6c30876dfa 3791 ((__SOURCE__) == RCC_SYSCLKSOURCE_HSI) || \
Kojto 107:4f6c30876dfa 3792 ((__SOURCE__) == RCC_SYSCLKSOURCE_HSE) || \
Kojto 107:4f6c30876dfa 3793 ((__SOURCE__) == RCC_SYSCLKSOURCE_PLLCLK))
Kojto 107:4f6c30876dfa 3794
Kojto 107:4f6c30876dfa 3795 #define IS_RCC_HCLK(__HCLK__) (((__HCLK__) == RCC_SYSCLK_DIV1) || ((__HCLK__) == RCC_SYSCLK_DIV2) || \
Kojto 107:4f6c30876dfa 3796 ((__HCLK__) == RCC_SYSCLK_DIV4) || ((__HCLK__) == RCC_SYSCLK_DIV8) || \
Kojto 107:4f6c30876dfa 3797 ((__HCLK__) == RCC_SYSCLK_DIV16) || ((__HCLK__) == RCC_SYSCLK_DIV64) || \
Kojto 107:4f6c30876dfa 3798 ((__HCLK__) == RCC_SYSCLK_DIV128) || ((__HCLK__) == RCC_SYSCLK_DIV256) || \
Kojto 107:4f6c30876dfa 3799 ((__HCLK__) == RCC_SYSCLK_DIV512))
Kojto 107:4f6c30876dfa 3800
Kojto 107:4f6c30876dfa 3801 #define IS_RCC_PCLK(__PCLK__) (((__PCLK__) == RCC_HCLK_DIV1) || ((__PCLK__) == RCC_HCLK_DIV2) || \
Kojto 107:4f6c30876dfa 3802 ((__PCLK__) == RCC_HCLK_DIV4) || ((__PCLK__) == RCC_HCLK_DIV8) || \
Kojto 107:4f6c30876dfa 3803 ((__PCLK__) == RCC_HCLK_DIV16))
Kojto 107:4f6c30876dfa 3804
Kojto 122:f9eeca106725 3805 #define IS_RCC_RTCCLKSOURCE(__SOURCE__) (((__SOURCE__) == RCC_RTCCLKSOURCE_NO_CLK) || \
Kojto 122:f9eeca106725 3806 ((__SOURCE__) == RCC_RTCCLKSOURCE_LSE) || \
Kojto 122:f9eeca106725 3807 ((__SOURCE__) == RCC_RTCCLKSOURCE_LSI) || \
Kojto 107:4f6c30876dfa 3808 ((__SOURCE__) == RCC_RTCCLKSOURCE_HSE_DIV32))
Kojto 107:4f6c30876dfa 3809
Kojto 107:4f6c30876dfa 3810 #define IS_RCC_MCO(__MCOX__) ((__MCOX__) == RCC_MCO1)
Kojto 107:4f6c30876dfa 3811
Kojto 122:f9eeca106725 3812 #if defined(RCC_HSI48_SUPPORT)
Kojto 122:f9eeca106725 3813 #define IS_RCC_MCO1SOURCE(__SOURCE__) (((__SOURCE__) == RCC_MCO1SOURCE_NOCLOCK) || \
Kojto 122:f9eeca106725 3814 ((__SOURCE__) == RCC_MCO1SOURCE_SYSCLK) || \
Kojto 122:f9eeca106725 3815 ((__SOURCE__) == RCC_MCO1SOURCE_MSI) || \
Kojto 122:f9eeca106725 3816 ((__SOURCE__) == RCC_MCO1SOURCE_HSI) || \
Kojto 122:f9eeca106725 3817 ((__SOURCE__) == RCC_MCO1SOURCE_HSE) || \
Kojto 122:f9eeca106725 3818 ((__SOURCE__) == RCC_MCO1SOURCE_PLLCLK) || \
Kojto 122:f9eeca106725 3819 ((__SOURCE__) == RCC_MCO1SOURCE_LSI) || \
Kojto 122:f9eeca106725 3820 ((__SOURCE__) == RCC_MCO1SOURCE_LSE) || \
Kojto 122:f9eeca106725 3821 ((__SOURCE__) == RCC_MCO1SOURCE_HSI48))
Kojto 122:f9eeca106725 3822 #else
Kojto 122:f9eeca106725 3823 #define IS_RCC_MCO1SOURCE(__SOURCE__) (((__SOURCE__) == RCC_MCO1SOURCE_NOCLOCK) || \
Kojto 122:f9eeca106725 3824 ((__SOURCE__) == RCC_MCO1SOURCE_SYSCLK) || \
Kojto 107:4f6c30876dfa 3825 ((__SOURCE__) == RCC_MCO1SOURCE_MSI) || \
Kojto 107:4f6c30876dfa 3826 ((__SOURCE__) == RCC_MCO1SOURCE_HSI) || \
Kojto 107:4f6c30876dfa 3827 ((__SOURCE__) == RCC_MCO1SOURCE_HSE) || \
Kojto 107:4f6c30876dfa 3828 ((__SOURCE__) == RCC_MCO1SOURCE_PLLCLK) || \
Kojto 107:4f6c30876dfa 3829 ((__SOURCE__) == RCC_MCO1SOURCE_LSI) || \
Kojto 107:4f6c30876dfa 3830 ((__SOURCE__) == RCC_MCO1SOURCE_LSE))
Kojto 122:f9eeca106725 3831 #endif /* RCC_HSI48_SUPPORT */
Kojto 107:4f6c30876dfa 3832
Kojto 107:4f6c30876dfa 3833 #define IS_RCC_MCODIV(__DIV__) (((__DIV__) == RCC_MCODIV_1) || ((__DIV__) == RCC_MCODIV_2) || \
Kojto 107:4f6c30876dfa 3834 ((__DIV__) == RCC_MCODIV_4) || ((__DIV__) == RCC_MCODIV_8) || \
Kojto 107:4f6c30876dfa 3835 ((__DIV__) == RCC_MCODIV_16))
Kojto 107:4f6c30876dfa 3836
Kojto 107:4f6c30876dfa 3837 #define IS_RCC_LSE_DRIVE(__DRIVE__) (((__DRIVE__) == RCC_LSEDRIVE_LOW) || \
Kojto 107:4f6c30876dfa 3838 ((__DRIVE__) == RCC_LSEDRIVE_MEDIUMLOW) || \
Kojto 107:4f6c30876dfa 3839 ((__DRIVE__) == RCC_LSEDRIVE_MEDIUMHIGH) || \
Kojto 107:4f6c30876dfa 3840 ((__DRIVE__) == RCC_LSEDRIVE_HIGH))
Kojto 107:4f6c30876dfa 3841
Kojto 107:4f6c30876dfa 3842 #define IS_RCC_STOP_WAKEUPCLOCK(__SOURCE__) (((__SOURCE__) == RCC_STOP_WAKEUPCLOCK_MSI) || \
Kojto 107:4f6c30876dfa 3843 ((__SOURCE__) == RCC_STOP_WAKEUPCLOCK_HSI))
Kojto 107:4f6c30876dfa 3844 /**
Kojto 107:4f6c30876dfa 3845 * @}
Kojto 107:4f6c30876dfa 3846 */
Kojto 107:4f6c30876dfa 3847
Kojto 107:4f6c30876dfa 3848 /* Include RCC HAL Extended module */
Kojto 107:4f6c30876dfa 3849 #include "stm32l4xx_hal_rcc_ex.h"
Kojto 107:4f6c30876dfa 3850
Kojto 107:4f6c30876dfa 3851 /* Exported functions --------------------------------------------------------*/
Kojto 107:4f6c30876dfa 3852 /** @addtogroup RCC_Exported_Functions
Kojto 107:4f6c30876dfa 3853 * @{
Kojto 107:4f6c30876dfa 3854 */
Kojto 107:4f6c30876dfa 3855
Kojto 107:4f6c30876dfa 3856
Kojto 107:4f6c30876dfa 3857 /** @addtogroup RCC_Exported_Functions_Group1
Kojto 107:4f6c30876dfa 3858 * @{
Kojto 107:4f6c30876dfa 3859 */
Kojto 107:4f6c30876dfa 3860
Kojto 107:4f6c30876dfa 3861 /* Initialization and de-initialization functions ******************************/
Kojto 107:4f6c30876dfa 3862 void HAL_RCC_DeInit(void);
Kojto 107:4f6c30876dfa 3863 HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct);
Kojto 107:4f6c30876dfa 3864 HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t FLatency);
Kojto 107:4f6c30876dfa 3865
Kojto 107:4f6c30876dfa 3866 /**
Kojto 107:4f6c30876dfa 3867 * @}
Kojto 107:4f6c30876dfa 3868 */
Kojto 107:4f6c30876dfa 3869
Kojto 107:4f6c30876dfa 3870 /** @addtogroup RCC_Exported_Functions_Group2
Kojto 107:4f6c30876dfa 3871 * @{
Kojto 107:4f6c30876dfa 3872 */
Kojto 107:4f6c30876dfa 3873
Kojto 107:4f6c30876dfa 3874 /* Peripheral Control functions ************************************************/
Kojto 107:4f6c30876dfa 3875 void HAL_RCC_MCOConfig(uint32_t RCC_MCOx, uint32_t RCC_MCOSource, uint32_t RCC_MCODiv);
Kojto 107:4f6c30876dfa 3876 void HAL_RCC_EnableCSS(void);
Kojto 107:4f6c30876dfa 3877 uint32_t HAL_RCC_GetSysClockFreq(void);
Kojto 107:4f6c30876dfa 3878 uint32_t HAL_RCC_GetHCLKFreq(void);
Kojto 107:4f6c30876dfa 3879 uint32_t HAL_RCC_GetPCLK1Freq(void);
Kojto 107:4f6c30876dfa 3880 uint32_t HAL_RCC_GetPCLK2Freq(void);
Kojto 107:4f6c30876dfa 3881 void HAL_RCC_GetOscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct);
Kojto 107:4f6c30876dfa 3882 void HAL_RCC_GetClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t *pFLatency);
Kojto 107:4f6c30876dfa 3883 /* CSS NMI IRQ handler */
Kojto 107:4f6c30876dfa 3884 void HAL_RCC_NMI_IRQHandler(void);
Kojto 107:4f6c30876dfa 3885 /* User Callbacks in non blocking mode (IT mode) */
Kojto 107:4f6c30876dfa 3886 void HAL_RCC_CSSCallback(void);
Kojto 107:4f6c30876dfa 3887
Kojto 107:4f6c30876dfa 3888 /**
Kojto 107:4f6c30876dfa 3889 * @}
Kojto 107:4f6c30876dfa 3890 */
Kojto 107:4f6c30876dfa 3891
Kojto 107:4f6c30876dfa 3892 /**
Kojto 107:4f6c30876dfa 3893 * @}
Kojto 107:4f6c30876dfa 3894 */
Kojto 107:4f6c30876dfa 3895
Kojto 107:4f6c30876dfa 3896 /**
Kojto 107:4f6c30876dfa 3897 * @}
Kojto 107:4f6c30876dfa 3898 */
Kojto 107:4f6c30876dfa 3899
Kojto 107:4f6c30876dfa 3900 /**
Kojto 107:4f6c30876dfa 3901 * @}
Kojto 107:4f6c30876dfa 3902 */
Kojto 107:4f6c30876dfa 3903
Kojto 107:4f6c30876dfa 3904 #ifdef __cplusplus
Kojto 107:4f6c30876dfa 3905 }
Kojto 107:4f6c30876dfa 3906 #endif
Kojto 107:4f6c30876dfa 3907
Kojto 107:4f6c30876dfa 3908 #endif /* __STM32L4xx_HAL_RCC_H */
Kojto 107:4f6c30876dfa 3909
Kojto 107:4f6c30876dfa 3910 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/