Skip to content

Commit f94ab8a

Browse files
committed
Revert "STM32F7 refactor common files"
This reverts commit 4f788ad.
1 parent d44be71 commit f94ab8a

File tree

12 files changed

+1204
-19
lines changed

12 files changed

+1204
-19
lines changed

targets/TARGET_STM/TARGET_STM32F7/device/stm32f7xx.h renamed to targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F746xG/device/stm32f7xx.h

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
* - Configuration section that allows to select:
1010
* - The STM32F7xx device used in the target application
1111
* - 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
12+
* code will be based on direct access to peripheral’s registers
13+
* rather than drivers API), this option is controlled by
1414
* "#define USE_HAL_DRIVER"
1515
*
1616
******************************************************************************
@@ -74,12 +74,10 @@
7474
*/
7575
#if !defined (STM32F756xx) && !defined (STM32F746xx) && !defined (STM32F745xx) && !defined (STM32F767xx) && \
7676
!defined (STM32F769xx) && !defined (STM32F777xx) && !defined (STM32F779xx) && !defined (STM32F722xx) && \
77-
!defined (STM32F723xx) && !defined (STM32F732xx) && !defined (STM32F733xx) && !defined (STM32F730xx) && \
78-
!defined (STM32F750xx)
79-
77+
!defined (STM32F723xx) && !defined (STM32F732xx) && !defined (STM32F733xx)
8078
/* #define STM32F756xx */ /*!< STM32F756VG, STM32F756ZG, STM32F756ZG, STM32F756IG, STM32F756BG,
8179
STM32F756NG Devices */
82-
/* #define STM32F746xx */ /*!< STM32F746VE, STM32F746VG, STM32F746ZE, STM32F746ZG, STM32F746IE, STM32F746IG,
80+
#define STM32F746xx /*!< STM32F746VE, STM32F746VG, STM32F746ZE, STM32F746ZG, STM32F746IE, STM32F746IG,
8381
STM32F746BE, STM32F746BG, STM32F746NE, STM32F746NG Devices */
8482
/* #define STM32F745xx */ /*!< STM32F745VE, STM32F745VG, STM32F745ZG, STM32F745ZE, STM32F745IE, STM32F745IG Devices */
8583
/* #define STM32F765xx */ /*!< STM32F765BI, STM32F765BG, STM32F765NI, STM32F765NG, STM32F765II, STM32F765IG,
@@ -95,8 +93,6 @@
9593
/* #define STM32F723xx */ /*!< STM32F723IE, STM32F723ZE, STM32F723VE, STM32F723IC, STM32F723ZC, STM32F723VC Devices */
9694
/* #define STM32F732xx */ /*!< STM32F732IE, STM32F732ZE, STM32F732VE, STM32F732RE Devices */
9795
/* #define STM32F733xx */ /*!< STM32F733IE, STM32F733ZE, STM32F733VE Devices */
98-
/* #define STM32F730xx */ /*!< STM32F730R, STM32F730V, STM32F730Z, STM32F730I Devices */
99-
/* #define STM32F750xx */ /*!< STM32F750V, STM32F750Z, STM32F750N Devices */
10096
#endif
10197

10298
/* Tip: To avoid modifying this file each time you need to switch between these
@@ -109,20 +105,20 @@
109105
In this case, these drivers will not be included and the application code will
110106
be based on direct access to peripherals registers
111107
*/
112-
/*#define USE_HAL_DRIVER */
108+
#define USE_HAL_DRIVER
113109
#endif /* USE_HAL_DRIVER */
114110

115111
/**
116-
* @brief CMSIS Device version number V1.2.4
112+
* @brief CMSIS Device version number V1.2.2
117113
*/
118114
#define __STM32F7_CMSIS_VERSION_MAIN (0x01) /*!< [31:24] main version */
119115
#define __STM32F7_CMSIS_VERSION_SUB1 (0x02) /*!< [23:16] sub1 version */
120-
#define __STM32F7_CMSIS_VERSION_SUB2 (0x04) /*!< [15:8] sub2 version */
116+
#define __STM32F7_CMSIS_VERSION_SUB2 (0x02) /*!< [15:8] sub2 version */
121117
#define __STM32F7_CMSIS_VERSION_RC (0x00) /*!< [7:0] release candidate */
122118
#define __STM32F7_CMSIS_VERSION ((__STM32F7_CMSIS_VERSION_MAIN << 24)\
123119
|(__STM32F7_CMSIS_VERSION_SUB1 << 16)\
124120
|(__STM32F7_CMSIS_VERSION_SUB2 << 8 )\
125-
|(__STM32F7_CMSIS_VERSION_RC))
121+
|(__STM32F7_CMSIS_VERSION))
126122
/**
127123
* @}
128124
*/
@@ -154,10 +150,6 @@
154150
#include "stm32f777xx.h"
155151
#elif defined(STM32F779xx)
156152
#include "stm32f779xx.h"
157-
#elif defined(STM32F730xx)
158-
#include "stm32f730xx.h"
159-
#elif defined(STM32F750xx)
160-
#include "stm32f750xx.h"
161153
#else
162154
#error "Please select first the target STM32F7xx device used in your application (in stm32f7xx.h file)"
163155
#endif
@@ -184,8 +176,8 @@ typedef enum
184176

185177
typedef enum
186178
{
187-
SUCCESS = 0U,
188-
ERROR = !SUCCESS
179+
ERROR = 0U,
180+
SUCCESS = !ERROR
189181
} ErrorStatus;
190182

191183
/**

targets/TARGET_STM/TARGET_STM32F7/device/system_stm32f7xx.h renamed to targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F746xG/device/system_stm32f7xx.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ extern const uint8_t APBPrescTable[8]; /*!< APB prescalers table values */
103103

104104
extern void SystemInit(void);
105105
extern void SystemCoreClockUpdate(void);
106+
extern void SetSysClock(void);
106107
/**
107108
* @}
108109
*/

targets/TARGET_STM/TARGET_STM32F7/us_ticker_data.h renamed to targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F746xG/device/us_ticker_data.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@
1717
#define __US_TICKER_DATA_H
1818

1919
#ifdef __cplusplus
20-
extern "C" {
20+
extern "C" {
2121
#endif
2222

23+
#include "stm32f7xx.h"
24+
#include "stm32f7xx_ll_tim.h"
25+
#include "cmsis_nvic.h"
26+
2327
#define TIM_MST TIM5
2428
#define TIM_MST_IRQ TIM5_IRQn
2529
#define TIM_MST_RCC __TIM5_CLK_ENABLE()
Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
/**
2+
******************************************************************************
3+
* @file stm32f7xx.h
4+
* @author MCD Application Team
5+
* @brief CMSIS STM32F7xx Device Peripheral Access Layer Header File.
6+
*
7+
* The file is the unique include file that the application programmer
8+
* is using in the C source code, usually in main.c. This file contains:
9+
* - Configuration section that allows to select:
10+
* - The STM32F7xx device used in the target application
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
14+
* "#define USE_HAL_DRIVER"
15+
*
16+
******************************************************************************
17+
* @attention
18+
*
19+
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
20+
*
21+
* Redistribution and use in source and binary forms, with or without modification,
22+
* are permitted provided that the following conditions are met:
23+
* 1. Redistributions of source code must retain the above copyright notice,
24+
* this list of conditions and the following disclaimer.
25+
* 2. Redistributions in binary form must reproduce the above copyright notice,
26+
* this list of conditions and the following disclaimer in the documentation
27+
* and/or other materials provided with the distribution.
28+
* 3. Neither the name of STMicroelectronics nor the names of its contributors
29+
* may be used to endorse or promote products derived from this software
30+
* without specific prior written permission.
31+
*
32+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
33+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
34+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
35+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
36+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
38+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
39+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
40+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
41+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42+
*
43+
******************************************************************************
44+
*/
45+
46+
/** @addtogroup CMSIS
47+
* @{
48+
*/
49+
50+
/** @addtogroup stm32f7xx
51+
* @{
52+
*/
53+
54+
#ifndef __STM32F7xx_H
55+
#define __STM32F7xx_H
56+
57+
#ifdef __cplusplus
58+
extern "C" {
59+
#endif /* __cplusplus */
60+
61+
/** @addtogroup Library_configuration_section
62+
* @{
63+
*/
64+
65+
/**
66+
* @brief STM32 Family
67+
*/
68+
#if !defined (STM32F7)
69+
#define STM32F7
70+
#endif /* STM32F7 */
71+
72+
/* Uncomment the line below according to the target STM32 device used in your
73+
application
74+
*/
75+
#if !defined (STM32F756xx) && !defined (STM32F746xx) && !defined (STM32F745xx) && !defined (STM32F767xx) && \
76+
!defined (STM32F769xx) && !defined (STM32F777xx) && !defined (STM32F779xx) && !defined (STM32F722xx) && \
77+
!defined (STM32F723xx) && !defined (STM32F732xx) && !defined (STM32F733xx)
78+
#define STM32F756xx /*!< STM32F756VG, STM32F756ZG, STM32F756ZG, STM32F756IG, STM32F756BG,
79+
STM32F756NG Devices */
80+
/* #define STM32F746xx */ /*!< STM32F746VE, STM32F746VG, STM32F746ZE, STM32F746ZG, STM32F746IE, STM32F746IG,
81+
STM32F746BE, STM32F746BG, STM32F746NE, STM32F746NG Devices */
82+
/* #define STM32F745xx */ /*!< STM32F745VE, STM32F745VG, STM32F745ZG, STM32F745ZE, STM32F745IE, STM32F745IG Devices */
83+
/* #define STM32F765xx */ /*!< STM32F765BI, STM32F765BG, STM32F765NI, STM32F765NG, STM32F765II, STM32F765IG,
84+
STM32F765ZI, STM32F765ZG, STM32F765VI, STM32F765VG Devices */
85+
/* #define STM32F767xx */ /*!< STM32F767BG, STM32F767BI, STM32F767IG, STM32F767II, STM32F767NG, STM32F767NI,
86+
STM32F767VG, STM32F767VI, STM32F767ZG, STM32F767ZI Devices */
87+
/* #define STM32F769xx */ /*!< STM32F769AG, STM32F769AI, STM32F769BG, STM32F769BI, STM32F769IG, STM32F769II,
88+
STM32F769NG, STM32F769NI, STM32F768AI Devices */
89+
/* #define STM32F777xx */ /*!< STM32F777VI, STM32F777ZI, STM32F777II, STM32F777BI, STM32F777NI Devices */
90+
/* #define STM32F779xx */ /*!< STM32F779II, STM32F779BI, STM32F779NI, STM32F779AI, STM32F778AI Devices */
91+
/* #define STM32F722xx */ /*!< STM32F722IE, STM32F722ZE, STM32F722VE, STM32F722RE, STM32F722IC, STM32F722ZC,
92+
STM32F722VC, STM32F722RC Devices */
93+
/* #define STM32F723xx */ /*!< STM32F723IE, STM32F723ZE, STM32F723VE, STM32F723IC, STM32F723ZC, STM32F723VC Devices */
94+
/* #define STM32F732xx */ /*!< STM32F732IE, STM32F732ZE, STM32F732VE, STM32F732RE Devices */
95+
/* #define STM32F733xx */ /*!< STM32F733IE, STM32F733ZE, STM32F733VE Devices */
96+
#endif
97+
98+
/* Tip: To avoid modifying this file each time you need to switch between these
99+
devices, you can define the device in your toolchain compiler preprocessor.
100+
*/
101+
102+
#if !defined (USE_HAL_DRIVER)
103+
/**
104+
* @brief Comment the line below if you will not use the peripherals drivers.
105+
In this case, these drivers will not be included and the application code will
106+
be based on direct access to peripherals registers
107+
*/
108+
#define USE_HAL_DRIVER
109+
#endif /* USE_HAL_DRIVER */
110+
111+
/**
112+
* @brief CMSIS Device version number V1.2.2
113+
*/
114+
#define __STM32F7_CMSIS_VERSION_MAIN (0x01) /*!< [31:24] main version */
115+
#define __STM32F7_CMSIS_VERSION_SUB1 (0x02) /*!< [23:16] sub1 version */
116+
#define __STM32F7_CMSIS_VERSION_SUB2 (0x02) /*!< [15:8] sub2 version */
117+
#define __STM32F7_CMSIS_VERSION_RC (0x00) /*!< [7:0] release candidate */
118+
#define __STM32F7_CMSIS_VERSION ((__STM32F7_CMSIS_VERSION_MAIN << 24)\
119+
|(__STM32F7_CMSIS_VERSION_SUB1 << 16)\
120+
|(__STM32F7_CMSIS_VERSION_SUB2 << 8 )\
121+
|(__STM32F7_CMSIS_VERSION))
122+
/**
123+
* @}
124+
*/
125+
126+
/** @addtogroup Device_Included
127+
* @{
128+
*/
129+
#if defined(STM32F722xx)
130+
#include "stm32f722xx.h"
131+
#elif defined(STM32F723xx)
132+
#include "stm32f723xx.h"
133+
#elif defined(STM32F732xx)
134+
#include "stm32f732xx.h"
135+
#elif defined(STM32F733xx)
136+
#include "stm32f733xx.h"
137+
#elif defined(STM32F756xx)
138+
#include "stm32f756xx.h"
139+
#elif defined(STM32F746xx)
140+
#include "stm32f746xx.h"
141+
#elif defined(STM32F745xx)
142+
#include "stm32f745xx.h"
143+
#elif defined(STM32F765xx)
144+
#include "stm32f765xx.h"
145+
#elif defined(STM32F767xx)
146+
#include "stm32f767xx.h"
147+
#elif defined(STM32F769xx)
148+
#include "stm32f769xx.h"
149+
#elif defined(STM32F777xx)
150+
#include "stm32f777xx.h"
151+
#elif defined(STM32F779xx)
152+
#include "stm32f779xx.h"
153+
#else
154+
#error "Please select first the target STM32F7xx device used in your application (in stm32f7xx.h file)"
155+
#endif
156+
157+
/**
158+
* @}
159+
*/
160+
161+
/** @addtogroup Exported_types
162+
* @{
163+
*/
164+
typedef enum
165+
{
166+
RESET = 0U,
167+
SET = !RESET
168+
} FlagStatus, ITStatus;
169+
170+
typedef enum
171+
{
172+
DISABLE = 0U,
173+
ENABLE = !DISABLE
174+
} FunctionalState;
175+
#define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
176+
177+
typedef enum
178+
{
179+
ERROR = 0U,
180+
SUCCESS = !ERROR
181+
} ErrorStatus;
182+
183+
/**
184+
* @}
185+
*/
186+
187+
/** @addtogroup Exported_macro
188+
* @{
189+
*/
190+
#define SET_BIT(REG, BIT) ((REG) |= (BIT))
191+
192+
#define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
193+
194+
#define READ_BIT(REG, BIT) ((REG) & (BIT))
195+
196+
#define CLEAR_REG(REG) ((REG) = (0x0))
197+
198+
#define WRITE_REG(REG, VAL) ((REG) = (VAL))
199+
200+
#define READ_REG(REG) ((REG))
201+
202+
#define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
203+
204+
#define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
205+
206+
/**
207+
* @}
208+
*/
209+
210+
#ifdef USE_HAL_DRIVER
211+
#include "stm32f7xx_hal.h"
212+
#endif /* USE_HAL_DRIVER */
213+
214+
#ifdef __cplusplus
215+
}
216+
#endif /* __cplusplus */
217+
218+
#endif /* __STM32F7xx_H */
219+
220+
/**
221+
* @}
222+
*/
223+
224+
/**
225+
* @}
226+
*/
227+
228+
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

0 commit comments

Comments
 (0)