almindor / st7789

Rust library for displays using the ST7735 driver
https://docs.rs/st7735-lcd
MIT License
47 stars 24 forks source link

fix generic for bl vs rst pins #17

Closed pyaillet closed 2 years ago

pyaillet commented 2 years ago

Hi !

Thank you for making the st7789 Rust driver.

When using it with a TTGO Display in this project: https://github.com/pyaillet/ttgo-display-idf-rs

I faced a problem regarding generic parameters for the reset and backlight pins relying on the same generic parameter type. I might be wrong, but I think it's a mistake because these two Pins won't be the same and so should rely on different generic parameters type.

So here is a PR to fix this. I was able to test it in my previous quoted project.

almindor commented 2 years ago

Ahh you're right. I think I missed it because I hardwired my backlight :D

As a side note I've moved on to a generic mipidsi driver and this one will be deprecated in favour. The generic one doesn't really handle the BL pin at all, I'm now wondering how to best approach that.

pyaillet commented 2 years ago

Hi !

Thank you for the reply.

Oh, I will migrate my projects to use this new driver.

Regarding the BL pin, to be fair, I'm not sure of the benefits in binding it to the driver.

almindor commented 2 years ago

Yeah I tend to agree, I think the pin should be outside. I'll merge this tho since it was already included but won't push the pin into the generic crate.

Thanks!