Open ost-ing opened 3 years ago
Sorry for the delay! @therealprof maintains the crate that WriteOnlyDataCommand
so might be able to offer more insight, but yes I think it's enough to add a custom impl of WriteOnlyDataCommand
and pass that into Builder::new().connect(interface).into()
instead of the provided blocking implementations.
There's an embedded-hal-async
now that provides async
/await
-compatible bus interfaces. See https://github.com/jamwaffles/ssd1331/pull/13 for a PR adding support to the ssd1311
crate and follow https://github.com/embedded-graphics/embedded-graphics/issues/622 for an upstream embedded-graphics
trait.
It looks like someone already has an async fork: https://github.com/simmsb/ssd1306
Nonblocking I2C support
Hello, I'm attempting to build an application that utilizes this library in conjunction with doing real-time DAC/ADC functions. I have noticed that my DAC output, which is executed from a Timer producing a simple sine-wave is blocked by the I2C communication that this library executes, which distorts the output of the DAC.
I know that the
embedded-hal
doesn't support non-blocking for various reasons. What I would like to do is write my own interface adapter and implement I2C interrupt handling within my app to unblock the communication to the display.Looking at the
test_helpers.rs
, I see this:I assume that I could use the
WriteOnlyDataCommand
trait to achieve this?Kind regards Oliver