annotate f103c8/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h @ 6:ca42336826bd default tip

working on clock sources
author cin
date Mon, 23 Jan 2017 02:40:17 +0300
parents 0c59e7a7782a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2 ******************************************************************************
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3 * @file stm32f1xx_hal_rcc_ex.h
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4 * @author MCD Application Team
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5 * @version V1.0.4
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6 * @date 29-April-2016
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7 * @brief Header file of RCC HAL Extension module.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
8 ******************************************************************************
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
9 * @attention
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
10 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
11 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
12 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
13 * Redistribution and use in source and binary forms, with or without modification,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
14 * are permitted provided that the following conditions are met:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
15 * 1. Redistributions of source code must retain the above copyright notice,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
16 * this list of conditions and the following disclaimer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
17 * 2. Redistributions in binary form must reproduce the above copyright notice,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
18 * this list of conditions and the following disclaimer in the documentation
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
19 * and/or other materials provided with the distribution.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
21 * may be used to endorse or promote products derived from this software
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
22 * without specific prior written permission.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
23 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
34 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
35 ******************************************************************************
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
36 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
37
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
38 /* Define to prevent recursive inclusion -------------------------------------*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
39 #ifndef __STM32F1xx_HAL_RCC_EX_H
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
40 #define __STM32F1xx_HAL_RCC_EX_H
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
41
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
42 #ifdef __cplusplus
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
43 extern "C" {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
44 #endif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
45
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
46 /* Includes ------------------------------------------------------------------*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
47 #include "stm32f1xx_hal_def.h"
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
48
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
49 /** @addtogroup STM32F1xx_HAL_Driver
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
50 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
51 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
52
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
53 /** @addtogroup RCCEx
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
54 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
55 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
56
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
57 /** @addtogroup RCCEx_Private_Constants
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
58 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
59 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
60
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
61 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
62
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
63 /* Alias word address of PLLI2SON bit */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
64 #define PLLI2SON_BITNUMBER POSITION_VAL(RCC_CR_PLL3ON)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
65 #define RCC_CR_PLLI2SON_BB ((uint32_t)(PERIPH_BB_BASE + (RCC_CR_OFFSET_BB * 32) + (PLLI2SON_BITNUMBER * 4)))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
66 /* Alias word address of PLL2ON bit */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
67 #define PLL2ON_BITNUMBER POSITION_VAL(RCC_CR_PLL2ON)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
68 #define RCC_CR_PLL2ON_BB ((uint32_t)(PERIPH_BB_BASE + (RCC_CR_OFFSET_BB * 32) + (PLL2ON_BITNUMBER * 4)))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
69
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
70 #define PLLI2S_TIMEOUT_VALUE ((uint32_t)100) /* 100 ms */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
71 #define PLL2_TIMEOUT_VALUE ((uint32_t)100) /* 100 ms */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
72
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
73 #endif /* STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
74
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
75
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
76 #define CR_REG_INDEX ((uint8_t)1)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
77
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
78 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
79 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
80 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
81
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
82 /** @addtogroup RCCEx_Private_Macros
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
83 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
84 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
85
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
86 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
87 #define IS_RCC_PREDIV1_SOURCE(__SOURCE__) (((__SOURCE__) == RCC_PREDIV1_SOURCE_HSE) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
88 ((__SOURCE__) == RCC_PREDIV1_SOURCE_PLL2))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
89 #endif /* STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
90
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
91 #if defined(STM32F105xC) || defined(STM32F107xC) || defined(STM32F100xB)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
92 || defined(STM32F100xE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
93 #define IS_RCC_HSE_PREDIV(__DIV__) (((__DIV__) == RCC_HSE_PREDIV_DIV1) || ((__DIV__) == RCC_HSE_PREDIV_DIV2) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
94 ((__DIV__) == RCC_HSE_PREDIV_DIV3) || ((__DIV__) == RCC_HSE_PREDIV_DIV4) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
95 ((__DIV__) == RCC_HSE_PREDIV_DIV5) || ((__DIV__) == RCC_HSE_PREDIV_DIV6) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
96 ((__DIV__) == RCC_HSE_PREDIV_DIV7) || ((__DIV__) == RCC_HSE_PREDIV_DIV8) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
97 ((__DIV__) == RCC_HSE_PREDIV_DIV9) || ((__DIV__) == RCC_HSE_PREDIV_DIV10) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
98 ((__DIV__) == RCC_HSE_PREDIV_DIV11) || ((__DIV__) == RCC_HSE_PREDIV_DIV12) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
99 ((__DIV__) == RCC_HSE_PREDIV_DIV13) || ((__DIV__) == RCC_HSE_PREDIV_DIV14) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
100 ((__DIV__) == RCC_HSE_PREDIV_DIV15) || ((__DIV__) == RCC_HSE_PREDIV_DIV16))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
101
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
102 #else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
103 #define IS_RCC_HSE_PREDIV(__DIV__) (((__DIV__) == RCC_HSE_PREDIV_DIV1) || ((__DIV__) == RCC_HSE_PREDIV_DIV2))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
104 #endif /* STM32F105xC || STM32F107xC || STM32F100xB || STM32F100xE */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
105
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
106 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
107 #define IS_RCC_PLL_MUL(__MUL__) (((__MUL__) == RCC_PLL_MUL4) || ((__MUL__) == RCC_PLL_MUL5) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
108 ((__MUL__) == RCC_PLL_MUL6) || ((__MUL__) == RCC_PLL_MUL7) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
109 ((__MUL__) == RCC_PLL_MUL8) || ((__MUL__) == RCC_PLL_MUL9) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
110 ((__MUL__) == RCC_PLL_MUL6_5))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
111
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
112 #define IS_RCC_MCO1SOURCE(__SOURCE__) (((__SOURCE__) == RCC_MCO1SOURCE_SYSCLK) || ((__SOURCE__) == RCC_MCO1SOURCE_HSI) \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
113 || ((__SOURCE__) == RCC_MCO1SOURCE_HSE) || ((__SOURCE__) == RCC_MCO1SOURCE_PLLCLK) \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
114 || ((__SOURCE__) == RCC_MCO1SOURCE_PLL2CLK) || ((__SOURCE__) == RCC_MCO1SOURCE_PLL3CLK) \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
115 || ((__SOURCE__) == RCC_MCO1SOURCE_PLL3CLK_DIV2) || ((__SOURCE__) == RCC_MCO1SOURCE_EXT_HSE) \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
116 || ((__SOURCE__) == RCC_MCO1SOURCE_NOCLOCK))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
117
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
118 #else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
119 #define IS_RCC_PLL_MUL(__MUL__) (((__MUL__) == RCC_PLL_MUL2) || ((__MUL__) == RCC_PLL_MUL3) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
120 ((__MUL__) == RCC_PLL_MUL4) || ((__MUL__) == RCC_PLL_MUL5) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
121 ((__MUL__) == RCC_PLL_MUL6) || ((__MUL__) == RCC_PLL_MUL7) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
122 ((__MUL__) == RCC_PLL_MUL8) || ((__MUL__) == RCC_PLL_MUL9) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
123 ((__MUL__) == RCC_PLL_MUL10) || ((__MUL__) == RCC_PLL_MUL11) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
124 ((__MUL__) == RCC_PLL_MUL12) || ((__MUL__) == RCC_PLL_MUL13) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
125 ((__MUL__) == RCC_PLL_MUL14) || ((__MUL__) == RCC_PLL_MUL15) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
126 ((__MUL__) == RCC_PLL_MUL16))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
127
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
128 #define IS_RCC_MCO1SOURCE(__SOURCE__) (((__SOURCE__) == RCC_MCO1SOURCE_SYSCLK) || ((__SOURCE__) == RCC_MCO1SOURCE_HSI) \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
129 || ((__SOURCE__) == RCC_MCO1SOURCE_HSE) || ((__SOURCE__) == RCC_MCO1SOURCE_PLLCLK) \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
130 || ((__SOURCE__) == RCC_MCO1SOURCE_NOCLOCK))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
131
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
132 #endif /* STM32F105xC || STM32F107xC*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
133
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
134 #define IS_RCC_ADCPLLCLK_DIV(__ADCCLK__) (((__ADCCLK__) == RCC_ADCPCLK2_DIV2) || ((__ADCCLK__) == RCC_ADCPCLK2_DIV4) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
135 ((__ADCCLK__) == RCC_ADCPCLK2_DIV6) || ((__ADCCLK__) == RCC_ADCPCLK2_DIV8))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
136
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
137 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
138 #define IS_RCC_I2S2CLKSOURCE(__SOURCE__) (((__SOURCE__) == RCC_I2S2CLKSOURCE_SYSCLK) || ((__SOURCE__) == RCC_I2S2CLKSOURCE_PLLI2S_VCO))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
139
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
140 #define IS_RCC_I2S3CLKSOURCE(__SOURCE__) (((__SOURCE__) == RCC_I2S3CLKSOURCE_SYSCLK) || ((__SOURCE__) == RCC_I2S3CLKSOURCE_PLLI2S_VCO))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
141
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
142 #define IS_RCC_USBPLLCLK_DIV(__USBCLK__) (((__USBCLK__) == RCC_USBCLKSOURCE_PLL_DIV2) || ((__USBCLK__) == RCC_USBCLKSOURCE_PLL_DIV3))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
143
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
144 #define IS_RCC_PLLI2S_MUL(__MUL__) (((__MUL__) == RCC_PLLI2S_MUL8) || ((__MUL__) == RCC_PLLI2S_MUL9) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
145 ((__MUL__) == RCC_PLLI2S_MUL10) || ((__MUL__) == RCC_PLLI2S_MUL11) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
146 ((__MUL__) == RCC_PLLI2S_MUL12) || ((__MUL__) == RCC_PLLI2S_MUL13) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
147 ((__MUL__) == RCC_PLLI2S_MUL14) || ((__MUL__) == RCC_PLLI2S_MUL16) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
148 ((__MUL__) == RCC_PLLI2S_MUL20))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
149
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
150 #define IS_RCC_HSE_PREDIV2(__DIV__) (((__DIV__) == RCC_HSE_PREDIV2_DIV1) || ((__DIV__) == RCC_HSE_PREDIV2_DIV2) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
151 ((__DIV__) == RCC_HSE_PREDIV2_DIV3) || ((__DIV__) == RCC_HSE_PREDIV2_DIV4) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
152 ((__DIV__) == RCC_HSE_PREDIV2_DIV5) || ((__DIV__) == RCC_HSE_PREDIV2_DIV6) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
153 ((__DIV__) == RCC_HSE_PREDIV2_DIV7) || ((__DIV__) == RCC_HSE_PREDIV2_DIV8) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
154 ((__DIV__) == RCC_HSE_PREDIV2_DIV9) || ((__DIV__) == RCC_HSE_PREDIV2_DIV10) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
155 ((__DIV__) == RCC_HSE_PREDIV2_DIV11) || ((__DIV__) == RCC_HSE_PREDIV2_DIV12) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
156 ((__DIV__) == RCC_HSE_PREDIV2_DIV13) || ((__DIV__) == RCC_HSE_PREDIV2_DIV14) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
157 ((__DIV__) == RCC_HSE_PREDIV2_DIV15) || ((__DIV__) == RCC_HSE_PREDIV2_DIV16))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
158
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
159 #define IS_RCC_PLL2(__PLL__) (((__PLL__) == RCC_PLL2_NONE) || ((__PLL__) == RCC_PLL2_OFF) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
160 ((__PLL__) == RCC_PLL2_ON))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
161
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
162 #define IS_RCC_PLL2_MUL(__MUL__) (((__MUL__) == RCC_PLL2_MUL8) || ((__MUL__) == RCC_PLL2_MUL9) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
163 ((__MUL__) == RCC_PLL2_MUL10) || ((__MUL__) == RCC_PLL2_MUL11) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
164 ((__MUL__) == RCC_PLL2_MUL12) || ((__MUL__) == RCC_PLL2_MUL13) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
165 ((__MUL__) == RCC_PLL2_MUL14) || ((__MUL__) == RCC_PLL2_MUL16) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
166 ((__MUL__) == RCC_PLL2_MUL20))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
167
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
168 #define IS_RCC_PERIPHCLOCK(__SELECTION__) \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
169 ((((__SELECTION__) & RCC_PERIPHCLK_RTC) == RCC_PERIPHCLK_RTC) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
170 (((__SELECTION__) & RCC_PERIPHCLK_ADC) == RCC_PERIPHCLK_ADC) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
171 (((__SELECTION__) & RCC_PERIPHCLK_I2S2) == RCC_PERIPHCLK_I2S2) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
172 (((__SELECTION__) & RCC_PERIPHCLK_I2S3) == RCC_PERIPHCLK_I2S3) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
173 (((__SELECTION__) & RCC_PERIPHCLK_USB) == RCC_PERIPHCLK_USB))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
174
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
175 #elif defined(STM32F103xE) || defined(STM32F103xG)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
176
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
177 #define IS_RCC_I2S2CLKSOURCE(__SOURCE__) ((__SOURCE__) == RCC_I2S2CLKSOURCE_SYSCLK)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
178
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
179 #define IS_RCC_I2S3CLKSOURCE(__SOURCE__) ((__SOURCE__) == RCC_I2S3CLKSOURCE_SYSCLK)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
180
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
181 #define IS_RCC_PERIPHCLOCK(__SELECTION__) \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
182 ((((__SELECTION__) & RCC_PERIPHCLK_RTC) == RCC_PERIPHCLK_RTC) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
183 (((__SELECTION__) & RCC_PERIPHCLK_ADC) == RCC_PERIPHCLK_ADC) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
184 (((__SELECTION__) & RCC_PERIPHCLK_I2S2) == RCC_PERIPHCLK_I2S2) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
185 (((__SELECTION__) & RCC_PERIPHCLK_I2S3) == RCC_PERIPHCLK_I2S3) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
186 (((__SELECTION__) & RCC_PERIPHCLK_USB) == RCC_PERIPHCLK_USB))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
187
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
188
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
189 #elif defined(STM32F102x6) || defined(STM32F102xB) || defined(STM32F103x6)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
190 || defined(STM32F103xB)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
191
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
192 #define IS_RCC_PERIPHCLOCK(__SELECTION__) \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
193 ((((__SELECTION__) & RCC_PERIPHCLK_RTC) == RCC_PERIPHCLK_RTC) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
194 (((__SELECTION__) & RCC_PERIPHCLK_ADC) == RCC_PERIPHCLK_ADC) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
195 (((__SELECTION__) & RCC_PERIPHCLK_USB) == RCC_PERIPHCLK_USB))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
196
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
197 #else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
198
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
199 #define IS_RCC_PERIPHCLOCK(__SELECTION__) \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
200 ((((__SELECTION__) & RCC_PERIPHCLK_RTC) == RCC_PERIPHCLK_RTC) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
201 (((__SELECTION__) & RCC_PERIPHCLK_ADC) == RCC_PERIPHCLK_ADC))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
202
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
203 #endif /* STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
204
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
205 #if defined(STM32F102x6) || defined(STM32F102xB) || defined(STM32F103x6)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
206 || defined(STM32F103xB) || defined(STM32F103xE) || defined(STM32F103xG)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
207
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
208 #define IS_RCC_USBPLLCLK_DIV(__USBCLK__) (((__USBCLK__) == RCC_USBCLKSOURCE_PLL) || ((__USBCLK__) == RCC_USBCLKSOURCE_PLL_DIV1_5))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
209
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
210 #endif /* STM32F102x6 || STM32F102xB || STM32F103x6 || STM32F103xB || STM32F103xE || STM32F103xG */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
211
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
212 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
213 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
214 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
215
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
216 /* Exported types ------------------------------------------------------------*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
217
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
218 /** @defgroup RCCEx_Exported_Types RCCEx Exported Types
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
219 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
220 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
221
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
222 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
223 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
224 * @brief RCC PLL2 configuration structure definition
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
225 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
226 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
227 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
228 uint32_t PLL2State; /*!< The new state of the PLL2.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
229 This parameter can be a value of @ref RCCEx_PLL2_Config */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
230
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
231 uint32_t PLL2MUL; /*!< PLL2MUL: Multiplication factor for PLL2 VCO input clock
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
232 This parameter must be a value of @ref RCCEx_PLL2_Multiplication_Factor*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
233
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
234 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
235 uint32_t HSEPrediv2Value; /*!< The Prediv2 factor value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
236 This parameter can be a value of @ref RCCEx_Prediv2_Factor */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
237
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
238 #endif /* STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
239 } RCC_PLL2InitTypeDef;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
240
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
241 #endif /* STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
242
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
243 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
244 * @brief RCC Internal/External Oscillator (HSE, HSI, LSE and LSI) configuration structure definition
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
245 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
246 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
247 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
248 uint32_t OscillatorType; /*!< The oscillators to be configured.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
249 This parameter can be a value of @ref RCC_Oscillator_Type */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
250
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
251 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
252 uint32_t Prediv1Source; /*!< The Prediv1 source value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
253 This parameter can be a value of @ref RCCEx_Prediv1_Source */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
254 #endif /* STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
255
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
256 uint32_t HSEState; /*!< The new state of the HSE.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
257 This parameter can be a value of @ref RCC_HSE_Config */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
258
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
259 uint32_t HSEPredivValue; /*!< The Prediv1 factor value (named PREDIV1 or PLLXTPRE in RM)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
260 This parameter can be a value of @ref RCCEx_Prediv1_Factor */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
261
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
262 uint32_t LSEState; /*!< The new state of the LSE.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
263 This parameter can be a value of @ref RCC_LSE_Config */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
264
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
265 uint32_t HSIState; /*!< The new state of the HSI.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
266 This parameter can be a value of @ref RCC_HSI_Config */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
267
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
268 uint32_t HSICalibrationValue; /*!< The HSI calibration trimming value (default is RCC_HSICALIBRATION_DEFAULT).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
269 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x1F */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
270
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
271 uint32_t LSIState; /*!< The new state of the LSI.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
272 This parameter can be a value of @ref RCC_LSI_Config */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
273
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
274 RCC_PLLInitTypeDef PLL; /*!< PLL structure parameters */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
275
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
276 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
277 RCC_PLL2InitTypeDef PLL2; /*!< PLL2 structure parameters */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
278 #endif /* STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
279 } RCC_OscInitTypeDef;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
280
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
281 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
282 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
283 * @brief RCC PLLI2S configuration structure definition
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
284 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
285 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
286 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
287 uint32_t PLLI2SMUL; /*!< PLLI2SMUL: Multiplication factor for PLLI2S VCO input clock
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
288 This parameter must be a value of @ref RCCEx_PLLI2S_Multiplication_Factor*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
289
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
290 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
291 uint32_t HSEPrediv2Value; /*!< The Prediv2 factor value.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
292 This parameter can be a value of @ref RCCEx_Prediv2_Factor */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
293
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
294 #endif /* STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
295 } RCC_PLLI2SInitTypeDef;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
296 #endif /* STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
297
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
298 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
299 * @brief RCC extended clocks structure definition
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
300 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
301 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
302 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
303 uint32_t PeriphClockSelection; /*!< The Extended Clock to be configured.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
304 This parameter can be a value of @ref RCCEx_Periph_Clock_Selection */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
305
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
306 uint32_t RTCClockSelection; /*!< specifies the RTC clock source.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
307 This parameter can be a value of @ref RCC_RTC_Clock_Source */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
308
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
309 uint32_t AdcClockSelection; /*!< ADC clock source
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
310 This parameter can be a value of @ref RCCEx_ADC_Prescaler */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
311
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
312 #if defined(STM32F103xE) || defined(STM32F103xG) || defined(STM32F105xC)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
313 || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
314 uint32_t I2s2ClockSelection; /*!< I2S2 clock source
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
315 This parameter can be a value of @ref RCCEx_I2S2_Clock_Source */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
316
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
317 uint32_t I2s3ClockSelection; /*!< I2S3 clock source
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
318 This parameter can be a value of @ref RCCEx_I2S3_Clock_Source */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
319
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
320 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
321 RCC_PLLI2SInitTypeDef PLLI2S; /*!< PLL I2S structure parameters
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
322 This parameter will be used only when PLLI2S is selected as Clock Source I2S2 or I2S3 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
323
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
324 #endif /* STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
325 #endif /* STM32F103xE || STM32F103xG || STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
326
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
327 #if defined(STM32F102x6) || defined(STM32F102xB) || defined(STM32F103x6)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
328 || defined(STM32F103xB) || defined(STM32F103xE) || defined(STM32F103xG)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
329 || defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
330 uint32_t UsbClockSelection; /*!< USB clock source
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
331 This parameter can be a value of @ref RCCEx_USB_Prescaler */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
332
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
333 #endif /* STM32F102x6 || STM32F102xB || STM32F103x6 || STM32F103xB || STM32F103xE || STM32F103xG || STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
334 } RCC_PeriphCLKInitTypeDef;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
335
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
336 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
337 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
338 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
339
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
340 /* Exported constants --------------------------------------------------------*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
341
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
342 /** @defgroup RCCEx_Exported_Constants RCCEx Exported Constants
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
343 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
344 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
345
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
346 /** @defgroup RCCEx_Periph_Clock_Selection Periph Clock Selection
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
347 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
348 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
349 #define RCC_PERIPHCLK_RTC ((uint32_t)0x00000001)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
350 #define RCC_PERIPHCLK_ADC ((uint32_t)0x00000002)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
351 #if defined(STM32F103xE) || defined(STM32F103xG) || defined(STM32F105xC)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
352 || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
353 #define RCC_PERIPHCLK_I2S2 ((uint32_t)0x00000004)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
354 #define RCC_PERIPHCLK_I2S3 ((uint32_t)0x00000008)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
355 #endif /* STM32F103xE || STM32F103xG || STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
356 #if defined(STM32F102x6) || defined(STM32F102xB) || defined(STM32F103x6)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
357 || defined(STM32F103xB) || defined(STM32F103xE) || defined(STM32F103xG)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
358 || defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
359 #define RCC_PERIPHCLK_USB ((uint32_t)0x00000010)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
360 #endif /* STM32F102x6 || STM32F102xB || STM32F103x6 || STM32F103xB || STM32F103xE || STM32F103xG || STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
361
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
362 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
363 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
364 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
365
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
366 /** @defgroup RCCEx_ADC_Prescaler ADC Prescaler
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
367 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
368 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
369 #define RCC_ADCPCLK2_DIV2 RCC_CFGR_ADCPRE_DIV2
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
370 #define RCC_ADCPCLK2_DIV4 RCC_CFGR_ADCPRE_DIV4
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
371 #define RCC_ADCPCLK2_DIV6 RCC_CFGR_ADCPRE_DIV6
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
372 #define RCC_ADCPCLK2_DIV8 RCC_CFGR_ADCPRE_DIV8
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
373
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
374 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
375 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
376 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
377
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
378 #if defined(STM32F103xE) || defined(STM32F103xG) || defined(STM32F105xC)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
379 || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
380 /** @defgroup RCCEx_I2S2_Clock_Source I2S2 Clock Source
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
381 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
382 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
383 #define RCC_I2S2CLKSOURCE_SYSCLK ((uint32_t)0x00000000)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
384 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
385 #define RCC_I2S2CLKSOURCE_PLLI2S_VCO RCC_CFGR2_I2S2SRC
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
386 #endif /* STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
387
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
388 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
389 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
390 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
391
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
392 /** @defgroup RCCEx_I2S3_Clock_Source I2S3 Clock Source
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
393 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
394 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
395 #define RCC_I2S3CLKSOURCE_SYSCLK ((uint32_t)0x00000000)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
396 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
397 #define RCC_I2S3CLKSOURCE_PLLI2S_VCO RCC_CFGR2_I2S3SRC
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
398 #endif /* STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
399
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
400 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
401 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
402 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
403
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
404 #endif /* STM32F103xE || STM32F103xG || STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
405
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
406 #if defined(STM32F102x6) || defined(STM32F102xB) || defined(STM32F103x6)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
407 || defined(STM32F103xB) || defined(STM32F103xE) || defined(STM32F103xG)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
408
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
409 /** @defgroup RCCEx_USB_Prescaler USB Prescaler
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
410 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
411 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
412 #define RCC_USBCLKSOURCE_PLL RCC_CFGR_USBPRE
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
413 #define RCC_USBCLKSOURCE_PLL_DIV1_5 ((uint32_t)0x00000000)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
414
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
415 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
416 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
417 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
418
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
419 #endif /* STM32F102x6 || STM32F102xB || STM32F103x6 || STM32F103xB || STM32F103xE || STM32F103xG */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
420
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
421
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
422 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
423 /** @defgroup RCCEx_USB_Prescaler USB Prescaler
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
424 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
425 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
426 #define RCC_USBCLKSOURCE_PLL_DIV2 RCC_CFGR_OTGFSPRE
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
427 #define RCC_USBCLKSOURCE_PLL_DIV3 ((uint32_t)0x00000000)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
428
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
429 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
430 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
431 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
432
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
433 /** @defgroup RCCEx_PLLI2S_Multiplication_Factor PLLI2S Multiplication Factor
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
434 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
435 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
436
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
437 #define RCC_PLLI2S_MUL8 RCC_CFGR2_PLL3MUL8 /*!< PLLI2S input clock * 8 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
438 #define RCC_PLLI2S_MUL9 RCC_CFGR2_PLL3MUL9 /*!< PLLI2S input clock * 9 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
439 #define RCC_PLLI2S_MUL10 RCC_CFGR2_PLL3MUL10 /*!< PLLI2S input clock * 10 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
440 #define RCC_PLLI2S_MUL11 RCC_CFGR2_PLL3MUL11 /*!< PLLI2S input clock * 11 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
441 #define RCC_PLLI2S_MUL12 RCC_CFGR2_PLL3MUL12 /*!< PLLI2S input clock * 12 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
442 #define RCC_PLLI2S_MUL13 RCC_CFGR2_PLL3MUL13 /*!< PLLI2S input clock * 13 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
443 #define RCC_PLLI2S_MUL14 RCC_CFGR2_PLL3MUL14 /*!< PLLI2S input clock * 14 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
444 #define RCC_PLLI2S_MUL16 RCC_CFGR2_PLL3MUL16 /*!< PLLI2S input clock * 16 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
445 #define RCC_PLLI2S_MUL20 RCC_CFGR2_PLL3MUL20 /*!< PLLI2S input clock * 20 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
446
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
447 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
448 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
449 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
450 #endif /* STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
451
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
452 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
453 /** @defgroup RCCEx_Prediv1_Source Prediv1 Source
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
454 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
455 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
456
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
457 #define RCC_PREDIV1_SOURCE_HSE RCC_CFGR2_PREDIV1SRC_HSE
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
458 #define RCC_PREDIV1_SOURCE_PLL2 RCC_CFGR2_PREDIV1SRC_PLL2
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
459
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
460 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
461 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
462 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
463 #endif /* STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
464
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
465 /** @defgroup RCCEx_Prediv1_Factor HSE Prediv1 Factor
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
466 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
467 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
468
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
469 #define RCC_HSE_PREDIV_DIV1 ((uint32_t)0x00000000)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
470
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
471 #if defined(STM32F105xC) || defined(STM32F107xC) || defined(STM32F100xB)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
472 || defined(STM32F100xE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
473 #define RCC_HSE_PREDIV_DIV2 RCC_CFGR2_PREDIV1_DIV2
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
474 #define RCC_HSE_PREDIV_DIV3 RCC_CFGR2_PREDIV1_DIV3
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
475 #define RCC_HSE_PREDIV_DIV4 RCC_CFGR2_PREDIV1_DIV4
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
476 #define RCC_HSE_PREDIV_DIV5 RCC_CFGR2_PREDIV1_DIV5
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
477 #define RCC_HSE_PREDIV_DIV6 RCC_CFGR2_PREDIV1_DIV6
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
478 #define RCC_HSE_PREDIV_DIV7 RCC_CFGR2_PREDIV1_DIV7
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
479 #define RCC_HSE_PREDIV_DIV8 RCC_CFGR2_PREDIV1_DIV8
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
480 #define RCC_HSE_PREDIV_DIV9 RCC_CFGR2_PREDIV1_DIV9
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
481 #define RCC_HSE_PREDIV_DIV10 RCC_CFGR2_PREDIV1_DIV10
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
482 #define RCC_HSE_PREDIV_DIV11 RCC_CFGR2_PREDIV1_DIV11
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
483 #define RCC_HSE_PREDIV_DIV12 RCC_CFGR2_PREDIV1_DIV12
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
484 #define RCC_HSE_PREDIV_DIV13 RCC_CFGR2_PREDIV1_DIV13
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
485 #define RCC_HSE_PREDIV_DIV14 RCC_CFGR2_PREDIV1_DIV14
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
486 #define RCC_HSE_PREDIV_DIV15 RCC_CFGR2_PREDIV1_DIV15
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
487 #define RCC_HSE_PREDIV_DIV16 RCC_CFGR2_PREDIV1_DIV16
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
488 #else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
489 #define RCC_HSE_PREDIV_DIV2 RCC_CFGR_PLLXTPRE
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
490 #endif /* STM32F105xC || STM32F107xC || STM32F100xB || STM32F100xE */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
491
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
492 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
493 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
494 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
495
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
496 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
497 /** @defgroup RCCEx_Prediv2_Factor HSE Prediv2 Factor
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
498 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
499 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
500
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
501 #define RCC_HSE_PREDIV2_DIV1 RCC_CFGR2_PREDIV2_DIV1 /*!< PREDIV2 input clock not divided */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
502 #define RCC_HSE_PREDIV2_DIV2 RCC_CFGR2_PREDIV2_DIV2 /*!< PREDIV2 input clock divided by 2 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
503 #define RCC_HSE_PREDIV2_DIV3 RCC_CFGR2_PREDIV2_DIV3 /*!< PREDIV2 input clock divided by 3 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
504 #define RCC_HSE_PREDIV2_DIV4 RCC_CFGR2_PREDIV2_DIV4 /*!< PREDIV2 input clock divided by 4 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
505 #define RCC_HSE_PREDIV2_DIV5 RCC_CFGR2_PREDIV2_DIV5 /*!< PREDIV2 input clock divided by 5 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
506 #define RCC_HSE_PREDIV2_DIV6 RCC_CFGR2_PREDIV2_DIV6 /*!< PREDIV2 input clock divided by 6 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
507 #define RCC_HSE_PREDIV2_DIV7 RCC_CFGR2_PREDIV2_DIV7 /*!< PREDIV2 input clock divided by 7 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
508 #define RCC_HSE_PREDIV2_DIV8 RCC_CFGR2_PREDIV2_DIV8 /*!< PREDIV2 input clock divided by 8 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
509 #define RCC_HSE_PREDIV2_DIV9 RCC_CFGR2_PREDIV2_DIV9 /*!< PREDIV2 input clock divided by 9 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
510 #define RCC_HSE_PREDIV2_DIV10 RCC_CFGR2_PREDIV2_DIV10 /*!< PREDIV2 input clock divided by 10 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
511 #define RCC_HSE_PREDIV2_DIV11 RCC_CFGR2_PREDIV2_DIV11 /*!< PREDIV2 input clock divided by 11 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
512 #define RCC_HSE_PREDIV2_DIV12 RCC_CFGR2_PREDIV2_DIV12 /*!< PREDIV2 input clock divided by 12 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
513 #define RCC_HSE_PREDIV2_DIV13 RCC_CFGR2_PREDIV2_DIV13 /*!< PREDIV2 input clock divided by 13 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
514 #define RCC_HSE_PREDIV2_DIV14 RCC_CFGR2_PREDIV2_DIV14 /*!< PREDIV2 input clock divided by 14 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
515 #define RCC_HSE_PREDIV2_DIV15 RCC_CFGR2_PREDIV2_DIV15 /*!< PREDIV2 input clock divided by 15 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
516 #define RCC_HSE_PREDIV2_DIV16 RCC_CFGR2_PREDIV2_DIV16 /*!< PREDIV2 input clock divided by 16 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
517
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
518 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
519 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
520 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
521
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
522 /** @defgroup RCCEx_PLL2_Config PLL Config
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
523 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
524 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
525 #define RCC_PLL2_NONE ((uint32_t)0x00000000)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
526 #define RCC_PLL2_OFF ((uint32_t)0x00000001)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
527 #define RCC_PLL2_ON ((uint32_t)0x00000002)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
528
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
529 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
530 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
531 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
532
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
533 /** @defgroup RCCEx_PLL2_Multiplication_Factor PLL2 Multiplication Factor
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
534 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
535 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
536
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
537 #define RCC_PLL2_MUL8 RCC_CFGR2_PLL2MUL8 /*!< PLL2 input clock * 8 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
538 #define RCC_PLL2_MUL9 RCC_CFGR2_PLL2MUL9 /*!< PLL2 input clock * 9 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
539 #define RCC_PLL2_MUL10 RCC_CFGR2_PLL2MUL10 /*!< PLL2 input clock * 10 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
540 #define RCC_PLL2_MUL11 RCC_CFGR2_PLL2MUL11 /*!< PLL2 input clock * 11 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
541 #define RCC_PLL2_MUL12 RCC_CFGR2_PLL2MUL12 /*!< PLL2 input clock * 12 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
542 #define RCC_PLL2_MUL13 RCC_CFGR2_PLL2MUL13 /*!< PLL2 input clock * 13 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
543 #define RCC_PLL2_MUL14 RCC_CFGR2_PLL2MUL14 /*!< PLL2 input clock * 14 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
544 #define RCC_PLL2_MUL16 RCC_CFGR2_PLL2MUL16 /*!< PLL2 input clock * 16 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
545 #define RCC_PLL2_MUL20 RCC_CFGR2_PLL2MUL20 /*!< PLL2 input clock * 20 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
546
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
547 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
548 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
549 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
550
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
551 #endif /* STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
552
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
553 /** @defgroup RCCEx_PLL_Multiplication_Factor PLL Multiplication Factor
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
554 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
555 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
556
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
557 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
558 #else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
559 #define RCC_PLL_MUL2 RCC_CFGR_PLLMULL2
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
560 #define RCC_PLL_MUL3 RCC_CFGR_PLLMULL3
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
561 #endif /* STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
562 #define RCC_PLL_MUL4 RCC_CFGR_PLLMULL4
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
563 #define RCC_PLL_MUL5 RCC_CFGR_PLLMULL5
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
564 #define RCC_PLL_MUL6 RCC_CFGR_PLLMULL6
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
565 #define RCC_PLL_MUL7 RCC_CFGR_PLLMULL7
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
566 #define RCC_PLL_MUL8 RCC_CFGR_PLLMULL8
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
567 #define RCC_PLL_MUL9 RCC_CFGR_PLLMULL9
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
568 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
569 #define RCC_PLL_MUL6_5 RCC_CFGR_PLLMULL6_5
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
570 #else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
571 #define RCC_PLL_MUL10 RCC_CFGR_PLLMULL10
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
572 #define RCC_PLL_MUL11 RCC_CFGR_PLLMULL11
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
573 #define RCC_PLL_MUL12 RCC_CFGR_PLLMULL12
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
574 #define RCC_PLL_MUL13 RCC_CFGR_PLLMULL13
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
575 #define RCC_PLL_MUL14 RCC_CFGR_PLLMULL14
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
576 #define RCC_PLL_MUL15 RCC_CFGR_PLLMULL15
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
577 #define RCC_PLL_MUL16 RCC_CFGR_PLLMULL16
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
578 #endif /* STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
579
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
580 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
581 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
582 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
583
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
584 /** @defgroup RCCEx_MCO1_Clock_Source MCO1 Clock Source
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
585 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
586 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
587 #define RCC_MCO1SOURCE_NOCLOCK ((uint32_t)RCC_CFGR_MCO_NOCLOCK)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
588 #define RCC_MCO1SOURCE_SYSCLK ((uint32_t)RCC_CFGR_MCO_SYSCLK)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
589 #define RCC_MCO1SOURCE_HSI ((uint32_t)RCC_CFGR_MCO_HSI)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
590 #define RCC_MCO1SOURCE_HSE ((uint32_t)RCC_CFGR_MCO_HSE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
591 #define RCC_MCO1SOURCE_PLLCLK ((uint32_t)RCC_CFGR_MCO_PLLCLK_DIV2)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
592 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
593 #define RCC_MCO1SOURCE_PLL2CLK ((uint32_t)RCC_CFGR_MCO_PLL2CLK)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
594 #define RCC_MCO1SOURCE_PLL3CLK_DIV2 ((uint32_t)RCC_CFGR_MCO_PLL3CLK_DIV2)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
595 #define RCC_MCO1SOURCE_EXT_HSE ((uint32_t)RCC_CFGR_MCO_EXT_HSE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
596 #define RCC_MCO1SOURCE_PLL3CLK ((uint32_t)RCC_CFGR_MCO_PLL3CLK)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
597 #endif /* STM32F105xC || STM32F107xC*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
598 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
599 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
600 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
601
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
602 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
603 /** @defgroup RCCEx_Interrupt RCCEx Interrupt
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
604 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
605 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
606 #define RCC_IT_PLL2RDY ((uint8_t)RCC_CIR_PLL2RDYF)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
607 #define RCC_IT_PLLI2SRDY ((uint8_t)RCC_CIR_PLL3RDYF)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
608 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
609 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
610 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
611
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
612 /** @defgroup RCCEx_Flag RCCEx Flag
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
613 * Elements values convention: 0XXYYYYYb
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
614 * - YYYYY : Flag position in the register
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
615 * - XX : Register index
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
616 * - 01: CR register
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
617 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
618 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
619 /* Flags in the CR register */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
620 #define RCC_FLAG_PLL2RDY ((uint8_t)((CR_REG_INDEX << 5) | POSITION_VAL(RCC_CR_PLL2RDY)))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
621 #define RCC_FLAG_PLLI2SRDY ((uint8_t)((CR_REG_INDEX << 5) | POSITION_VAL(RCC_CR_PLL3RDY)))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
622 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
623 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
624 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
625 #endif /* STM32F105xC || STM32F107xC*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
626
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
627 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
628 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
629 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
630
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
631 /* Exported macro ------------------------------------------------------------*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
632 /** @defgroup RCCEx_Exported_Macros RCCEx Exported Macros
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
633 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
634 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
635
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
636 /** @defgroup RCCEx_Peripheral_Clock_Enable_Disable Peripheral Clock Enable Disable
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
637 * @brief Enable or disable the AHB1 peripheral clock.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
638 * @note After reset, the peripheral clock (used for registers read/write access)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
639 * is disabled and the application software has to enable this clock before
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
640 * using it.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
641 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
642 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
643
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
644 #if defined(STM32F101xE) || defined(STM32F103xE) || defined(STM32F101xG)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
645 || defined(STM32F103xG) || defined(STM32F105xC) || defined (STM32F107xC)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
646 || defined (STM32F100xE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
647 #define __HAL_RCC_DMA2_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
648 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
649 SET_BIT(RCC->AHBENR, RCC_AHBENR_DMA2EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
650 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
651 tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_DMA2EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
652 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
653 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
654
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
655 #define __HAL_RCC_DMA2_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_DMA2EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
656 #endif /* STM32F101xE || STM32F103xE || STM32F101xG || STM32F103xG || STM32F105xC || STM32F107xC || STM32F100xE */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
657
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
658 #if defined(STM32F101xE) || defined(STM32F103xE) || defined(STM32F101xG)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
659 || defined(STM32F103xG) || defined (STM32F100xE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
660 #define __HAL_RCC_FSMC_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
661 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
662 SET_BIT(RCC->AHBENR, RCC_AHBENR_FSMCEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
663 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
664 tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_FSMCEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
665 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
666 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
667
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
668 #define __HAL_RCC_FSMC_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_FSMCEN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
669 #endif /* STM32F101xE || STM32F103xE || STM32F101xG || STM32F103xG || STM32F100xE */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
670
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
671 #if defined(STM32F103xE) || defined(STM32F103xG)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
672 #define __HAL_RCC_SDIO_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
673 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
674 SET_BIT(RCC->AHBENR, RCC_AHBENR_SDIOEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
675 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
676 tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_SDIOEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
677 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
678 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
679
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
680
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
681 #define __HAL_RCC_SDIO_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_SDIOEN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
682 #endif /* STM32F103xE || STM32F103xG */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
683
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
684 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
685 #define __HAL_RCC_USB_OTG_FS_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
686 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
687 SET_BIT(RCC->AHBENR, RCC_AHBENR_OTGFSEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
688 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
689 tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_OTGFSEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
690 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
691 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
692
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
693
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
694 #define __HAL_RCC_USB_OTG_FS_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_OTGFSEN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
695 #endif /* STM32F105xC || STM32F107xC*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
696
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
697 #if defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
698 #define __HAL_RCC_ETHMAC_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
699 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
700 SET_BIT(RCC->AHBENR, RCC_AHBENR_ETHMACEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
701 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
702 tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_ETHMACEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
703 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
704 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
705
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
706 #define __HAL_RCC_ETHMACTX_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
707 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
708 SET_BIT(RCC->AHBENR, RCC_AHBENR_ETHMACTXEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
709 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
710 tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_ETHMACTXEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
711 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
712 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
713
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
714 #define __HAL_RCC_ETHMACRX_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
715 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
716 SET_BIT(RCC->AHBENR, RCC_AHBENR_ETHMACRXEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
717 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
718 tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_ETHMACRXEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
719 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
720 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
721
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
722 #define __HAL_RCC_ETHMAC_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_ETHMACEN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
723 #define __HAL_RCC_ETHMACTX_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_ETHMACTXEN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
724 #define __HAL_RCC_ETHMACRX_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_ETHMACRXEN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
725
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
726 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
727 * @brief Enable ETHERNET clock.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
728 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
729 #define __HAL_RCC_ETH_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
730 __HAL_RCC_ETHMAC_CLK_ENABLE(); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
731 __HAL_RCC_ETHMACTX_CLK_ENABLE(); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
732 __HAL_RCC_ETHMACRX_CLK_ENABLE(); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
733 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
734 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
735 * @brief Disable ETHERNET clock.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
736 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
737 #define __HAL_RCC_ETH_CLK_DISABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
738 __HAL_RCC_ETHMACTX_CLK_DISABLE(); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
739 __HAL_RCC_ETHMACRX_CLK_DISABLE(); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
740 __HAL_RCC_ETHMAC_CLK_DISABLE(); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
741 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
742
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
743 #endif /* STM32F107xC*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
744
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
745 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
746 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
747 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
748
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
749 /** @defgroup RCCEx_AHB1_Peripheral_Clock_Enable_Disable_Status AHB1 Peripheral Clock Enable Disable Status
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
750 * @brief Get the enable or disable status of the AHB1 peripheral clock.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
751 * @note After reset, the peripheral clock (used for registers read/write access)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
752 * is disabled and the application software has to enable this clock before
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
753 * using it.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
754 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
755 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
756
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
757 #if defined(STM32F101xE) || defined(STM32F103xE) || defined(STM32F101xG)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
758 || defined(STM32F103xG) || defined(STM32F105xC) || defined (STM32F107xC)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
759 || defined (STM32F100xE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
760 #define __HAL_RCC_DMA2_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_DMA2EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
761 #define __HAL_RCC_DMA2_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_DMA2EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
762 #endif /* STM32F101xE || STM32F103xE || STM32F101xG || STM32F103xG || STM32F105xC || STM32F107xC || STM32F100xE */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
763 #if defined(STM32F101xE) || defined(STM32F103xE) || defined(STM32F101xG)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
764 || defined(STM32F103xG) || defined (STM32F100xE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
765 #define __HAL_RCC_FSMC_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_FSMCEN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
766 #define __HAL_RCC_FSMC_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_FSMCEN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
767 #endif /* STM32F101xE || STM32F103xE || STM32F101xG || STM32F103xG || STM32F100xE */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
768 #if defined(STM32F103xE) || defined(STM32F103xG)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
769 #define __HAL_RCC_SDIO_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_SDIOEN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
770 #define __HAL_RCC_SDIO_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_SDIOEN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
771 #endif /* STM32F103xE || STM32F103xG */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
772 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
773 #define __HAL_RCC_USB_OTG_FS_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_OTGFSEN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
774 #define __HAL_RCC_USB_OTG_FS_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_OTGFSEN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
775 #endif /* STM32F105xC || STM32F107xC*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
776 #if defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
777 #define __HAL_RCC_ETHMAC_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_ETHMACEN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
778 #define __HAL_RCC_ETHMAC_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_ETHMACEN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
779 #define __HAL_RCC_ETHMACTX_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_ETHMACTXEN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
780 #define __HAL_RCC_ETHMACTX_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_ETHMACTXEN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
781 #define __HAL_RCC_ETHMACRX_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_ETHMACRXEN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
782 #define __HAL_RCC_ETHMACRX_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_ETHMACRXEN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
783 #endif /* STM32F107xC*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
784
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
785 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
786 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
787 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
788
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
789 /** @defgroup RCCEx_APB1_Clock_Enable_Disable APB1 Clock Enable Disable
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
790 * @brief Enable or disable the Low Speed APB (APB1) peripheral clock.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
791 * @note After reset, the peripheral clock (used for registers read/write access)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
792 * is disabled and the application software has to enable this clock before
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
793 * using it.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
794 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
795 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
796
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
797 #if defined(STM32F103x6) || defined(STM32F103xB) || defined(STM32F103xE)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
798 || defined(STM32F103xG) || defined(STM32F105xC) ||defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
799 #define __HAL_RCC_CAN1_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
800 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
801 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_CAN1EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
802 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
803 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_CAN1EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
804 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
805 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
806
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
807 #define __HAL_RCC_CAN1_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_CAN1EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
808 #endif /* STM32F103x6 || STM32F103xB || STM32F103xE || STM32F103xG || STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
809
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
810 #if defined(STM32F100xB) || defined(STM32F100xE) || defined(STM32F101xB)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
811 || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F102xB)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
812 || defined(STM32F103xB) || defined(STM32F103xE) || defined(STM32F103xG)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
813 || defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
814 #define __HAL_RCC_TIM4_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
815 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
816 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM4EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
817 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
818 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM4EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
819 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
820 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
821
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
822 #define __HAL_RCC_SPI2_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
823 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
824 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI2EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
825 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
826 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI2EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
827 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
828 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
829
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
830 #define __HAL_RCC_USART3_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
831 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
832 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_USART3EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
833 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
834 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_USART3EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
835 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
836 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
837
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
838 #define __HAL_RCC_I2C2_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
839 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
840 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C2EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
841 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
842 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C2EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
843 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
844 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
845
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
846 #define __HAL_RCC_TIM4_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM4EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
847 #define __HAL_RCC_SPI2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_SPI2EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
848 #define __HAL_RCC_USART3_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_USART3EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
849 #define __HAL_RCC_I2C2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_I2C2EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
850 #endif /* STM32F100xB || STM32F101xB || STM32F101xE || (...) || STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
851
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
852 #if defined(STM32F102x6) || defined(STM32F102xB) || defined(STM32F103x6)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
853 || defined(STM32F103xB) || defined(STM32F103xE) || defined(STM32F103xG)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
854 #define __HAL_RCC_USB_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
855 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
856 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_USBEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
857 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
858 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_USBEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
859 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
860 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
861
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
862 #define __HAL_RCC_USB_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_USBEN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
863 #endif /* STM32F102x6 || STM32F102xB || STM32F103x6 || STM32F103xB || STM32F103xE || STM32F103xG */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
864
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
865 #if defined(STM32F101xE) || defined(STM32F103xE) || defined(STM32F101xG)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
866 || defined(STM32F103xG) || defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
867 #define __HAL_RCC_TIM5_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
868 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
869 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM5EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
870 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
871 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM5EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
872 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
873 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
874
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
875 #define __HAL_RCC_TIM6_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
876 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
877 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM6EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
878 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
879 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM6EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
880 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
881 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
882
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
883 #define __HAL_RCC_TIM7_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
884 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
885 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM7EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
886 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
887 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM7EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
888 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
889 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
890
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
891 #define __HAL_RCC_SPI3_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
892 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
893 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI3EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
894 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
895 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI3EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
896 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
897 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
898
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
899 #define __HAL_RCC_UART4_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
900 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
901 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_UART4EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
902 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
903 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_UART4EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
904 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
905 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
906
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
907 #define __HAL_RCC_UART5_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
908 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
909 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_UART5EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
910 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
911 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_UART5EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
912 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
913 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
914
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
915 #define __HAL_RCC_DAC_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
916 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
917 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_DACEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
918 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
919 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_DACEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
920 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
921 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
922
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
923 #define __HAL_RCC_TIM5_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM5EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
924 #define __HAL_RCC_TIM6_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM6EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
925 #define __HAL_RCC_TIM7_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM7EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
926 #define __HAL_RCC_SPI3_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_SPI3EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
927 #define __HAL_RCC_UART4_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_UART4EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
928 #define __HAL_RCC_UART5_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_UART5EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
929 #define __HAL_RCC_DAC_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_DACEN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
930 #endif /* STM32F101xE || STM32F103xE || STM32F101xG || (...) || STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
931
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
932 #if defined(STM32F100xB) || defined (STM32F100xE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
933 #define __HAL_RCC_TIM6_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
934 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
935 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM6EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
936 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
937 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM6EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
938 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
939 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
940
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
941 #define __HAL_RCC_TIM7_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
942 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
943 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM7EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
944 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
945 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM7EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
946 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
947 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
948
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
949 #define __HAL_RCC_DAC_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
950 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
951 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_DACEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
952 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
953 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_DACEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
954 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
955 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
956
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
957 #define __HAL_RCC_CEC_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
958 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
959 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_CECEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
960 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
961 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_CECEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
962 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
963 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
964
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
965 #define __HAL_RCC_TIM6_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM6EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
966 #define __HAL_RCC_TIM7_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM7EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
967 #define __HAL_RCC_DAC_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_DACEN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
968 #define __HAL_RCC_CEC_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_CECEN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
969 #endif /* STM32F100xB || STM32F100xE */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
970
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
971 #ifdef STM32F100xE
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
972 #define __HAL_RCC_TIM5_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
973 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
974 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM5EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
975 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
976 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM5EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
977 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
978 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
979
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
980 #define __HAL_RCC_TIM12_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
981 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
982 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM12EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
983 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
984 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM12EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
985 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
986 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
987
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
988 #define __HAL_RCC_TIM13_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
989 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
990 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM13EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
991 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
992 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM13EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
993 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
994 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
995
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
996 #define __HAL_RCC_TIM14_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
997 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
998 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM14EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
999 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1000 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM14EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1001 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1002 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1003
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1004 #define __HAL_RCC_SPI3_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1005 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1006 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI3EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1007 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1008 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI3EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1009 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1010 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1011
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1012 #define __HAL_RCC_UART4_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1013 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1014 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_UART4EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1015 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1016 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_UART4EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1017 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1018 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1019
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1020 #define __HAL_RCC_UART5_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1021 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1022 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_UART5EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1023 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1024 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_UART5EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1025 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1026 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1027
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1028 #define __HAL_RCC_TIM5_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM5EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1029 #define __HAL_RCC_TIM12_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM12EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1030 #define __HAL_RCC_TIM13_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM13EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1031 #define __HAL_RCC_TIM14_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM14EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1032 #define __HAL_RCC_SPI3_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_SPI3EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1033 #define __HAL_RCC_UART4_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_UART4EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1034 #define __HAL_RCC_UART5_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_UART5EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1035 #endif /* STM32F100xE */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1036
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1037 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1038 #define __HAL_RCC_CAN2_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1039 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1040 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_CAN2EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1041 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1042 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_CAN2EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1043 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1044 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1045
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1046 #define __HAL_RCC_CAN2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_CAN2EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1047 #endif /* STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1048
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1049 #if defined(STM32F101xG) || defined(STM32F103xG)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1050 #define __HAL_RCC_TIM12_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1051 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1052 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM12EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1053 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1054 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM12EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1055 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1056 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1057
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1058 #define __HAL_RCC_TIM13_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1059 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1060 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM13EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1061 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1062 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM13EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1063 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1064 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1065
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1066 #define __HAL_RCC_TIM14_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1067 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1068 SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM14EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1069 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1070 tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM14EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1071 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1072 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1073
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1074 #define __HAL_RCC_TIM12_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM12EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1075 #define __HAL_RCC_TIM13_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM13EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1076 #define __HAL_RCC_TIM14_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM14EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1077 #endif /* STM32F101xG || STM32F103xG*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1078
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1079 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1080 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1081 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1082
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1083 /** @defgroup RCCEx_APB1_Peripheral_Clock_Enable_Disable_Status APB1 Peripheral Clock Enable Disable Status
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1084 * @brief Get the enable or disable status of the APB1 peripheral clock.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1085 * @note After reset, the peripheral clock (used for registers read/write access)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1086 * is disabled and the application software has to enable this clock before
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1087 * using it.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1088 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1089 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1090
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1091 #if defined(STM32F103x6) || defined(STM32F103xB) || defined(STM32F103xE)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1092 || defined(STM32F103xG) || defined(STM32F105xC) ||defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1093 #define __HAL_RCC_CAN1_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_CAN1EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1094 #define __HAL_RCC_CAN1_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_CAN1EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1095 #endif /* STM32F103x6 || STM32F103xB || STM32F103xE || STM32F103xG || STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1096 #if defined(STM32F100xB) || defined(STM32F100xE) || defined(STM32F101xB)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1097 || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F102xB)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1098 || defined(STM32F103xB) || defined(STM32F103xE) || defined(STM32F103xG)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1099 || defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1100 #define __HAL_RCC_TIM4_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM4EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1101 #define __HAL_RCC_TIM4_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM4EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1102 #define __HAL_RCC_SPI2_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_SPI2EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1103 #define __HAL_RCC_SPI2_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_SPI2EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1104 #define __HAL_RCC_USART3_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_USART3EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1105 #define __HAL_RCC_USART3_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_USART3EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1106 #define __HAL_RCC_I2C2_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_I2C2EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1107 #define __HAL_RCC_I2C2_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_I2C2EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1108 #endif /* STM32F100xB || STM32F101xB || STM32F101xE || (...) || STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1109 #if defined(STM32F102x6) || defined(STM32F102xB) || defined(STM32F103x6)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1110 || defined(STM32F103xB) || defined(STM32F103xE) || defined(STM32F103xG)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1111 #define __HAL_RCC_USB_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_USBEN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1112 #define __HAL_RCC_USB_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_USBEN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1113 #endif /* STM32F102x6 || STM32F102xB || STM32F103x6 || STM32F103xB || STM32F103xE || STM32F103xG */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1114 #if defined(STM32F101xE) || defined(STM32F103xE) || defined(STM32F101xG)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1115 || defined(STM32F103xG) || defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1116 #define __HAL_RCC_TIM5_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM5EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1117 #define __HAL_RCC_TIM5_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM5EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1118 #define __HAL_RCC_TIM6_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM6EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1119 #define __HAL_RCC_TIM6_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM6EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1120 #define __HAL_RCC_TIM7_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM7EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1121 #define __HAL_RCC_TIM7_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM7EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1122 #define __HAL_RCC_SPI3_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_SPI3EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1123 #define __HAL_RCC_SPI3_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_SPI3EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1124 #define __HAL_RCC_UART4_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_UART4EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1125 #define __HAL_RCC_UART4_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_UART4EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1126 #define __HAL_RCC_UART5_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_UART5EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1127 #define __HAL_RCC_UART5_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_UART5EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1128 #define __HAL_RCC_DAC_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_DACEN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1129 #define __HAL_RCC_DAC_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_DACEN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1130 #endif /* STM32F101xE || STM32F103xE || STM32F101xG || (...) || STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1131 #if defined(STM32F100xB) || defined (STM32F100xE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1132 #define __HAL_RCC_TIM6_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM6EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1133 #define __HAL_RCC_TIM6_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM6EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1134 #define __HAL_RCC_TIM7_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM7EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1135 #define __HAL_RCC_TIM7_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM7EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1136 #define __HAL_RCC_DAC_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_DACEN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1137 #define __HAL_RCC_DAC_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_DACEN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1138 #define __HAL_RCC_CEC_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_CECEN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1139 #define __HAL_RCC_CEC_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_CECEN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1140 #endif /* STM32F100xB || STM32F100xE */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1141 #ifdef STM32F100xE
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1142 #define __HAL_RCC_TIM5_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM5EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1143 #define __HAL_RCC_TIM5_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM5EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1144 #define __HAL_RCC_TIM12_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM12EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1145 #define __HAL_RCC_TIM12_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM12EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1146 #define __HAL_RCC_TIM13_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM13EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1147 #define __HAL_RCC_TIM13_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM13EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1148 #define __HAL_RCC_TIM14_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM14EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1149 #define __HAL_RCC_TIM14_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM14EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1150 #define __HAL_RCC_SPI3_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_SPI3EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1151 #define __HAL_RCC_SPI3_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_SPI3EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1152 #define __HAL_RCC_UART4_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_UART4EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1153 #define __HAL_RCC_UART4_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_UART4EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1154 #define __HAL_RCC_UART5_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_UART5EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1155 #define __HAL_RCC_UART5_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_UART5EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1156 #define __HAL_RCC_CAN2_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_CAN2EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1157 #define __HAL_RCC_CAN2_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_CAN2EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1158 #endif /* STM32F100xE */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1159 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1160 #define __HAL_RCC_TIM12_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM12EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1161 #define __HAL_RCC_TIM12_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM12EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1162 #endif /* STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1163 #if defined(STM32F101xG) || defined(STM32F103xG)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1164 #define __HAL_RCC_TIM13_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM13EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1165 #define __HAL_RCC_TIM13_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM13EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1166 #define __HAL_RCC_TIM14_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM14EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1167 #define __HAL_RCC_TIM14_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM14EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1168 #endif /* STM32F101xG || STM32F103xG*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1169
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1170 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1171 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1172 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1173
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1174 /** @defgroup RCCEx_APB2_Clock_Enable_Disable APB2 Clock Enable Disable
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1175 * @brief Enable or disable the High Speed APB (APB2) peripheral clock.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1176 * @note After reset, the peripheral clock (used for registers read/write access)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1177 * is disabled and the application software has to enable this clock before
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1178 * using it.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1179 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1180 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1181
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1182 #if defined(STM32F101xG) || defined(STM32F103x6) || defined(STM32F103xB)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1183 || defined(STM32F105xC) || defined(STM32F107xC) || defined(STM32F103xE)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1184 || defined(STM32F103xG)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1185 #define __HAL_RCC_ADC2_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1186 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1187 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_ADC2EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1188 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1189 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_ADC2EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1190 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1191 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1192
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1193 #define __HAL_RCC_ADC2_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_ADC2EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1194 #endif /* STM32F101xG || STM32F103x6 || STM32F103xB || STM32F105xC || STM32F107xC || STM32F103xE || STM32F103xG */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1195
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1196 #if defined(STM32F100xB) || defined(STM32F100xE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1197 #define __HAL_RCC_TIM15_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1198 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1199 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM15EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1200 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1201 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM15EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1202 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1203 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1204
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1205 #define __HAL_RCC_TIM16_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1206 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1207 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM16EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1208 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1209 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM16EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1210 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1211 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1212
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1213 #define __HAL_RCC_TIM17_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1214 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1215 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM17EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1216 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1217 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM17EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1218 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1219 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1220
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1221 #define __HAL_RCC_TIM15_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM15EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1222 #define __HAL_RCC_TIM16_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM16EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1223 #define __HAL_RCC_TIM17_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM17EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1224 #endif /* STM32F100xB || STM32F100xE */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1225
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1226 #if defined(STM32F100xE) || defined(STM32F101xB) || defined(STM32F101xE)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1227 || defined(STM32F101xG) || defined(STM32F100xB) || defined(STM32F103xB)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1228 || defined(STM32F103xE) || defined(STM32F103xG) || defined(STM32F105xC)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1229 || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1230 #define __HAL_RCC_GPIOE_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1231 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1232 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_IOPEEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1233 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1234 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_IOPEEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1235 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1236 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1237
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1238 #define __HAL_RCC_GPIOE_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_IOPEEN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1239 #endif /* STM32F101x6 || STM32F101xB || STM32F101xE || (...) || STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1240
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1241 #if defined(STM32F101xE) || defined(STM32F103xE) || defined(STM32F101xG)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1242 || defined(STM32F103xG)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1243 #define __HAL_RCC_GPIOF_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1244 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1245 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_IOPFEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1246 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1247 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_IOPFEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1248 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1249 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1250
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1251 #define __HAL_RCC_GPIOG_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1252 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1253 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_IOPGEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1254 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1255 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_IOPGEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1256 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1257 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1258
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1259 #define __HAL_RCC_GPIOF_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_IOPFEN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1260 #define __HAL_RCC_GPIOG_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_IOPGEN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1261 #endif /* STM32F101xE || STM32F103xE || STM32F101xG || STM32F103xG*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1262
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1263 #if defined(STM32F103xE) || defined(STM32F103xG)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1264 #define __HAL_RCC_TIM8_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1265 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1266 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM8EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1267 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1268 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM8EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1269 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1270 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1271
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1272 #define __HAL_RCC_ADC3_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1273 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1274 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_ADC3EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1275 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1276 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_ADC3EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1277 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1278 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1279
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1280 #define __HAL_RCC_TIM8_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM8EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1281 #define __HAL_RCC_ADC3_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_ADC3EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1282 #endif /* STM32F103xE || STM32F103xG */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1283
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1284 #if defined(STM32F100xE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1285 #define __HAL_RCC_GPIOF_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1286 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1287 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_IOPFEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1288 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1289 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_IOPFEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1290 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1291 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1292
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1293 #define __HAL_RCC_GPIOG_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1294 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1295 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_IOPGEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1296 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1297 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_IOPGEN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1298 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1299 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1300
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1301 #define __HAL_RCC_GPIOF_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_IOPFEN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1302 #define __HAL_RCC_GPIOG_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_IOPGEN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1303 #endif /* STM32F100xE */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1304
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1305 #if defined(STM32F101xG) || defined(STM32F103xG)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1306 #define __HAL_RCC_TIM9_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1307 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1308 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM9EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1309 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1310 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM9EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1311 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1312 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1313
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1314 #define __HAL_RCC_TIM10_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1315 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1316 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM10EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1317 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1318 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM10EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1319 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1320 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1321
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1322 #define __HAL_RCC_TIM11_CLK_ENABLE() do { \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1323 __IO uint32_t tmpreg; \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1324 SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM11EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1325 /* Delay after an RCC peripheral clock enabling */ \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1326 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM11EN);\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1327 UNUSED(tmpreg); \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1328 } while(0)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1329
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1330 #define __HAL_RCC_TIM9_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM9EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1331 #define __HAL_RCC_TIM10_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM10EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1332 #define __HAL_RCC_TIM11_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM11EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1333 #endif /* STM32F101xG || STM32F103xG */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1334
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1335 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1336 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1337 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1338
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1339 /** @defgroup RCCEx_APB2_Peripheral_Clock_Enable_Disable_Status APB2 Peripheral Clock Enable Disable Status
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1340 * @brief Get the enable or disable status of the APB2 peripheral clock.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1341 * @note After reset, the peripheral clock (used for registers read/write access)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1342 * is disabled and the application software has to enable this clock before
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1343 * using it.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1344 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1345 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1346
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1347 #if defined(STM32F101xG) || defined(STM32F103x6) || defined(STM32F103xB)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1348 || defined(STM32F105xC) || defined(STM32F107xC) || defined(STM32F103xE)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1349 || defined(STM32F103xG)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1350 #define __HAL_RCC_ADC2_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_ADC2EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1351 #define __HAL_RCC_ADC2_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_ADC2EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1352 #endif /* STM32F101xG || STM32F103x6 || STM32F103xB || STM32F105xC || STM32F107xC || STM32F103xE || STM32F103xG */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1353 #if defined(STM32F100xB) || defined(STM32F100xE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1354 #define __HAL_RCC_TIM15_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM15EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1355 #define __HAL_RCC_TIM15_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM15EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1356 #define __HAL_RCC_TIM16_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM16EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1357 #define __HAL_RCC_TIM16_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM16EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1358 #define __HAL_RCC_TIM17_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM17EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1359 #define __HAL_RCC_TIM17_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM17EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1360 #endif /* STM32F100xB || STM32F100xE */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1361 #if defined(STM32F100xE) || defined(STM32F101xB) || defined(STM32F101xE)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1362 || defined(STM32F101xG) || defined(STM32F100xB) || defined(STM32F103xB)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1363 || defined(STM32F103xE) || defined(STM32F103xG) || defined(STM32F105xC)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1364 || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1365 #define __HAL_RCC_GPIOE_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_IOPEEN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1366 #define __HAL_RCC_GPIOE_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_IOPEEN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1367 #endif /* STM32F101x6 || STM32F101xB || STM32F101xE || (...) || STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1368 #if defined(STM32F101xE) || defined(STM32F103xE) || defined(STM32F101xG)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1369 || defined(STM32F103xG)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1370 #define __HAL_RCC_GPIOF_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_IOPFEN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1371 #define __HAL_RCC_GPIOF_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_IOPFEN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1372 #define __HAL_RCC_GPIOG_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_IOPGEN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1373 #define __HAL_RCC_GPIOG_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_IOPGEN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1374 #endif /* STM32F101xE || STM32F103xE || STM32F101xG || STM32F103xG*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1375 #if defined(STM32F103xE) || defined(STM32F103xG)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1376 #define __HAL_RCC_TIM8_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM8EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1377 #define __HAL_RCC_TIM8_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM8EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1378 #define __HAL_RCC_ADC3_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_ADC3EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1379 #define __HAL_RCC_ADC3_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_ADC3EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1380 #endif /* STM32F103xE || STM32F103xG */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1381 #if defined(STM32F100xE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1382 #define __HAL_RCC_GPIOF_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_IOPFEN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1383 #define __HAL_RCC_GPIOF_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_IOPFEN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1384 #define __HAL_RCC_GPIOG_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_IOPGEN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1385 #define __HAL_RCC_GPIOG_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_IOPGEN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1386 #endif /* STM32F100xE */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1387 #if defined(STM32F101xG) || defined(STM32F103xG)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1388 #define __HAL_RCC_TIM9_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM9EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1389 #define __HAL_RCC_TIM9_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM9EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1390 #define __HAL_RCC_TIM10_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM10EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1391 #define __HAL_RCC_TIM10_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM10EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1392 #define __HAL_RCC_TIM11_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM11EN)) != RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1393 #define __HAL_RCC_TIM11_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM11EN)) == RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1394 #endif /* STM32F101xG || STM32F103xG */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1395
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1396 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1397 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1398 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1399
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1400 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1401 /** @defgroup RCCEx_Peripheral_Clock_Force_Release Peripheral Clock Force Release
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1402 * @brief Force or release AHB peripheral reset.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1403 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1404 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1405 #define __HAL_RCC_AHB_FORCE_RESET() (RCC->AHBRSTR = 0xFFFFFFFFU)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1406 #define __HAL_RCC_USB_OTG_FS_FORCE_RESET() (RCC->AHBRSTR |= (RCC_AHBRSTR_OTGFSRST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1407 #if defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1408 #define __HAL_RCC_ETHMAC_FORCE_RESET() (RCC->AHBRSTR |= (RCC_AHBRSTR_ETHMACRST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1409 #endif /* STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1410
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1411 #define __HAL_RCC_AHB_RELEASE_RESET() (RCC->AHBRSTR = 0x00)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1412 #define __HAL_RCC_USB_OTG_FS_RELEASE_RESET() (RCC->AHBRSTR &= ~(RCC_AHBRSTR_OTGFSRST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1413 #if defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1414 #define __HAL_RCC_ETHMAC_RELEASE_RESET() (RCC->AHBRSTR &= ~(RCC_AHBRSTR_ETHMACRST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1415 #endif /* STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1416
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1417 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1418 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1419 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1420 #endif /* STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1421
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1422 /** @defgroup RCCEx_APB1_Force_Release_Reset APB1 Force Release Reset
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1423 * @brief Force or release APB1 peripheral reset.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1424 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1425 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1426
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1427 #if defined(STM32F103x6) || defined(STM32F103xB) || defined(STM32F103xE)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1428 || defined(STM32F103xG) || defined(STM32F105xC) ||defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1429 #define __HAL_RCC_CAN1_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_CAN1RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1430
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1431 #define __HAL_RCC_CAN1_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_CAN1RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1432 #endif /* STM32F103x6 || STM32F103xB || STM32F103xE || STM32F103xG || STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1433
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1434 #if defined(STM32F100xB) || defined(STM32F100xE) || defined(STM32F101xB)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1435 || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F102xB)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1436 || defined(STM32F103xB) || defined(STM32F103xE) || defined(STM32F103xG)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1437 || defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1438 #define __HAL_RCC_TIM4_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM4RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1439 #define __HAL_RCC_SPI2_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_SPI2RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1440 #define __HAL_RCC_USART3_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_USART3RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1441 #define __HAL_RCC_I2C2_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_I2C2RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1442
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1443 #define __HAL_RCC_TIM4_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM4RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1444 #define __HAL_RCC_SPI2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_SPI2RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1445 #define __HAL_RCC_USART3_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_USART3RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1446 #define __HAL_RCC_I2C2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_I2C2RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1447 #endif /* STM32F100xB || STM32F101xB || STM32F101xE || (...) || STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1448
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1449 #if defined(STM32F102x6) || defined(STM32F102xB) || defined(STM32F103x6)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1450 || defined(STM32F103xB) || defined(STM32F103xE) || defined(STM32F103xG)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1451 #define __HAL_RCC_USB_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_USBRST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1452 #define __HAL_RCC_USB_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_USBRST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1453 #endif /* STM32F102x6 || STM32F102xB || STM32F103x6 || STM32F103xB || STM32F103xE || STM32F103xG */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1454
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1455 #if defined(STM32F101xE) || defined(STM32F103xE) || defined(STM32F101xG)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1456 || defined(STM32F103xG) || defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1457 #define __HAL_RCC_TIM5_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM5RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1458 #define __HAL_RCC_TIM6_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM6RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1459 #define __HAL_RCC_TIM7_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM7RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1460 #define __HAL_RCC_SPI3_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_SPI3RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1461 #define __HAL_RCC_UART4_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_UART4RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1462 #define __HAL_RCC_UART5_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_UART5RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1463 #define __HAL_RCC_DAC_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_DACRST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1464
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1465 #define __HAL_RCC_TIM5_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM5RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1466 #define __HAL_RCC_TIM6_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM6RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1467 #define __HAL_RCC_TIM7_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM7RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1468 #define __HAL_RCC_SPI3_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_SPI3RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1469 #define __HAL_RCC_UART4_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_UART4RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1470 #define __HAL_RCC_UART5_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_UART5RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1471 #define __HAL_RCC_DAC_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_DACRST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1472 #endif /* STM32F101xE || STM32F103xE || STM32F101xG || (...) || STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1473
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1474 #if defined(STM32F100xB) || defined (STM32F100xE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1475 #define __HAL_RCC_TIM6_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM6RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1476 #define __HAL_RCC_TIM7_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM7RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1477 #define __HAL_RCC_DAC_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_DACRST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1478 #define __HAL_RCC_CEC_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_CECRST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1479
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1480 #define __HAL_RCC_TIM6_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM6RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1481 #define __HAL_RCC_TIM7_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM7RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1482 #define __HAL_RCC_DAC_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_DACRST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1483 #define __HAL_RCC_CEC_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_CECRST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1484 #endif /* STM32F100xB || STM32F100xE */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1485
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1486 #if defined (STM32F100xE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1487 #define __HAL_RCC_TIM5_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM5RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1488 #define __HAL_RCC_TIM12_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM12RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1489 #define __HAL_RCC_TIM13_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM13RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1490 #define __HAL_RCC_TIM14_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM14RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1491 #define __HAL_RCC_SPI3_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_SPI3RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1492 #define __HAL_RCC_UART4_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_UART4RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1493 #define __HAL_RCC_UART5_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_UART5RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1494
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1495 #define __HAL_RCC_TIM5_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM5RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1496 #define __HAL_RCC_TIM12_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM12RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1497 #define __HAL_RCC_TIM13_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM13RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1498 #define __HAL_RCC_TIM14_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM14RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1499 #define __HAL_RCC_SPI3_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_SPI3RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1500 #define __HAL_RCC_UART4_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_UART4RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1501 #define __HAL_RCC_UART5_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_UART5RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1502 #endif /* STM32F100xE */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1503
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1504 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1505 #define __HAL_RCC_CAN2_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_CAN2RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1506
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1507 #define __HAL_RCC_CAN2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_CAN2RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1508 #endif /* STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1509
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1510 #if defined(STM32F101xG) || defined(STM32F103xG)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1511 #define __HAL_RCC_TIM12_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM12RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1512 #define __HAL_RCC_TIM13_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM13RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1513 #define __HAL_RCC_TIM14_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM14RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1514
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1515 #define __HAL_RCC_TIM12_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM12RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1516 #define __HAL_RCC_TIM13_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM13RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1517 #define __HAL_RCC_TIM14_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM14RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1518 #endif /* STM32F101xG || STM32F103xG */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1519
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1520 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1521 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1522 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1523
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1524 /** @defgroup RCCEx_APB2_Force_Release_Reset APB2 Force Release Reset
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1525 * @brief Force or release APB2 peripheral reset.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1526 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1527 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1528
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1529 #if defined(STM32F101xG) || defined(STM32F103x6) || defined(STM32F103xB)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1530 || defined(STM32F105xC) || defined(STM32F107xC) || defined(STM32F103xE)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1531 || defined(STM32F103xG)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1532 #define __HAL_RCC_ADC2_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_ADC2RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1533
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1534 #define __HAL_RCC_ADC2_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_ADC2RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1535 #endif /* STM32F101xG || STM32F103x6 || STM32F103xB || STM32F105xC || STM32F107xC || STM32F103xE || STM32F103xG */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1536
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1537 #if defined(STM32F100xB) || defined(STM32F100xE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1538 #define __HAL_RCC_TIM15_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM15RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1539 #define __HAL_RCC_TIM16_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM16RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1540 #define __HAL_RCC_TIM17_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM17RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1541
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1542 #define __HAL_RCC_TIM15_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM15RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1543 #define __HAL_RCC_TIM16_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM16RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1544 #define __HAL_RCC_TIM17_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM17RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1545 #endif /* STM32F100xB || STM32F100xE */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1546
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1547 #if defined(STM32F100xE) || defined(STM32F101xB) || defined(STM32F101xE)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1548 || defined(STM32F101xG) || defined(STM32F100xB) || defined(STM32F103xB)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1549 || defined(STM32F103xE) || defined(STM32F103xG) || defined(STM32F105xC)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1550 || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1551 #define __HAL_RCC_GPIOE_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_IOPERST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1552
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1553 #define __HAL_RCC_GPIOE_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_IOPERST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1554 #endif /* STM32F101x6 || STM32F101xB || STM32F101xE || (...) || STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1555
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1556 #if defined(STM32F101xE) || defined(STM32F103xE) || defined(STM32F101xG)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1557 || defined(STM32F103xG)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1558 #define __HAL_RCC_GPIOF_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_IOPFRST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1559 #define __HAL_RCC_GPIOG_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_IOPGRST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1560
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1561 #define __HAL_RCC_GPIOF_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_IOPFRST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1562 #define __HAL_RCC_GPIOG_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_IOPGRST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1563 #endif /* STM32F101xE || STM32F103xE || STM32F101xG || STM32F103xG*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1564
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1565 #if defined(STM32F103xE) || defined(STM32F103xG)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1566 #define __HAL_RCC_TIM8_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM8RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1567 #define __HAL_RCC_ADC3_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_ADC3RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1568
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1569 #define __HAL_RCC_TIM8_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM8RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1570 #define __HAL_RCC_ADC3_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_ADC3RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1571 #endif /* STM32F103xE || STM32F103xG */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1572
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1573 #if defined(STM32F100xE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1574 #define __HAL_RCC_GPIOF_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_IOPFRST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1575 #define __HAL_RCC_GPIOG_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_IOPGRST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1576
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1577 #define __HAL_RCC_GPIOF_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_IOPFRST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1578 #define __HAL_RCC_GPIOG_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_IOPGRST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1579 #endif /* STM32F100xE */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1580
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1581 #if defined(STM32F101xG) || defined(STM32F103xG)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1582 #define __HAL_RCC_TIM9_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM9RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1583 #define __HAL_RCC_TIM10_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM10RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1584 #define __HAL_RCC_TIM11_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM11RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1585
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1586 #define __HAL_RCC_TIM9_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM9RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1587 #define __HAL_RCC_TIM10_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM10RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1588 #define __HAL_RCC_TIM11_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM11RST))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1589 #endif /* STM32F101xG || STM32F103xG*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1590
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1591 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1592 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1593 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1594
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1595 /** @defgroup RCCEx_HSE_Configuration HSE Configuration
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1596 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1597 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1598
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1599 #if defined(STM32F105xC) || defined(STM32F107xC) || defined(STM32F100xB)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1600 || defined(STM32F100xE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1601 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1602 * @brief Macro to configure the External High Speed oscillator (HSE) Predivision factor for PLL.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1603 * @note Predivision factor can not be changed if PLL is used as system clock
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1604 * In this case, you have to select another source of the system clock, disable the PLL and
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1605 * then change the HSE predivision factor.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1606 * @param __HSE_PREDIV_VALUE__ specifies the division value applied to HSE.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1607 * This parameter must be a number between RCC_HSE_PREDIV_DIV1 and RCC_HSE_PREDIV_DIV16.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1608 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1609 #define __HAL_RCC_HSE_PREDIV_CONFIG(__HSE_PREDIV_VALUE__) MODIFY_REG(RCC->CFGR2, RCC_CFGR2_PREDIV1, (uint32_t)(__HSE_PREDIV_VALUE__))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1610 #else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1611 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1612 * @brief Macro to configure the External High Speed oscillator (HSE) Predivision factor for PLL.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1613 * @note Predivision factor can not be changed if PLL is used as system clock
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1614 * In this case, you have to select another source of the system clock, disable the PLL and
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1615 * then change the HSE predivision factor.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1616 * @param __HSE_PREDIV_VALUE__ specifies the division value applied to HSE.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1617 * This parameter must be a number between RCC_HSE_PREDIV_DIV1 and RCC_HSE_PREDIV_DIV2.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1618 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1619 #define __HAL_RCC_HSE_PREDIV_CONFIG(__HSE_PREDIV_VALUE__) \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1620 MODIFY_REG(RCC->CFGR,RCC_CFGR_PLLXTPRE, (uint32_t)(__HSE_PREDIV_VALUE__))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1621
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1622 #endif /* STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1623
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1624 #if defined(STM32F105xC) || defined(STM32F107xC) || defined(STM32F100xB)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1625 || defined(STM32F100xE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1626 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1627 * @brief Macro to get prediv1 factor for PLL.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1628 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1629 #define __HAL_RCC_HSE_GET_PREDIV() READ_BIT(RCC->CFGR2, RCC_CFGR2_PREDIV1)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1630
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1631 #else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1632 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1633 * @brief Macro to get prediv1 factor for PLL.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1634 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1635 #define __HAL_RCC_HSE_GET_PREDIV() READ_BIT(RCC->CFGR, RCC_CFGR_PLLXTPRE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1636
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1637 #endif /* STM32F105xC || STM32F107xC || STM32F100xB || STM32F100xE */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1638
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1639 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1640 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1641 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1642
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1643 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1644 /** @defgroup RCCEx_PLLI2S_Configuration PLLI2S Configuration
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1645 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1646 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1647
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1648 /** @brief Macros to enable the main PLLI2S.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1649 * @note After enabling the main PLLI2S, the application software should wait on
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1650 * PLLI2SRDY flag to be set indicating that PLLI2S clock is stable and can
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1651 * be used as system clock source.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1652 * @note The main PLLI2S is disabled by hardware when entering STOP and STANDBY modes.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1653 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1654 #define __HAL_RCC_PLLI2S_ENABLE() (*(__IO uint32_t *) RCC_CR_PLLI2SON_BB = ENABLE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1655
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1656 /** @brief Macros to disable the main PLLI2S.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1657 * @note The main PLLI2S is disabled by hardware when entering STOP and STANDBY modes.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1658 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1659 #define __HAL_RCC_PLLI2S_DISABLE() (*(__IO uint32_t *) RCC_CR_PLLI2SON_BB = DISABLE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1660
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1661 /** @brief macros to configure the main PLLI2S multiplication factor.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1662 * @note This function must be used only when the main PLLI2S is disabled.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1663 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1664 * @param __PLLI2SMUL__ specifies the multiplication factor for PLLI2S VCO output clock
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1665 * This parameter can be one of the following values:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1666 * @arg @ref RCC_PLLI2S_MUL8 PLLI2SVCO = PLLI2S clock entry x 8
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1667 * @arg @ref RCC_PLLI2S_MUL9 PLLI2SVCO = PLLI2S clock entry x 9
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1668 * @arg @ref RCC_PLLI2S_MUL10 PLLI2SVCO = PLLI2S clock entry x 10
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1669 * @arg @ref RCC_PLLI2S_MUL11 PLLI2SVCO = PLLI2S clock entry x 11
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1670 * @arg @ref RCC_PLLI2S_MUL12 PLLI2SVCO = PLLI2S clock entry x 12
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1671 * @arg @ref RCC_PLLI2S_MUL13 PLLI2SVCO = PLLI2S clock entry x 13
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1672 * @arg @ref RCC_PLLI2S_MUL14 PLLI2SVCO = PLLI2S clock entry x 14
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1673 * @arg @ref RCC_PLLI2S_MUL16 PLLI2SVCO = PLLI2S clock entry x 16
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1674 * @arg @ref RCC_PLLI2S_MUL20 PLLI2SVCO = PLLI2S clock entry x 20
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1675 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1676 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1677 #define __HAL_RCC_PLLI2S_CONFIG(__PLLI2SMUL__)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1678 MODIFY_REG(RCC->CFGR2, RCC_CFGR2_PLL3MUL,(__PLLI2SMUL__))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1679
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1680 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1681 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1682 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1683
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1684 #endif /* STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1685
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1686 /** @defgroup RCCEx_Peripheral_Configuration Peripheral Configuration
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1687 * @brief Macros to configure clock source of different peripherals.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1688 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1689 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1690
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1691 #if defined(STM32F102x6) || defined(STM32F102xB) || defined(STM32F103x6)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1692 || defined(STM32F103xB) || defined(STM32F103xE) || defined(STM32F103xG)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1693 /** @brief Macro to configure the USB clock.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1694 * @param __USBCLKSOURCE__ specifies the USB clock source.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1695 * This parameter can be one of the following values:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1696 * @arg @ref RCC_USBCLKSOURCE_PLL PLL clock divided by 1 selected as USB clock
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1697 * @arg @ref RCC_USBCLKSOURCE_PLL_DIV1_5 PLL clock divided by 1.5 selected as USB clock
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1698 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1699 #define __HAL_RCC_USB_CONFIG(__USBCLKSOURCE__) \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1700 MODIFY_REG(RCC->CFGR, RCC_CFGR_USBPRE, (uint32_t)(__USBCLKSOURCE__))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1701
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1702 /** @brief Macro to get the USB clock (USBCLK).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1703 * @retval The clock source can be one of the following values:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1704 * @arg @ref RCC_USBCLKSOURCE_PLL PLL clock divided by 1 selected as USB clock
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1705 * @arg @ref RCC_USBCLKSOURCE_PLL_DIV1_5 PLL clock divided by 1.5 selected as USB clock
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1706 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1707 #define __HAL_RCC_GET_USB_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_USBPRE)))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1708
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1709 #endif /* STM32F102x6 || STM32F102xB || STM32F103x6 || STM32F103xB || STM32F103xE || STM32F103xG */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1710
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1711 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1712
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1713 /** @brief Macro to configure the USB OTSclock.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1714 * @param __USBCLKSOURCE__ specifies the USB clock source.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1715 * This parameter can be one of the following values:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1716 * @arg @ref RCC_USBCLKSOURCE_PLL_DIV2 PLL clock divided by 2 selected as USB OTG FS clock
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1717 * @arg @ref RCC_USBCLKSOURCE_PLL_DIV3 PLL clock divided by 3 selected as USB OTG FS clock
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1718 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1719 #define __HAL_RCC_USB_CONFIG(__USBCLKSOURCE__) \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1720 MODIFY_REG(RCC->CFGR, RCC_CFGR_OTGFSPRE, (uint32_t)(__USBCLKSOURCE__))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1721
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1722 /** @brief Macro to get the USB clock (USBCLK).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1723 * @retval The clock source can be one of the following values:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1724 * @arg @ref RCC_USBCLKSOURCE_PLL_DIV2 PLL clock divided by 2 selected as USB OTG FS clock
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1725 * @arg @ref RCC_USBCLKSOURCE_PLL_DIV3 PLL clock divided by 3 selected as USB OTG FS clock
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1726 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1727 #define __HAL_RCC_GET_USB_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_OTGFSPRE)))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1728
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1729 #endif /* STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1730
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1731 /** @brief Macro to configure the ADCx clock (x=1 to 3 depending on devices).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1732 * @param __ADCCLKSOURCE__ specifies the ADC clock source.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1733 * This parameter can be one of the following values:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1734 * @arg @ref RCC_ADCPCLK2_DIV2 PCLK2 clock divided by 2 selected as ADC clock
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1735 * @arg @ref RCC_ADCPCLK2_DIV4 PCLK2 clock divided by 4 selected as ADC clock
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1736 * @arg @ref RCC_ADCPCLK2_DIV6 PCLK2 clock divided by 6 selected as ADC clock
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1737 * @arg @ref RCC_ADCPCLK2_DIV8 PCLK2 clock divided by 8 selected as ADC clock
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1738 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1739 #define __HAL_RCC_ADC_CONFIG(__ADCCLKSOURCE__) \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1740 MODIFY_REG(RCC->CFGR, RCC_CFGR_ADCPRE, (uint32_t)(__ADCCLKSOURCE__))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1741
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1742 /** @brief Macro to get the ADC clock (ADCxCLK, x=1 to 3 depending on devices).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1743 * @retval The clock source can be one of the following values:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1744 * @arg @ref RCC_ADCPCLK2_DIV2 PCLK2 clock divided by 2 selected as ADC clock
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1745 * @arg @ref RCC_ADCPCLK2_DIV4 PCLK2 clock divided by 4 selected as ADC clock
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1746 * @arg @ref RCC_ADCPCLK2_DIV6 PCLK2 clock divided by 6 selected as ADC clock
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1747 * @arg @ref RCC_ADCPCLK2_DIV8 PCLK2 clock divided by 8 selected as ADC clock
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1748 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1749 #define __HAL_RCC_GET_ADC_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_ADCPRE)))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1750
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1751 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1752 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1753 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1754
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1755 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1756
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1757 /** @addtogroup RCCEx_HSE_Configuration
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1758 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1759 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1760
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1761 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1762 * @brief Macro to configure the PLL2 & PLLI2S Predivision factor.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1763 * @note Predivision factor can not be changed if PLL2 is used indirectly as system clock
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1764 * In this case, you have to select another source of the system clock, disable the PLL2 and PLLI2S and
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1765 * then change the PREDIV2 factor.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1766 * @param __HSE_PREDIV2_VALUE__ specifies the PREDIV2 value applied to PLL2 & PLLI2S.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1767 * This parameter must be a number between RCC_HSE_PREDIV2_DIV1 and RCC_HSE_PREDIV2_DIV16.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1768 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1769 #define __HAL_RCC_HSE_PREDIV2_CONFIG(__HSE_PREDIV2_VALUE__) \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1770 MODIFY_REG(RCC->CFGR2, RCC_CFGR2_PREDIV2, (uint32_t)(__HSE_PREDIV2_VALUE__))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1771
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1772 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1773 * @brief Macro to get prediv2 factor for PLL2 & PLL3.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1774 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1775 #define __HAL_RCC_HSE_GET_PREDIV2() READ_BIT(RCC->CFGR2, RCC_CFGR2_PREDIV2)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1776
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1777 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1778 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1779 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1780
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1781 /** @addtogroup RCCEx_PLLI2S_Configuration
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1782 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1783 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1784
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1785 /** @brief Macros to enable the main PLL2.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1786 * @note After enabling the main PLL2, the application software should wait on
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1787 * PLL2RDY flag to be set indicating that PLL2 clock is stable and can
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1788 * be used as system clock source.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1789 * @note The main PLL2 is disabled by hardware when entering STOP and STANDBY modes.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1790 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1791 #define __HAL_RCC_PLL2_ENABLE() (*(__IO uint32_t *) RCC_CR_PLL2ON_BB = ENABLE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1792
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1793 /** @brief Macros to disable the main PLL2.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1794 * @note The main PLL2 can not be disabled if it is used indirectly as system clock source
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1795 * @note The main PLL2 is disabled by hardware when entering STOP and STANDBY modes.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1796 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1797 #define __HAL_RCC_PLL2_DISABLE() (*(__IO uint32_t *) RCC_CR_PLL2ON_BB = DISABLE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1798
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1799 /** @brief macros to configure the main PLL2 multiplication factor.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1800 * @note This function must be used only when the main PLL2 is disabled.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1801 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1802 * @param __PLL2MUL__ specifies the multiplication factor for PLL2 VCO output clock
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1803 * This parameter can be one of the following values:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1804 * @arg @ref RCC_PLL2_MUL8 PLL2VCO = PLL2 clock entry x 8
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1805 * @arg @ref RCC_PLL2_MUL9 PLL2VCO = PLL2 clock entry x 9
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1806 * @arg @ref RCC_PLL2_MUL10 PLL2VCO = PLL2 clock entry x 10
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1807 * @arg @ref RCC_PLL2_MUL11 PLL2VCO = PLL2 clock entry x 11
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1808 * @arg @ref RCC_PLL2_MUL12 PLL2VCO = PLL2 clock entry x 12
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1809 * @arg @ref RCC_PLL2_MUL13 PLL2VCO = PLL2 clock entry x 13
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1810 * @arg @ref RCC_PLL2_MUL14 PLL2VCO = PLL2 clock entry x 14
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1811 * @arg @ref RCC_PLL2_MUL16 PLL2VCO = PLL2 clock entry x 16
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1812 * @arg @ref RCC_PLL2_MUL20 PLL2VCO = PLL2 clock entry x 20
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1813 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1814 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1815 #define __HAL_RCC_PLL2_CONFIG(__PLL2MUL__)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1816 MODIFY_REG(RCC->CFGR2, RCC_CFGR2_PLL2MUL,(__PLL2MUL__))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1817
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1818 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1819 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1820 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1821
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1822 /** @defgroup RCCEx_I2S_Configuration I2S Configuration
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1823 * @brief Macros to configure clock source of I2S peripherals.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1824 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1825 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1826
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1827 /** @brief Macro to configure the I2S2 clock.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1828 * @param __I2S2CLKSOURCE__ specifies the I2S2 clock source.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1829 * This parameter can be one of the following values:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1830 * @arg @ref RCC_I2S2CLKSOURCE_SYSCLK system clock selected as I2S3 clock entry
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1831 * @arg @ref RCC_I2S2CLKSOURCE_PLLI2S_VCO PLLI2S VCO clock selected as I2S3 clock entry
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1832 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1833 #define __HAL_RCC_I2S2_CONFIG(__I2S2CLKSOURCE__) \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1834 MODIFY_REG(RCC->CFGR2, RCC_CFGR2_I2S2SRC, (uint32_t)(__I2S2CLKSOURCE__))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1835
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1836 /** @brief Macro to get the I2S2 clock (I2S2CLK).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1837 * @retval The clock source can be one of the following values:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1838 * @arg @ref RCC_I2S2CLKSOURCE_SYSCLK system clock selected as I2S3 clock entry
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1839 * @arg @ref RCC_I2S2CLKSOURCE_PLLI2S_VCO PLLI2S VCO clock selected as I2S3 clock entry
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1840 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1841 #define __HAL_RCC_GET_I2S2_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR2, RCC_CFGR2_I2S2SRC)))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1842
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1843 /** @brief Macro to configure the I2S3 clock.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1844 * @param __I2S2CLKSOURCE__ specifies the I2S3 clock source.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1845 * This parameter can be one of the following values:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1846 * @arg @ref RCC_I2S3CLKSOURCE_SYSCLK system clock selected as I2S3 clock entry
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1847 * @arg @ref RCC_I2S3CLKSOURCE_PLLI2S_VCO PLLI2S VCO clock selected as I2S3 clock entry
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1848 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1849 #define __HAL_RCC_I2S3_CONFIG(__I2S2CLKSOURCE__) \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1850 MODIFY_REG(RCC->CFGR2, RCC_CFGR2_I2S3SRC, (uint32_t)(__I2S2CLKSOURCE__))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1851
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1852 /** @brief Macro to get the I2S3 clock (I2S3CLK).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1853 * @retval The clock source can be one of the following values:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1854 * @arg @ref RCC_I2S3CLKSOURCE_SYSCLK system clock selected as I2S3 clock entry
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1855 * @arg @ref RCC_I2S3CLKSOURCE_PLLI2S_VCO PLLI2S VCO clock selected as I2S3 clock entry
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1856 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1857 #define __HAL_RCC_GET_I2S3_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR2, RCC_CFGR2_I2S3SRC)))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1858
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1859 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1860 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1861 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1862
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1863 #endif /* STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1864 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1865 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1866 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1867
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1868 /* Exported functions --------------------------------------------------------*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1869 /** @addtogroup RCCEx_Exported_Functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1870 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1871 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1872
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1873 /** @addtogroup RCCEx_Exported_Functions_Group1
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1874 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1875 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1876
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1877 HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1878 void HAL_RCCEx_GetPeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1879 uint32_t HAL_RCCEx_GetPeriphCLKFreq(uint32_t PeriphClk);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1880
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1881 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1882 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1883 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1884
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1885 #if defined(STM32F105xC) || defined(STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1886 /** @addtogroup RCCEx_Exported_Functions_Group2
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1887 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1888 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1889 HAL_StatusTypeDef HAL_RCCEx_EnablePLLI2S(RCC_PLLI2SInitTypeDef *PLLI2SInit);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1890 HAL_StatusTypeDef HAL_RCCEx_DisablePLLI2S(void);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1891
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1892 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1893 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1894 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1895
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1896 /** @addtogroup RCCEx_Exported_Functions_Group3
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1897 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1898 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1899 HAL_StatusTypeDef HAL_RCCEx_EnablePLL2(RCC_PLL2InitTypeDef *PLL2Init);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1900 HAL_StatusTypeDef HAL_RCCEx_DisablePLL2(void);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1901
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1902 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1903 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1904 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1905 #endif /* STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1906
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1907 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1908 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1909 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1910
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1911 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1912 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1913 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1914
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1915 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1916 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1917 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1918
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1919 #ifdef __cplusplus
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1920 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1921 #endif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1922
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1923 #endif /* __STM32F1xx_HAL_RCC_EX_H */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1924
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1925 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1926