Skip to content

Commit f576057

Browse files
committed
stmhal: Add CMSIS device header files for STM32F2xx series.
1 parent 0621eca commit f576057

File tree

6 files changed

+30562
-0
lines changed

6 files changed

+30562
-0
lines changed

stmhal/cmsis/devinc/stm32f205xx.h

Lines changed: 7185 additions & 0 deletions
Large diffs are not rendered by default.

stmhal/cmsis/devinc/stm32f207xx.h

Lines changed: 7790 additions & 0 deletions
Large diffs are not rendered by default.

stmhal/cmsis/devinc/stm32f215xx.h

Lines changed: 7331 additions & 0 deletions
Large diffs are not rendered by default.

stmhal/cmsis/devinc/stm32f217xx.h

Lines changed: 7937 additions & 0 deletions
Large diffs are not rendered by default.

stmhal/cmsis/devinc/stm32f2xx.h

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
/**
2+
******************************************************************************
3+
* @file stm32f2xx.h
4+
* @author MCD Application Team
5+
* @version V2.0.1
6+
* @date 25-March-2014
7+
* @brief CMSIS STM32F2xx 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 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
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 stm32f2xx
53+
* @{
54+
*/
55+
56+
#ifndef __STM32F2xx_H
57+
#define __STM32F2xx_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 (STM32F205xx) && !defined (STM32F215xx) && !defined (STM32F207xx) && !defined (STM32F217xx)
72+
73+
/* #define STM32F205xx */ /*!< STM32Fxx Devices */
74+
/* #define STM32F215xx */ /*!< STM32Fxx Devices */
75+
/* #define STM32F207xx */ /*!< STM32Fxx Devices */
76+
/* #define STM32F217xx */ /*!< STM32Fxx Devices */
77+
78+
#endif
79+
80+
/* Tip: To avoid modifying this file each time you need to switch between these
81+
devices, you can define the device in your toolchain compiler preprocessor.
82+
*/
83+
#if !defined (USE_HAL_DRIVER)
84+
/**
85+
* @brief Comment the line below if you will not use the peripherals drivers.
86+
In this case, these drivers will not be included and the application code will
87+
be based on direct access to peripherals registers
88+
*/
89+
/*#define USE_HAL_DRIVER */
90+
#endif /* USE_HAL_DRIVER */
91+
92+
/**
93+
* @brief CMSIS Device version number V2.0.1
94+
*/
95+
#define __STM32F2xx_CMSIS_DEVICE_VERSION_MAIN (0x02) /*!< [31:24] main version */
96+
#define __STM32F2xx_CMSIS_DEVICE_VERSION_SUB1 (0x00) /*!< [23:16] sub1 version */
97+
#define __STM32F2xx_CMSIS_DEVICE_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */
98+
#define __STM32F2xx_CMSIS_DEVICE_VERSION_RC (0x00) /*!< [7:0] release candidate */
99+
#define __STM32F2xx_CMSIS_DEVICE_VERSION ((__CMSIS_DEVICE_VERSION_MAIN << 24)\
100+
|(__CMSIS_DEVICE_HAL_VERSION_SUB1 << 16)\
101+
|(__CMSIS_DEVICE_HAL_VERSION_SUB2 << 8 )\
102+
|(__CMSIS_DEVICE_HAL_VERSION_RC))
103+
104+
/**
105+
* @}
106+
*/
107+
108+
/** @addtogroup Device_Included
109+
* @{
110+
*/
111+
112+
#if defined(STM32F205xx)
113+
#include "stm32f205xx.h"
114+
#elif defined(STM32F215xx)
115+
#include "stm32f215xx.h"
116+
#elif defined(STM32F207xx)
117+
#include "stm32f207xx.h"
118+
#elif defined(STM32F217xx)
119+
#include "stm32f217xx.h"
120+
#else
121+
#error "Please select first the target STM32F2xx device used in your application (in stm32f2xx.h file)"
122+
#endif
123+
124+
/**
125+
* @}
126+
*/
127+
128+
/** @addtogroup Exported_types
129+
* @{
130+
*/
131+
typedef enum
132+
{
133+
RESET = 0,
134+
SET = !RESET
135+
} FlagStatus, ITStatus;
136+
137+
typedef enum
138+
{
139+
DISABLE = 0,
140+
ENABLE = !DISABLE
141+
} FunctionalState;
142+
#define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
143+
144+
typedef enum
145+
{
146+
ERROR = 0,
147+
SUCCESS = !ERROR
148+
} ErrorStatus;
149+
150+
/**
151+
* @}
152+
*/
153+
154+
155+
/** @addtogroup Exported_macro
156+
* @{
157+
*/
158+
#define SET_BIT(REG, BIT) ((REG) |= (BIT))
159+
160+
#define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
161+
162+
#define READ_BIT(REG, BIT) ((REG) & (BIT))
163+
164+
#define CLEAR_REG(REG) ((REG) = (0x0))
165+
166+
#define WRITE_REG(REG, VAL) ((REG) = (VAL))
167+
168+
#define READ_REG(REG) ((REG))
169+
170+
#define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
171+
172+
#define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
173+
174+
175+
/**
176+
* @}
177+
*/
178+
179+
180+
#ifdef __cplusplus
181+
}
182+
#endif /* __cplusplus */
183+
184+
#endif /* __STM32F2xx_H */
185+
186+
/**
187+
* @}
188+
*/
189+
190+
/**
191+
* @}
192+
*/
193+
194+
195+
196+
197+
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
/**
2+
******************************************************************************
3+
* @file system_stm32f2xx.h
4+
* @author MCD Application Team
5+
* @version V2.0.1
6+
* @date 25-March-2014
7+
* @brief CMSIS Cortex-M3 Device System Source File for STM32F2xx devices.
8+
******************************************************************************
9+
* @attention
10+
*
11+
* <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
12+
*
13+
* Redistribution and use in source and binary forms, with or without modification,
14+
* are permitted provided that the following conditions are met:
15+
* 1. Redistributions of source code must retain the above copyright notice,
16+
* this list of conditions and the following disclaimer.
17+
* 2. Redistributions in binary form must reproduce the above copyright notice,
18+
* this list of conditions and the following disclaimer in the documentation
19+
* and/or other materials provided with the distribution.
20+
* 3. Neither the name of STMicroelectronics nor the names of its contributors
21+
* may be used to endorse or promote products derived from this software
22+
* without specific prior written permission.
23+
*
24+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34+
*
35+
******************************************************************************
36+
*/
37+
38+
/** @addtogroup CMSIS
39+
* @{
40+
*/
41+
42+
/** @addtogroup stm32f2xx_system
43+
* @{
44+
*/
45+
46+
/**
47+
* @brief Define to prevent recursive inclusion
48+
*/
49+
#ifndef __SYSTEM_STM32F2XX_H
50+
#define __SYSTEM_STM32F2XX_H
51+
52+
#ifdef __cplusplus
53+
extern "C" {
54+
#endif
55+
56+
/** @addtogroup STM32F2xx_System_Includes
57+
* @{
58+
*/
59+
60+
/**
61+
* @}
62+
*/
63+
64+
65+
/** @addtogroup STM32F2xx_System_Exported_types
66+
* @{
67+
*/
68+
/* This variable is updated in three ways:
69+
1) by calling CMSIS function SystemCoreClockUpdate()
70+
2) by calling HAL API function HAL_RCC_GetSysClockFreq()
71+
3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
72+
Note: If you use this function to configure the system clock; then there
73+
is no need to call the 2 first functions listed above, since SystemCoreClock
74+
variable is updated automatically.
75+
*/
76+
extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
77+
78+
79+
/**
80+
* @}
81+
*/
82+
83+
/** @addtogroup STM32F2xx_System_Exported_Constants
84+
* @{
85+
*/
86+
87+
/**
88+
* @}
89+
*/
90+
91+
/** @addtogroup STM32F2xx_System_Exported_Macros
92+
* @{
93+
*/
94+
95+
/**
96+
* @}
97+
*/
98+
99+
/** @addtogroup STM32F2xx_System_Exported_Functions
100+
* @{
101+
*/
102+
103+
extern void SystemInit(void);
104+
extern void SystemCoreClockUpdate(void);
105+
/**
106+
* @}
107+
*/
108+
109+
#ifdef __cplusplus
110+
}
111+
#endif
112+
113+
#endif /*__SYSTEM_STM32F2XX_H */
114+
115+
/**
116+
* @}
117+
*/
118+
119+
/**
120+
* @}
121+
*/
122+
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

0 commit comments

Comments
 (0)