| Crates.io | wasi-embedded-hal |
| lib.rs | wasi-embedded-hal |
| version | 0.2.1 |
| created_at | 2024-03-16 22:10:50.972026+00 |
| updated_at | 2024-06-11 19:15:39.77087+00 |
| description | Implementation of the `embedded-hal` traits for Wasm components |
| homepage | |
| repository | https://github.com/Zelzahn/wasi-embedded-hal |
| max_upload_size | |
| id | 1176020 |
| size | 22,992 |
wasi-embedded-halImplementation of the
embedded-haltraits for Webassembly components
Currently only support for I2C and Delay is provided, but more is planned.
Note that only embedded-hal version 1.O is supported.
Simply use this crate and then add add_i2c_hal!(i2c) in your file. Where i2c is the module from bindings.rs generated by cargo-component.
The generated bindings and the embedded-hal API differ slightly, e.g. &[...] vs. Vec<...>. This crate defines methods that follow the embedded-hal API, and that underneath call those from the generated bindings. Effectively allowing one to very easily use crates that adhere to embedded-hal inside Wasm.
This crate is guaranteed to compile on stable Rust 1.76.0 and up. It might compile with older versions but that may change in any new patch release.