Skip to content

Commit d978849

Browse files
committed
system(H5): add STM32H5xx CMSIS Drivers to v1.0.0
Included in STM32CubeH5 FW v1.0.0 Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent bdd2c61 commit d978849

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+95482
-0
lines changed

system/Drivers/CMSIS/Device/ST/STM32H5xx/Include/Templates/partition_stm32h562xx.h

+649
Large diffs are not rendered by default.

system/Drivers/CMSIS/Device/ST/STM32H5xx/Include/Templates/partition_stm32h563xx.h

+654
Large diffs are not rendered by default.

system/Drivers/CMSIS/Device/ST/STM32H5xx/Include/Templates/partition_stm32h573xx.h

+680
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/**
2+
******************************************************************************
3+
* @file partition_stm32h5xx.h
4+
* @author MCD Application Team
5+
* @brief CMSIS STM32H5xx Device Header File for Initial Setup for Secure /
6+
* Non-Secure Zones for ARMCM33 based on CMSIS CORE partition_ARMCM33.h
7+
* Template.
8+
*
9+
* The file is included in system_stm32h5xx_s.c in secure application.
10+
* It includes the configuration section that allows to select the
11+
* STM32H5xx device partitioning file for system core secure attributes
12+
* and interrupt secure and non-secure assignment.
13+
*
14+
******************************************************************************
15+
* @attention
16+
*
17+
* Copyright (c) 2023 STMicroelectronics.
18+
* All rights reserved.
19+
*
20+
* This software is licensed under terms that can be found in the LICENSE file
21+
* in the root directory of this software component.
22+
* If no LICENSE file comes with this software, it is provided AS-IS.
23+
*
24+
******************************************************************************
25+
*/
26+
27+
/** @addtogroup CMSIS
28+
* @{
29+
*/
30+
31+
/** @addtogroup stm32h5xx
32+
* @{
33+
*/
34+
35+
#ifndef PARTITION_STM32H5XX_H
36+
#define PARTITION_STM32H5XX_H
37+
38+
#ifdef __cplusplus
39+
extern "C" {
40+
#endif /* __cplusplus */
41+
42+
/** @addtogroup Secure_configuration_section
43+
* @{
44+
*/
45+
46+
#if defined(STM32H573xx)
47+
#include "partition_stm32h573xx.h"
48+
#elif defined(STM32H563xx)
49+
#include "partition_stm32h563xx.h"
50+
#elif defined(STM32H562xx)
51+
#include "partition_stm32h562xx.h"
52+
#else
53+
#error "Please select first the target STM32H5xx device used in your application (in stm32h5xx.h file)"
54+
#endif
55+
56+
57+
#ifdef __cplusplus
58+
}
59+
#endif /* __cplusplus */
60+
61+
#endif /* PARTITION_STM32H5XX_H */
62+
/**
63+
* @}
64+
*/
65+
66+
/**
67+
* @}
68+
*/

system/Drivers/CMSIS/Device/ST/STM32H5xx/Include/stm32h503xx.h

+14,038
Large diffs are not rendered by default.

system/Drivers/CMSIS/Device/ST/STM32H5xx/Include/stm32h562xx.h

+21,478
Large diffs are not rendered by default.

system/Drivers/CMSIS/Device/ST/STM32H5xx/Include/stm32h563xx.h

+23,614
Large diffs are not rendered by default.

system/Drivers/CMSIS/Device/ST/STM32H5xx/Include/stm32h573xx.h

+24,539
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,238 @@
1+
/**
2+
******************************************************************************
3+
* @file stm32h5xx.h
4+
* @author MCD Application Team
5+
* @brief CMSIS STM32H5xx 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 STM32H5xx 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+
* Copyright (c) 2023 STMicroelectronics.
20+
* All rights reserved.
21+
*
22+
* This software is licensed under terms that can be found in the LICENSE file
23+
* in the root directory of this software component.
24+
* If no LICENSE file comes with this software, it is provided AS-IS.
25+
*
26+
******************************************************************************
27+
*/
28+
29+
/** @addtogroup CMSIS
30+
* @{
31+
*/
32+
33+
/** @addtogroup stm32h5xx
34+
* @{
35+
*/
36+
37+
#ifndef STM32H5xx_H
38+
#define STM32H5xx_H
39+
#include "math.h"
40+
41+
#ifdef __cplusplus
42+
extern "C" {
43+
#endif /* __cplusplus */
44+
45+
/** @addtogroup Library_configuration_section
46+
* @{
47+
*/
48+
49+
/**
50+
* @brief STM32 Family
51+
*/
52+
#if !defined (STM32H5)
53+
#define STM32H5
54+
#endif /* STM32H5 */
55+
56+
/* Uncomment the line below according to the target STM32H5 device used in your
57+
application
58+
*/
59+
60+
#if !defined (STM32H573xx) && !defined (STM32H563xx) \
61+
&& !defined (STM32H562xx) && !defined (STM32H503xx)
62+
/* #define STM32H573xx */ /*!< STM32H5753xx Devices */
63+
/* #define STM32H563xx */ /*!< STM32H563xx Devices */
64+
/* #define STM32H562xx */ /*!< STM32H562xx Devices */
65+
/* #define STM32H503xx */ /*!< STM32H503xx Devices */
66+
#endif
67+
68+
/* Tip: To avoid modifying this file each time you need to switch between these
69+
devices, you can define the device in your toolchain compiler preprocessor.
70+
*/
71+
#if !defined (USE_HAL_DRIVER)
72+
/**
73+
* @brief Comment the line below if you will not use the peripherals drivers.
74+
In this case, these drivers will not be included and the application code will
75+
be based on direct access to peripherals registers
76+
*/
77+
/*#define USE_HAL_DRIVER */
78+
#endif /* USE_HAL_DRIVER */
79+
80+
/**
81+
* @brief CMSIS Device version number 1.0.0
82+
*/
83+
#define __STM32H5_CMSIS_VERSION_MAIN (0x01) /*!< [31:24] main version */
84+
#define __STM32H5_CMSIS_VERSION_SUB1 (0x00) /*!< [23:16] sub1 version */
85+
#define __STM32H5_CMSIS_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */
86+
#define __STM32H5_CMSIS_VERSION_RC (0x00) /*!< [7:0] release candidate */
87+
#define __STM32H5_CMSIS_VERSION ((__STM32H5_CMSIS_VERSION_MAIN << 24U)\
88+
|(__STM32H5_CMSIS_VERSION_SUB1 << 16U)\
89+
|(__STM32H5_CMSIS_VERSION_SUB2 << 8U )\
90+
|(__STM32H5_CMSIS_VERSION_RC))
91+
92+
/**
93+
* @}
94+
*/
95+
96+
/** @addtogroup Device_Included
97+
* @{
98+
*/
99+
100+
#if defined(STM32H573xx)
101+
#include "stm32h573xx.h"
102+
#elif defined(STM32H563xx)
103+
#include "stm32h563xx.h"
104+
#elif defined(STM32H562xx)
105+
#include "stm32h562xx.h"
106+
#elif defined(STM32H503xx)
107+
#include "stm32h503xx.h"
108+
#else
109+
#error "Please select first the target STM32H5xx device used in your application (in stm32h5xx.h file)"
110+
#endif
111+
112+
113+
/**
114+
* @}
115+
*/
116+
117+
/** @addtogroup Exported_types
118+
* @{
119+
*/
120+
typedef enum
121+
{
122+
RESET = 0,
123+
SET = !RESET
124+
} FlagStatus, ITStatus;
125+
126+
typedef enum
127+
{
128+
DISABLE = 0,
129+
ENABLE = !DISABLE
130+
} FunctionalState;
131+
#define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
132+
133+
typedef enum
134+
{
135+
SUCCESS = 0,
136+
ERROR = !SUCCESS
137+
} ErrorStatus;
138+
139+
/**
140+
* @}
141+
*/
142+
143+
144+
/** @addtogroup Exported_macros
145+
* @{
146+
*/
147+
#define SET_BIT(REG, BIT) ((REG) |= (BIT))
148+
149+
#define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
150+
151+
#define READ_BIT(REG, BIT) ((REG) & (BIT))
152+
153+
#define CLEAR_REG(REG) ((REG) = (0x0))
154+
155+
#define WRITE_REG(REG, VAL) ((REG) = (VAL))
156+
157+
#define READ_REG(REG) ((REG))
158+
159+
#define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
160+
161+
/* Use of CMSIS compiler intrinsics for register exclusive access */
162+
/* Atomic 32-bit register access macro to set one or several bits */
163+
#define ATOMIC_SET_BIT(REG, BIT) \
164+
do { \
165+
uint32_t val; \
166+
do { \
167+
val = __LDREXW((__IO uint32_t *)&(REG)) | (BIT); \
168+
} while ((__STREXW(val,(__IO uint32_t *)&(REG))) != 0U); \
169+
} while(0)
170+
171+
/* Atomic 32-bit register access macro to clear one or several bits */
172+
#define ATOMIC_CLEAR_BIT(REG, BIT) \
173+
do { \
174+
uint32_t val; \
175+
do { \
176+
val = __LDREXW((__IO uint32_t *)&(REG)) & ~(BIT); \
177+
} while ((__STREXW(val,(__IO uint32_t *)&(REG))) != 0U); \
178+
} while(0)
179+
180+
/* Atomic 32-bit register access macro to clear and set one or several bits */
181+
#define ATOMIC_MODIFY_REG(REG, CLEARMSK, SETMASK) \
182+
do { \
183+
uint32_t val; \
184+
do { \
185+
val = (__LDREXW((__IO uint32_t *)&(REG)) & ~(CLEARMSK)) | (SETMASK); \
186+
} while ((__STREXW(val,(__IO uint32_t *)&(REG))) != 0U); \
187+
} while(0)
188+
189+
/* Atomic 16-bit register access macro to set one or several bits */
190+
#define ATOMIC_SETH_BIT(REG, BIT) \
191+
do { \
192+
uint16_t val; \
193+
do { \
194+
val = __LDREXH((__IO uint16_t *)&(REG)) | (BIT); \
195+
} while ((__STREXH(val,(__IO uint16_t *)&(REG))) != 0U); \
196+
} while(0)
197+
198+
/* Atomic 16-bit register access macro to clear one or several bits */
199+
#define ATOMIC_CLEARH_BIT(REG, BIT) \
200+
do { \
201+
uint16_t val; \
202+
do { \
203+
val = __LDREXH((__IO uint16_t *)&(REG)) & ~(BIT); \
204+
} while ((__STREXH(val,(__IO uint16_t *)&(REG))) != 0U); \
205+
} while(0)
206+
207+
/* Atomic 16-bit register access macro to clear and set one or several bits */
208+
#define ATOMIC_MODIFYH_REG(REG, CLEARMSK, SETMASK) \
209+
do { \
210+
uint16_t val; \
211+
do { \
212+
val = (__LDREXH((__IO uint16_t *)&(REG)) & ~(CLEARMSK)) | (SETMASK); \
213+
} while ((__STREXH(val,(__IO uint16_t *)&(REG))) != 0U); \
214+
} while(0)
215+
216+
#define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
217+
218+
219+
/**
220+
* @}
221+
*/
222+
223+
#if defined (USE_HAL_DRIVER)
224+
#include "stm32h5xx_hal.h"
225+
#endif /* USE_HAL_DRIVER */
226+
227+
#ifdef __cplusplus
228+
}
229+
#endif /* __cplusplus */
230+
231+
#endif /* STM32H5xx_H */
232+
/**
233+
* @}
234+
*/
235+
236+
/**
237+
* @}
238+
*/

0 commit comments

Comments
 (0)