22 \file gd32f4xx.h
33 \brief general definitions for GD32F4xx
44
5- \version 2016-08-15, V1.0.0, firmware for GD32F4xx
6- \version 2018-12-12, V2.0.0, firmware for GD32F4xx
7- \version 2020-09-30, V2.1.0, firmware for GD32F4xx
5+ \version 2026-02-05, V3.3.3, firmware for GD32F4xx
86*/
97
10- /*
11- Copyright (c) 2020 , GigaDevice Semiconductor Inc.
8+ /* Copyright (c) 2012 ARM LIMITED
9+ Copyright (c) 2026 , GigaDevice Semiconductor Inc.
1210
13- Redistribution and use in source and binary forms, with or without modification,
14- are permitted provided that the following conditions are met:
11+ All rights reserved.
12+ Redistribution and use in source and binary forms, with or without
13+ modification, are permitted provided that the following conditions are met:
14+ - Redistributions of source code must retain the above copyright
15+ notice, this list of conditions and the following disclaimer.
16+ - Redistributions in binary form must reproduce the above copyright
17+ notice, this list of conditions and the following disclaimer in the
18+ documentation and/or other materials provided with the distribution.
19+ - Neither the name of ARM nor the names of its contributors may be used
20+ to endorse or promote products derived from this software without
21+ specific prior written permission.
22+ *
23+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26+ ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
27+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33+ POSSIBILITY OF SUCH DAMAGE.
34+ ---------------------------------------------------------------------------*/
1535
16- 1. Redistributions of source code must retain the above copyright notice, this
17- list of conditions and the following disclaimer.
18- 2. Redistributions in binary form must reproduce the above copyright notice,
19- this list of conditions and the following disclaimer in the documentation
20- and/or other materials provided with the distribution.
21- 3. Neither the name of the copyright holder nor the names of its contributors
22- may be used to endorse or promote products derived from this software without
23- specific prior written permission.
24-
25- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
27- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28- IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
29- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
30- NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
31- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
32- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
34- OF SUCH DAMAGE.
35- */
36+ /* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */
3637
3738#ifndef GD32F4XX_H
3839#define GD32F4XX_H
3940
40- /* AvV BEGIN */
41- #pragma GCC diagnostic push
42- #pragma GCC diagnostic ignored "-Wunused-function"
43- #pragma GCC diagnostic ignored "-Wunused-parameter"
44- #pragma GCC diagnostic ignored "-Wconversion"
45- #pragma GCC diagnostic ignored "-Wsign-conversion"
46- #pragma GCC diagnostic ignored "-Wduplicated-cond"
47- /* AvV END */
48-
4941#ifdef __cplusplus
5042 extern "C" {
5143#endif
5244
5345/* define GD32F4xx */
54- #if !defined (GD32F450 ) && !defined (GD32F405 ) && !defined (GD32F407 )
46+ #if !defined (GD32F450 ) && !defined (GD32F405 ) && !defined (GD32F407 ) && !defined ( GD32F470 ) && !defined ( GD32F425 ) && !defined ( GD32F427 )
5547 /* #define GD32F450 */
5648 /* #define GD32F405 */
5749 /* #define GD32F407 */
50+ /* #define GD32F470 */
51+ /* #define GD32F425 */
52+ /* #define GD32F427 */
5853#endif /* define GD32F4xx */
5954
60- #if !defined (GD32F450 ) && !defined (GD32F405 ) && !defined (GD32F407 )
55+ #if !defined (GD32F450 ) && !defined (GD32F405 ) && !defined (GD32F407 ) && !defined ( GD32F470 ) && !defined ( GD32F425 ) && !defined ( GD32F427 )
6156 #error "Please select the target GD32F4xx device in gd32f4xx.h file"
6257#endif /* undefine GD32F4xx tip */
6358
@@ -96,8 +91,8 @@ OF SUCH DAMAGE.
9691
9792/* GD32F4xx firmware library version number V1.0 */
9893#define __GD32F4xx_STDPERIPH_VERSION_MAIN (0x03) /*!< [31:24] main version */
99- #define __GD32F4xx_STDPERIPH_VERSION_SUB1 (0x00 ) /*!< [23:16] sub1 version */
100- #define __GD32F4xx_STDPERIPH_VERSION_SUB2 (0x00 ) /*!< [15:8] sub2 version */
94+ #define __GD32F4xx_STDPERIPH_VERSION_SUB1 (0x03 ) /*!< [23:16] sub1 version */
95+ #define __GD32F4xx_STDPERIPH_VERSION_SUB2 (0x03 ) /*!< [15:8] sub2 version */
10196#define __GD32F4xx_STDPERIPH_VERSION_RC (0x00) /*!< [7:0] release candidate */
10297#define __GD32F4xx_STDPERIPH_VERSION ((__GD32F4xx_STDPERIPH_VERSION_MAIN << 24)\
10398 |(__GD32F4xx_STDPERIPH_VERSION_SUB1 << 16)\
@@ -114,7 +109,8 @@ OF SUCH DAMAGE.
114109typedef enum IRQn
115110{
116111 /* cortex-M4 processor exceptions numbers */
117- NonMaskableInt_IRQn = -14 , /*!< 2 non maskable interrupt */
112+ NonMaskableInt_IRQn = -14 , /*!< non maskable interrupt */
113+ HardFault_IRQn = -13 , /*!< hard-fault interrupt */
118114 MemoryManagement_IRQn = -12 , /*!< 4 cortex-M4 memory management interrupt */
119115 BusFault_IRQn = -11 , /*!< 5 cortex-M4 bus fault interrupt */
120116 UsageFault_IRQn = -10 , /*!< 6 cortex-M4 usage fault interrupt */
@@ -172,7 +168,7 @@ typedef enum IRQn
172168 TIMER7_Channel_IRQn = 46 , /*!< TIMER7 channel capture compare interrupt */
173169 DMA0_Channel7_IRQn = 47 , /*!< DMA0 channel7 interrupt */
174170
175- #if defined (GD32F450 )
171+ #if defined (GD32F450 ) || defined ( GD32F470 )
176172 EXMC_IRQn = 48 , /*!< EXMC interrupt */
177173 SDIO_IRQn = 49 , /*!< SDIO interrupt */
178174 TIMER4_IRQn = 50 , /*!< TIMER4 interrupt */
@@ -214,9 +210,9 @@ typedef enum IRQn
214210 TLI_IRQn = 88 , /*!< TLI interrupt */
215211 TLI_ER_IRQn = 89 , /*!< TLI error interrupt */
216212 IPA_IRQn = 90 , /*!< IPA interrupt */
217- #endif /* GD32F450 */
213+ #endif /* GD32F450 and GD32F470 */
218214
219- #if defined (GD32F405 )
215+ #if defined (GD32F405 ) || defined ( GD32F425 )
220216 SDIO_IRQn = 49 , /*!< SDIO interrupt */
221217 TIMER4_IRQn = 50 , /*!< TIMER4 interrupt */
222218 SPI2_IRQn = 51 , /*!< SPI2 interrupt */
@@ -247,9 +243,9 @@ typedef enum IRQn
247243 DCI_IRQn = 78 , /*!< DCI interrupt */
248244 TRNG_IRQn = 80 , /*!< TRNG interrupt */
249245 FPU_IRQn = 81 , /*!< FPU interrupt */
250- #endif /* GD32F405 */
246+ #endif /* GD32F405 and GD32F425 */
251247
252- #if defined (GD32F407 )
248+ #if defined (GD32F407 ) || defined ( GD32F427 )
253249 EXMC_IRQn = 48 , /*!< EXMC interrupt */
254250 SDIO_IRQn = 49 , /*!< SDIO interrupt */
255251 TIMER4_IRQn = 50 , /*!< TIMER4 interrupt */
@@ -283,7 +279,7 @@ typedef enum IRQn
283279 DCI_IRQn = 78 , /*!< DCI interrupt */
284280 TRNG_IRQn = 80 , /*!< TRNG interrupt */
285281 FPU_IRQn = 81 , /*!< FPU interrupt */
286- #endif /* GD32F407 */
282+ #endif /* GD32F407 and GD32F427 */
287283
288284} IRQn_Type ;
289285
0 commit comments