2
2
******************************************************************************
3
3
* @file stm32f1xx.h
4
4
* @author MCD Application Team
5
- * @version V4.2.0
6
- * @date 31-March-2017
7
- * @brief CMSIS STM32F1xx Device Peripheral Access Layer Header File.
5
+ * @brief CMSIS STM32F1xx 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 STM32F1xx 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 stm32f1xx
53
35
* @{
54
36
*/
55
-
37
+
56
38
#ifndef __STM32F1XX_H
57
39
#define __STM32F1XX_H
58
40
59
41
#ifdef __cplusplus
60
42
extern "C" {
61
43
#endif /* __cplusplus */
62
-
44
+
63
45
/** @addtogroup Library_configuration_section
64
46
* @{
65
47
*/
71
53
#define STM32F1
72
54
#endif /* STM32F1 */
73
55
74
- /* Uncomment the line below according to the target STM32L device used in your
75
- application
56
+ /* Uncomment the line below according to the target STM32L device used in your
57
+ application
76
58
*/
77
59
78
60
#if !defined (STM32F100xB ) && !defined (STM32F100xE ) && !defined (STM32F101x6 ) && \
82
64
/* #define STM32F100xE */ /*!< STM32F100RC, STM32F100VC, STM32F100ZC, STM32F100RD, STM32F100VD, STM32F100ZD, STM32F100RE, STM32F100VE and STM32F100ZE */
83
65
/* #define STM32F101x6 */ /*!< STM32F101C4, STM32F101R4, STM32F101T4, STM32F101C6, STM32F101R6 and STM32F101T6 Devices */
84
66
/* #define STM32F101xB */ /*!< STM32F101C8, STM32F101R8, STM32F101T8, STM32F101V8, STM32F101CB, STM32F101RB, STM32F101TB and STM32F101VB */
85
- /* #define STM32F101xE */ /*!< STM32F101RC, STM32F101VC, STM32F101ZC, STM32F101RD, STM32F101VD, STM32F101ZD, STM32F101RE, STM32F101VE and STM32F101ZE */
67
+ /* #define STM32F101xE */ /*!< STM32F101RC, STM32F101VC, STM32F101ZC, STM32F101RD, STM32F101VD, STM32F101ZD, STM32F101RE, STM32F101VE and STM32F101ZE */
86
68
/* #define STM32F101xG */ /*!< STM32F101RF, STM32F101VF, STM32F101ZF, STM32F101RG, STM32F101VG and STM32F101ZG */
87
69
/* #define STM32F102x6 */ /*!< STM32F102C4, STM32F102R4, STM32F102C6 and STM32F102R6 */
88
70
/* #define STM32F102xB */ /*!< STM32F102C8, STM32F102R8, STM32F102CB and STM32F102RB */
91
73
/* #define STM32F103xE */ /*!< STM32F103RC, STM32F103VC, STM32F103ZC, STM32F103RD, STM32F103VD, STM32F103ZD, STM32F103RE, STM32F103VE and STM32F103ZE */
92
74
/* #define STM32F103xG */ /*!< STM32F103RF, STM32F103VF, STM32F103ZF, STM32F103RG, STM32F103VG and STM32F103ZG */
93
75
/* #define STM32F105xC */ /*!< STM32F105R8, STM32F105V8, STM32F105RB, STM32F105VB, STM32F105RC and STM32F105VC */
94
- /* #define STM32F107xC */ /*!< STM32F107RB, STM32F107VB, STM32F107RC and STM32F107VC */
76
+ /* #define STM32F107xC */ /*!< STM32F107RB, STM32F107VB, STM32F107RC and STM32F107VC */
95
77
#endif
96
78
97
79
/* Tip: To avoid modifying this file each time you need to switch between these
98
80
devices, you can define the device in your toolchain compiler preprocessor.
99
81
*/
100
-
82
+
101
83
#if !defined (USE_HAL_DRIVER )
102
84
/**
103
85
* @brief Comment the line below if you will not use the peripherals drivers.
104
- In this case, these drivers will not be included and the application code will
105
- be based on direct access to peripherals registers
86
+ In this case, these drivers will not be included and the application code will
87
+ be based on direct access to peripherals registers
106
88
*/
107
89
/*#define USE_HAL_DRIVER */
108
90
#endif /* USE_HAL_DRIVER */
109
91
110
92
/**
111
- * @brief CMSIS Device version number V4.2.0
93
+ * @brief CMSIS Device version number V4.3.1
112
94
*/
113
95
#define __STM32F1_CMSIS_VERSION_MAIN (0x04) /*!< [31:24] main version */
114
- #define __STM32F1_CMSIS_VERSION_SUB1 (0x02 ) /*!< [23:16] sub1 version */
115
- #define __STM32F1_CMSIS_VERSION_SUB2 (0x00 ) /*!< [15:8] sub2 version */
116
- #define __STM32F1_CMSIS_VERSION_RC (0x00) /*!< [7:0] release candidate */
96
+ #define __STM32F1_CMSIS_VERSION_SUB1 (0x03 ) /*!< [23:16] sub1 version */
97
+ #define __STM32F1_CMSIS_VERSION_SUB2 (0x01 ) /*!< [15:8] sub2 version */
98
+ #define __STM32F1_CMSIS_VERSION_RC (0x00) /*!< [7:0] release candidate */
117
99
#define __STM32F1_CMSIS_VERSION ((__STM32F1_CMSIS_VERSION_MAIN << 24)\
118
100
|(__STM32F1_CMSIS_VERSION_SUB1 << 16)\
119
101
|(__STM32F1_CMSIS_VERSION_SUB2 << 8 )\
165
147
166
148
/** @addtogroup Exported_types
167
149
* @{
168
- */
169
- typedef enum
150
+ */
151
+ typedef enum
170
152
{
171
- RESET = 0 ,
153
+ RESET = 0 ,
172
154
SET = !RESET
173
155
} FlagStatus , ITStatus ;
174
156
175
- typedef enum
157
+ typedef enum
176
158
{
177
- DISABLE = 0 ,
159
+ DISABLE = 0 ,
178
160
ENABLE = !DISABLE
179
161
} FunctionalState ;
180
162
#define IS_FUNCTIONAL_STATE (STATE ) (((STATE) == DISABLE) || ((STATE) == ENABLE))
181
163
182
- typedef enum
164
+ typedef enum
183
165
{
184
- ERROR = 0 ,
185
- SUCCESS = !ERROR
166
+ SUCCESS = 0U ,
167
+ ERROR = !SUCCESS
186
168
} ErrorStatus ;
187
169
188
170
/**
@@ -207,7 +189,7 @@ typedef enum
207
189
208
190
#define MODIFY_REG (REG , CLEARMASK , SETMASK ) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
209
191
210
- #define POSITION_VAL (VAL ) (__CLZ(__RBIT(VAL)))
192
+ #define POSITION_VAL (VAL ) (__CLZ(__RBIT(VAL)))
211
193
212
194
213
195
/**
@@ -231,7 +213,7 @@ typedef enum
231
213
/**
232
214
* @}
233
215
*/
234
-
216
+
235
217
236
218
237
219
0 commit comments