rust-embedded-community / sh1106

SH1106 driver for use with embedded_hal and (optionally) embedded_graphics
Apache License 2.0
34 stars 36 forks source link

Handling of reset pin to SH1106 #26

Open Phyllostachys opened 2 years ago

Phyllostachys commented 2 years ago

It doesn't appear that this driver handles operation of the reset pin on SH1106 devices, at least when compared to this Adafruit forked Arduino driver here. Unless I'm missing something (probably)?

jamwaffles commented 2 years ago

We do have a reset method on GraphicsMode, but we don't on RawMode. What mode are you using?

The examples also don't reset the display which may have added to your confusion. reset is findable in the docs, but only if you search for it.

Phyllostachys commented 2 years ago

Oooh, yeah, we were using GraphicsMode but I missed that the reset method takes a pin to be used for reset and I did it manually. I guess I can see why it isn't captured by the builder since it isn't done often. Alright, thanks!

Phyllostachys commented 2 years ago

Err, I guess in the examples I've seen, I haven't seen any calls to set that pin or calls to reset? I was using this for the Adafruit Macropad which has the pin pulled to ground, which might be where my difficulty was.

jamwaffles commented 2 years ago

No, the examples don't call it at all which is a bit of an oversight. I believe reset is only valid for SPI as well (although please let me know if you have an I2C display with a reset line), so I think I need to consider moving reset to a more protocol-agnostic part of the crate.

jamwaffles commented 2 years ago

... and add it to the examples for completeness' sake.