A rust driver for the notecard?

Hi,

has there been any attempt at writing an API for Rust that works with embedded-hal I2C? I am currently working on my own driver.

Regards, Gaute

2 Likes

Hi @gauteh thanks for posting, and welcome to the community, we’re glad you’re here! We’ve not tried our hands at a Rust API yet, but would love to see one! Please let us know how it goes, and share your progress here as I’m sure there are others in the community that would be interested in a Rust SDK.

Hi, here is the repository for the driver. Currently working on the I2C interface.

3 Likes

I am de-serializing the JSON from card.time, and as specified I get an error before the notecard has available data. I am wondering where the schema for errors and the incomplete structs are (e.g. what are optional fields?).

So far this driver does not use any allocations.

I’ve just published v0.1.0 of the rust driver to crates.io: https://crates.io/crates/blues-notecard, typed requests and responses, no dynamic allocations (everything known upfront and on the stack), generic (and reconfigurable) buffer sizes, a wait / async-ish type API (you can do stuff while waiting for the response.

Set up with defmt ( deferred formatting ), so you don’t compile a bunch of formatting code, just the data when debugging the program.

It also contains a raw, untyped API, so you can deal with dynamic JSON objects if you want.

– gaute

3 Likes

Hi,

I am working on a rust embedded notecard project. Big thanks to @gauteh for publishing a rust crate for the notecard. I hope at some point Blues will make it a first class citizen in the provided notecard libraries, or contribute to @gauteh notecard-rs crate to make it support all types of communication and the full API.

Cheers,
Piotr

2 Likes