This crate implements a hardware abstraction layer for the Holtek HT32F1YYY chip family.
It relies on the ht32f1yyy peripheral access crate to provide appropriate register definitions, and implements a partial set of the embedded-hal traits.
Much of the implementation was adapted from other HAL crates, like ht32f5xxxx-hal and those in the stm32-rs organisation.
Collaboration on this crate is highly welcome, as are pull requests!
The examples folder contains several example programs. To compile them, specify the target device in a cargo feature:
$ cargo build --features=ht32f1755,rt
The examples make use of defmt for logging with deferred formatting. To be able to flash the firmware and view the log messages, you will need to use a tool like probe-rs-cli or probe-run.
To use ht32f1yyy-hal as a dependency in a standalone project the
target device feature must be specified in the Cargo.toml
file:
[dependencies]
cortex-m = "0.7"
cortex-m-rt = "0.7"
ht32f1yyy-hal = {version = "0.1.0", features = ["ht32f1755","rt","critical-section-impl"]}
Copy over the memory.x file to your project and uncomment the correct entry for your device.
If you are unfamiliar with embedded development using Rust, there are a number of fantastic resources available to help.
- Embedded Rust Documentation
- The Embedded Rust Book
- Rust Embedded FAQ
- rust-embedded/awesome-embedded-rust
The Minimum Supported Rust Version (MSRV) at the moment is 1.69.0. Older versions may compile, especially when some features are not used in your application.
MIT License, see LICENSE or http://opensource.org/licenses/MIT for more details.