mbed library sources modified for open wear
Dependents: openwear-lifelogger-example
Fork of mbed-src by
targets/cmsis/TARGET_STM/TARGET_NUCLEO_F030R8/stm32f0xx_rcc.h@76:aeb1df146756, 2014-01-27 (annotated)
- Committer:
- mbed_official
- Date:
- Mon Jan 27 14:30:07 2014 +0000
- Revision:
- 76:aeb1df146756
- Child:
- 106:ced8cbb51063
Synchronized with git revision a31ec9c5f7bcb5c8a1b2eced103f6a1dfa921abd
Full URL: https://github.com/mbedmicro/mbed/commit/a31ec9c5f7bcb5c8a1b2eced103f6a1dfa921abd/
Add NUCLEO_L152RE
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 76:aeb1df146756 | 1 | /** |
mbed_official | 76:aeb1df146756 | 2 | ****************************************************************************** |
mbed_official | 76:aeb1df146756 | 3 | * @file stm32f0xx_rcc.h |
mbed_official | 76:aeb1df146756 | 4 | * @author MCD Application Team |
mbed_official | 76:aeb1df146756 | 5 | * @version V1.3.0 |
mbed_official | 76:aeb1df146756 | 6 | * @date 16-January-2014 |
mbed_official | 76:aeb1df146756 | 7 | * @brief This file contains all the functions prototypes for the RCC |
mbed_official | 76:aeb1df146756 | 8 | * firmware library. |
mbed_official | 76:aeb1df146756 | 9 | ****************************************************************************** |
mbed_official | 76:aeb1df146756 | 10 | * @attention |
mbed_official | 76:aeb1df146756 | 11 | * |
mbed_official | 76:aeb1df146756 | 12 | * <h2><center>© COPYRIGHT 2014 STMicroelectronics</center></h2> |
mbed_official | 76:aeb1df146756 | 13 | * |
mbed_official | 76:aeb1df146756 | 14 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); |
mbed_official | 76:aeb1df146756 | 15 | * You may not use this file except in compliance with the License. |
mbed_official | 76:aeb1df146756 | 16 | * You may obtain a copy of the License at: |
mbed_official | 76:aeb1df146756 | 17 | * |
mbed_official | 76:aeb1df146756 | 18 | * http://www.st.com/software_license_agreement_liberty_v2 |
mbed_official | 76:aeb1df146756 | 19 | * |
mbed_official | 76:aeb1df146756 | 20 | * Unless required by applicable law or agreed to in writing, software |
mbed_official | 76:aeb1df146756 | 21 | * distributed under the License is distributed on an "AS IS" BASIS, |
mbed_official | 76:aeb1df146756 | 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
mbed_official | 76:aeb1df146756 | 23 | * See the License for the specific language governing permissions and |
mbed_official | 76:aeb1df146756 | 24 | * limitations under the License. |
mbed_official | 76:aeb1df146756 | 25 | * |
mbed_official | 76:aeb1df146756 | 26 | ****************************************************************************** |
mbed_official | 76:aeb1df146756 | 27 | */ |
mbed_official | 76:aeb1df146756 | 28 | |
mbed_official | 76:aeb1df146756 | 29 | /* Define to prevent recursive inclusion -------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 30 | #ifndef __STM32F0XX_RCC_H |
mbed_official | 76:aeb1df146756 | 31 | #define __STM32F0XX_RCC_H |
mbed_official | 76:aeb1df146756 | 32 | |
mbed_official | 76:aeb1df146756 | 33 | #ifdef __cplusplus |
mbed_official | 76:aeb1df146756 | 34 | extern "C" { |
mbed_official | 76:aeb1df146756 | 35 | #endif |
mbed_official | 76:aeb1df146756 | 36 | |
mbed_official | 76:aeb1df146756 | 37 | /* Includes ------------------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 38 | #include "stm32f0xx.h" |
mbed_official | 76:aeb1df146756 | 39 | |
mbed_official | 76:aeb1df146756 | 40 | /** @addtogroup STM32F0xx_StdPeriph_Driver |
mbed_official | 76:aeb1df146756 | 41 | * @{ |
mbed_official | 76:aeb1df146756 | 42 | */ |
mbed_official | 76:aeb1df146756 | 43 | |
mbed_official | 76:aeb1df146756 | 44 | /** @addtogroup RCC |
mbed_official | 76:aeb1df146756 | 45 | * @{ |
mbed_official | 76:aeb1df146756 | 46 | */ |
mbed_official | 76:aeb1df146756 | 47 | |
mbed_official | 76:aeb1df146756 | 48 | /* Exported types ------------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 49 | |
mbed_official | 76:aeb1df146756 | 50 | typedef struct |
mbed_official | 76:aeb1df146756 | 51 | { |
mbed_official | 76:aeb1df146756 | 52 | uint32_t SYSCLK_Frequency; |
mbed_official | 76:aeb1df146756 | 53 | uint32_t HCLK_Frequency; |
mbed_official | 76:aeb1df146756 | 54 | uint32_t PCLK_Frequency; |
mbed_official | 76:aeb1df146756 | 55 | uint32_t ADCCLK_Frequency; |
mbed_official | 76:aeb1df146756 | 56 | uint32_t CECCLK_Frequency; |
mbed_official | 76:aeb1df146756 | 57 | uint32_t I2C1CLK_Frequency; |
mbed_official | 76:aeb1df146756 | 58 | uint32_t USART1CLK_Frequency; |
mbed_official | 76:aeb1df146756 | 59 | uint32_t USART2CLK_Frequency; /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 60 | uint32_t USBCLK_Frequency; /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 61 | }RCC_ClocksTypeDef; |
mbed_official | 76:aeb1df146756 | 62 | |
mbed_official | 76:aeb1df146756 | 63 | /* Exported constants --------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 64 | |
mbed_official | 76:aeb1df146756 | 65 | /** @defgroup RCC_Exported_Constants |
mbed_official | 76:aeb1df146756 | 66 | * @{ |
mbed_official | 76:aeb1df146756 | 67 | */ |
mbed_official | 76:aeb1df146756 | 68 | |
mbed_official | 76:aeb1df146756 | 69 | /** @defgroup RCC_HSE_configuration |
mbed_official | 76:aeb1df146756 | 70 | * @{ |
mbed_official | 76:aeb1df146756 | 71 | */ |
mbed_official | 76:aeb1df146756 | 72 | |
mbed_official | 76:aeb1df146756 | 73 | #define RCC_HSE_OFF ((uint8_t)0x00) |
mbed_official | 76:aeb1df146756 | 74 | #define RCC_HSE_ON ((uint8_t)0x01) |
mbed_official | 76:aeb1df146756 | 75 | #define RCC_HSE_Bypass ((uint8_t)0x05) |
mbed_official | 76:aeb1df146756 | 76 | #define IS_RCC_HSE(HSE) (((HSE) == RCC_HSE_OFF) || ((HSE) == RCC_HSE_ON) || \ |
mbed_official | 76:aeb1df146756 | 77 | ((HSE) == RCC_HSE_Bypass)) |
mbed_official | 76:aeb1df146756 | 78 | |
mbed_official | 76:aeb1df146756 | 79 | /** |
mbed_official | 76:aeb1df146756 | 80 | * @} |
mbed_official | 76:aeb1df146756 | 81 | */ |
mbed_official | 76:aeb1df146756 | 82 | |
mbed_official | 76:aeb1df146756 | 83 | /** @defgroup RCC_PLL_Clock_Source |
mbed_official | 76:aeb1df146756 | 84 | * @{ |
mbed_official | 76:aeb1df146756 | 85 | */ |
mbed_official | 76:aeb1df146756 | 86 | |
mbed_official | 76:aeb1df146756 | 87 | #define RCC_PLLSource_HSI_Div2 RCC_CFGR_PLLSRC_HSI_Div2 |
mbed_official | 76:aeb1df146756 | 88 | #define RCC_PLLSource_PREDIV1 RCC_CFGR_PLLSRC_HSE_PREDIV /* Old HSEPREDIV1 bit definition, maintained for legacy purpose */ |
mbed_official | 76:aeb1df146756 | 89 | #define RCC_PLLSource_HSE RCC_CFGR_PLLSRC_HSE_PREDIV /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 90 | #define RCC_PLLSource_HSI48 RCC_CFGR_PLLSRC_HSI48_PREDIV /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 91 | #define RCC_PLLSource_HSI RCC_CFGR_PLLSRC_HSI_PREDIV /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 92 | |
mbed_official | 76:aeb1df146756 | 93 | #define IS_RCC_PLL_SOURCE(SOURCE) (((SOURCE) == RCC_PLLSource_HSI_Div2) || \ |
mbed_official | 76:aeb1df146756 | 94 | ((SOURCE) == RCC_PLLSource_HSI48) || \ |
mbed_official | 76:aeb1df146756 | 95 | ((SOURCE) == RCC_PLLSource_HSI) || \ |
mbed_official | 76:aeb1df146756 | 96 | ((SOURCE) == RCC_PLLSource_HSE) || \ |
mbed_official | 76:aeb1df146756 | 97 | ((SOURCE) == RCC_PLLSource_PREDIV1)) |
mbed_official | 76:aeb1df146756 | 98 | /** |
mbed_official | 76:aeb1df146756 | 99 | * @} |
mbed_official | 76:aeb1df146756 | 100 | */ |
mbed_official | 76:aeb1df146756 | 101 | |
mbed_official | 76:aeb1df146756 | 102 | /** @defgroup RCC_PLL_Multiplication_Factor |
mbed_official | 76:aeb1df146756 | 103 | * @{ |
mbed_official | 76:aeb1df146756 | 104 | */ |
mbed_official | 76:aeb1df146756 | 105 | |
mbed_official | 76:aeb1df146756 | 106 | #define RCC_PLLMul_2 RCC_CFGR_PLLMULL2 |
mbed_official | 76:aeb1df146756 | 107 | #define RCC_PLLMul_3 RCC_CFGR_PLLMULL3 |
mbed_official | 76:aeb1df146756 | 108 | #define RCC_PLLMul_4 RCC_CFGR_PLLMULL4 |
mbed_official | 76:aeb1df146756 | 109 | #define RCC_PLLMul_5 RCC_CFGR_PLLMULL5 |
mbed_official | 76:aeb1df146756 | 110 | #define RCC_PLLMul_6 RCC_CFGR_PLLMULL6 |
mbed_official | 76:aeb1df146756 | 111 | #define RCC_PLLMul_7 RCC_CFGR_PLLMULL7 |
mbed_official | 76:aeb1df146756 | 112 | #define RCC_PLLMul_8 RCC_CFGR_PLLMULL8 |
mbed_official | 76:aeb1df146756 | 113 | #define RCC_PLLMul_9 RCC_CFGR_PLLMULL9 |
mbed_official | 76:aeb1df146756 | 114 | #define RCC_PLLMul_10 RCC_CFGR_PLLMULL10 |
mbed_official | 76:aeb1df146756 | 115 | #define RCC_PLLMul_11 RCC_CFGR_PLLMULL11 |
mbed_official | 76:aeb1df146756 | 116 | #define RCC_PLLMul_12 RCC_CFGR_PLLMULL12 |
mbed_official | 76:aeb1df146756 | 117 | #define RCC_PLLMul_13 RCC_CFGR_PLLMULL13 |
mbed_official | 76:aeb1df146756 | 118 | #define RCC_PLLMul_14 RCC_CFGR_PLLMULL14 |
mbed_official | 76:aeb1df146756 | 119 | #define RCC_PLLMul_15 RCC_CFGR_PLLMULL15 |
mbed_official | 76:aeb1df146756 | 120 | #define RCC_PLLMul_16 RCC_CFGR_PLLMULL16 |
mbed_official | 76:aeb1df146756 | 121 | #define IS_RCC_PLL_MUL(MUL) (((MUL) == RCC_PLLMul_2) || ((MUL) == RCC_PLLMul_3) || \ |
mbed_official | 76:aeb1df146756 | 122 | ((MUL) == RCC_PLLMul_4) || ((MUL) == RCC_PLLMul_5) || \ |
mbed_official | 76:aeb1df146756 | 123 | ((MUL) == RCC_PLLMul_6) || ((MUL) == RCC_PLLMul_7) || \ |
mbed_official | 76:aeb1df146756 | 124 | ((MUL) == RCC_PLLMul_8) || ((MUL) == RCC_PLLMul_9) || \ |
mbed_official | 76:aeb1df146756 | 125 | ((MUL) == RCC_PLLMul_10) || ((MUL) == RCC_PLLMul_11) || \ |
mbed_official | 76:aeb1df146756 | 126 | ((MUL) == RCC_PLLMul_12) || ((MUL) == RCC_PLLMul_13) || \ |
mbed_official | 76:aeb1df146756 | 127 | ((MUL) == RCC_PLLMul_14) || ((MUL) == RCC_PLLMul_15) || \ |
mbed_official | 76:aeb1df146756 | 128 | ((MUL) == RCC_PLLMul_16)) |
mbed_official | 76:aeb1df146756 | 129 | /** |
mbed_official | 76:aeb1df146756 | 130 | * @} |
mbed_official | 76:aeb1df146756 | 131 | */ |
mbed_official | 76:aeb1df146756 | 132 | |
mbed_official | 76:aeb1df146756 | 133 | /** @defgroup RCC_PREDIV1_division_factor |
mbed_official | 76:aeb1df146756 | 134 | * @{ |
mbed_official | 76:aeb1df146756 | 135 | */ |
mbed_official | 76:aeb1df146756 | 136 | #define RCC_PREDIV1_Div1 RCC_CFGR2_PREDIV1_DIV1 |
mbed_official | 76:aeb1df146756 | 137 | #define RCC_PREDIV1_Div2 RCC_CFGR2_PREDIV1_DIV2 |
mbed_official | 76:aeb1df146756 | 138 | #define RCC_PREDIV1_Div3 RCC_CFGR2_PREDIV1_DIV3 |
mbed_official | 76:aeb1df146756 | 139 | #define RCC_PREDIV1_Div4 RCC_CFGR2_PREDIV1_DIV4 |
mbed_official | 76:aeb1df146756 | 140 | #define RCC_PREDIV1_Div5 RCC_CFGR2_PREDIV1_DIV5 |
mbed_official | 76:aeb1df146756 | 141 | #define RCC_PREDIV1_Div6 RCC_CFGR2_PREDIV1_DIV6 |
mbed_official | 76:aeb1df146756 | 142 | #define RCC_PREDIV1_Div7 RCC_CFGR2_PREDIV1_DIV7 |
mbed_official | 76:aeb1df146756 | 143 | #define RCC_PREDIV1_Div8 RCC_CFGR2_PREDIV1_DIV8 |
mbed_official | 76:aeb1df146756 | 144 | #define RCC_PREDIV1_Div9 RCC_CFGR2_PREDIV1_DIV9 |
mbed_official | 76:aeb1df146756 | 145 | #define RCC_PREDIV1_Div10 RCC_CFGR2_PREDIV1_DIV10 |
mbed_official | 76:aeb1df146756 | 146 | #define RCC_PREDIV1_Div11 RCC_CFGR2_PREDIV1_DIV11 |
mbed_official | 76:aeb1df146756 | 147 | #define RCC_PREDIV1_Div12 RCC_CFGR2_PREDIV1_DIV12 |
mbed_official | 76:aeb1df146756 | 148 | #define RCC_PREDIV1_Div13 RCC_CFGR2_PREDIV1_DIV13 |
mbed_official | 76:aeb1df146756 | 149 | #define RCC_PREDIV1_Div14 RCC_CFGR2_PREDIV1_DIV14 |
mbed_official | 76:aeb1df146756 | 150 | #define RCC_PREDIV1_Div15 RCC_CFGR2_PREDIV1_DIV15 |
mbed_official | 76:aeb1df146756 | 151 | #define RCC_PREDIV1_Div16 RCC_CFGR2_PREDIV1_DIV16 |
mbed_official | 76:aeb1df146756 | 152 | |
mbed_official | 76:aeb1df146756 | 153 | #define IS_RCC_PREDIV1(PREDIV1) (((PREDIV1) == RCC_PREDIV1_Div1) || ((PREDIV1) == RCC_PREDIV1_Div2) || \ |
mbed_official | 76:aeb1df146756 | 154 | ((PREDIV1) == RCC_PREDIV1_Div3) || ((PREDIV1) == RCC_PREDIV1_Div4) || \ |
mbed_official | 76:aeb1df146756 | 155 | ((PREDIV1) == RCC_PREDIV1_Div5) || ((PREDIV1) == RCC_PREDIV1_Div6) || \ |
mbed_official | 76:aeb1df146756 | 156 | ((PREDIV1) == RCC_PREDIV1_Div7) || ((PREDIV1) == RCC_PREDIV1_Div8) || \ |
mbed_official | 76:aeb1df146756 | 157 | ((PREDIV1) == RCC_PREDIV1_Div9) || ((PREDIV1) == RCC_PREDIV1_Div10) || \ |
mbed_official | 76:aeb1df146756 | 158 | ((PREDIV1) == RCC_PREDIV1_Div11) || ((PREDIV1) == RCC_PREDIV1_Div12) || \ |
mbed_official | 76:aeb1df146756 | 159 | ((PREDIV1) == RCC_PREDIV1_Div13) || ((PREDIV1) == RCC_PREDIV1_Div14) || \ |
mbed_official | 76:aeb1df146756 | 160 | ((PREDIV1) == RCC_PREDIV1_Div15) || ((PREDIV1) == RCC_PREDIV1_Div16)) |
mbed_official | 76:aeb1df146756 | 161 | /** |
mbed_official | 76:aeb1df146756 | 162 | * @} |
mbed_official | 76:aeb1df146756 | 163 | */ |
mbed_official | 76:aeb1df146756 | 164 | |
mbed_official | 76:aeb1df146756 | 165 | /** @defgroup RCC_System_Clock_Source |
mbed_official | 76:aeb1df146756 | 166 | * @{ |
mbed_official | 76:aeb1df146756 | 167 | */ |
mbed_official | 76:aeb1df146756 | 168 | |
mbed_official | 76:aeb1df146756 | 169 | #define RCC_SYSCLKSource_HSI RCC_CFGR_SW_HSI |
mbed_official | 76:aeb1df146756 | 170 | #define RCC_SYSCLKSource_HSE RCC_CFGR_SW_HSE |
mbed_official | 76:aeb1df146756 | 171 | #define RCC_SYSCLKSource_PLLCLK RCC_CFGR_SW_PLL |
mbed_official | 76:aeb1df146756 | 172 | #define RCC_SYSCLKSource_HSI48 RCC_CFGR_SW_HSI48 /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 173 | |
mbed_official | 76:aeb1df146756 | 174 | #define IS_RCC_SYSCLK_SOURCE(SOURCE) (((SOURCE) == RCC_SYSCLKSource_HSI) || \ |
mbed_official | 76:aeb1df146756 | 175 | ((SOURCE) == RCC_SYSCLKSource_HSE) || \ |
mbed_official | 76:aeb1df146756 | 176 | ((SOURCE) == RCC_SYSCLKSource_HSI48) || \ |
mbed_official | 76:aeb1df146756 | 177 | ((SOURCE) == RCC_SYSCLKSource_PLLCLK)) |
mbed_official | 76:aeb1df146756 | 178 | /** |
mbed_official | 76:aeb1df146756 | 179 | * @} |
mbed_official | 76:aeb1df146756 | 180 | */ |
mbed_official | 76:aeb1df146756 | 181 | |
mbed_official | 76:aeb1df146756 | 182 | /** @defgroup RCC_AHB_Clock_Source |
mbed_official | 76:aeb1df146756 | 183 | * @{ |
mbed_official | 76:aeb1df146756 | 184 | */ |
mbed_official | 76:aeb1df146756 | 185 | |
mbed_official | 76:aeb1df146756 | 186 | #define RCC_SYSCLK_Div1 RCC_CFGR_HPRE_DIV1 |
mbed_official | 76:aeb1df146756 | 187 | #define RCC_SYSCLK_Div2 RCC_CFGR_HPRE_DIV2 |
mbed_official | 76:aeb1df146756 | 188 | #define RCC_SYSCLK_Div4 RCC_CFGR_HPRE_DIV4 |
mbed_official | 76:aeb1df146756 | 189 | #define RCC_SYSCLK_Div8 RCC_CFGR_HPRE_DIV8 |
mbed_official | 76:aeb1df146756 | 190 | #define RCC_SYSCLK_Div16 RCC_CFGR_HPRE_DIV16 |
mbed_official | 76:aeb1df146756 | 191 | #define RCC_SYSCLK_Div64 RCC_CFGR_HPRE_DIV64 |
mbed_official | 76:aeb1df146756 | 192 | #define RCC_SYSCLK_Div128 RCC_CFGR_HPRE_DIV128 |
mbed_official | 76:aeb1df146756 | 193 | #define RCC_SYSCLK_Div256 RCC_CFGR_HPRE_DIV256 |
mbed_official | 76:aeb1df146756 | 194 | #define RCC_SYSCLK_Div512 RCC_CFGR_HPRE_DIV512 |
mbed_official | 76:aeb1df146756 | 195 | #define IS_RCC_HCLK(HCLK) (((HCLK) == RCC_SYSCLK_Div1) || ((HCLK) == RCC_SYSCLK_Div2) || \ |
mbed_official | 76:aeb1df146756 | 196 | ((HCLK) == RCC_SYSCLK_Div4) || ((HCLK) == RCC_SYSCLK_Div8) || \ |
mbed_official | 76:aeb1df146756 | 197 | ((HCLK) == RCC_SYSCLK_Div16) || ((HCLK) == RCC_SYSCLK_Div64) || \ |
mbed_official | 76:aeb1df146756 | 198 | ((HCLK) == RCC_SYSCLK_Div128) || ((HCLK) == RCC_SYSCLK_Div256) || \ |
mbed_official | 76:aeb1df146756 | 199 | ((HCLK) == RCC_SYSCLK_Div512)) |
mbed_official | 76:aeb1df146756 | 200 | /** |
mbed_official | 76:aeb1df146756 | 201 | * @} |
mbed_official | 76:aeb1df146756 | 202 | */ |
mbed_official | 76:aeb1df146756 | 203 | |
mbed_official | 76:aeb1df146756 | 204 | /** @defgroup RCC_APB_Clock_Source |
mbed_official | 76:aeb1df146756 | 205 | * @{ |
mbed_official | 76:aeb1df146756 | 206 | */ |
mbed_official | 76:aeb1df146756 | 207 | |
mbed_official | 76:aeb1df146756 | 208 | #define RCC_HCLK_Div1 RCC_CFGR_PPRE_DIV1 |
mbed_official | 76:aeb1df146756 | 209 | #define RCC_HCLK_Div2 RCC_CFGR_PPRE_DIV2 |
mbed_official | 76:aeb1df146756 | 210 | #define RCC_HCLK_Div4 RCC_CFGR_PPRE_DIV4 |
mbed_official | 76:aeb1df146756 | 211 | #define RCC_HCLK_Div8 RCC_CFGR_PPRE_DIV8 |
mbed_official | 76:aeb1df146756 | 212 | #define RCC_HCLK_Div16 RCC_CFGR_PPRE_DIV16 |
mbed_official | 76:aeb1df146756 | 213 | #define IS_RCC_PCLK(PCLK) (((PCLK) == RCC_HCLK_Div1) || ((PCLK) == RCC_HCLK_Div2) || \ |
mbed_official | 76:aeb1df146756 | 214 | ((PCLK) == RCC_HCLK_Div4) || ((PCLK) == RCC_HCLK_Div8) || \ |
mbed_official | 76:aeb1df146756 | 215 | ((PCLK) == RCC_HCLK_Div16)) |
mbed_official | 76:aeb1df146756 | 216 | /** |
mbed_official | 76:aeb1df146756 | 217 | * @} |
mbed_official | 76:aeb1df146756 | 218 | */ |
mbed_official | 76:aeb1df146756 | 219 | |
mbed_official | 76:aeb1df146756 | 220 | /** @defgroup RCC_ADC_clock_source |
mbed_official | 76:aeb1df146756 | 221 | * @{ |
mbed_official | 76:aeb1df146756 | 222 | */ |
mbed_official | 76:aeb1df146756 | 223 | /* These defines are obsolete and kept for legacy purpose only. |
mbed_official | 76:aeb1df146756 | 224 | Proper ADC clock selection is done within ADC driver by mean of the ADC_ClockModeConfig() function */ |
mbed_official | 76:aeb1df146756 | 225 | #define RCC_ADCCLK_HSI14 ((uint32_t)0x00000000) |
mbed_official | 76:aeb1df146756 | 226 | #define RCC_ADCCLK_PCLK_Div2 ((uint32_t)0x01000000) |
mbed_official | 76:aeb1df146756 | 227 | #define RCC_ADCCLK_PCLK_Div4 ((uint32_t)0x01004000) |
mbed_official | 76:aeb1df146756 | 228 | |
mbed_official | 76:aeb1df146756 | 229 | #define IS_RCC_ADCCLK(ADCCLK) (((ADCCLK) == RCC_ADCCLK_HSI14) || ((ADCCLK) == RCC_ADCCLK_PCLK_Div2) || \ |
mbed_official | 76:aeb1df146756 | 230 | ((ADCCLK) == RCC_ADCCLK_PCLK_Div4)) |
mbed_official | 76:aeb1df146756 | 231 | |
mbed_official | 76:aeb1df146756 | 232 | /** |
mbed_official | 76:aeb1df146756 | 233 | * @} |
mbed_official | 76:aeb1df146756 | 234 | */ |
mbed_official | 76:aeb1df146756 | 235 | |
mbed_official | 76:aeb1df146756 | 236 | /** @defgroup RCC_CEC_clock_source |
mbed_official | 76:aeb1df146756 | 237 | * @{ |
mbed_official | 76:aeb1df146756 | 238 | */ |
mbed_official | 76:aeb1df146756 | 239 | |
mbed_official | 76:aeb1df146756 | 240 | #define RCC_CECCLK_HSI_Div244 ((uint32_t)0x00000000) |
mbed_official | 76:aeb1df146756 | 241 | #define RCC_CECCLK_LSE RCC_CFGR3_CECSW |
mbed_official | 76:aeb1df146756 | 242 | |
mbed_official | 76:aeb1df146756 | 243 | #define IS_RCC_CECCLK(CECCLK) (((CECCLK) == RCC_CECCLK_HSI_Div244) || ((CECCLK) == RCC_CECCLK_LSE)) |
mbed_official | 76:aeb1df146756 | 244 | |
mbed_official | 76:aeb1df146756 | 245 | /** |
mbed_official | 76:aeb1df146756 | 246 | * @} |
mbed_official | 76:aeb1df146756 | 247 | */ |
mbed_official | 76:aeb1df146756 | 248 | |
mbed_official | 76:aeb1df146756 | 249 | /** @defgroup RCC_I2C_clock_source |
mbed_official | 76:aeb1df146756 | 250 | * @{ |
mbed_official | 76:aeb1df146756 | 251 | */ |
mbed_official | 76:aeb1df146756 | 252 | |
mbed_official | 76:aeb1df146756 | 253 | #define RCC_I2C1CLK_HSI ((uint32_t)0x00000000) |
mbed_official | 76:aeb1df146756 | 254 | #define RCC_I2C1CLK_SYSCLK RCC_CFGR3_I2C1SW |
mbed_official | 76:aeb1df146756 | 255 | |
mbed_official | 76:aeb1df146756 | 256 | #define IS_RCC_I2CCLK(I2CCLK) (((I2CCLK) == RCC_I2C1CLK_HSI) || ((I2CCLK) == RCC_I2C1CLK_SYSCLK)) |
mbed_official | 76:aeb1df146756 | 257 | |
mbed_official | 76:aeb1df146756 | 258 | /** |
mbed_official | 76:aeb1df146756 | 259 | * @} |
mbed_official | 76:aeb1df146756 | 260 | */ |
mbed_official | 76:aeb1df146756 | 261 | |
mbed_official | 76:aeb1df146756 | 262 | /** @defgroup RCC_USB_clock_source |
mbed_official | 76:aeb1df146756 | 263 | * @brief Applicable only for STM32F072 devices |
mbed_official | 76:aeb1df146756 | 264 | * @{ |
mbed_official | 76:aeb1df146756 | 265 | */ |
mbed_official | 76:aeb1df146756 | 266 | |
mbed_official | 76:aeb1df146756 | 267 | #define RCC_USBCLK_HSI48 ((uint32_t)0x00000000) |
mbed_official | 76:aeb1df146756 | 268 | #define RCC_USBCLK_PLLCLK RCC_CFGR3_USBSW |
mbed_official | 76:aeb1df146756 | 269 | |
mbed_official | 76:aeb1df146756 | 270 | #define IS_RCC_USBCLK(USBCLK) (((USBCLK) == RCC_USBCLK_HSI48) || ((USBCLK) == RCC_USBCLK_PLLCLK)) |
mbed_official | 76:aeb1df146756 | 271 | |
mbed_official | 76:aeb1df146756 | 272 | /** |
mbed_official | 76:aeb1df146756 | 273 | * @} |
mbed_official | 76:aeb1df146756 | 274 | */ |
mbed_official | 76:aeb1df146756 | 275 | |
mbed_official | 76:aeb1df146756 | 276 | /** @defgroup RCC_USART_clock_source |
mbed_official | 76:aeb1df146756 | 277 | * @{ |
mbed_official | 76:aeb1df146756 | 278 | */ |
mbed_official | 76:aeb1df146756 | 279 | |
mbed_official | 76:aeb1df146756 | 280 | #define RCC_USART1CLK_PCLK ((uint32_t)0x10000000) |
mbed_official | 76:aeb1df146756 | 281 | #define RCC_USART1CLK_SYSCLK ((uint32_t)0x10000001) |
mbed_official | 76:aeb1df146756 | 282 | #define RCC_USART1CLK_LSE ((uint32_t)0x10000002) |
mbed_official | 76:aeb1df146756 | 283 | #define RCC_USART1CLK_HSI ((uint32_t)0x10000003) |
mbed_official | 76:aeb1df146756 | 284 | |
mbed_official | 76:aeb1df146756 | 285 | #define RCC_USART2CLK_PCLK ((uint32_t)0x20000000) /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 286 | #define RCC_USART2CLK_SYSCLK ((uint32_t)0x20010000) /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 287 | #define RCC_USART2CLK_LSE ((uint32_t)0x20020000) /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 288 | #define RCC_USART2CLK_HSI ((uint32_t)0x20030000) /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 289 | |
mbed_official | 76:aeb1df146756 | 290 | #define IS_RCC_USARTCLK(USARTCLK) (((USARTCLK) == RCC_USART1CLK_PCLK) || \ |
mbed_official | 76:aeb1df146756 | 291 | ((USARTCLK) == RCC_USART1CLK_SYSCLK) || \ |
mbed_official | 76:aeb1df146756 | 292 | ((USARTCLK) == RCC_USART1CLK_LSE) || \ |
mbed_official | 76:aeb1df146756 | 293 | ((USARTCLK) == RCC_USART1CLK_HSI) || \ |
mbed_official | 76:aeb1df146756 | 294 | ((USARTCLK) == RCC_USART2CLK_PCLK) || \ |
mbed_official | 76:aeb1df146756 | 295 | ((USARTCLK) == RCC_USART2CLK_SYSCLK) || \ |
mbed_official | 76:aeb1df146756 | 296 | ((USARTCLK) == RCC_USART2CLK_LSE) || \ |
mbed_official | 76:aeb1df146756 | 297 | ((USARTCLK) == RCC_USART2CLK_HSI)) |
mbed_official | 76:aeb1df146756 | 298 | |
mbed_official | 76:aeb1df146756 | 299 | /** |
mbed_official | 76:aeb1df146756 | 300 | * @} |
mbed_official | 76:aeb1df146756 | 301 | */ |
mbed_official | 76:aeb1df146756 | 302 | |
mbed_official | 76:aeb1df146756 | 303 | /** @defgroup RCC_Interrupt_Source |
mbed_official | 76:aeb1df146756 | 304 | * @{ |
mbed_official | 76:aeb1df146756 | 305 | */ |
mbed_official | 76:aeb1df146756 | 306 | |
mbed_official | 76:aeb1df146756 | 307 | #define RCC_IT_LSIRDY ((uint8_t)0x01) |
mbed_official | 76:aeb1df146756 | 308 | #define RCC_IT_LSERDY ((uint8_t)0x02) |
mbed_official | 76:aeb1df146756 | 309 | #define RCC_IT_HSIRDY ((uint8_t)0x04) |
mbed_official | 76:aeb1df146756 | 310 | #define RCC_IT_HSERDY ((uint8_t)0x08) |
mbed_official | 76:aeb1df146756 | 311 | #define RCC_IT_PLLRDY ((uint8_t)0x10) |
mbed_official | 76:aeb1df146756 | 312 | #define RCC_IT_HSI14RDY ((uint8_t)0x20) |
mbed_official | 76:aeb1df146756 | 313 | #define RCC_IT_HSI48RDY ((uint8_t)0x40) /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 314 | #define RCC_IT_CSS ((uint8_t)0x80) |
mbed_official | 76:aeb1df146756 | 315 | |
mbed_official | 76:aeb1df146756 | 316 | #define IS_RCC_IT(IT) ((((IT) & (uint8_t)0x80) == 0x00) && ((IT) != 0x00)) |
mbed_official | 76:aeb1df146756 | 317 | |
mbed_official | 76:aeb1df146756 | 318 | #define IS_RCC_GET_IT(IT) (((IT) == RCC_IT_LSIRDY) || ((IT) == RCC_IT_LSERDY) || \ |
mbed_official | 76:aeb1df146756 | 319 | ((IT) == RCC_IT_HSIRDY) || ((IT) == RCC_IT_HSERDY) || \ |
mbed_official | 76:aeb1df146756 | 320 | ((IT) == RCC_IT_PLLRDY) || ((IT) == RCC_IT_HSI14RDY) || \ |
mbed_official | 76:aeb1df146756 | 321 | ((IT) == RCC_IT_CSS) || ((IT) == RCC_IT_HSI48RDY)) |
mbed_official | 76:aeb1df146756 | 322 | |
mbed_official | 76:aeb1df146756 | 323 | #define IS_RCC_CLEAR_IT(IT) ((IT) != 0x00) |
mbed_official | 76:aeb1df146756 | 324 | |
mbed_official | 76:aeb1df146756 | 325 | /** |
mbed_official | 76:aeb1df146756 | 326 | * @} |
mbed_official | 76:aeb1df146756 | 327 | */ |
mbed_official | 76:aeb1df146756 | 328 | |
mbed_official | 76:aeb1df146756 | 329 | /** @defgroup RCC_LSE_Configuration |
mbed_official | 76:aeb1df146756 | 330 | * @{ |
mbed_official | 76:aeb1df146756 | 331 | */ |
mbed_official | 76:aeb1df146756 | 332 | |
mbed_official | 76:aeb1df146756 | 333 | #define RCC_LSE_OFF ((uint32_t)0x00000000) |
mbed_official | 76:aeb1df146756 | 334 | #define RCC_LSE_ON RCC_BDCR_LSEON |
mbed_official | 76:aeb1df146756 | 335 | #define RCC_LSE_Bypass ((uint32_t)(RCC_BDCR_LSEON | RCC_BDCR_LSEBYP)) |
mbed_official | 76:aeb1df146756 | 336 | #define IS_RCC_LSE(LSE) (((LSE) == RCC_LSE_OFF) || ((LSE) == RCC_LSE_ON) || \ |
mbed_official | 76:aeb1df146756 | 337 | ((LSE) == RCC_LSE_Bypass)) |
mbed_official | 76:aeb1df146756 | 338 | /** |
mbed_official | 76:aeb1df146756 | 339 | * @} |
mbed_official | 76:aeb1df146756 | 340 | */ |
mbed_official | 76:aeb1df146756 | 341 | |
mbed_official | 76:aeb1df146756 | 342 | /** @defgroup RCC_RTC_Clock_Source |
mbed_official | 76:aeb1df146756 | 343 | * @{ |
mbed_official | 76:aeb1df146756 | 344 | */ |
mbed_official | 76:aeb1df146756 | 345 | |
mbed_official | 76:aeb1df146756 | 346 | #define RCC_RTCCLKSource_LSE RCC_BDCR_RTCSEL_LSE |
mbed_official | 76:aeb1df146756 | 347 | #define RCC_RTCCLKSource_LSI RCC_BDCR_RTCSEL_LSI |
mbed_official | 76:aeb1df146756 | 348 | #define RCC_RTCCLKSource_HSE_Div32 RCC_BDCR_RTCSEL_HSE |
mbed_official | 76:aeb1df146756 | 349 | |
mbed_official | 76:aeb1df146756 | 350 | #define IS_RCC_RTCCLK_SOURCE(SOURCE) (((SOURCE) == RCC_RTCCLKSource_LSE) || \ |
mbed_official | 76:aeb1df146756 | 351 | ((SOURCE) == RCC_RTCCLKSource_LSI) || \ |
mbed_official | 76:aeb1df146756 | 352 | ((SOURCE) == RCC_RTCCLKSource_HSE_Div32)) |
mbed_official | 76:aeb1df146756 | 353 | /** |
mbed_official | 76:aeb1df146756 | 354 | * @} |
mbed_official | 76:aeb1df146756 | 355 | */ |
mbed_official | 76:aeb1df146756 | 356 | |
mbed_official | 76:aeb1df146756 | 357 | /** @defgroup RCC_LSE_Drive_Configuration |
mbed_official | 76:aeb1df146756 | 358 | * @{ |
mbed_official | 76:aeb1df146756 | 359 | */ |
mbed_official | 76:aeb1df146756 | 360 | |
mbed_official | 76:aeb1df146756 | 361 | #define RCC_LSEDrive_Low ((uint32_t)0x00000000) |
mbed_official | 76:aeb1df146756 | 362 | #define RCC_LSEDrive_MediumLow RCC_BDCR_LSEDRV_0 |
mbed_official | 76:aeb1df146756 | 363 | #define RCC_LSEDrive_MediumHigh RCC_BDCR_LSEDRV_1 |
mbed_official | 76:aeb1df146756 | 364 | #define RCC_LSEDrive_High RCC_BDCR_LSEDRV |
mbed_official | 76:aeb1df146756 | 365 | #define IS_RCC_LSE_DRIVE(DRIVE) (((DRIVE) == RCC_LSEDrive_Low) || ((DRIVE) == RCC_LSEDrive_MediumLow) || \ |
mbed_official | 76:aeb1df146756 | 366 | ((DRIVE) == RCC_LSEDrive_MediumHigh) || ((DRIVE) == RCC_LSEDrive_High)) |
mbed_official | 76:aeb1df146756 | 367 | /** |
mbed_official | 76:aeb1df146756 | 368 | * @} |
mbed_official | 76:aeb1df146756 | 369 | */ |
mbed_official | 76:aeb1df146756 | 370 | |
mbed_official | 76:aeb1df146756 | 371 | /** @defgroup RCC_AHB_Peripherals |
mbed_official | 76:aeb1df146756 | 372 | * @{ |
mbed_official | 76:aeb1df146756 | 373 | */ |
mbed_official | 76:aeb1df146756 | 374 | |
mbed_official | 76:aeb1df146756 | 375 | #define RCC_AHBPeriph_GPIOA RCC_AHBENR_GPIOAEN |
mbed_official | 76:aeb1df146756 | 376 | #define RCC_AHBPeriph_GPIOB RCC_AHBENR_GPIOBEN |
mbed_official | 76:aeb1df146756 | 377 | #define RCC_AHBPeriph_GPIOC RCC_AHBENR_GPIOCEN |
mbed_official | 76:aeb1df146756 | 378 | #define RCC_AHBPeriph_GPIOD RCC_AHBENR_GPIODEN |
mbed_official | 76:aeb1df146756 | 379 | #define RCC_AHBPeriph_GPIOE RCC_AHBENR_GPIOEEN /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 380 | #define RCC_AHBPeriph_GPIOF RCC_AHBENR_GPIOFEN |
mbed_official | 76:aeb1df146756 | 381 | #define RCC_AHBPeriph_TS RCC_AHBENR_TSEN |
mbed_official | 76:aeb1df146756 | 382 | #define RCC_AHBPeriph_CRC RCC_AHBENR_CRCEN |
mbed_official | 76:aeb1df146756 | 383 | #define RCC_AHBPeriph_FLITF RCC_AHBENR_FLITFEN |
mbed_official | 76:aeb1df146756 | 384 | #define RCC_AHBPeriph_SRAM RCC_AHBENR_SRAMEN |
mbed_official | 76:aeb1df146756 | 385 | #define RCC_AHBPeriph_DMA1 RCC_AHBENR_DMA1EN |
mbed_official | 76:aeb1df146756 | 386 | |
mbed_official | 76:aeb1df146756 | 387 | #define IS_RCC_AHB_PERIPH(PERIPH) ((((PERIPH) & 0xFE81FFAA) == 0x00) && ((PERIPH) != 0x00)) |
mbed_official | 76:aeb1df146756 | 388 | #define IS_RCC_AHB_RST_PERIPH(PERIPH) ((((PERIPH) & 0xFE81FFFF) == 0x00) && ((PERIPH) != 0x00)) |
mbed_official | 76:aeb1df146756 | 389 | |
mbed_official | 76:aeb1df146756 | 390 | /** |
mbed_official | 76:aeb1df146756 | 391 | * @} |
mbed_official | 76:aeb1df146756 | 392 | */ |
mbed_official | 76:aeb1df146756 | 393 | |
mbed_official | 76:aeb1df146756 | 394 | /** @defgroup RCC_APB2_Peripherals |
mbed_official | 76:aeb1df146756 | 395 | * @{ |
mbed_official | 76:aeb1df146756 | 396 | */ |
mbed_official | 76:aeb1df146756 | 397 | |
mbed_official | 76:aeb1df146756 | 398 | #define RCC_APB2Periph_SYSCFG RCC_APB2ENR_SYSCFGEN |
mbed_official | 76:aeb1df146756 | 399 | #define RCC_APB2Periph_ADC1 RCC_APB2ENR_ADC1EN |
mbed_official | 76:aeb1df146756 | 400 | #define RCC_APB2Periph_TIM1 RCC_APB2ENR_TIM1EN |
mbed_official | 76:aeb1df146756 | 401 | #define RCC_APB2Periph_SPI1 RCC_APB2ENR_SPI1EN |
mbed_official | 76:aeb1df146756 | 402 | #define RCC_APB2Periph_USART1 RCC_APB2ENR_USART1EN |
mbed_official | 76:aeb1df146756 | 403 | #define RCC_APB2Periph_TIM15 RCC_APB2ENR_TIM15EN |
mbed_official | 76:aeb1df146756 | 404 | #define RCC_APB2Periph_TIM16 RCC_APB2ENR_TIM16EN |
mbed_official | 76:aeb1df146756 | 405 | #define RCC_APB2Periph_TIM17 RCC_APB2ENR_TIM17EN |
mbed_official | 76:aeb1df146756 | 406 | #define RCC_APB2Periph_DBGMCU RCC_APB2ENR_DBGMCUEN |
mbed_official | 76:aeb1df146756 | 407 | |
mbed_official | 76:aeb1df146756 | 408 | #define IS_RCC_APB2_PERIPH(PERIPH) ((((PERIPH) & 0xFFB8A5FE) == 0x00) && ((PERIPH) != 0x00)) |
mbed_official | 76:aeb1df146756 | 409 | |
mbed_official | 76:aeb1df146756 | 410 | /** |
mbed_official | 76:aeb1df146756 | 411 | * @} |
mbed_official | 76:aeb1df146756 | 412 | */ |
mbed_official | 76:aeb1df146756 | 413 | |
mbed_official | 76:aeb1df146756 | 414 | /** @defgroup RCC_APB1_Peripherals |
mbed_official | 76:aeb1df146756 | 415 | * @{ |
mbed_official | 76:aeb1df146756 | 416 | */ |
mbed_official | 76:aeb1df146756 | 417 | |
mbed_official | 76:aeb1df146756 | 418 | #define RCC_APB1Periph_TIM2 RCC_APB1ENR_TIM2EN /*!< Only applicable for STM32F051 and STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 419 | #define RCC_APB1Periph_TIM3 RCC_APB1ENR_TIM3EN |
mbed_official | 76:aeb1df146756 | 420 | #define RCC_APB1Periph_TIM6 RCC_APB1ENR_TIM6EN |
mbed_official | 76:aeb1df146756 | 421 | #define RCC_APB1Periph_TIM7 RCC_APB1ENR_TIM7EN /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 422 | #define RCC_APB1Periph_TIM14 RCC_APB1ENR_TIM14EN |
mbed_official | 76:aeb1df146756 | 423 | #define RCC_APB1Periph_WWDG RCC_APB1ENR_WWDGEN |
mbed_official | 76:aeb1df146756 | 424 | #define RCC_APB1Periph_SPI2 RCC_APB1ENR_SPI2EN |
mbed_official | 76:aeb1df146756 | 425 | #define RCC_APB1Periph_USART2 RCC_APB1ENR_USART2EN |
mbed_official | 76:aeb1df146756 | 426 | #define RCC_APB1Periph_USART3 RCC_APB1ENR_USART3EN /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 427 | #define RCC_APB1Periph_USART4 RCC_APB1ENR_USART4EN /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 428 | #define RCC_APB1Periph_I2C1 RCC_APB1ENR_I2C1EN |
mbed_official | 76:aeb1df146756 | 429 | #define RCC_APB1Periph_I2C2 RCC_APB1ENR_I2C2EN |
mbed_official | 76:aeb1df146756 | 430 | #define RCC_APB1Periph_USB RCC_APB1ENR_USBEN /*!< Only applicable for STM32F072 and STM32F042 devices */ |
mbed_official | 76:aeb1df146756 | 431 | #define RCC_APB1Periph_CAN RCC_APB1ENR_CANEN /*!< Only applicable for STM32F072 and STM32F042 devices */ |
mbed_official | 76:aeb1df146756 | 432 | #define RCC_APB1Periph_CRS RCC_APB1ENR_CRSEN /*!< Only applicable for STM32F072 and STM32F042 devices*/ |
mbed_official | 76:aeb1df146756 | 433 | #define RCC_APB1Periph_PWR RCC_APB1ENR_PWREN |
mbed_official | 76:aeb1df146756 | 434 | #define RCC_APB1Periph_DAC RCC_APB1ENR_DACEN /*!< Only applicable for STM32F051 and STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 435 | #define RCC_APB1Periph_CEC RCC_APB1ENR_CECEN /*!< Only applicable for STM32F051, STM32F042 and STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 436 | |
mbed_official | 76:aeb1df146756 | 437 | #define IS_RCC_APB1_PERIPH(PERIPH) ((((PERIPH) & 0x8511B6CC) == 0x00) && ((PERIPH) != 0x00)) |
mbed_official | 76:aeb1df146756 | 438 | /** |
mbed_official | 76:aeb1df146756 | 439 | * @} |
mbed_official | 76:aeb1df146756 | 440 | */ |
mbed_official | 76:aeb1df146756 | 441 | |
mbed_official | 76:aeb1df146756 | 442 | /** @defgroup RCC_MCO_Clock_Source |
mbed_official | 76:aeb1df146756 | 443 | * @{ |
mbed_official | 76:aeb1df146756 | 444 | */ |
mbed_official | 76:aeb1df146756 | 445 | |
mbed_official | 76:aeb1df146756 | 446 | #define RCC_MCOSource_NoClock ((uint8_t)0x00) |
mbed_official | 76:aeb1df146756 | 447 | #define RCC_MCOSource_HSI14 ((uint8_t)0x01) |
mbed_official | 76:aeb1df146756 | 448 | #define RCC_MCOSource_LSI ((uint8_t)0x02) |
mbed_official | 76:aeb1df146756 | 449 | #define RCC_MCOSource_LSE ((uint8_t)0x03) |
mbed_official | 76:aeb1df146756 | 450 | #define RCC_MCOSource_SYSCLK ((uint8_t)0x04) |
mbed_official | 76:aeb1df146756 | 451 | #define RCC_MCOSource_HSI ((uint8_t)0x05) |
mbed_official | 76:aeb1df146756 | 452 | #define RCC_MCOSource_HSE ((uint8_t)0x06) |
mbed_official | 76:aeb1df146756 | 453 | #define RCC_MCOSource_PLLCLK_Div2 ((uint8_t)0x07) |
mbed_official | 76:aeb1df146756 | 454 | #define RCC_MCOSource_HSI48 ((uint8_t)0x08) /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 455 | #define RCC_MCOSource_PLLCLK ((uint8_t)0x87) |
mbed_official | 76:aeb1df146756 | 456 | |
mbed_official | 76:aeb1df146756 | 457 | #define IS_RCC_MCO_SOURCE(SOURCE) (((SOURCE) == RCC_MCOSource_NoClock) || ((SOURCE) == RCC_MCOSource_HSI14) || \ |
mbed_official | 76:aeb1df146756 | 458 | ((SOURCE) == RCC_MCOSource_SYSCLK) || ((SOURCE) == RCC_MCOSource_HSI) || \ |
mbed_official | 76:aeb1df146756 | 459 | ((SOURCE) == RCC_MCOSource_HSE) || ((SOURCE) == RCC_MCOSource_PLLCLK_Div2)|| \ |
mbed_official | 76:aeb1df146756 | 460 | ((SOURCE) == RCC_MCOSource_LSI) || ((SOURCE) == RCC_MCOSource_HSI48) || \ |
mbed_official | 76:aeb1df146756 | 461 | ((SOURCE) == RCC_MCOSource_PLLCLK) || ((SOURCE) == RCC_MCOSource_LSE)) |
mbed_official | 76:aeb1df146756 | 462 | /** |
mbed_official | 76:aeb1df146756 | 463 | * @} |
mbed_official | 76:aeb1df146756 | 464 | */ |
mbed_official | 76:aeb1df146756 | 465 | |
mbed_official | 76:aeb1df146756 | 466 | /** @defgroup RCC_MCOPrescaler |
mbed_official | 76:aeb1df146756 | 467 | * @{ |
mbed_official | 76:aeb1df146756 | 468 | */ |
mbed_official | 76:aeb1df146756 | 469 | #if !defined (STM32F051) |
mbed_official | 76:aeb1df146756 | 470 | #define RCC_MCOPrescaler_1 RCC_CFGR_MCO_PRE_1 |
mbed_official | 76:aeb1df146756 | 471 | #define RCC_MCOPrescaler_2 RCC_CFGR_MCO_PRE_2 |
mbed_official | 76:aeb1df146756 | 472 | #define RCC_MCOPrescaler_4 RCC_CFGR_MCO_PRE_4 |
mbed_official | 76:aeb1df146756 | 473 | #define RCC_MCOPrescaler_8 RCC_CFGR_MCO_PRE_8 |
mbed_official | 76:aeb1df146756 | 474 | #define RCC_MCOPrescaler_16 RCC_CFGR_MCO_PRE_16 |
mbed_official | 76:aeb1df146756 | 475 | #define RCC_MCOPrescaler_32 RCC_CFGR_MCO_PRE_32 |
mbed_official | 76:aeb1df146756 | 476 | #define RCC_MCOPrescaler_64 RCC_CFGR_MCO_PRE_64 |
mbed_official | 76:aeb1df146756 | 477 | #define RCC_MCOPrescaler_128 RCC_CFGR_MCO_PRE_128 |
mbed_official | 76:aeb1df146756 | 478 | |
mbed_official | 76:aeb1df146756 | 479 | #define IS_RCC_MCO_PRESCALER(PRESCALER) (((PRESCALER) == RCC_MCOPrescaler_1) || \ |
mbed_official | 76:aeb1df146756 | 480 | ((PRESCALER) == RCC_MCOPrescaler_2) || \ |
mbed_official | 76:aeb1df146756 | 481 | ((PRESCALER) == RCC_MCOPrescaler_4) || \ |
mbed_official | 76:aeb1df146756 | 482 | ((PRESCALER) == RCC_MCOPrescaler_8) || \ |
mbed_official | 76:aeb1df146756 | 483 | ((PRESCALER) == RCC_MCOPrescaler_16) || \ |
mbed_official | 76:aeb1df146756 | 484 | ((PRESCALER) == RCC_MCOPrescaler_32) || \ |
mbed_official | 76:aeb1df146756 | 485 | ((PRESCALER) == RCC_MCOPrescaler_64) || \ |
mbed_official | 76:aeb1df146756 | 486 | ((PRESCALER) == RCC_MCOPrescaler_128)) |
mbed_official | 76:aeb1df146756 | 487 | #endif /* STM32F051 */ |
mbed_official | 76:aeb1df146756 | 488 | /** |
mbed_official | 76:aeb1df146756 | 489 | * @} |
mbed_official | 76:aeb1df146756 | 490 | */ |
mbed_official | 76:aeb1df146756 | 491 | |
mbed_official | 76:aeb1df146756 | 492 | /** @defgroup RCC_Flag |
mbed_official | 76:aeb1df146756 | 493 | * @{ |
mbed_official | 76:aeb1df146756 | 494 | */ |
mbed_official | 76:aeb1df146756 | 495 | #define RCC_FLAG_HSIRDY ((uint8_t)0x01) |
mbed_official | 76:aeb1df146756 | 496 | #define RCC_FLAG_HSERDY ((uint8_t)0x11) |
mbed_official | 76:aeb1df146756 | 497 | #define RCC_FLAG_PLLRDY ((uint8_t)0x19) |
mbed_official | 76:aeb1df146756 | 498 | #define RCC_FLAG_LSERDY ((uint8_t)0x21) |
mbed_official | 76:aeb1df146756 | 499 | #define RCC_FLAG_LSIRDY ((uint8_t)0x41) |
mbed_official | 76:aeb1df146756 | 500 | #define RCC_FLAG_V18PWRRSTF ((uint8_t)0x57) |
mbed_official | 76:aeb1df146756 | 501 | #define RCC_FLAG_OBLRST ((uint8_t)0x59) |
mbed_official | 76:aeb1df146756 | 502 | #define RCC_FLAG_PINRST ((uint8_t)0x5A) |
mbed_official | 76:aeb1df146756 | 503 | #define RCC_FLAG_PORRST ((uint8_t)0x5B) |
mbed_official | 76:aeb1df146756 | 504 | #define RCC_FLAG_SFTRST ((uint8_t)0x5C) |
mbed_official | 76:aeb1df146756 | 505 | #define RCC_FLAG_IWDGRST ((uint8_t)0x5D) |
mbed_official | 76:aeb1df146756 | 506 | #define RCC_FLAG_WWDGRST ((uint8_t)0x5E) |
mbed_official | 76:aeb1df146756 | 507 | #define RCC_FLAG_LPWRRST ((uint8_t)0x5F) |
mbed_official | 76:aeb1df146756 | 508 | #define RCC_FLAG_HSI14RDY ((uint8_t)0x61) |
mbed_official | 76:aeb1df146756 | 509 | #define RCC_FLAG_HSI48RDY ((uint8_t)0x71) /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 510 | |
mbed_official | 76:aeb1df146756 | 511 | #define IS_RCC_FLAG(FLAG) (((FLAG) == RCC_FLAG_HSIRDY) || ((FLAG) == RCC_FLAG_HSERDY) || \ |
mbed_official | 76:aeb1df146756 | 512 | ((FLAG) == RCC_FLAG_PLLRDY) || ((FLAG) == RCC_FLAG_LSERDY) || \ |
mbed_official | 76:aeb1df146756 | 513 | ((FLAG) == RCC_FLAG_LSIRDY) || ((FLAG) == RCC_FLAG_OBLRST) || \ |
mbed_official | 76:aeb1df146756 | 514 | ((FLAG) == RCC_FLAG_PINRST) || ((FLAG) == RCC_FLAG_PORRST) || \ |
mbed_official | 76:aeb1df146756 | 515 | ((FLAG) == RCC_FLAG_SFTRST) || ((FLAG) == RCC_FLAG_IWDGRST) || \ |
mbed_official | 76:aeb1df146756 | 516 | ((FLAG) == RCC_FLAG_WWDGRST) || ((FLAG) == RCC_FLAG_LPWRRST) || \ |
mbed_official | 76:aeb1df146756 | 517 | ((FLAG) == RCC_FLAG_HSI14RDY)|| ((FLAG) == RCC_FLAG_HSI48RDY)|| \ |
mbed_official | 76:aeb1df146756 | 518 | ((FLAG) == RCC_FLAG_V18PWRRSTF)) |
mbed_official | 76:aeb1df146756 | 519 | |
mbed_official | 76:aeb1df146756 | 520 | #define IS_RCC_HSI_CALIBRATION_VALUE(VALUE) ((VALUE) <= 0x1F) |
mbed_official | 76:aeb1df146756 | 521 | #define IS_RCC_HSI14_CALIBRATION_VALUE(VALUE) ((VALUE) <= 0x1F) |
mbed_official | 76:aeb1df146756 | 522 | |
mbed_official | 76:aeb1df146756 | 523 | /** |
mbed_official | 76:aeb1df146756 | 524 | * @} |
mbed_official | 76:aeb1df146756 | 525 | */ |
mbed_official | 76:aeb1df146756 | 526 | |
mbed_official | 76:aeb1df146756 | 527 | /** |
mbed_official | 76:aeb1df146756 | 528 | * @} |
mbed_official | 76:aeb1df146756 | 529 | */ |
mbed_official | 76:aeb1df146756 | 530 | |
mbed_official | 76:aeb1df146756 | 531 | /* Exported macro ------------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 532 | /* Exported functions ------------------------------------------------------- */ |
mbed_official | 76:aeb1df146756 | 533 | |
mbed_official | 76:aeb1df146756 | 534 | /* Function used to set the RCC clock configuration to the default reset state */ |
mbed_official | 76:aeb1df146756 | 535 | void RCC_DeInit(void); |
mbed_official | 76:aeb1df146756 | 536 | |
mbed_official | 76:aeb1df146756 | 537 | /* Internal/external clocks, PLL, CSS and MCO configuration functions *********/ |
mbed_official | 76:aeb1df146756 | 538 | void RCC_HSEConfig(uint8_t RCC_HSE); |
mbed_official | 76:aeb1df146756 | 539 | ErrorStatus RCC_WaitForHSEStartUp(void); |
mbed_official | 76:aeb1df146756 | 540 | void RCC_AdjustHSICalibrationValue(uint8_t HSICalibrationValue); |
mbed_official | 76:aeb1df146756 | 541 | void RCC_HSICmd(FunctionalState NewState); |
mbed_official | 76:aeb1df146756 | 542 | void RCC_AdjustHSI14CalibrationValue(uint8_t HSI14CalibrationValue); |
mbed_official | 76:aeb1df146756 | 543 | void RCC_HSI14Cmd(FunctionalState NewState); |
mbed_official | 76:aeb1df146756 | 544 | void RCC_HSI14ADCRequestCmd(FunctionalState NewState); |
mbed_official | 76:aeb1df146756 | 545 | void RCC_LSEConfig(uint32_t RCC_LSE); |
mbed_official | 76:aeb1df146756 | 546 | void RCC_LSEDriveConfig(uint32_t RCC_LSEDrive); |
mbed_official | 76:aeb1df146756 | 547 | void RCC_LSICmd(FunctionalState NewState); |
mbed_official | 76:aeb1df146756 | 548 | void RCC_PLLConfig(uint32_t RCC_PLLSource, uint32_t RCC_PLLMul); |
mbed_official | 76:aeb1df146756 | 549 | void RCC_PLLCmd(FunctionalState NewState); |
mbed_official | 76:aeb1df146756 | 550 | void RCC_HSI48Cmd(FunctionalState NewState); /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 551 | uint32_t RCC_GetHSI48CalibrationValue(void); /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 552 | void RCC_PREDIV1Config(uint32_t RCC_PREDIV1_Div); |
mbed_official | 76:aeb1df146756 | 553 | void RCC_ClockSecuritySystemCmd(FunctionalState NewState); |
mbed_official | 76:aeb1df146756 | 554 | #ifdef STM32F051 |
mbed_official | 76:aeb1df146756 | 555 | void RCC_MCOConfig(uint8_t RCC_MCOSource); |
mbed_official | 76:aeb1df146756 | 556 | #else |
mbed_official | 76:aeb1df146756 | 557 | void RCC_MCOConfig(uint8_t RCC_MCOSource,uint32_t RCC_MCOPrescaler); |
mbed_official | 76:aeb1df146756 | 558 | #endif /* STM32F051 */ |
mbed_official | 76:aeb1df146756 | 559 | |
mbed_official | 76:aeb1df146756 | 560 | /* System, AHB and APB busses clocks configuration functions ******************/ |
mbed_official | 76:aeb1df146756 | 561 | void RCC_SYSCLKConfig(uint32_t RCC_SYSCLKSource); |
mbed_official | 76:aeb1df146756 | 562 | uint8_t RCC_GetSYSCLKSource(void); |
mbed_official | 76:aeb1df146756 | 563 | void RCC_HCLKConfig(uint32_t RCC_SYSCLK); |
mbed_official | 76:aeb1df146756 | 564 | void RCC_PCLKConfig(uint32_t RCC_HCLK); |
mbed_official | 76:aeb1df146756 | 565 | void RCC_ADCCLKConfig(uint32_t RCC_ADCCLK); /* This function is obsolete. |
mbed_official | 76:aeb1df146756 | 566 | For proper ADC clock selection, refer to |
mbed_official | 76:aeb1df146756 | 567 | ADC_ClockModeConfig() in the ADC driver */ |
mbed_official | 76:aeb1df146756 | 568 | void RCC_CECCLKConfig(uint32_t RCC_CECCLK); |
mbed_official | 76:aeb1df146756 | 569 | void RCC_I2CCLKConfig(uint32_t RCC_I2CCLK); |
mbed_official | 76:aeb1df146756 | 570 | void RCC_USARTCLKConfig(uint32_t RCC_USARTCLK); |
mbed_official | 76:aeb1df146756 | 571 | void RCC_USBCLKConfig(uint32_t RCC_USBCLK); /*!< Only applicable for STM32F042 and STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 572 | void RCC_GetClocksFreq(RCC_ClocksTypeDef* RCC_Clocks); |
mbed_official | 76:aeb1df146756 | 573 | |
mbed_official | 76:aeb1df146756 | 574 | /* Peripheral clocks configuration functions **********************************/ |
mbed_official | 76:aeb1df146756 | 575 | void RCC_RTCCLKConfig(uint32_t RCC_RTCCLKSource); |
mbed_official | 76:aeb1df146756 | 576 | void RCC_RTCCLKCmd(FunctionalState NewState); |
mbed_official | 76:aeb1df146756 | 577 | void RCC_BackupResetCmd(FunctionalState NewState); |
mbed_official | 76:aeb1df146756 | 578 | |
mbed_official | 76:aeb1df146756 | 579 | void RCC_AHBPeriphClockCmd(uint32_t RCC_AHBPeriph, FunctionalState NewState); |
mbed_official | 76:aeb1df146756 | 580 | void RCC_APB2PeriphClockCmd(uint32_t RCC_APB2Periph, FunctionalState NewState); |
mbed_official | 76:aeb1df146756 | 581 | void RCC_APB1PeriphClockCmd(uint32_t RCC_APB1Periph, FunctionalState NewState); |
mbed_official | 76:aeb1df146756 | 582 | |
mbed_official | 76:aeb1df146756 | 583 | void RCC_AHBPeriphResetCmd(uint32_t RCC_AHBPeriph, FunctionalState NewState); |
mbed_official | 76:aeb1df146756 | 584 | void RCC_APB2PeriphResetCmd(uint32_t RCC_APB2Periph, FunctionalState NewState); |
mbed_official | 76:aeb1df146756 | 585 | void RCC_APB1PeriphResetCmd(uint32_t RCC_APB1Periph, FunctionalState NewState); |
mbed_official | 76:aeb1df146756 | 586 | |
mbed_official | 76:aeb1df146756 | 587 | /* Interrupts and flags management functions **********************************/ |
mbed_official | 76:aeb1df146756 | 588 | void RCC_ITConfig(uint8_t RCC_IT, FunctionalState NewState); |
mbed_official | 76:aeb1df146756 | 589 | FlagStatus RCC_GetFlagStatus(uint8_t RCC_FLAG); |
mbed_official | 76:aeb1df146756 | 590 | void RCC_ClearFlag(void); |
mbed_official | 76:aeb1df146756 | 591 | ITStatus RCC_GetITStatus(uint8_t RCC_IT); |
mbed_official | 76:aeb1df146756 | 592 | void RCC_ClearITPendingBit(uint8_t RCC_IT); |
mbed_official | 76:aeb1df146756 | 593 | |
mbed_official | 76:aeb1df146756 | 594 | #ifdef __cplusplus |
mbed_official | 76:aeb1df146756 | 595 | } |
mbed_official | 76:aeb1df146756 | 596 | #endif |
mbed_official | 76:aeb1df146756 | 597 | |
mbed_official | 76:aeb1df146756 | 598 | #endif /* __STM32F0XX_RCC_H */ |
mbed_official | 76:aeb1df146756 | 599 | |
mbed_official | 76:aeb1df146756 | 600 | /** |
mbed_official | 76:aeb1df146756 | 601 | * @} |
mbed_official | 76:aeb1df146756 | 602 | */ |
mbed_official | 76:aeb1df146756 | 603 | |
mbed_official | 76:aeb1df146756 | 604 | /** |
mbed_official | 76:aeb1df146756 | 605 | * @} |
mbed_official | 76:aeb1df146756 | 606 | */ |
mbed_official | 76:aeb1df146756 | 607 | |
mbed_official | 76:aeb1df146756 | 608 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |