Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CH32L103 #3

Merged
merged 9 commits into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ch32-metapac-gen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"

[dependencies]
regex = "1.7.1"
chiptool = { git = "https://github.com/ch32-rs/chiptool", rev = "1c198ae678ebd426751513f0deab6fbd6f8b8211" }
chiptool = { git = "https://github.com/ch32-rs/chiptool", rev = "305bd6ee3e57009ae93be2c81d6e94b9896a03b1" }
serde = { version = "1.0.157", features = ["derive"] }
serde_json = "1.0.94"
proc-macro2 = "1.0.52"
Expand Down
7 changes: 5 additions & 2 deletions ch32-metapac-gen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl Gen {
.peripherals
.iter()
.find(|p| p.name == "GPIOA")
.unwrap()
.expect("GPIOA must exist")
.address as u32;
let gpio_stride = 0x400;

Expand Down Expand Up @@ -360,7 +360,10 @@ impl Gen {
.join("registers")
.join(&format!("{}_{}.json", module, version));

let mut ir: ir::IR = serde_json::from_reader(File::open(regs_path).unwrap()).unwrap();
let mut ir: ir::IR = serde_json::from_reader(
File::open(&regs_path).expect(&format!("open {}", regs_path.display())),
)
.unwrap();

transform::expand_extends::ExpandExtends {}
.run(&mut ir)
Expand Down
2 changes: 1 addition & 1 deletion d
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ case "$CMD" in
gen)
rm -rf build/data
echo "TODO: More chips to be added"
cargo run -p ch32-data-gen && cargo run -p ch32-metapac-gen -- "CH32X03*" "CH32V*" CH641 CH643
cargo run -p ch32-data-gen && cargo run -p ch32-metapac-gen -- "CH32X03*" "CH32V*" "CH32L*" CH641 CH643
;;
ci)
echo TODO $CMD
Expand Down
5 changes: 4 additions & 1 deletion data/chips/CH32L103C8T6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ device_id: 271648512
keywords:
- USBPD
- Low Power
- CAN FD
packages:
- name: CH32L103C8T6
package: LQFP48
Expand All @@ -25,13 +26,15 @@ memory:
docs:
- type: homepage
title: Homepage
name: ""
name: "CH32L103"
url: https://www.wch.cn/products/CH32L103.html
cores:
- name: qingke-v4c
peripherals: []
include_peripherals:
- "../family/CH32L1.yaml"
- "../peripherals/L1x_SPI2.yaml"
- "../peripherals/L1x_I2C2.yaml"
include_dma_channels:
DMA1: "../dma/CH32V_V4C_L1.yaml"
include_interrupts: "../interrupts/CH32L1.yaml"
Expand Down
5 changes: 4 additions & 1 deletion data/chips/CH32L103F7P6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ device_id: 272041728
keywords:
- USBPD
- Low Power
- CAN FD
packages:
- name: CH32L103F7P6
package: TSSOP20
Expand All @@ -25,13 +26,15 @@ memory:
docs:
- type: homepage
title: Homepage
name: ""
name: "CH32L103"
url: https://www.wch.cn/products/CH32L103.html
cores:
- name: qingke-v4c
peripherals: []
include_peripherals:
- "../family/CH32L1.yaml"
- "../peripherals/L1x_SPI2.yaml"
- "../peripherals/L1x_I2C2.yaml"
include_dma_channels:
DMA1: "../dma/CH32V_V4C_L1.yaml"
include_interrupts: "../interrupts/CH32L1.yaml"
Expand Down
3 changes: 2 additions & 1 deletion data/chips/CH32L103F8P6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ device_id: 272238336
keywords:
- USBPD
- Low Power
- CAN FD
packages:
- name: CH32L103F8P6
package: TSSOP20
Expand All @@ -25,7 +26,7 @@ memory:
docs:
- type: homepage
title: Homepage
name: ""
name: "CH32L103"
url: https://www.wch.cn/products/CH32L103.html
cores:
- name: qingke-v4c
Expand Down
5 changes: 4 additions & 1 deletion data/chips/CH32L103F8U6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ device_id: 272434944
keywords:
- USBPD
- Low Power
- CAN FD
packages:
- name: CH32L103F8U6
package: QFN20
Expand All @@ -25,13 +26,15 @@ memory:
docs:
- type: homepage
title: Homepage
name: ""
name: "CH32L103"
url: https://www.wch.cn/products/CH32L103.html
cores:
- name: qingke-v4c
peripherals: []
include_peripherals:
- "../family/CH32L1.yaml"
- "../peripherals/L1x_SPI2.yaml"
- "../peripherals/L1x_I2C2.yaml"
include_dma_channels:
DMA1: "../dma/CH32V_V4C_L1.yaml"
include_interrupts: "../interrupts/CH32L1.yaml"
Expand Down
2 changes: 2 additions & 0 deletions data/chips/CH32L103G8R6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ cores:
peripherals: []
include_peripherals:
- "../family/CH32L1.yaml"
- "../peripherals/L1x_SPI2.yaml"
- "../peripherals/L1x_I2C2.yaml"
include_dma_channels:
DMA1: "../dma/CH32V_V4C_L1.yaml"
include_interrupts: "../interrupts/CH32L1.yaml"
Expand Down
Loading
Loading