ch32-rs / ch32-hal

A Rust HAL implementation for the CH32V0, CH32V1, CH32V2, CH32V3, CH32X0, CH32L1 family, with Embassy framework support and compatible with embedded-hal.
Apache License 2.0
77 stars 21 forks source link
async drivers embedded hal rust

ch32-hal

Demo Code Github Actions

Rust HAL(Hardware Abstraction Layer) crate for WCH's 32-bit RISC-V microcontrollers.

Note This project is under development. While it's usable for experimentation and testing, it may not be fully stable for production environments. We welcome user feedback and encourage reporting any issues you encounter to help improve the hal crate.

This HAL crates is the Embassy framework driver for WCH's 32-bit RISC-V microcontrollers.

This HAL crates uses the metapac approach to support multiple chips in the same crate. The metapac is maintained in the ch32-rs/ch32-data repository, published as a crate ch32-metapac.

Keypoints:

Supported Devices and Peripherals

Currently, supported chips are listed in Cargo.toml as feature flags, others should work if you are careful as most peripherals are similar enough.

For a full list of chip capabilities and peripherals, check the ch32-data repository.

Family V2/V3 V1 V0 X0 L1 CH641 CH643
Embassy
RCC
GPIO
UART*
SPI* N/A
I2C
ADC
Timer(PWM)
USB/OTG FS ✅* N/A N/A N/A N/A N/A
USB HS ✅* N/A N/A N/A N/A N/A

Notes

TODOs

This section lists some key items that are not implemented yet. And should be noted when using this crate.

Coming New Chips - Help Wanted

Built with ch32-hal ✨

This is a list for awesome projects that are built using ch32-hal

Minimum supported Rust version(MSRV)

This project is developed with a recent nightly version of Rust compiler. And is expected to work with beta versions of Rust.

Feel free to change this if you did some testing with some version of Rust.

Contributing

All kinds of contributions are welcome.

License

This project is licensed under the MIT or Apache-2.0 license, at your option.