2
2
******************************************************************************
3
3
* @file stm32f2xx.h
4
4
* @author MCD Application Team
5
- * @version V2.2.0
6
- * @date 17-March-2017
7
- * @brief CMSIS STM32F2xx Device Peripheral Access Layer Header File.
5
+ * @brief CMSIS STM32F2xx Device Peripheral Access Layer Header File.
8
6
*
9
7
* The file is the unique include file that the application programmer
10
8
* is using in the C source code, usually in main.c. This file contains:
11
9
* - Configuration section that allows to select:
12
10
* - The STM32F2xx device used in the target application
13
- * - To use or not the peripheral’s drivers in application code(i.e.
14
- * code will be based on direct access to peripheral’s registers
15
- * rather than drivers API), this option is controlled by
11
+ * - To use or not the peripheral’s drivers in application code(i.e.
12
+ * code will be based on direct access to peripheral’s registers
13
+ * rather than drivers API), this option is controlled by
16
14
* "#define USE_HAL_DRIVER"
17
- *
15
+ *
18
16
******************************************************************************
19
17
* @attention
20
18
*
21
- * <h2><center>© COPYRIGHT(c) 2017 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.
19
+ * <h2><center>© Copyright (c) 2017 STMicroelectronics.
20
+ * All rights reserved.</center></h2>
33
21
*
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.
22
+ * This software component is licensed by ST under BSD 3-Clause license,
23
+ * the "License"; You may not use this file except in compliance with the
24
+ * License. You may obtain a copy of the License at:
25
+ * opensource.org/licenses/BSD-3-Clause
44
26
*
45
27
******************************************************************************
46
28
*/
52
34
/** @addtogroup stm32f2xx
53
35
* @{
54
36
*/
55
-
37
+
56
38
#ifndef __STM32F2xx_H
57
39
#define __STM32F2xx_H
58
40
59
41
#ifdef __cplusplus
60
- extern "C" {
42
+ extern "C" {
61
43
#endif /* __cplusplus */
62
-
44
+
63
45
/** @addtogroup Library_configuration_section
64
46
* @{
65
47
*/
@@ -70,40 +52,40 @@ extern "C" {
70
52
#if !defined (STM32F2 )
71
53
#define STM32F2
72
54
#endif /* STM32F2 */
73
-
55
+
74
56
/* Uncomment the line below according to the target STM32 device used in your
75
- application
57
+ application
76
58
*/
77
59
#if !defined (STM32F205xx ) && !defined (STM32F215xx ) && !defined (STM32F207xx ) && !defined (STM32F217xx )
78
60
79
- /* #define STM32F205xx */ /*!< STM32F205RG, STM32F205VG, STM32F205ZG, STM32F205RF, STM32F205VF, STM32F205ZF,
80
- STM32F205RE, STM32F205VE, STM32F205ZE, STM32F205RC, STM32F205VC, STM32F205ZC,
81
- STM32F205RB and STM32F205VB Devices */
82
- /* #define STM32F215xx */ /*!< STM32F215RG, STM32F215VG, STM32F215ZG, STM32F215RE, STM32F215VE and STM32F215ZE Devices */
83
- #define STM32F207xx /*!< STM32F207VG, STM32F207ZG, STM32F207IG, STM32F207VF, STM32F207ZF, STM32F207IF,
61
+ /* #define STM32F205xx */ /*!< STM32F205RG, STM32F205VG, STM32F205ZG, STM32F205RF, STM32F205VF, STM32F205ZF,
62
+ STM32F205RE, STM32F205VE, STM32F205ZE, STM32F205RC, STM32F205VC, STM32F205ZC,
63
+ STM32F205RB and STM32F205VB Devices */
64
+ /* #define STM32F215xx */ /*!< STM32F215RG, STM32F215VG, STM32F215ZG, STM32F215RE, STM32F215VE and STM32F215ZE Devices */
65
+ /* #define STM32F207xx */ /*!< STM32F207VG, STM32F207ZG, STM32F207IG, STM32F207VF, STM32F207ZF, STM32F207IF,
84
66
STM32F207VE, STM32F207ZE, STM32F207IE, STM32F207VC, STM32F207ZC and STM32F207IC Devices */
85
- /* #define STM32F217xx */ /*!< STM32F217VG, STM32F217ZG, STM32F217IG, STM32F217VE, STM32F217ZE and STM32F217IE Devices */
86
-
67
+ /* #define STM32F217xx */ /*!< STM32F217VG, STM32F217ZG, STM32F217IG, STM32F217VE, STM32F217ZE and STM32F217IE Devices */
68
+
87
69
#endif
88
-
70
+
89
71
/* Tip: To avoid modifying this file each time you need to switch between these
90
72
devices, you can define the device in your toolchain compiler preprocessor.
91
73
*/
92
74
#if !defined (USE_HAL_DRIVER )
93
75
/**
94
76
* @brief Comment the line below if you will not use the peripherals drivers.
95
- In this case, these drivers will not be included and the application code will
96
- be based on direct access to peripherals registers
77
+ In this case, these drivers will not be included and the application code will
78
+ be based on direct access to peripherals registers
97
79
*/
98
- #define USE_HAL_DRIVER
80
+ /* #define USE_HAL_DRIVER */
99
81
#endif /* USE_HAL_DRIVER */
100
82
101
83
/**
102
- * @brief CMSIS Device version number V2.2.0
84
+ * @brief CMSIS Device version number V2.2.4
103
85
*/
104
86
#define __STM32F2xx_CMSIS_VERSION_MAIN (0x02U) /*!< [31:24] main version */
105
87
#define __STM32F2xx_CMSIS_VERSION_SUB1 (0x02U) /*!< [23:16] sub1 version */
106
- #define __STM32F2xx_CMSIS_VERSION_SUB2 (0x00U ) /*!< [15:8] sub2 version */
88
+ #define __STM32F2xx_CMSIS_VERSION_SUB2 (0x04U ) /*!< [15:8] sub2 version */
107
89
#define __STM32F2xx_CMSIS_VERSION_RC (0x00U) /*!< [7:0] release candidate */
108
90
#define __STM32F2xx_CMSIS_VERSION ((__STM32F2xx_CMSIS_VERSION_MAIN << 24)\
109
91
|(__STM32F2xx_CMSIS_VERSION_SUB1 << 16)\
@@ -119,15 +101,15 @@ extern "C" {
119
101
*/
120
102
121
103
#if defined(STM32F205xx )
122
- #include "stm32f205xx.h"
104
+ #include "stm32f205xx.h"
123
105
#elif defined(STM32F215xx )
124
- #include "stm32f215xx.h"
106
+ #include "stm32f215xx.h"
125
107
#elif defined(STM32F207xx )
126
- #include "stm32f207xx.h"
108
+ #include "stm32f207xx.h"
127
109
#elif defined(STM32F217xx )
128
- #include "stm32f217xx.h"
110
+ #include "stm32f217xx.h"
129
111
#else
130
- #error "Please select first the target STM32F2xx device used in your application (in stm32f2xx.h file)"
112
+ #error "Please select first the target STM32F2xx device used in your application (in stm32f2xx.h file)"
131
113
#endif
132
114
133
115
/**
@@ -136,21 +118,24 @@ extern "C" {
136
118
137
119
/** @addtogroup Exported_types
138
120
* @{
139
- */
140
- typedef enum {
141
- RESET = 0 ,
142
- SET = !RESET
121
+ */
122
+ typedef enum
123
+ {
124
+ RESET = 0U ,
125
+ SET = !RESET
143
126
} FlagStatus , ITStatus ;
144
127
145
- typedef enum {
146
- DISABLE = 0 ,
147
- ENABLE = !DISABLE
128
+ typedef enum
129
+ {
130
+ DISABLE = 0U ,
131
+ ENABLE = !DISABLE
148
132
} FunctionalState ;
149
133
#define IS_FUNCTIONAL_STATE (STATE ) (((STATE) == DISABLE) || ((STATE) == ENABLE))
150
134
151
- typedef enum {
152
- ERROR = 0 ,
153
- SUCCESS = !ERROR
135
+ typedef enum
136
+ {
137
+ SUCCESS = 0U ,
138
+ ERROR = !SUCCESS
154
139
} ErrorStatus ;
155
140
156
141
/**
@@ -175,15 +160,15 @@ typedef enum {
175
160
176
161
#define MODIFY_REG (REG , CLEARMASK , SETMASK ) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
177
162
178
- #define POSITION_VAL (VAL ) (__CLZ(__RBIT(VAL)))
163
+ #define POSITION_VAL (VAL ) (__CLZ(__RBIT(VAL)))
179
164
180
165
181
166
/**
182
167
* @}
183
168
*/
184
-
169
+
185
170
#if defined (USE_HAL_DRIVER )
186
- #include "stm32f2xx_hal.h"
171
+ #include "stm32f2xx_hal.h"
187
172
#endif /* USE_HAL_DRIVER */
188
173
189
174
#ifdef __cplusplus
@@ -199,7 +184,7 @@ typedef enum {
199
184
/**
200
185
* @}
201
186
*/
202
-
187
+
203
188
204
189
205
190
0 commit comments