Skip to content

Commit

Permalink
Merge pull request #63 from RationalAsh/main
Browse files Browse the repository at this point in the history
Adding basic support for GD32F425
  • Loading branch information
qwandor authored Sep 10, 2024
2 parents e4c4b1f + 0a95a6b commit 2e47962
Show file tree
Hide file tree
Showing 9 changed files with 55,072 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- gd32f1
- gd32f2
- gd32f3
- gd32f4
env:
CRATES: ${{ matrix.crate }}
CARGO_INCREMENTAL: 0
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [unreleased]

- GD32F4xx
- Added support for GD32F425 in new `gd32f4` crate.

## [0.9.1]

- Re-enabled re-export of `cortex_m_rt::interrupt` macro.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ all: patch svd2rust

SHELL := /usr/bin/env bash

CRATES ?= gd32c1 gd32e1 gd32e2 gd32e5 gd32f1 gd32f2 gd32f3
CRATES ?= gd32c1 gd32e1 gd32e2 gd32e5 gd32f1 gd32f2 gd32f3 gd32f4

# All yaml files in devices/ will be used to patch an SVD
YAMLS := $(foreach crate, $(CRATES), \
Expand Down
27 changes: 27 additions & 0 deletions devices/common_patches/gd32f425.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2024 The gd32-rs authors.
#
# SPDX-License-Identifier: MIT OR Apache-2.0

RCU:
_modify:
CTL:
name: "CTL0"
ADDINT:
_modify:
IRC48MSTBIC:
access: write-only
VKEY:
_modify:
KEY:
access: write-only
USART0:
STAT1:
_modify:
EBF:
access: write-only
RTF:
access: write-only
TLI:
_modify:
CPPOS:
access: read-only
10 changes: 10 additions & 0 deletions devices/gd32f425.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2024 The gd32-rs authors.
#
# SPDX-License-Identifier: MIT OR Apache-2.0

_svd: ../svd/gd32f425.svd

_modify:
name: "GD32F425"
_include:
- common_patches/gd32f425.yaml
8 changes: 8 additions & 0 deletions gd32_part_table.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,11 @@ gd32f3:
rm_url: https://www.gigadevice.com/manual/gd32f307xxxx-user-manual/
members:
- GD32F307
gd32f4:
gd32f425:
url: https://www.gigadevice.com/product/mcu/high-performance-mcus/gd32f4xx-series/gd32f425
rm: GD32F425
rm_title: GD32F425
rm_url: https://www.gigadevice.com/datasheet/gd32f425xxxx-datasheet/
members:
- GD32F425
2 changes: 2 additions & 0 deletions scripts/makecrates.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"gd32f1": ["rt", "gd32f130", "gd32f190"],
"gd32f2": ["rt", "gd32f205", "gd32f207"],
"gd32f3": ["rt", "gd32f303", "gd32f307"],
"gd32f4": ["rt", "gd32f425"],
}

CRATE_DOC_TARGETS = {
Expand All @@ -37,6 +38,7 @@
"gd32f1": "thumbv7m-none-eabi",
"gd32f2": "thumbv7m-none-eabi",
"gd32f3": "thumbv7em-none-eabihf",
"gd32f4": "thumbv7em-none-eabihf",
}

CARGO_TOML_TPL = """\
Expand Down
2 changes: 2 additions & 0 deletions svd/extract.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ cp vendor/GD32F30x_XD.svd gd32f303.svd
cp vendor/GD32F30x_CL.svd gd32f305.svd
cp vendor/GD32F30x_CL.svd gd32f307.svd

cp vendor/GD32F4xx.svd gd32f425.svd

unzip -juLL vendor/gd32f207_svd.zip '**.svd'
cp gd32f20x_cl.svd gd32f205.svd
cp gd32f20x_cl.svd gd32f207.svd
Loading

0 comments on commit 2e47962

Please sign in to comment.