Skip to content

Commit 21ca1ed

Browse files
committed
Add STM32G0xx CMSIS to v1.10
Included in STM32CubeG0 FW V1.10 Signed-off-by: Frederic.Pillon <[email protected]>
1 parent 99de29a commit 21ca1ed

17 files changed

+52254
-0
lines changed

system/Drivers/CMSIS/Device/ST/STM32G0xx/Include/stm32g030xx.h

+7,378
Large diffs are not rendered by default.

system/Drivers/CMSIS/Device/ST/STM32G0xx/Include/stm32g031xx.h

+7,919
Large diffs are not rendered by default.

system/Drivers/CMSIS/Device/ST/STM32G0xx/Include/stm32g041xx.h

+8,227
Large diffs are not rendered by default.

system/Drivers/CMSIS/Device/ST/STM32G0xx/Include/stm32g070xx.h

+7,639
Large diffs are not rendered by default.

system/Drivers/CMSIS/Device/ST/STM32G0xx/Include/stm32g071xx.h

+9,160
Large diffs are not rendered by default.

system/Drivers/CMSIS/Device/ST/STM32G0xx/Include/stm32g081xx.h

+9,468
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
/**
2+
******************************************************************************
3+
* @file stm32g0xx.h
4+
* @author MCD Application Team
5+
* @brief CMSIS STM32G0xx 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 STM32G0xx device used in the target application
11+
* - To use or not the peripherals drivers in application code(i.e.
12+
* code will be based on direct access to peripherals 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) 2018 STMicroelectronics.
20+
* All rights reserved.</center></h2>
21+
*
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
26+
*
27+
******************************************************************************
28+
*/
29+
30+
/** @addtogroup CMSIS
31+
* @{
32+
*/
33+
34+
/** @addtogroup stm32g0xx
35+
* @{
36+
*/
37+
38+
#ifndef STM32G0xx_H
39+
#define STM32G0xx_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 (STM32G0)
53+
#define STM32G0
54+
#endif /* STM32G0 */
55+
56+
/* Uncomment the line below according to the target STM32G0 device used in your
57+
application
58+
*/
59+
60+
#if !defined (STM32G071xx) && !defined (STM32G081xx) && !defined (STM32G070xx)
61+
/* #define STM32G070xx */ /*!< STM32G070xx Devices */
62+
/* #define STM32G071xx */ /*!< STM32G071xx Devices */
63+
/* #define STM32G081xx */ /*!< STM32G081xx Devices */
64+
#endif
65+
66+
/* Tip: To avoid modifying this file each time you need to switch between these
67+
devices, you can define the device in your toolchain compiler preprocessor.
68+
*/
69+
#if !defined (USE_HAL_DRIVER)
70+
/**
71+
* @brief Comment the line below if you will not use the peripherals drivers.
72+
In this case, these drivers will not be included and the application code will
73+
be based on direct access to peripherals registers
74+
*/
75+
/*#define USE_HAL_DRIVER */
76+
#endif /* USE_HAL_DRIVER */
77+
78+
/**
79+
* @brief CMSIS Device version number $VERSION$
80+
*/
81+
#define __STM32G0_CMSIS_VERSION_MAIN (0x01U) /*!< [31:24] main version */
82+
#define __STM32G0_CMSIS_VERSION_SUB1 (0x01U) /*!< [23:16] sub1 version */
83+
#define __STM32G0_CMSIS_VERSION_SUB2 (0x00U) /*!< [15:8] sub2 version */
84+
#define __STM32G0_CMSIS_VERSION_RC (0x00U) /*!< [7:0] release candidate */
85+
#define __STM32G0_CMSIS_VERSION ((__STM32G0_CMSIS_VERSION_MAIN << 24)\
86+
|(__STM32G0_CMSIS_VERSION_SUB1 << 16)\
87+
|(__STM32G0_CMSIS_VERSION_SUB2 << 8 )\
88+
|(__STM32G0_CMSIS_VERSION_RC))
89+
90+
/**
91+
* @}
92+
*/
93+
94+
/** @addtogroup Device_Included
95+
* @{
96+
*/
97+
98+
#if defined(STM32G071xx)
99+
#include "stm32g071xx.h"
100+
#elif defined(STM32G081xx)
101+
#include "stm32g081xx.h"
102+
#elif defined(STM32G070xx)
103+
#include "stm32g070xx.h"
104+
#else
105+
#error "Please select first the target STM32G0xx device used in your application (in stm32g0xx.h file)"
106+
#endif
107+
108+
/**
109+
* @}
110+
*/
111+
112+
/** @addtogroup Exported_types
113+
* @{
114+
*/
115+
typedef enum
116+
{
117+
RESET = 0,
118+
SET = !RESET
119+
} FlagStatus, ITStatus;
120+
121+
typedef enum
122+
{
123+
DISABLE = 0,
124+
ENABLE = !DISABLE
125+
} FunctionalState;
126+
#define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
127+
128+
typedef enum
129+
{
130+
SUCCESS = 0,
131+
ERROR = !SUCCESS
132+
} ErrorStatus;
133+
134+
/**
135+
* @}
136+
*/
137+
138+
139+
/** @addtogroup Exported_macros
140+
* @{
141+
*/
142+
#define SET_BIT(REG, BIT) ((REG) |= (BIT))
143+
144+
#define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
145+
146+
#define READ_BIT(REG, BIT) ((REG) & (BIT))
147+
148+
#define CLEAR_REG(REG) ((REG) = (0x0))
149+
150+
#define WRITE_REG(REG, VAL) ((REG) = (VAL))
151+
152+
#define READ_REG(REG) ((REG))
153+
154+
#define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
155+
156+
/*#define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))*/
157+
/**
158+
* @}
159+
*/
160+
161+
#if defined (USE_HAL_DRIVER)
162+
#include "stm32g0xx_hal.h"
163+
#endif /* USE_HAL_DRIVER */
164+
165+
#ifdef __cplusplus
166+
}
167+
#endif /* __cplusplus */
168+
169+
#endif /* STM32G0xx_H */
170+
/**
171+
* @}
172+
*/
173+
174+
/**
175+
* @}
176+
*/
177+
178+
179+
180+
181+
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
/**
2+
******************************************************************************
3+
* @file system_stm32g0xx.h
4+
* @author MCD Application Team
5+
* @brief CMSIS Cortex-M0+ Device System Source File for STM32G0xx devices.
6+
******************************************************************************
7+
* @attention
8+
*
9+
* <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
10+
* All rights reserved.</center></h2>
11+
*
12+
* This software component is licensed by ST under BSD 3-Clause license,
13+
* the "License"; You may not use this file except in compliance with the
14+
* License. You may obtain a copy of the License at:
15+
* opensource.org/licenses/BSD-3-Clause
16+
*
17+
******************************************************************************
18+
*/
19+
20+
/** @addtogroup CMSIS
21+
* @{
22+
*/
23+
24+
/** @addtogroup stm32g0xx_system
25+
* @{
26+
*/
27+
28+
/**
29+
* @brief Define to prevent recursive inclusion
30+
*/
31+
#ifndef SYSTEM_STM32G0XX_H
32+
#define SYSTEM_STM32G0XX_H
33+
34+
#ifdef __cplusplus
35+
extern "C" {
36+
#endif
37+
38+
/** @addtogroup STM32G0xx_System_Includes
39+
* @{
40+
*/
41+
42+
/**
43+
* @}
44+
*/
45+
46+
47+
/** @addtogroup STM32G0xx_System_Exported_types
48+
* @{
49+
*/
50+
/* This variable is updated in three ways:
51+
1) by calling CMSIS function SystemCoreClockUpdate()
52+
2) by calling HAL API function HAL_RCC_GetSysClockFreq()
53+
3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
54+
Note: If you use this function to configure the system clock; then there
55+
is no need to call the 2 first functions listed above, since SystemCoreClock
56+
variable is updated automatically.
57+
*/
58+
extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
59+
60+
extern const uint32_t AHBPrescTable[16]; /*!< AHB prescalers table values */
61+
extern const uint32_t APBPrescTable[8]; /*!< APB prescalers table values */
62+
63+
/**
64+
* @}
65+
*/
66+
67+
/** @addtogroup STM32G0xx_System_Exported_Constants
68+
* @{
69+
*/
70+
71+
/**
72+
* @}
73+
*/
74+
75+
/** @addtogroup STM32G0xx_System_Exported_Macros
76+
* @{
77+
*/
78+
79+
/**
80+
* @}
81+
*/
82+
83+
/** @addtogroup STM32G0xx_System_Exported_Functions
84+
* @{
85+
*/
86+
87+
extern void SystemInit(void);
88+
extern void SystemCoreClockUpdate(void);
89+
/**
90+
* @}
91+
*/
92+
93+
#ifdef __cplusplus
94+
}
95+
#endif
96+
97+
#endif /*SYSTEM_STM32G0XX_H */
98+
99+
/**
100+
* @}
101+
*/
102+
103+
/**
104+
* @}
105+
*/
106+
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

0 commit comments

Comments
 (0)