mbed library sources

Dependents:   Marvino mbot

Fork of mbed-src by mbed official

Committer:
jaerts
Date:
Tue Dec 22 13:22:16 2015 +0000
Revision:
637:ed69428d4850
Parent:
155:8435094ec241
Add very shady LPC1768 CAN Filter implementation

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 155:8435094ec241 1 /**
mbed_official 155:8435094ec241 2 ******************************************************************************
mbed_official 155:8435094ec241 3 * @file stm32f30x_rcc.h
mbed_official 155:8435094ec241 4 * @author MCD Application Team
mbed_official 155:8435094ec241 5 * @version V1.1.0
mbed_official 155:8435094ec241 6 * @date 27-February-2014
mbed_official 155:8435094ec241 7 * @brief This file contains all the functions prototypes for the RCC
mbed_official 155:8435094ec241 8 * firmware library.
mbed_official 155:8435094ec241 9 ******************************************************************************
mbed_official 155:8435094ec241 10 * @attention
mbed_official 155:8435094ec241 11 *
mbed_official 155:8435094ec241 12 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
mbed_official 155:8435094ec241 13 *
mbed_official 155:8435094ec241 14 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 155:8435094ec241 15 * are permitted provided that the following conditions are met:
mbed_official 155:8435094ec241 16 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 155:8435094ec241 17 * this list of conditions and the following disclaimer.
mbed_official 155:8435094ec241 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 155:8435094ec241 19 * this list of conditions and the following disclaimer in the documentation
mbed_official 155:8435094ec241 20 * and/or other materials provided with the distribution.
mbed_official 155:8435094ec241 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 155:8435094ec241 22 * may be used to endorse or promote products derived from this software
mbed_official 155:8435094ec241 23 * without specific prior written permission.
mbed_official 155:8435094ec241 24 *
mbed_official 155:8435094ec241 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 155:8435094ec241 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 155:8435094ec241 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 155:8435094ec241 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 155:8435094ec241 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 155:8435094ec241 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 155:8435094ec241 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 155:8435094ec241 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 155:8435094ec241 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 155:8435094ec241 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 155:8435094ec241 35 *
mbed_official 155:8435094ec241 36 ******************************************************************************
mbed_official 155:8435094ec241 37 */
mbed_official 155:8435094ec241 38
mbed_official 155:8435094ec241 39 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 155:8435094ec241 40 #ifndef __STM32F30x_RCC_H
mbed_official 155:8435094ec241 41 #define __STM32F30x_RCC_H
mbed_official 155:8435094ec241 42
mbed_official 155:8435094ec241 43 #ifdef __cplusplus
mbed_official 155:8435094ec241 44 extern "C" {
mbed_official 155:8435094ec241 45 #endif
mbed_official 155:8435094ec241 46
mbed_official 155:8435094ec241 47 /* Includes ------------------------------------------------------------------*/
mbed_official 155:8435094ec241 48 #include "stm32f30x.h"
mbed_official 155:8435094ec241 49
mbed_official 155:8435094ec241 50 /** @addtogroup STM32F30x_StdPeriph_Driver
mbed_official 155:8435094ec241 51 * @{
mbed_official 155:8435094ec241 52 */
mbed_official 155:8435094ec241 53
mbed_official 155:8435094ec241 54 /** @addtogroup RCC
mbed_official 155:8435094ec241 55 * @{
mbed_official 155:8435094ec241 56 */
mbed_official 155:8435094ec241 57
mbed_official 155:8435094ec241 58 /* Exported types ------------------------------------------------------------*/
mbed_official 155:8435094ec241 59
mbed_official 155:8435094ec241 60 typedef struct
mbed_official 155:8435094ec241 61 {
mbed_official 155:8435094ec241 62 uint32_t SYSCLK_Frequency;
mbed_official 155:8435094ec241 63 uint32_t HCLK_Frequency;
mbed_official 155:8435094ec241 64 uint32_t PCLK1_Frequency;
mbed_official 155:8435094ec241 65 uint32_t PCLK2_Frequency;
mbed_official 155:8435094ec241 66 uint32_t ADC12CLK_Frequency;
mbed_official 155:8435094ec241 67 uint32_t ADC34CLK_Frequency;
mbed_official 155:8435094ec241 68 uint32_t I2C1CLK_Frequency;
mbed_official 155:8435094ec241 69 uint32_t I2C2CLK_Frequency;
mbed_official 155:8435094ec241 70 uint32_t I2C3CLK_Frequency;
mbed_official 155:8435094ec241 71 uint32_t TIM1CLK_Frequency;
mbed_official 155:8435094ec241 72 uint32_t HRTIM1CLK_Frequency;
mbed_official 155:8435094ec241 73 uint32_t TIM8CLK_Frequency;
mbed_official 155:8435094ec241 74 uint32_t USART1CLK_Frequency;
mbed_official 155:8435094ec241 75 uint32_t USART2CLK_Frequency;
mbed_official 155:8435094ec241 76 uint32_t USART3CLK_Frequency;
mbed_official 155:8435094ec241 77 uint32_t UART4CLK_Frequency;
mbed_official 155:8435094ec241 78 uint32_t UART5CLK_Frequency;
mbed_official 155:8435094ec241 79 uint32_t TIM15CLK_Frequency;
mbed_official 155:8435094ec241 80 uint32_t TIM16CLK_Frequency;
mbed_official 155:8435094ec241 81 uint32_t TIM17CLK_Frequency;
mbed_official 155:8435094ec241 82 }RCC_ClocksTypeDef;
mbed_official 155:8435094ec241 83
mbed_official 155:8435094ec241 84 /* Exported constants --------------------------------------------------------*/
mbed_official 155:8435094ec241 85
mbed_official 155:8435094ec241 86 /** @defgroup RCC_Exported_Constants
mbed_official 155:8435094ec241 87 * @{
mbed_official 155:8435094ec241 88 */
mbed_official 155:8435094ec241 89
mbed_official 155:8435094ec241 90 /** @defgroup RCC_HSE_configuration
mbed_official 155:8435094ec241 91 * @{
mbed_official 155:8435094ec241 92 */
mbed_official 155:8435094ec241 93
mbed_official 155:8435094ec241 94 #define RCC_HSE_OFF ((uint8_t)0x00)
mbed_official 155:8435094ec241 95 #define RCC_HSE_ON ((uint8_t)0x01)
mbed_official 155:8435094ec241 96 #define RCC_HSE_Bypass ((uint8_t)0x05)
mbed_official 155:8435094ec241 97 #define IS_RCC_HSE(HSE) (((HSE) == RCC_HSE_OFF) || ((HSE) == RCC_HSE_ON) || \
mbed_official 155:8435094ec241 98 ((HSE) == RCC_HSE_Bypass))
mbed_official 155:8435094ec241 99
mbed_official 155:8435094ec241 100 /**
mbed_official 155:8435094ec241 101 * @}
mbed_official 155:8435094ec241 102 */
mbed_official 155:8435094ec241 103
mbed_official 155:8435094ec241 104 /** @defgroup RCC_PLL_Clock_Source
mbed_official 155:8435094ec241 105 * @{
mbed_official 155:8435094ec241 106 */
mbed_official 155:8435094ec241 107
mbed_official 155:8435094ec241 108 #define RCC_PLLSource_HSI_Div2 RCC_CFGR_PLLSRC_HSI_Div2
mbed_official 155:8435094ec241 109 #define RCC_PLLSource_PREDIV1 RCC_CFGR_PLLSRC_PREDIV1
mbed_official 155:8435094ec241 110
mbed_official 155:8435094ec241 111 #define IS_RCC_PLL_SOURCE(SOURCE) (((SOURCE) == RCC_PLLSource_HSI_Div2) || \
mbed_official 155:8435094ec241 112 ((SOURCE) == RCC_PLLSource_PREDIV1))
mbed_official 155:8435094ec241 113 /**
mbed_official 155:8435094ec241 114 * @}
mbed_official 155:8435094ec241 115 */
mbed_official 155:8435094ec241 116
mbed_official 155:8435094ec241 117 /** @defgroup RCC_PLL_Multiplication_Factor
mbed_official 155:8435094ec241 118 * @{
mbed_official 155:8435094ec241 119 */
mbed_official 155:8435094ec241 120
mbed_official 155:8435094ec241 121 #define RCC_PLLMul_2 RCC_CFGR_PLLMULL2
mbed_official 155:8435094ec241 122 #define RCC_PLLMul_3 RCC_CFGR_PLLMULL3
mbed_official 155:8435094ec241 123 #define RCC_PLLMul_4 RCC_CFGR_PLLMULL4
mbed_official 155:8435094ec241 124 #define RCC_PLLMul_5 RCC_CFGR_PLLMULL5
mbed_official 155:8435094ec241 125 #define RCC_PLLMul_6 RCC_CFGR_PLLMULL6
mbed_official 155:8435094ec241 126 #define RCC_PLLMul_7 RCC_CFGR_PLLMULL7
mbed_official 155:8435094ec241 127 #define RCC_PLLMul_8 RCC_CFGR_PLLMULL8
mbed_official 155:8435094ec241 128 #define RCC_PLLMul_9 RCC_CFGR_PLLMULL9
mbed_official 155:8435094ec241 129 #define RCC_PLLMul_10 RCC_CFGR_PLLMULL10
mbed_official 155:8435094ec241 130 #define RCC_PLLMul_11 RCC_CFGR_PLLMULL11
mbed_official 155:8435094ec241 131 #define RCC_PLLMul_12 RCC_CFGR_PLLMULL12
mbed_official 155:8435094ec241 132 #define RCC_PLLMul_13 RCC_CFGR_PLLMULL13
mbed_official 155:8435094ec241 133 #define RCC_PLLMul_14 RCC_CFGR_PLLMULL14
mbed_official 155:8435094ec241 134 #define RCC_PLLMul_15 RCC_CFGR_PLLMULL15
mbed_official 155:8435094ec241 135 #define RCC_PLLMul_16 RCC_CFGR_PLLMULL16
mbed_official 155:8435094ec241 136 #define IS_RCC_PLL_MUL(MUL) (((MUL) == RCC_PLLMul_2) || ((MUL) == RCC_PLLMul_3) || \
mbed_official 155:8435094ec241 137 ((MUL) == RCC_PLLMul_4) || ((MUL) == RCC_PLLMul_5) || \
mbed_official 155:8435094ec241 138 ((MUL) == RCC_PLLMul_6) || ((MUL) == RCC_PLLMul_7) || \
mbed_official 155:8435094ec241 139 ((MUL) == RCC_PLLMul_8) || ((MUL) == RCC_PLLMul_9) || \
mbed_official 155:8435094ec241 140 ((MUL) == RCC_PLLMul_10) || ((MUL) == RCC_PLLMul_11) || \
mbed_official 155:8435094ec241 141 ((MUL) == RCC_PLLMul_12) || ((MUL) == RCC_PLLMul_13) || \
mbed_official 155:8435094ec241 142 ((MUL) == RCC_PLLMul_14) || ((MUL) == RCC_PLLMul_15) || \
mbed_official 155:8435094ec241 143 ((MUL) == RCC_PLLMul_16))
mbed_official 155:8435094ec241 144 /**
mbed_official 155:8435094ec241 145 * @}
mbed_official 155:8435094ec241 146 */
mbed_official 155:8435094ec241 147
mbed_official 155:8435094ec241 148 /** @defgroup RCC_PREDIV1_division_factor
mbed_official 155:8435094ec241 149 * @{
mbed_official 155:8435094ec241 150 */
mbed_official 155:8435094ec241 151 #define RCC_PREDIV1_Div1 RCC_CFGR2_PREDIV1_DIV1
mbed_official 155:8435094ec241 152 #define RCC_PREDIV1_Div2 RCC_CFGR2_PREDIV1_DIV2
mbed_official 155:8435094ec241 153 #define RCC_PREDIV1_Div3 RCC_CFGR2_PREDIV1_DIV3
mbed_official 155:8435094ec241 154 #define RCC_PREDIV1_Div4 RCC_CFGR2_PREDIV1_DIV4
mbed_official 155:8435094ec241 155 #define RCC_PREDIV1_Div5 RCC_CFGR2_PREDIV1_DIV5
mbed_official 155:8435094ec241 156 #define RCC_PREDIV1_Div6 RCC_CFGR2_PREDIV1_DIV6
mbed_official 155:8435094ec241 157 #define RCC_PREDIV1_Div7 RCC_CFGR2_PREDIV1_DIV7
mbed_official 155:8435094ec241 158 #define RCC_PREDIV1_Div8 RCC_CFGR2_PREDIV1_DIV8
mbed_official 155:8435094ec241 159 #define RCC_PREDIV1_Div9 RCC_CFGR2_PREDIV1_DIV9
mbed_official 155:8435094ec241 160 #define RCC_PREDIV1_Div10 RCC_CFGR2_PREDIV1_DIV10
mbed_official 155:8435094ec241 161 #define RCC_PREDIV1_Div11 RCC_CFGR2_PREDIV1_DIV11
mbed_official 155:8435094ec241 162 #define RCC_PREDIV1_Div12 RCC_CFGR2_PREDIV1_DIV12
mbed_official 155:8435094ec241 163 #define RCC_PREDIV1_Div13 RCC_CFGR2_PREDIV1_DIV13
mbed_official 155:8435094ec241 164 #define RCC_PREDIV1_Div14 RCC_CFGR2_PREDIV1_DIV14
mbed_official 155:8435094ec241 165 #define RCC_PREDIV1_Div15 RCC_CFGR2_PREDIV1_DIV15
mbed_official 155:8435094ec241 166 #define RCC_PREDIV1_Div16 RCC_CFGR2_PREDIV1_DIV16
mbed_official 155:8435094ec241 167
mbed_official 155:8435094ec241 168 #define IS_RCC_PREDIV1(PREDIV1) (((PREDIV1) == RCC_PREDIV1_Div1) || ((PREDIV1) == RCC_PREDIV1_Div2) || \
mbed_official 155:8435094ec241 169 ((PREDIV1) == RCC_PREDIV1_Div3) || ((PREDIV1) == RCC_PREDIV1_Div4) || \
mbed_official 155:8435094ec241 170 ((PREDIV1) == RCC_PREDIV1_Div5) || ((PREDIV1) == RCC_PREDIV1_Div6) || \
mbed_official 155:8435094ec241 171 ((PREDIV1) == RCC_PREDIV1_Div7) || ((PREDIV1) == RCC_PREDIV1_Div8) || \
mbed_official 155:8435094ec241 172 ((PREDIV1) == RCC_PREDIV1_Div9) || ((PREDIV1) == RCC_PREDIV1_Div10) || \
mbed_official 155:8435094ec241 173 ((PREDIV1) == RCC_PREDIV1_Div11) || ((PREDIV1) == RCC_PREDIV1_Div12) || \
mbed_official 155:8435094ec241 174 ((PREDIV1) == RCC_PREDIV1_Div13) || ((PREDIV1) == RCC_PREDIV1_Div14) || \
mbed_official 155:8435094ec241 175 ((PREDIV1) == RCC_PREDIV1_Div15) || ((PREDIV1) == RCC_PREDIV1_Div16))
mbed_official 155:8435094ec241 176 /**
mbed_official 155:8435094ec241 177 * @}
mbed_official 155:8435094ec241 178 */
mbed_official 155:8435094ec241 179
mbed_official 155:8435094ec241 180 /** @defgroup RCC_System_Clock_Source
mbed_official 155:8435094ec241 181 * @{
mbed_official 155:8435094ec241 182 */
mbed_official 155:8435094ec241 183
mbed_official 155:8435094ec241 184 #define RCC_SYSCLKSource_HSI RCC_CFGR_SW_HSI
mbed_official 155:8435094ec241 185 #define RCC_SYSCLKSource_HSE RCC_CFGR_SW_HSE
mbed_official 155:8435094ec241 186 #define RCC_SYSCLKSource_PLLCLK RCC_CFGR_SW_PLL
mbed_official 155:8435094ec241 187 #define IS_RCC_SYSCLK_SOURCE(SOURCE) (((SOURCE) == RCC_SYSCLKSource_HSI) || \
mbed_official 155:8435094ec241 188 ((SOURCE) == RCC_SYSCLKSource_HSE) || \
mbed_official 155:8435094ec241 189 ((SOURCE) == RCC_SYSCLKSource_PLLCLK))
mbed_official 155:8435094ec241 190 /**
mbed_official 155:8435094ec241 191 * @}
mbed_official 155:8435094ec241 192 */
mbed_official 155:8435094ec241 193
mbed_official 155:8435094ec241 194 /** @defgroup RCC_AHB_Clock_Source
mbed_official 155:8435094ec241 195 * @{
mbed_official 155:8435094ec241 196 */
mbed_official 155:8435094ec241 197
mbed_official 155:8435094ec241 198 #define RCC_SYSCLK_Div1 RCC_CFGR_HPRE_DIV1
mbed_official 155:8435094ec241 199 #define RCC_SYSCLK_Div2 RCC_CFGR_HPRE_DIV2
mbed_official 155:8435094ec241 200 #define RCC_SYSCLK_Div4 RCC_CFGR_HPRE_DIV4
mbed_official 155:8435094ec241 201 #define RCC_SYSCLK_Div8 RCC_CFGR_HPRE_DIV8
mbed_official 155:8435094ec241 202 #define RCC_SYSCLK_Div16 RCC_CFGR_HPRE_DIV16
mbed_official 155:8435094ec241 203 #define RCC_SYSCLK_Div64 RCC_CFGR_HPRE_DIV64
mbed_official 155:8435094ec241 204 #define RCC_SYSCLK_Div128 RCC_CFGR_HPRE_DIV128
mbed_official 155:8435094ec241 205 #define RCC_SYSCLK_Div256 RCC_CFGR_HPRE_DIV256
mbed_official 155:8435094ec241 206 #define RCC_SYSCLK_Div512 RCC_CFGR_HPRE_DIV512
mbed_official 155:8435094ec241 207 #define IS_RCC_HCLK(HCLK) (((HCLK) == RCC_SYSCLK_Div1) || ((HCLK) == RCC_SYSCLK_Div2) || \
mbed_official 155:8435094ec241 208 ((HCLK) == RCC_SYSCLK_Div4) || ((HCLK) == RCC_SYSCLK_Div8) || \
mbed_official 155:8435094ec241 209 ((HCLK) == RCC_SYSCLK_Div16) || ((HCLK) == RCC_SYSCLK_Div64) || \
mbed_official 155:8435094ec241 210 ((HCLK) == RCC_SYSCLK_Div128) || ((HCLK) == RCC_SYSCLK_Div256) || \
mbed_official 155:8435094ec241 211 ((HCLK) == RCC_SYSCLK_Div512))
mbed_official 155:8435094ec241 212 /**
mbed_official 155:8435094ec241 213 * @}
mbed_official 155:8435094ec241 214 */
mbed_official 155:8435094ec241 215
mbed_official 155:8435094ec241 216 /** @defgroup RCC_APB1_APB2_clock_source
mbed_official 155:8435094ec241 217 * @{
mbed_official 155:8435094ec241 218 */
mbed_official 155:8435094ec241 219
mbed_official 155:8435094ec241 220 #define RCC_HCLK_Div1 ((uint32_t)0x00000000)
mbed_official 155:8435094ec241 221 #define RCC_HCLK_Div2 ((uint32_t)0x00000400)
mbed_official 155:8435094ec241 222 #define RCC_HCLK_Div4 ((uint32_t)0x00000500)
mbed_official 155:8435094ec241 223 #define RCC_HCLK_Div8 ((uint32_t)0x00000600)
mbed_official 155:8435094ec241 224 #define RCC_HCLK_Div16 ((uint32_t)0x00000700)
mbed_official 155:8435094ec241 225 #define IS_RCC_PCLK(PCLK) (((PCLK) == RCC_HCLK_Div1) || ((PCLK) == RCC_HCLK_Div2) || \
mbed_official 155:8435094ec241 226 ((PCLK) == RCC_HCLK_Div4) || ((PCLK) == RCC_HCLK_Div8) || \
mbed_official 155:8435094ec241 227 ((PCLK) == RCC_HCLK_Div16))
mbed_official 155:8435094ec241 228 /**
mbed_official 155:8435094ec241 229 * @}
mbed_official 155:8435094ec241 230 */
mbed_official 155:8435094ec241 231
mbed_official 155:8435094ec241 232 /** @defgroup RCC_ADC_clock_source
mbed_official 155:8435094ec241 233 * @{
mbed_official 155:8435094ec241 234 */
mbed_official 155:8435094ec241 235
mbed_official 155:8435094ec241 236 /* ADC1 & ADC2 */
mbed_official 155:8435094ec241 237 #define RCC_ADC12PLLCLK_OFF ((uint32_t)0x00000000)
mbed_official 155:8435094ec241 238 #define RCC_ADC12PLLCLK_Div1 ((uint32_t)0x00000100)
mbed_official 155:8435094ec241 239 #define RCC_ADC12PLLCLK_Div2 ((uint32_t)0x00000110)
mbed_official 155:8435094ec241 240 #define RCC_ADC12PLLCLK_Div4 ((uint32_t)0x00000120)
mbed_official 155:8435094ec241 241 #define RCC_ADC12PLLCLK_Div6 ((uint32_t)0x00000130)
mbed_official 155:8435094ec241 242 #define RCC_ADC12PLLCLK_Div8 ((uint32_t)0x00000140)
mbed_official 155:8435094ec241 243 #define RCC_ADC12PLLCLK_Div10 ((uint32_t)0x00000150)
mbed_official 155:8435094ec241 244 #define RCC_ADC12PLLCLK_Div12 ((uint32_t)0x00000160)
mbed_official 155:8435094ec241 245 #define RCC_ADC12PLLCLK_Div16 ((uint32_t)0x00000170)
mbed_official 155:8435094ec241 246 #define RCC_ADC12PLLCLK_Div32 ((uint32_t)0x00000180)
mbed_official 155:8435094ec241 247 #define RCC_ADC12PLLCLK_Div64 ((uint32_t)0x00000190)
mbed_official 155:8435094ec241 248 #define RCC_ADC12PLLCLK_Div128 ((uint32_t)0x000001A0)
mbed_official 155:8435094ec241 249 #define RCC_ADC12PLLCLK_Div256 ((uint32_t)0x000001B0)
mbed_official 155:8435094ec241 250
mbed_official 155:8435094ec241 251 /* ADC3 & ADC4 */
mbed_official 155:8435094ec241 252 #define RCC_ADC34PLLCLK_OFF ((uint32_t)0x10000000)
mbed_official 155:8435094ec241 253 #define RCC_ADC34PLLCLK_Div1 ((uint32_t)0x10002000)
mbed_official 155:8435094ec241 254 #define RCC_ADC34PLLCLK_Div2 ((uint32_t)0x10002200)
mbed_official 155:8435094ec241 255 #define RCC_ADC34PLLCLK_Div4 ((uint32_t)0x10002400)
mbed_official 155:8435094ec241 256 #define RCC_ADC34PLLCLK_Div6 ((uint32_t)0x10002600)
mbed_official 155:8435094ec241 257 #define RCC_ADC34PLLCLK_Div8 ((uint32_t)0x10002800)
mbed_official 155:8435094ec241 258 #define RCC_ADC34PLLCLK_Div10 ((uint32_t)0x10002A00)
mbed_official 155:8435094ec241 259 #define RCC_ADC34PLLCLK_Div12 ((uint32_t)0x10002C00)
mbed_official 155:8435094ec241 260 #define RCC_ADC34PLLCLK_Div16 ((uint32_t)0x10002E00)
mbed_official 155:8435094ec241 261 #define RCC_ADC34PLLCLK_Div32 ((uint32_t)0x10003000)
mbed_official 155:8435094ec241 262 #define RCC_ADC34PLLCLK_Div64 ((uint32_t)0x10003200)
mbed_official 155:8435094ec241 263 #define RCC_ADC34PLLCLK_Div128 ((uint32_t)0x10003400)
mbed_official 155:8435094ec241 264 #define RCC_ADC34PLLCLK_Div256 ((uint32_t)0x10003600)
mbed_official 155:8435094ec241 265
mbed_official 155:8435094ec241 266 #define IS_RCC_ADCCLK(ADCCLK) (((ADCCLK) == RCC_ADC12PLLCLK_OFF) || ((ADCCLK) == RCC_ADC12PLLCLK_Div1) || \
mbed_official 155:8435094ec241 267 ((ADCCLK) == RCC_ADC12PLLCLK_Div2) || ((ADCCLK) == RCC_ADC12PLLCLK_Div4) || \
mbed_official 155:8435094ec241 268 ((ADCCLK) == RCC_ADC12PLLCLK_Div6) || ((ADCCLK) == RCC_ADC12PLLCLK_Div8) || \
mbed_official 155:8435094ec241 269 ((ADCCLK) == RCC_ADC12PLLCLK_Div10) || ((ADCCLK) == RCC_ADC12PLLCLK_Div12) || \
mbed_official 155:8435094ec241 270 ((ADCCLK) == RCC_ADC12PLLCLK_Div16) || ((ADCCLK) == RCC_ADC12PLLCLK_Div32) || \
mbed_official 155:8435094ec241 271 ((ADCCLK) == RCC_ADC12PLLCLK_Div64) || ((ADCCLK) == RCC_ADC12PLLCLK_Div128) || \
mbed_official 155:8435094ec241 272 ((ADCCLK) == RCC_ADC12PLLCLK_Div256) || ((ADCCLK) == RCC_ADC34PLLCLK_OFF) || \
mbed_official 155:8435094ec241 273 ((ADCCLK) == RCC_ADC34PLLCLK_Div1) || ((ADCCLK) == RCC_ADC34PLLCLK_Div2) || \
mbed_official 155:8435094ec241 274 ((ADCCLK) == RCC_ADC34PLLCLK_Div4) || ((ADCCLK) == RCC_ADC34PLLCLK_Div6) || \
mbed_official 155:8435094ec241 275 ((ADCCLK) == RCC_ADC34PLLCLK_Div8) || ((ADCCLK) == RCC_ADC34PLLCLK_Div10) || \
mbed_official 155:8435094ec241 276 ((ADCCLK) == RCC_ADC34PLLCLK_Div12) || ((ADCCLK) == RCC_ADC34PLLCLK_Div16) || \
mbed_official 155:8435094ec241 277 ((ADCCLK) == RCC_ADC34PLLCLK_Div32) || ((ADCCLK) == RCC_ADC34PLLCLK_Div64) || \
mbed_official 155:8435094ec241 278 ((ADCCLK) == RCC_ADC34PLLCLK_Div128) || ((ADCCLK) == RCC_ADC34PLLCLK_Div256))
mbed_official 155:8435094ec241 279
mbed_official 155:8435094ec241 280 /**
mbed_official 155:8435094ec241 281 * @}
mbed_official 155:8435094ec241 282 */
mbed_official 155:8435094ec241 283
mbed_official 155:8435094ec241 284 /** @defgroup RCC_TIM_clock_source
mbed_official 155:8435094ec241 285 * @{
mbed_official 155:8435094ec241 286 */
mbed_official 155:8435094ec241 287
mbed_official 155:8435094ec241 288 #define RCC_TIM1CLK_HCLK ((uint32_t)0x00000000)
mbed_official 155:8435094ec241 289 #define RCC_TIM1CLK_PLLCLK RCC_CFGR3_TIM1SW
mbed_official 155:8435094ec241 290
mbed_official 155:8435094ec241 291 #define RCC_TIM8CLK_HCLK ((uint32_t)0x10000000)
mbed_official 155:8435094ec241 292 #define RCC_TIM8CLK_PLLCLK ((uint32_t)0x10000200)
mbed_official 155:8435094ec241 293
mbed_official 155:8435094ec241 294 #define RCC_TIM15CLK_HCLK ((uint32_t)0x20000000)
mbed_official 155:8435094ec241 295 #define RCC_TIM15CLK_PLLCLK ((uint32_t)0x20000400)
mbed_official 155:8435094ec241 296
mbed_official 155:8435094ec241 297 #define RCC_TIM16CLK_HCLK ((uint32_t)0x30000000)
mbed_official 155:8435094ec241 298 #define RCC_TIM16CLK_PLLCLK ((uint32_t)0x30000800)
mbed_official 155:8435094ec241 299
mbed_official 155:8435094ec241 300 #define RCC_TIM17CLK_HCLK ((uint32_t)0x40000000)
mbed_official 155:8435094ec241 301 #define RCC_TIM17CLK_PLLCLK ((uint32_t)0x40002000)
mbed_official 155:8435094ec241 302
mbed_official 155:8435094ec241 303 #define IS_RCC_TIMCLK(TIMCLK) (((TIMCLK) == RCC_TIM1CLK_HCLK) || ((TIMCLK) == RCC_TIM1CLK_PLLCLK) || \
mbed_official 155:8435094ec241 304 ((TIMCLK) == RCC_TIM8CLK_HCLK) || ((TIMCLK) == RCC_TIM8CLK_PLLCLK) || \
mbed_official 155:8435094ec241 305 ((TIMCLK) == RCC_TIM15CLK_HCLK) || ((TIMCLK) == RCC_TIM15CLK_PLLCLK) || \
mbed_official 155:8435094ec241 306 ((TIMCLK) == RCC_TIM16CLK_HCLK) || ((TIMCLK) == RCC_TIM16CLK_PLLCLK) || \
mbed_official 155:8435094ec241 307 ((TIMCLK) == RCC_TIM17CLK_HCLK) || ((TIMCLK) == RCC_TIM17CLK_PLLCLK))
mbed_official 155:8435094ec241 308
mbed_official 155:8435094ec241 309 /**
mbed_official 155:8435094ec241 310 * @}
mbed_official 155:8435094ec241 311 */
mbed_official 155:8435094ec241 312
mbed_official 155:8435094ec241 313 /** @defgroup RCC_HRTIM_clock_source
mbed_official 155:8435094ec241 314 * @{
mbed_official 155:8435094ec241 315 */
mbed_official 155:8435094ec241 316
mbed_official 155:8435094ec241 317 #define RCC_HRTIM1CLK_HCLK ((uint32_t)0x00000000)
mbed_official 155:8435094ec241 318 #define RCC_HRTIM1CLK_PLLCLK RCC_CFGR3_HRTIM1SW
mbed_official 155:8435094ec241 319
mbed_official 155:8435094ec241 320 #define IS_RCC_HRTIMCLK(HRTIMCLK) (((HRTIMCLK) == RCC_HRTIM1CLK_HCLK) || ((HRTIMCLK) == RCC_HRTIM1CLK_PLLCLK))
mbed_official 155:8435094ec241 321
mbed_official 155:8435094ec241 322 /**
mbed_official 155:8435094ec241 323 * @}
mbed_official 155:8435094ec241 324 */
mbed_official 155:8435094ec241 325
mbed_official 155:8435094ec241 326 /** @defgroup RCC_I2C_clock_source
mbed_official 155:8435094ec241 327 * @{
mbed_official 155:8435094ec241 328 */
mbed_official 155:8435094ec241 329
mbed_official 155:8435094ec241 330 #define RCC_I2C1CLK_HSI ((uint32_t)0x00000000)
mbed_official 155:8435094ec241 331 #define RCC_I2C1CLK_SYSCLK RCC_CFGR3_I2C1SW
mbed_official 155:8435094ec241 332
mbed_official 155:8435094ec241 333 #define RCC_I2C2CLK_HSI ((uint32_t)0x10000000)
mbed_official 155:8435094ec241 334 #define RCC_I2C2CLK_SYSCLK ((uint32_t)0x10000020)
mbed_official 155:8435094ec241 335
mbed_official 155:8435094ec241 336 #define RCC_I2C3CLK_HSI ((uint32_t)0x20000000)
mbed_official 155:8435094ec241 337 #define RCC_I2C3CLK_SYSCLK ((uint32_t)0x20000040)
mbed_official 155:8435094ec241 338
mbed_official 155:8435094ec241 339 #define IS_RCC_I2CCLK(I2CCLK) (((I2CCLK) == RCC_I2C1CLK_HSI) || ((I2CCLK) == RCC_I2C1CLK_SYSCLK) || \
mbed_official 155:8435094ec241 340 ((I2CCLK) == RCC_I2C2CLK_HSI) || ((I2CCLK) == RCC_I2C2CLK_SYSCLK) || \
mbed_official 155:8435094ec241 341 ((I2CCLK) == RCC_I2C3CLK_HSI) || ((I2CCLK) == RCC_I2C3CLK_SYSCLK))
mbed_official 155:8435094ec241 342
mbed_official 155:8435094ec241 343 /**
mbed_official 155:8435094ec241 344 * @}
mbed_official 155:8435094ec241 345 */
mbed_official 155:8435094ec241 346
mbed_official 155:8435094ec241 347 /** @defgroup RCC_USART_clock_source
mbed_official 155:8435094ec241 348 * @{
mbed_official 155:8435094ec241 349 */
mbed_official 155:8435094ec241 350
mbed_official 155:8435094ec241 351 #define RCC_USART1CLK_PCLK ((uint32_t)0x10000000)
mbed_official 155:8435094ec241 352 #define RCC_USART1CLK_SYSCLK ((uint32_t)0x10000001)
mbed_official 155:8435094ec241 353 #define RCC_USART1CLK_LSE ((uint32_t)0x10000002)
mbed_official 155:8435094ec241 354 #define RCC_USART1CLK_HSI ((uint32_t)0x10000003)
mbed_official 155:8435094ec241 355
mbed_official 155:8435094ec241 356 #define RCC_USART2CLK_PCLK ((uint32_t)0x20000000)
mbed_official 155:8435094ec241 357 #define RCC_USART2CLK_SYSCLK ((uint32_t)0x20010000)
mbed_official 155:8435094ec241 358 #define RCC_USART2CLK_LSE ((uint32_t)0x20020000)
mbed_official 155:8435094ec241 359 #define RCC_USART2CLK_HSI ((uint32_t)0x20030000)
mbed_official 155:8435094ec241 360
mbed_official 155:8435094ec241 361 #define RCC_USART3CLK_PCLK ((uint32_t)0x30000000)
mbed_official 155:8435094ec241 362 #define RCC_USART3CLK_SYSCLK ((uint32_t)0x30040000)
mbed_official 155:8435094ec241 363 #define RCC_USART3CLK_LSE ((uint32_t)0x30080000)
mbed_official 155:8435094ec241 364 #define RCC_USART3CLK_HSI ((uint32_t)0x300C0000)
mbed_official 155:8435094ec241 365
mbed_official 155:8435094ec241 366 #define RCC_UART4CLK_PCLK ((uint32_t)0x40000000)
mbed_official 155:8435094ec241 367 #define RCC_UART4CLK_SYSCLK ((uint32_t)0x40100000)
mbed_official 155:8435094ec241 368 #define RCC_UART4CLK_LSE ((uint32_t)0x40200000)
mbed_official 155:8435094ec241 369 #define RCC_UART4CLK_HSI ((uint32_t)0x40300000)
mbed_official 155:8435094ec241 370
mbed_official 155:8435094ec241 371 #define RCC_UART5CLK_PCLK ((uint32_t)0x50000000)
mbed_official 155:8435094ec241 372 #define RCC_UART5CLK_SYSCLK ((uint32_t)0x50400000)
mbed_official 155:8435094ec241 373 #define RCC_UART5CLK_LSE ((uint32_t)0x50800000)
mbed_official 155:8435094ec241 374 #define RCC_UART5CLK_HSI ((uint32_t)0x50C00000)
mbed_official 155:8435094ec241 375
mbed_official 155:8435094ec241 376 #define IS_RCC_USARTCLK(USARTCLK) (((USARTCLK) == RCC_USART1CLK_PCLK) || ((USARTCLK) == RCC_USART1CLK_SYSCLK) || \
mbed_official 155:8435094ec241 377 ((USARTCLK) == RCC_USART1CLK_LSE) || ((USARTCLK) == RCC_USART1CLK_HSI) ||\
mbed_official 155:8435094ec241 378 ((USARTCLK) == RCC_USART2CLK_PCLK) || ((USARTCLK) == RCC_USART2CLK_SYSCLK) || \
mbed_official 155:8435094ec241 379 ((USARTCLK) == RCC_USART2CLK_LSE) || ((USARTCLK) == RCC_USART2CLK_HSI) || \
mbed_official 155:8435094ec241 380 ((USARTCLK) == RCC_USART3CLK_PCLK) || ((USARTCLK) == RCC_USART3CLK_SYSCLK) || \
mbed_official 155:8435094ec241 381 ((USARTCLK) == RCC_USART3CLK_LSE) || ((USARTCLK) == RCC_USART3CLK_HSI) || \
mbed_official 155:8435094ec241 382 ((USARTCLK) == RCC_UART4CLK_PCLK) || ((USARTCLK) == RCC_UART4CLK_SYSCLK) || \
mbed_official 155:8435094ec241 383 ((USARTCLK) == RCC_UART4CLK_LSE) || ((USARTCLK) == RCC_UART4CLK_HSI) || \
mbed_official 155:8435094ec241 384 ((USARTCLK) == RCC_UART5CLK_PCLK) || ((USARTCLK) == RCC_UART5CLK_SYSCLK) || \
mbed_official 155:8435094ec241 385 ((USARTCLK) == RCC_UART5CLK_LSE) || ((USARTCLK) == RCC_UART5CLK_HSI))
mbed_official 155:8435094ec241 386
mbed_official 155:8435094ec241 387 /**
mbed_official 155:8435094ec241 388 * @}
mbed_official 155:8435094ec241 389 */
mbed_official 155:8435094ec241 390
mbed_official 155:8435094ec241 391 /** @defgroup RCC_Interrupt_Source
mbed_official 155:8435094ec241 392 * @{
mbed_official 155:8435094ec241 393 */
mbed_official 155:8435094ec241 394
mbed_official 155:8435094ec241 395 #define RCC_IT_LSIRDY ((uint8_t)0x01)
mbed_official 155:8435094ec241 396 #define RCC_IT_LSERDY ((uint8_t)0x02)
mbed_official 155:8435094ec241 397 #define RCC_IT_HSIRDY ((uint8_t)0x04)
mbed_official 155:8435094ec241 398 #define RCC_IT_HSERDY ((uint8_t)0x08)
mbed_official 155:8435094ec241 399 #define RCC_IT_PLLRDY ((uint8_t)0x10)
mbed_official 155:8435094ec241 400 #define RCC_IT_CSS ((uint8_t)0x80)
mbed_official 155:8435094ec241 401
mbed_official 155:8435094ec241 402 #define IS_RCC_IT(IT) ((((IT) & (uint8_t)0xC0) == 0x00) && ((IT) != 0x00))
mbed_official 155:8435094ec241 403
mbed_official 155:8435094ec241 404 #define IS_RCC_GET_IT(IT) (((IT) == RCC_IT_LSIRDY) || ((IT) == RCC_IT_LSERDY) || \
mbed_official 155:8435094ec241 405 ((IT) == RCC_IT_HSIRDY) || ((IT) == RCC_IT_HSERDY) || \
mbed_official 155:8435094ec241 406 ((IT) == RCC_IT_PLLRDY) || ((IT) == RCC_IT_CSS))
mbed_official 155:8435094ec241 407
mbed_official 155:8435094ec241 408
mbed_official 155:8435094ec241 409 #define IS_RCC_CLEAR_IT(IT) ((((IT) & (uint8_t)0x40) == 0x00) && ((IT) != 0x00))
mbed_official 155:8435094ec241 410
mbed_official 155:8435094ec241 411 /**
mbed_official 155:8435094ec241 412 * @}
mbed_official 155:8435094ec241 413 */
mbed_official 155:8435094ec241 414
mbed_official 155:8435094ec241 415 /** @defgroup RCC_LSE_configuration
mbed_official 155:8435094ec241 416 * @{
mbed_official 155:8435094ec241 417 */
mbed_official 155:8435094ec241 418
mbed_official 155:8435094ec241 419 #define RCC_LSE_OFF ((uint32_t)0x00000000)
mbed_official 155:8435094ec241 420 #define RCC_LSE_ON RCC_BDCR_LSEON
mbed_official 155:8435094ec241 421 #define RCC_LSE_Bypass ((uint32_t)(RCC_BDCR_LSEON | RCC_BDCR_LSEBYP))
mbed_official 155:8435094ec241 422 #define IS_RCC_LSE(LSE) (((LSE) == RCC_LSE_OFF) || ((LSE) == RCC_LSE_ON) || \
mbed_official 155:8435094ec241 423 ((LSE) == RCC_LSE_Bypass))
mbed_official 155:8435094ec241 424 /**
mbed_official 155:8435094ec241 425 * @}
mbed_official 155:8435094ec241 426 */
mbed_official 155:8435094ec241 427
mbed_official 155:8435094ec241 428 /** @defgroup RCC_RTC_Clock_Source
mbed_official 155:8435094ec241 429 * @{
mbed_official 155:8435094ec241 430 */
mbed_official 155:8435094ec241 431
mbed_official 155:8435094ec241 432 #define RCC_RTCCLKSource_LSE RCC_BDCR_RTCSEL_LSE
mbed_official 155:8435094ec241 433 #define RCC_RTCCLKSource_LSI RCC_BDCR_RTCSEL_LSI
mbed_official 155:8435094ec241 434 #define RCC_RTCCLKSource_HSE_Div32 RCC_BDCR_RTCSEL_HSE
mbed_official 155:8435094ec241 435
mbed_official 155:8435094ec241 436 #define IS_RCC_RTCCLK_SOURCE(SOURCE) (((SOURCE) == RCC_RTCCLKSource_LSE) || \
mbed_official 155:8435094ec241 437 ((SOURCE) == RCC_RTCCLKSource_LSI) || \
mbed_official 155:8435094ec241 438 ((SOURCE) == RCC_RTCCLKSource_HSE_Div32))
mbed_official 155:8435094ec241 439 /**
mbed_official 155:8435094ec241 440 * @}
mbed_official 155:8435094ec241 441 */
mbed_official 155:8435094ec241 442
mbed_official 155:8435094ec241 443 /** @defgroup RCC_I2S_Clock_Source
mbed_official 155:8435094ec241 444 * @{
mbed_official 155:8435094ec241 445 */
mbed_official 155:8435094ec241 446 #define RCC_I2S2CLKSource_SYSCLK ((uint8_t)0x00)
mbed_official 155:8435094ec241 447 #define RCC_I2S2CLKSource_Ext ((uint8_t)0x01)
mbed_official 155:8435094ec241 448
mbed_official 155:8435094ec241 449 #define IS_RCC_I2SCLK_SOURCE(SOURCE) (((SOURCE) == RCC_I2S2CLKSource_SYSCLK) || ((SOURCE) == RCC_I2S2CLKSource_Ext))
mbed_official 155:8435094ec241 450
mbed_official 155:8435094ec241 451 /** @defgroup RCC_LSE_Drive_Configuration
mbed_official 155:8435094ec241 452 * @{
mbed_official 155:8435094ec241 453 */
mbed_official 155:8435094ec241 454
mbed_official 155:8435094ec241 455 #define RCC_LSEDrive_Low ((uint32_t)0x00000000)
mbed_official 155:8435094ec241 456 #define RCC_LSEDrive_MediumLow RCC_BDCR_LSEDRV_0
mbed_official 155:8435094ec241 457 #define RCC_LSEDrive_MediumHigh RCC_BDCR_LSEDRV_1
mbed_official 155:8435094ec241 458 #define RCC_LSEDrive_High RCC_BDCR_LSEDRV
mbed_official 155:8435094ec241 459 #define IS_RCC_LSE_DRIVE(DRIVE) (((DRIVE) == RCC_LSEDrive_Low) || ((DRIVE) == RCC_LSEDrive_MediumLow) || \
mbed_official 155:8435094ec241 460 ((DRIVE) == RCC_LSEDrive_MediumHigh) || ((DRIVE) == RCC_LSEDrive_High))
mbed_official 155:8435094ec241 461 /**
mbed_official 155:8435094ec241 462 * @}
mbed_official 155:8435094ec241 463 */
mbed_official 155:8435094ec241 464
mbed_official 155:8435094ec241 465 /** @defgroup RCC_AHB_Peripherals
mbed_official 155:8435094ec241 466 * @{
mbed_official 155:8435094ec241 467 */
mbed_official 155:8435094ec241 468
mbed_official 155:8435094ec241 469 #define RCC_AHBPeriph_ADC34 RCC_AHBENR_ADC34EN
mbed_official 155:8435094ec241 470 #define RCC_AHBPeriph_ADC12 RCC_AHBENR_ADC12EN
mbed_official 155:8435094ec241 471 #define RCC_AHBPeriph_GPIOA RCC_AHBENR_GPIOAEN
mbed_official 155:8435094ec241 472 #define RCC_AHBPeriph_GPIOB RCC_AHBENR_GPIOBEN
mbed_official 155:8435094ec241 473 #define RCC_AHBPeriph_GPIOC RCC_AHBENR_GPIOCEN
mbed_official 155:8435094ec241 474 #define RCC_AHBPeriph_GPIOD RCC_AHBENR_GPIODEN
mbed_official 155:8435094ec241 475 #define RCC_AHBPeriph_GPIOE RCC_AHBENR_GPIOEEN
mbed_official 155:8435094ec241 476 #define RCC_AHBPeriph_GPIOF RCC_AHBENR_GPIOFEN
mbed_official 155:8435094ec241 477 #define RCC_AHBPeriph_TS RCC_AHBENR_TSEN
mbed_official 155:8435094ec241 478 #define RCC_AHBPeriph_CRC RCC_AHBENR_CRCEN
mbed_official 155:8435094ec241 479 #define RCC_AHBPeriph_FLITF RCC_AHBENR_FLITFEN
mbed_official 155:8435094ec241 480 #define RCC_AHBPeriph_SRAM RCC_AHBENR_SRAMEN
mbed_official 155:8435094ec241 481 #define RCC_AHBPeriph_DMA2 RCC_AHBENR_DMA2EN
mbed_official 155:8435094ec241 482 #define RCC_AHBPeriph_DMA1 RCC_AHBENR_DMA1EN
mbed_official 155:8435094ec241 483
mbed_official 155:8435094ec241 484 #define IS_RCC_AHB_PERIPH(PERIPH) ((((PERIPH) & 0xCE81FFA8) == 0x00) && ((PERIPH) != 0x00))
mbed_official 155:8435094ec241 485 #define IS_RCC_AHB_RST_PERIPH(PERIPH) ((((PERIPH) & 0xCE81FFFF) == 0x00) && ((PERIPH) != 0x00))
mbed_official 155:8435094ec241 486
mbed_official 155:8435094ec241 487 /**
mbed_official 155:8435094ec241 488 * @}
mbed_official 155:8435094ec241 489 */
mbed_official 155:8435094ec241 490
mbed_official 155:8435094ec241 491 /** @defgroup RCC_APB2_Peripherals
mbed_official 155:8435094ec241 492 * @{
mbed_official 155:8435094ec241 493 */
mbed_official 155:8435094ec241 494
mbed_official 155:8435094ec241 495 #define RCC_APB2Periph_SYSCFG RCC_APB2ENR_SYSCFGEN
mbed_official 155:8435094ec241 496 #define RCC_APB2Periph_TIM1 RCC_APB2ENR_TIM1EN
mbed_official 155:8435094ec241 497 #define RCC_APB2Periph_SPI1 RCC_APB2ENR_SPI1EN
mbed_official 155:8435094ec241 498 #define RCC_APB2Periph_TIM8 RCC_APB2ENR_TIM8EN
mbed_official 155:8435094ec241 499 #define RCC_APB2Periph_USART1 RCC_APB2ENR_USART1EN
mbed_official 155:8435094ec241 500 #define RCC_APB2Periph_TIM15 RCC_APB2ENR_TIM15EN
mbed_official 155:8435094ec241 501 #define RCC_APB2Periph_TIM16 RCC_APB2ENR_TIM16EN
mbed_official 155:8435094ec241 502 #define RCC_APB2Periph_TIM17 RCC_APB2ENR_TIM17EN
mbed_official 155:8435094ec241 503 #define RCC_APB2Periph_HRTIM1 RCC_APB2ENR_HRTIM1
mbed_official 155:8435094ec241 504
mbed_official 155:8435094ec241 505 #define IS_RCC_APB2_PERIPH(PERIPH) ((((PERIPH) & 0xDFF887FE) == 0x00) && ((PERIPH) != 0x00))
mbed_official 155:8435094ec241 506
mbed_official 155:8435094ec241 507 /**
mbed_official 155:8435094ec241 508 * @}
mbed_official 155:8435094ec241 509 */
mbed_official 155:8435094ec241 510
mbed_official 155:8435094ec241 511 /** @defgroup RCC_APB1_Peripherals
mbed_official 155:8435094ec241 512 * @{
mbed_official 155:8435094ec241 513 */
mbed_official 155:8435094ec241 514 #define RCC_APB1Periph_TIM2 RCC_APB1ENR_TIM2EN
mbed_official 155:8435094ec241 515 #define RCC_APB1Periph_TIM3 RCC_APB1ENR_TIM3EN
mbed_official 155:8435094ec241 516 #define RCC_APB1Periph_TIM4 RCC_APB1ENR_TIM4EN
mbed_official 155:8435094ec241 517 #define RCC_APB1Periph_TIM6 RCC_APB1ENR_TIM6EN
mbed_official 155:8435094ec241 518 #define RCC_APB1Periph_TIM7 RCC_APB1ENR_TIM7EN
mbed_official 155:8435094ec241 519 #define RCC_APB1Periph_WWDG RCC_APB1ENR_WWDGEN
mbed_official 155:8435094ec241 520 #define RCC_APB1Periph_SPI2 RCC_APB1ENR_SPI2EN
mbed_official 155:8435094ec241 521 #define RCC_APB1Periph_SPI3 RCC_APB1ENR_SPI3EN
mbed_official 155:8435094ec241 522 #define RCC_APB1Periph_USART2 RCC_APB1ENR_USART2EN
mbed_official 155:8435094ec241 523 #define RCC_APB1Periph_USART3 RCC_APB1ENR_USART3EN
mbed_official 155:8435094ec241 524 #define RCC_APB1Periph_UART4 RCC_APB1ENR_UART4EN
mbed_official 155:8435094ec241 525 #define RCC_APB1Periph_UART5 RCC_APB1ENR_UART5EN
mbed_official 155:8435094ec241 526 #define RCC_APB1Periph_I2C1 RCC_APB1ENR_I2C1EN
mbed_official 155:8435094ec241 527 #define RCC_APB1Periph_I2C2 RCC_APB1ENR_I2C2EN
mbed_official 155:8435094ec241 528 #define RCC_APB1Periph_USB RCC_APB1ENR_USBEN
mbed_official 155:8435094ec241 529 #define RCC_APB1Periph_CAN1 RCC_APB1ENR_CAN1EN
mbed_official 155:8435094ec241 530 #define RCC_APB1Periph_PWR RCC_APB1ENR_PWREN
mbed_official 155:8435094ec241 531 #define RCC_APB1Periph_DAC1 RCC_APB1ENR_DAC1EN
mbed_official 155:8435094ec241 532 #define RCC_APB1Periph_I2C3 RCC_APB1ENR_I2C3EN
mbed_official 155:8435094ec241 533 #define RCC_APB1Periph_DAC2 RCC_APB1ENR_DAC2EN
mbed_official 155:8435094ec241 534 #define RCC_APB1Periph_DAC RCC_APB1Periph_DAC1
mbed_official 155:8435094ec241 535
mbed_official 155:8435094ec241 536
mbed_official 155:8435094ec241 537 #define IS_RCC_APB1_PERIPH(PERIPH) ((((PERIPH) & 0x890137C8) == 0x00) && ((PERIPH) != 0x00))
mbed_official 155:8435094ec241 538 /**
mbed_official 155:8435094ec241 539 * @}
mbed_official 155:8435094ec241 540 */
mbed_official 155:8435094ec241 541
mbed_official 155:8435094ec241 542 /** @defgroup RCC_MCO_Clock_Source
mbed_official 155:8435094ec241 543 * @{
mbed_official 155:8435094ec241 544 */
mbed_official 155:8435094ec241 545
mbed_official 155:8435094ec241 546 #define RCC_MCOSource_NoClock ((uint8_t)0x00)
mbed_official 155:8435094ec241 547 #define RCC_MCOSource_LSI ((uint8_t)0x02)
mbed_official 155:8435094ec241 548 #define RCC_MCOSource_LSE ((uint8_t)0x03)
mbed_official 155:8435094ec241 549 #define RCC_MCOSource_SYSCLK ((uint8_t)0x04)
mbed_official 155:8435094ec241 550 #define RCC_MCOSource_HSI ((uint8_t)0x05)
mbed_official 155:8435094ec241 551 #define RCC_MCOSource_HSE ((uint8_t)0x06)
mbed_official 155:8435094ec241 552 #define RCC_MCOSource_PLLCLK_Div2 ((uint8_t)0x07)
mbed_official 155:8435094ec241 553
mbed_official 155:8435094ec241 554 #define IS_RCC_MCO_SOURCE(SOURCE) (((SOURCE) == RCC_MCOSource_NoClock) ||((SOURCE) == RCC_MCOSource_SYSCLK) ||\
mbed_official 155:8435094ec241 555 ((SOURCE) == RCC_MCOSource_HSI) || ((SOURCE) == RCC_MCOSource_HSE) || \
mbed_official 155:8435094ec241 556 ((SOURCE) == RCC_MCOSource_LSI) || ((SOURCE) == RCC_MCOSource_LSE) || \
mbed_official 155:8435094ec241 557 ((SOURCE) == RCC_MCOSource_PLLCLK_Div2))
mbed_official 155:8435094ec241 558 /**
mbed_official 155:8435094ec241 559 * @}
mbed_official 155:8435094ec241 560 */
mbed_official 155:8435094ec241 561
mbed_official 155:8435094ec241 562 /** @defgroup RCC_MCOPrescaler
mbed_official 155:8435094ec241 563 * @{
mbed_official 155:8435094ec241 564 */
mbed_official 155:8435094ec241 565
mbed_official 155:8435094ec241 566 #define RCC_MCOPrescaler_1 RCC_CFGR_MCO_PRE_1
mbed_official 155:8435094ec241 567 #define RCC_MCOPrescaler_2 RCC_CFGR_MCO_PRE_2
mbed_official 155:8435094ec241 568 #define RCC_MCOPrescaler_4 RCC_CFGR_MCO_PRE_4
mbed_official 155:8435094ec241 569 #define RCC_MCOPrescaler_8 RCC_CFGR_MCO_PRE_8
mbed_official 155:8435094ec241 570 #define RCC_MCOPrescaler_16 RCC_CFGR_MCO_PRE_16
mbed_official 155:8435094ec241 571 #define RCC_MCOPrescaler_32 RCC_CFGR_MCO_PRE_32
mbed_official 155:8435094ec241 572 #define RCC_MCOPrescaler_64 RCC_CFGR_MCO_PRE_64
mbed_official 155:8435094ec241 573 #define RCC_MCOPrescaler_128 RCC_CFGR_MCO_PRE_128
mbed_official 155:8435094ec241 574
mbed_official 155:8435094ec241 575 #define IS_RCC_MCO_PRESCALER(PRESCALER) (((PRESCALER) == RCC_MCOPrescaler_1) || \
mbed_official 155:8435094ec241 576 ((PRESCALER) == RCC_MCOPrescaler_2) || \
mbed_official 155:8435094ec241 577 ((PRESCALER) == RCC_MCOPrescaler_4) || \
mbed_official 155:8435094ec241 578 ((PRESCALER) == RCC_MCOPrescaler_8) || \
mbed_official 155:8435094ec241 579 ((PRESCALER) == RCC_MCOPrescaler_16) || \
mbed_official 155:8435094ec241 580 ((PRESCALER) == RCC_MCOPrescaler_32) || \
mbed_official 155:8435094ec241 581 ((PRESCALER) == RCC_MCOPrescaler_64) || \
mbed_official 155:8435094ec241 582 ((PRESCALER) == RCC_MCOPrescaler_128))
mbed_official 155:8435094ec241 583 /**
mbed_official 155:8435094ec241 584 * @}
mbed_official 155:8435094ec241 585 */
mbed_official 155:8435094ec241 586
mbed_official 155:8435094ec241 587 /** @defgroup RCC_USB_Device_clock_source
mbed_official 155:8435094ec241 588 * @{
mbed_official 155:8435094ec241 589 */
mbed_official 155:8435094ec241 590
mbed_official 155:8435094ec241 591 #define RCC_USBCLKSource_PLLCLK_1Div5 ((uint8_t)0x00)
mbed_official 155:8435094ec241 592 #define RCC_USBCLKSource_PLLCLK_Div1 ((uint8_t)0x01)
mbed_official 155:8435094ec241 593
mbed_official 155:8435094ec241 594 #define IS_RCC_USBCLK_SOURCE(SOURCE) (((SOURCE) == RCC_USBCLKSource_PLLCLK_1Div5) || \
mbed_official 155:8435094ec241 595 ((SOURCE) == RCC_USBCLKSource_PLLCLK_Div1))
mbed_official 155:8435094ec241 596 /**
mbed_official 155:8435094ec241 597 * @}
mbed_official 155:8435094ec241 598 */
mbed_official 155:8435094ec241 599
mbed_official 155:8435094ec241 600 /** @defgroup RCC_Flag
mbed_official 155:8435094ec241 601 * @{
mbed_official 155:8435094ec241 602 */
mbed_official 155:8435094ec241 603 #define RCC_FLAG_HSIRDY ((uint8_t)0x01)
mbed_official 155:8435094ec241 604 #define RCC_FLAG_HSERDY ((uint8_t)0x11)
mbed_official 155:8435094ec241 605 #define RCC_FLAG_PLLRDY ((uint8_t)0x19)
mbed_official 155:8435094ec241 606 #define RCC_FLAG_MCOF ((uint8_t)0x9C)
mbed_official 155:8435094ec241 607 #define RCC_FLAG_LSERDY ((uint8_t)0x21)
mbed_official 155:8435094ec241 608 #define RCC_FLAG_LSIRDY ((uint8_t)0x41)
mbed_official 155:8435094ec241 609 #define RCC_FLAG_OBLRST ((uint8_t)0x59)
mbed_official 155:8435094ec241 610 #define RCC_FLAG_PINRST ((uint8_t)0x5A)
mbed_official 155:8435094ec241 611 #define RCC_FLAG_PORRST ((uint8_t)0x5B)
mbed_official 155:8435094ec241 612 #define RCC_FLAG_SFTRST ((uint8_t)0x5C)
mbed_official 155:8435094ec241 613 #define RCC_FLAG_IWDGRST ((uint8_t)0x5D)
mbed_official 155:8435094ec241 614 #define RCC_FLAG_WWDGRST ((uint8_t)0x5E)
mbed_official 155:8435094ec241 615 #define RCC_FLAG_LPWRRST ((uint8_t)0x5F)
mbed_official 155:8435094ec241 616
mbed_official 155:8435094ec241 617 #define IS_RCC_FLAG(FLAG) (((FLAG) == RCC_FLAG_HSIRDY) || ((FLAG) == RCC_FLAG_HSERDY) || \
mbed_official 155:8435094ec241 618 ((FLAG) == RCC_FLAG_PLLRDY) || ((FLAG) == RCC_FLAG_LSERDY) || \
mbed_official 155:8435094ec241 619 ((FLAG) == RCC_FLAG_LSIRDY) || ((FLAG) == RCC_FLAG_OBLRST) || \
mbed_official 155:8435094ec241 620 ((FLAG) == RCC_FLAG_PINRST) || ((FLAG) == RCC_FLAG_PORRST) || \
mbed_official 155:8435094ec241 621 ((FLAG) == RCC_FLAG_SFTRST) || ((FLAG) == RCC_FLAG_IWDGRST)|| \
mbed_official 155:8435094ec241 622 ((FLAG) == RCC_FLAG_WWDGRST)|| ((FLAG) == RCC_FLAG_LPWRRST)|| \
mbed_official 155:8435094ec241 623 ((FLAG) == RCC_FLAG_MCOF))
mbed_official 155:8435094ec241 624
mbed_official 155:8435094ec241 625 #define IS_RCC_HSI_CALIBRATION_VALUE(VALUE) ((VALUE) <= 0x1F)
mbed_official 155:8435094ec241 626
mbed_official 155:8435094ec241 627 /**
mbed_official 155:8435094ec241 628 * @}
mbed_official 155:8435094ec241 629 */
mbed_official 155:8435094ec241 630
mbed_official 155:8435094ec241 631 /**
mbed_official 155:8435094ec241 632 * @}
mbed_official 155:8435094ec241 633 */
mbed_official 155:8435094ec241 634
mbed_official 155:8435094ec241 635 /* Exported macro ------------------------------------------------------------*/
mbed_official 155:8435094ec241 636 /* Exported functions ------------------------------------------------------- */
mbed_official 155:8435094ec241 637
mbed_official 155:8435094ec241 638 /* Function used to set the RCC clock configuration to the default reset state */
mbed_official 155:8435094ec241 639 void RCC_DeInit(void);
mbed_official 155:8435094ec241 640
mbed_official 155:8435094ec241 641 /* Internal/external clocks, PLL, CSS and MCO configuration functions *********/
mbed_official 155:8435094ec241 642 void RCC_HSEConfig(uint8_t RCC_HSE);
mbed_official 155:8435094ec241 643 ErrorStatus RCC_WaitForHSEStartUp(void);
mbed_official 155:8435094ec241 644 void RCC_AdjustHSICalibrationValue(uint8_t HSICalibrationValue);
mbed_official 155:8435094ec241 645 void RCC_HSICmd(FunctionalState NewState);
mbed_official 155:8435094ec241 646 void RCC_LSEConfig(uint32_t RCC_LSE);
mbed_official 155:8435094ec241 647 void RCC_LSEDriveConfig(uint32_t RCC_LSEDrive);
mbed_official 155:8435094ec241 648 void RCC_LSICmd(FunctionalState NewState);
mbed_official 155:8435094ec241 649 void RCC_PLLConfig(uint32_t RCC_PLLSource, uint32_t RCC_PLLMul);
mbed_official 155:8435094ec241 650 void RCC_PLLCmd(FunctionalState NewState);
mbed_official 155:8435094ec241 651 void RCC_PREDIV1Config(uint32_t RCC_PREDIV1_Div);
mbed_official 155:8435094ec241 652 void RCC_ClockSecuritySystemCmd(FunctionalState NewState);
mbed_official 155:8435094ec241 653 #ifdef STM32F303xC
mbed_official 155:8435094ec241 654 void RCC_MCOConfig(uint8_t RCC_MCOSource);
mbed_official 155:8435094ec241 655 #else
mbed_official 155:8435094ec241 656 void RCC_MCOConfig(uint8_t RCC_MCOSource,uint32_t RCC_MCOPrescaler);
mbed_official 155:8435094ec241 657 #endif /* STM32F303xC */
mbed_official 155:8435094ec241 658
mbed_official 155:8435094ec241 659 /* System, AHB and APB busses clocks configuration functions ******************/
mbed_official 155:8435094ec241 660 void RCC_SYSCLKConfig(uint32_t RCC_SYSCLKSource);
mbed_official 155:8435094ec241 661 uint8_t RCC_GetSYSCLKSource(void);
mbed_official 155:8435094ec241 662 void RCC_HCLKConfig(uint32_t RCC_SYSCLK);
mbed_official 155:8435094ec241 663 void RCC_PCLK1Config(uint32_t RCC_HCLK);
mbed_official 155:8435094ec241 664 void RCC_PCLK2Config(uint32_t RCC_HCLK);
mbed_official 155:8435094ec241 665 void RCC_GetClocksFreq(RCC_ClocksTypeDef* RCC_Clocks);
mbed_official 155:8435094ec241 666
mbed_official 155:8435094ec241 667 /* Peripheral clocks configuration functions **********************************/
mbed_official 155:8435094ec241 668 void RCC_ADCCLKConfig(uint32_t RCC_PLLCLK);
mbed_official 155:8435094ec241 669 void RCC_I2CCLKConfig(uint32_t RCC_I2CCLK);
mbed_official 155:8435094ec241 670 void RCC_TIMCLKConfig(uint32_t RCC_TIMCLK);
mbed_official 155:8435094ec241 671 void RCC_HRTIM1CLKConfig(uint32_t RCC_HRTIMCLK);
mbed_official 155:8435094ec241 672 void RCC_I2SCLKConfig(uint32_t RCC_I2SCLKSource);
mbed_official 155:8435094ec241 673 void RCC_USARTCLKConfig(uint32_t RCC_USARTCLK);
mbed_official 155:8435094ec241 674 void RCC_USBCLKConfig(uint32_t RCC_USBCLKSource);
mbed_official 155:8435094ec241 675
mbed_official 155:8435094ec241 676 void RCC_RTCCLKConfig(uint32_t RCC_RTCCLKSource);
mbed_official 155:8435094ec241 677 void RCC_RTCCLKCmd(FunctionalState NewState);
mbed_official 155:8435094ec241 678 void RCC_BackupResetCmd(FunctionalState NewState);
mbed_official 155:8435094ec241 679
mbed_official 155:8435094ec241 680 void RCC_AHBPeriphClockCmd(uint32_t RCC_AHBPeriph, FunctionalState NewState);
mbed_official 155:8435094ec241 681 void RCC_APB2PeriphClockCmd(uint32_t RCC_APB2Periph, FunctionalState NewState);
mbed_official 155:8435094ec241 682 void RCC_APB1PeriphClockCmd(uint32_t RCC_APB1Periph, FunctionalState NewState);
mbed_official 155:8435094ec241 683
mbed_official 155:8435094ec241 684 void RCC_AHBPeriphResetCmd(uint32_t RCC_AHBPeriph, FunctionalState NewState);
mbed_official 155:8435094ec241 685 void RCC_APB2PeriphResetCmd(uint32_t RCC_APB2Periph, FunctionalState NewState);
mbed_official 155:8435094ec241 686 void RCC_APB1PeriphResetCmd(uint32_t RCC_APB1Periph, FunctionalState NewState);
mbed_official 155:8435094ec241 687
mbed_official 155:8435094ec241 688 /* Interrupts and flags management functions **********************************/
mbed_official 155:8435094ec241 689 void RCC_ITConfig(uint8_t RCC_IT, FunctionalState NewState);
mbed_official 155:8435094ec241 690 FlagStatus RCC_GetFlagStatus(uint8_t RCC_FLAG);
mbed_official 155:8435094ec241 691 void RCC_ClearFlag(void);
mbed_official 155:8435094ec241 692 ITStatus RCC_GetITStatus(uint8_t RCC_IT);
mbed_official 155:8435094ec241 693 void RCC_ClearITPendingBit(uint8_t RCC_IT);
mbed_official 155:8435094ec241 694
mbed_official 155:8435094ec241 695 #ifdef __cplusplus
mbed_official 155:8435094ec241 696 }
mbed_official 155:8435094ec241 697 #endif
mbed_official 155:8435094ec241 698
mbed_official 155:8435094ec241 699 #endif /* __STM32F30x_RCC_H */
mbed_official 155:8435094ec241 700
mbed_official 155:8435094ec241 701 /**
mbed_official 155:8435094ec241 702 * @}
mbed_official 155:8435094ec241 703 */
mbed_official 155:8435094ec241 704
mbed_official 155:8435094ec241 705 /**
mbed_official 155:8435094ec241 706 * @}
mbed_official 155:8435094ec241 707 */
mbed_official 155:8435094ec241 708
mbed_official 155:8435094ec241 709 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/