]> git.gir.st - tmk_keyboard.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F3/TARGET_DISCO_F303VC/stm32f3xx.h
Merge commit '1fe4406f374291ab2e86e95a97341fd9c475fcb8'
[tmk_keyboard.git] / tmk_core / tool / mbed / mbed-sdk / libraries / mbed / targets / cmsis / TARGET_STM / TARGET_STM32F3 / TARGET_DISCO_F303VC / stm32f3xx.h
1 /**
2 ******************************************************************************
3 * @file stm32f3xx.h
4 * @author MCD Application Team
5 * @version V2.0.1
6 * @date 18-June-2014
7 * @brief CMSIS STM32F3xx Device Peripheral Access Layer Header File.
8 *
9 * The file is the unique include file that the application programmer
10 * is using in the C source code, usually in main.c. This file contains:
11 * - Configuration section that allows to select:
12 * - The STM32F3xx device used in the target application
13 * - To use or not the peripheral\92s drivers in application code(i.e.
14 * code will be based on direct access to peripheral\92s registers
15 * rather than drivers API), this option is controlled by
16 * "#define USE_HAL_DRIVER"
17 *
18 ******************************************************************************
19 * @attention
20 *
21 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
22 *
23 * Redistribution and use in source and binary forms, with or without modification,
24 * are permitted provided that the following conditions are met:
25 * 1. Redistributions of source code must retain the above copyright notice,
26 * this list of conditions and the following disclaimer.
27 * 2. Redistributions in binary form must reproduce the above copyright notice,
28 * this list of conditions and the following disclaimer in the documentation
29 * and/or other materials provided with the distribution.
30 * 3. Neither the name of STMicroelectronics nor the names of its contributors
31 * may be used to endorse or promote products derived from this software
32 * without specific prior written permission.
33 *
34 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
35 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
36 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
37 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
38 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
39 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
40 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
41 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
42 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
43 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44 *
45 ******************************************************************************
46 */
47
48 /** @addtogroup CMSIS
49 * @{
50 */
51
52 /** @addtogroup stm32f3xx
53 * @{
54 */
55
56 #ifndef __STM32F3xx_H
57 #define __STM32F3xx_H
58
59 #ifdef __cplusplus
60 extern "C" {
61 #endif /* __cplusplus */
62
63 /** @addtogroup Library_configuration_section
64 * @{
65 */
66
67 /* Uncomment the line below according to the target STM32 device used in your
68 application
69 */
70
71 #if !defined (STM32F301x8) && !defined (STM32F318xx) && \
72 !defined (STM32F302x8) && !defined (STM32F302xC) && \
73 !defined (STM32F303x8) && \
74 !defined (STM32F303xC) && !defined (STM32F358xx) && \
75 !defined (STM32F373xC) && !defined (STM32F378xx) && \
76 !defined (STM32F334x8) && !defined (STM32F328xx)
77 /* #define STM32F301x8 */ /*!< STM32F301K6, STM32F301K8, STM32F301C6, STM32F301C8,
78 STM32F301R6 and STM32F301R8 Devices */
79 /* #define STM32F302x8 */ /*!< STM32F302K6, STM32F302K8, STM32F302C6, STM32F302C8,
80 STM32F302R6 and STM32F302R8 Devices */
81 /* #define STM32F302xC */ /*!< STM32F302CB, STM32F302CC, STM32F302RB, STM32F302RC, STM32F302VB and STM32F302VC Devices */
82 /* #define STM32F303x8 */ /*!< STM32F303K6, STM32F303K8, STM32F303C6, STM32F303C8,
83 STM32F303R6 and STM32F303R8 Devices */
84 #define STM32F303xC /*!< STM32F303CB, STM32F303CC, STM32F303RB, STM32F303RC, STM32F303VB and STM32F303VC Devices */
85 /* #define STM32F373xC */ /*!< STM32F373C8, STM32F373CB, STM32F373CC, STM32F373R8, STM32F373RB, STM32F373RC,
86 STM32F373V8, STM32F373VB and STM32F373VC Devices */
87 /* #define STM32F334x8 */ /*!< STM32F334C4, STM32F334C6, STM32F334C8, STM32F334R4, STM32F334R6 and STM32F334R8 Devices */
88 /* #define STM32F318xx */ /*!< STM32F318K8, STM32F318C8: STM32F301x8 with regulator off: STM32F318xx Devices */
89 /* #define STM32F328xx */ /*!< STM32F328C8, STM32F328R8: STM32F334x8 with regulator off: STM32F328xx Devices */
90 /* #define STM32F358xx */ /*!< STM32F358CC, STM32F358RC, STM32F358VC: STM32F303xC with regulator off: STM32F358xx Devices */
91 /* #define STM32F378xx */ /*!< STM32F378CC, STM32F378RC, STM32F378VC: STM32F373xC with regulator off: STM32F378xx Devices */
92 #endif
93
94 /* Tip: To avoid modifying this file each time you need to switch between these
95 devices, you can define the device in your toolchain compiler preprocessor.
96 */
97 #if !defined (USE_HAL_DRIVER)
98 /**
99 * @brief Comment the line below if you will not use the peripherals drivers.
100 In this case, these drivers will not be included and the application code will
101 be based on direct access to peripherals registers
102 */
103 #define USE_HAL_DRIVER
104 #endif /* USE_HAL_DRIVER */
105
106 /**
107 * @brief CMSIS Device version number V2.0.1
108 */
109 #define __STM32F3xx_CMSIS_DEVICE_VERSION_MAIN (0x02) /*!< [31:24] main version */
110 #define __STM32F3xx_CMSIS_DEVICE_VERSION_SUB1 (0x00) /*!< [23:16] sub1 version */
111 #define __STM32F3xx_CMSIS_DEVICE_VERSION_SUB2 (0x01) /*!< [15:8] sub2 version */
112 #define __STM32F3xx_CMSIS_DEVICE_VERSION_RC (0x00) /*!< [7:0] release candidate */
113 #define __STM32F3xx_CMSIS_DEVICE_VERSION ((__CMSIS_DEVICE_VERSION_MAIN << 24)\
114 |(__CMSIS_DEVICE_HAL_VERSION_SUB1 << 16)\
115 |(__CMSIS_DEVICE_HAL_VERSION_SUB2 << 8 )\
116 |(__CMSIS_DEVICE_HAL_VERSION_RC))
117
118 /**
119 * @}
120 */
121
122 /** @addtogroup Device_Included
123 * @{
124 */
125
126 #if defined(STM32F301x8)
127 #include "stm32f301x8.h"
128 #elif defined(STM32F302x8)
129 #include "stm32f302x8.h"
130 #elif defined(STM32F302xC)
131 #include "stm32f302xc.h"
132 #elif defined(STM32F303x8)
133 #include "stm32f303x8.h"
134 #elif defined(STM32F303xC)
135 #include "stm32f303xc.h"
136 #elif defined(STM32F373xC)
137 #include "stm32f373xc.h"
138 #elif defined(STM32F334x8)
139 #include "stm32f334x8.h"
140 #elif defined(STM32F318xx)
141 #include "stm32f318xx.h"
142 #elif defined(STM32F328xx)
143 #include "stm32f328xx.h"
144 #elif defined(STM32F358xx)
145 #include "stm32f358xx.h"
146 #elif defined(STM32F378xx)
147 #include "stm32f378xx.h"
148 #else
149 #error "Please select first the target STM32F3xx device used in your application (in stm32f3xx.h file)"
150 #endif
151
152 /**
153 * @}
154 */
155
156 /** @addtogroup Exported_types
157 * @{
158 */
159 typedef enum
160 {
161 RESET = 0,
162 SET = !RESET
163 } FlagStatus, ITStatus;
164
165 typedef enum
166 {
167 DISABLE = 0,
168 ENABLE = !DISABLE
169 } FunctionalState;
170 #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
171
172 typedef enum
173 {
174 ERROR = 0,
175 SUCCESS = !ERROR
176 } ErrorStatus;
177
178 /**
179 * @}
180 */
181
182
183 /** @addtogroup Exported_macros
184 * @{
185 */
186 #define SET_BIT(REG, BIT) ((REG) |= (BIT))
187
188 #define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
189
190 #define READ_BIT(REG, BIT) ((REG) & (BIT))
191
192 #define CLEAR_REG(REG) ((REG) = (0x0))
193
194 #define WRITE_REG(REG, VAL) ((REG) = (VAL))
195
196 #define READ_REG(REG) ((REG))
197
198 #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
199
200 #define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
201
202
203 #if defined (USE_HAL_DRIVER)
204 #include "stm32f3xx_hal.h"
205 #endif /* USE_HAL_DRIVER */
206
207
208 /**
209 * @}
210 */
211
212
213 #ifdef __cplusplus
214 }
215 #endif /* __cplusplus */
216
217 #endif /* __STM32F3xx_H */
218 /**
219 * @}
220 */
221
222 /**
223 * @}
224 */
225
226
227
228
229 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Imprint / Impressum