JohnDoneth / hd44780-driver

Implementation of the embedded-hal traits for the HD44780.
MIT License
37 stars 40 forks source link

reinit display #44

Open richo opened 1 year ago

richo commented 1 year ago

Hi,

Thanks for the library. I have a display that is pretty glitchy, and while I'm trying to figure that out, in the meantime I'd like to be able to reinitialize the display.

My two thoughts on how to do this are:

Either add a public interface to init_4bit (and the 8bit and i2c versions, although I'm not using them), or

Add a method to destroy the HD44780 returning it's pins to the caller so I can create a new one and implicitly reinitialize it.

Do you have strong feelings on either solution? Is there another way to do this that I'm missing? I'm happy to give you a patch I'd just prefer to give you something you're willing to upstream,

richo

ColinTimBarndt commented 2 weeks ago

You could try out #54 where I've added a destruct function to the driver and bus. You could use that to re-assemble it again which would cause re-initialization. I'm not sure how often this is going to be used, but I could add a function for that.