|
2 | 2 | \file gd32f10x.h |
3 | 3 | \brief general definitions for GD32F10x |
4 | 4 |
|
5 | | - \version 2014-12-26, V1.0.0, firmware for GD32F10x |
6 | | - \version 2017-06-20, V2.0.0, firmware for GD32F10x |
7 | | - \version 2018-07-31, V2.1.0, firmware for GD32F10x |
8 | | - \version 2020-09-30, V2.2.0, firmware for GD32F10x |
| 5 | + \version 2026-02-12, V2.7.0, firmware for GD32F10x |
9 | 6 | */ |
10 | 7 |
|
11 | | -/* |
12 | | - Copyright (c) 2020, GigaDevice Semiconductor Inc. |
13 | | -
|
14 | | - Redistribution and use in source and binary forms, with or without modification, |
15 | | -are permitted provided that the following conditions are met: |
16 | | -
|
17 | | - 1. Redistributions of source code must retain the above copyright notice, this |
18 | | - list of conditions and the following disclaimer. |
19 | | - 2. Redistributions in binary form must reproduce the above copyright notice, |
20 | | - this list of conditions and the following disclaimer in the documentation |
21 | | - and/or other materials provided with the distribution. |
22 | | - 3. Neither the name of the copyright holder nor the names of its contributors |
23 | | - may be used to endorse or promote products derived from this software without |
24 | | - specific prior written permission. |
25 | | -
|
26 | | - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
27 | | -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
28 | | -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
29 | | -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, |
30 | | -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
31 | | -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
32 | | -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
33 | | -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
34 | | -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY |
35 | | -OF SUCH DAMAGE. |
36 | | -*/ |
| 8 | +/* Copyright (c) 2012 ARM LIMITED |
| 9 | + Copyright (c) 2026, GigaDevice Semiconductor Inc. |
| 10 | + |
| 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 | + ---------------------------------------------------------------------------*/ |
| 35 | + |
| 36 | +/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ |
37 | 37 |
|
38 | 38 | #ifndef GD32F10X_H |
39 | 39 | #define GD32F10X_H |
40 | 40 |
|
41 | | -/* AvV BEGIN */ |
42 | | -#pragma GCC diagnostic push |
43 | | -#pragma GCC diagnostic ignored "-Wunused-function" |
44 | | -#pragma GCC diagnostic ignored "-Wconversion" |
45 | | -#pragma GCC diagnostic ignored "-Wsign-conversion" |
46 | | -#pragma GCC diagnostic ignored "-Wduplicated-cond" |
47 | | -/* AvV END */ |
48 | | - |
49 | | -#ifdef __cplusplus |
| 41 | +#ifdef cplusplus |
50 | 42 | extern "C" { |
51 | 43 | #endif |
52 | 44 |
|
@@ -96,15 +88,15 @@ OF SUCH DAMAGE. |
96 | 88 | #define LXTAL_VALUE ((uint32_t)32768) |
97 | 89 | #endif /* low speed crystal oscillator value */ |
98 | 90 |
|
99 | | -/* GD32F10x firmware library version number V2.0 */ |
100 | | -#define __GD32F10x_STDPERIPH_VERSION_MAIN (0x01) /*!< [31:24] main version */ |
101 | | -#define __GD32F10x_STDPERIPH_VERSION_SUB1 (0x00) /*!< [23:16] sub1 version */ |
102 | | -#define __GD32F10x_STDPERIPH_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */ |
103 | | -#define __GD32F10x_STDPERIPH_VERSION_RC (0x00) /*!< [7:0] release candidate */ |
104 | | -#define __GD32F10x_STDPERIPH_VERSION ((__GD32F10x_STDPERIPH_VERSION_MAIN << 24)\ |
105 | | - |(__GD32F10x_STDPERIPH_VERSION_SUB1 << 16)\ |
106 | | - |(__GD32F10x_STDPERIPH_VERSION_SUB2 << 8)\ |
107 | | - |(__GD32F10x_STDPERIPH_VERSION_RC)) |
| 91 | +/* GD32F10x firmware library version number */ |
| 92 | +#define __GD32F10X_STDPERIPH_VERSION_MAIN (0x02) /*!< [31:24] main version */ |
| 93 | +#define __GD32F10X_STDPERIPH_VERSION_SUB1 (0x07) /*!< [23:16] sub1 version */ |
| 94 | +#define __GD32F10X_STDPERIPH_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */ |
| 95 | +#define __GD32F10X_STDPERIPH_VERSION_RC (0x00) /*!< [7:0] release candidate */ |
| 96 | +#define __GD32F10X_STDPERIPH_VERSION ((__GD32F10X_STDPERIPH_VERSION_MAIN << 24)\ |
| 97 | + |(__GD32F10X_STDPERIPH_VERSION_SUB1 << 16)\ |
| 98 | + |(__GD32F10X_STDPERIPH_VERSION_SUB2 << 8)\ |
| 99 | + |(__GD32F10X_STDPERIPH_VERSION_RC)) |
108 | 100 |
|
109 | 101 | /* configuration of the Cortex-M3 processor and core peripherals */ |
110 | 102 | #define __MPU_PRESENT 0 /*!< GD32F10x do not provide MPU */ |
@@ -319,7 +311,7 @@ typedef enum IRQn |
319 | 311 |
|
320 | 312 | /* enum definitions */ |
321 | 313 | typedef enum {DISABLE = 0, ENABLE = !DISABLE} EventStatus, ControlStatus; |
322 | | -//typedef enum {FALSE = 0, TRUE = !FALSE} bool; /* AvV BEGIN */ |
| 314 | +// typedef enum {FALSE = 0, TRUE = !FALSE} bool; AvV |
323 | 315 | typedef enum {RESET = 0, SET = !RESET} FlagStatus; |
324 | 316 | typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrStatus; |
325 | 317 |
|
@@ -382,7 +374,7 @@ typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrStatus; |
382 | 374 | #include "gd32f10x_libopt.h" |
383 | 375 | #endif /* USE_STDPERIPH_DRIVER */ |
384 | 376 |
|
385 | | -#ifdef __cplusplus |
| 377 | +#ifdef cplusplus |
386 | 378 | } |
387 | 379 | #endif |
388 | 380 | #endif |
0 commit comments