rust-embedded-community / ssd1331

SSD1331 colour OLED display driver for embedded Rust applications using embedded-hal
Apache License 2.0
17 stars 8 forks source link

Asyncify flush #13

Open jacobrosenthal opened 2 years ago

jacobrosenthal commented 2 years ago

Draft for discussion. Could support multiple traits, this could be the 'embassy' feature instead of async...

jamwaffles commented 2 years ago

this could be the 'embassy' feature instead of async

I think this is a good idea - Embassy might go away one day. Maybe call it async-embassy? That way we can have async-whatever for other executors if we need it.

jacobrosenthal commented 2 years ago

Fixed the trait, but pr is still a bit of a mess

But check it out does seem to work

richard-uk1 commented 2 years ago

It would be awesome if eventually there were a rutime-agnostic set of async traits. We're not ready yet (need more experimentation) but it would be cool if just the traits from embassy became managed by embedded-wg or similar so that if someone wants to use a different runtime they can.

jacobrosenthal commented 2 years ago

Id track here https://github.com/rust-embedded/embedded-hal/pull/285

and after that we need Prs to help the hals asyncify

jacobrosenthal commented 2 years ago

Well this is one way to do multiple target examples

quentinmit commented 2 years ago

I just looked into trying to use this, but it seems like sync operations are still used for non-flush operations?

Unfortunately I think that means that it can't be used with a proxy object from shared-bus, since it only provides async OR sync traits, but not both at the same time.

On the bright side, the async traits are now closer to standardized with the embedded-hal-async crate.