Skip to content

Commit 64759b1

Browse files
committed
Modify structure; adapt embedded-hal 1.0.0-alpha.1
1 parent 74c0a3c commit 64759b1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+126
-936
lines changed

Cargo.toml

+31-14
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
1-
[workspace]
2-
members = [
3-
"gd32vf103-hal",
4-
"gd32vf103-hal-example",
5-
]
1+
[package]
2+
name = "gd32vf103-hal"
3+
version = "0.0.4"
4+
categories = ["embedded", "hardware-support", "no-std"]
5+
repository = "https://github.com/luojia65/gd32vf103-hal"
6+
description = "Hardware abstract layer (HAL) for RISC-V microcontroller GD32VF103"
7+
documentation = "https://docs.rs/gd32vf103-hal"
8+
authors = ["luojia65 <[email protected]>"]
9+
edition = "2018"
10+
license-file = "../LICENSE-MULAN"
11+
readme = "README.md"
12+
keywords = ["riscv", "gd32v", "hal", "embedded-hal"]
13+
build = "build.rs"
614

7-
[profile.dev]
8-
codegen-units = 1
15+
[package.metadata.docs.rs]
16+
default-target = "riscv32imac-unknown-none-elf"
917

10-
[profile.release]
11-
codegen-units = 1
12-
# Debug symbols are okay here in release; it won't be flashed into target memory
13-
debug = true
14-
lto = true
18+
[features]
19+
inline-asm = ["riscv/inline-asm"]
1520

16-
# [patch.crates-io]
17-
# riscv-rt = { path = "../riscv-rt" }
21+
[dependencies]
22+
gd32vf103-pac = "0.2"
23+
embedded-hal = "1.0.0-alpha.1"
24+
nb = "0.1"
25+
riscv = "0.5"
26+
27+
[dependencies.void]
28+
default-features = false
29+
version = "1.0"
30+
31+
[lib]
32+
name = "gd32vf103_hal"
33+
test = false
34+
bench = false

README.md

+20
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,23 @@ This project is licensed under either of
1919

2020
- MIT license ([LICENSE-MIT](LICENSE-MIT) or [http://opensource.org/licenses/MIT](http://opensource.org/licenses/MIT))
2121
- Mulan PSL v1 ([LICENSE-MULAN](LICENSE-MULAN) or [http://license.coscl.org.cn/MulanPSL](http://license.coscl.org.cn/MulanPSL))
22+
23+
## Helps on assembling
24+
25+
The assemble script requires you have `riscv32imac-unknown-elf-gcc` installed.
26+
27+
Configure and compile GNU toolchain using:
28+
29+
```shell
30+
../configure --prefix=/opt/riscv32 --with-arch=rv32imac --with-abi=ilp32
31+
```
32+
33+
```shell
34+
make && make install
35+
```
36+
37+
Run assemble script: (run on any path is okay)
38+
39+
```shell
40+
./assemble.sh
41+
```

gd32vf103-hal/asm.S asm.S

File renamed without changes.
File renamed without changes.
File renamed without changes.

bin/riscv32imac-unknown-none-elf.a

19.1 KB
Binary file not shown.

gd32vf103-hal/build.rs build.rs

File renamed without changes.

gd32vf103-hal-example/Cargo.toml

-28
This file was deleted.

gd32vf103-hal-example/build.rs

-22
This file was deleted.

gd32vf103-hal-example/examples/blinky-mtime.rs

-54
This file was deleted.

gd32vf103-hal-example/examples/blinky.rs

-69
This file was deleted.

gd32vf103-hal-example/examples/crc-check.rs

-28
This file was deleted.

gd32vf103-hal-example/examples/delay-blinky.rs

-28
This file was deleted.

gd32vf103-hal-example/examples/float.rs

-29
This file was deleted.

gd32vf103-hal-example/examples/mode-after-lock-constrained.rs

-28
This file was deleted.

0 commit comments

Comments
 (0)