diondokter / device-driver

A toolkit to create better Rust device drivers, faster
https://diondokter.github.io/device-driver/
Apache License 2.0
96 stars 4 forks source link

Device driver toolkit #![no_std] crates.io Documentation

A toolkit to write better device drivers, faster.

This crate is a set of traits to represent devices, registers and commands. You can make use of macros to implement the registers and commands in a convenient way.

With quite some ease you can give users a blocking and an async interface to the device.

Currently you've got these options:

Feedback and feature requests are appreciated! Just open an issue on github. I want to add more features to this crate, but only once I (or maybe you) need them.

I realise the documentation is a bit lacking, but the examples should be pretty straightforward. For a real driver example using this crate you can also look at: https://github.com/diondokter/s2lp

Still wanted:

Note: Until https://github.com/illicitonion/num_enum/pull/77 gets merged, you'll need to import the num_enum in the crate where the device-driver macro is used. This needs to be added to the Cargo.toml. Trying to import the re-export from device-driver is not enough.

Architecture

This crate consists of three parts:

Semver

Anything that can reasonably break user code will warrant a breaking semver bump. This includes the macro format and file register definition formats.

The generation and macros crates are considered internal and so might not be as strict in their semver bumps. This is mostly to keep them somewhat in line with the version of the main crate.

If you depend on these crates directly, please let me know! If I know those have direct users, I will be stricter with the versions.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Changelog

Unreleased

0.7.0 (22-08-24)

0.6.0 (26-05-24)

0.5.3 (08-01-24)

0.5.2 (08-01-24)

0.5.1 (08-01-24)

0.5.0 (07-01-24)

0.4.1 (13-12-22)

0.3.1 (22-12-21)