Skip to content

Commit a9821c9

Browse files
committed
STM32MP1xx: Add first CMSIS Driver
1 parent 580aa3b commit a9821c9

File tree

14 files changed

+162308
-0
lines changed

14 files changed

+162308
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
/*
3+
* Auto generated Run-Time-Environment Component Configuration File
4+
* *** Do not modify ! ***
5+
*
6+
* Project: 'HAL_CORE'
7+
* Target: 'STM32MP1xx'
8+
*/
9+
10+
#ifndef RTE_COMPONENTS_H
11+
#define RTE_COMPONENTS_H
12+
13+
14+
/*
15+
* Define the Device Header File:
16+
*/
17+
#define CMSIS_device_header "stm32mp1xx_hal.h"
18+
19+
#endif /* RTE_COMPONENTS_H */

system/Drivers/CMSIS/Device/ST/STM32MP1xx/Include/stm32mp151axx_cm4.h

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

system/Drivers/CMSIS/Device/ST/STM32MP1xx/Include/stm32mp151cxx_cm4.h

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

system/Drivers/CMSIS/Device/ST/STM32MP1xx/Include/stm32mp153axx_cm4.h

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

system/Drivers/CMSIS/Device/ST/STM32MP1xx/Include/stm32mp153cxx_cm4.h

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

system/Drivers/CMSIS/Device/ST/STM32MP1xx/Include/stm32mp157axx_cm4.h

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

system/Drivers/CMSIS/Device/ST/STM32MP1xx/Include/stm32mp157cxx_cm4.h

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

0 commit comments

Comments
 (0)