adafruit / Adafruit_CircuitPython_ST7735

CircuitPython display driver for ST7735
MIT License
5 stars 9 forks source link

Subclass each display #1

Closed makermelissa closed 5 years ago

makermelissa commented 5 years ago

As discussed in https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing/issues/4 we should subclass various displays to use displayio that use 95% of the same init code so that it works in a similar manner to the Arduino. One of the main reasons for this is that in its current state, it doesn't work on the 160x80 display.

As a bonus, I would also like to bring in the ST7789 chip as a subclass since it is very similar.

makermelissa commented 5 years ago

Here is a list that I have of the displays to subclass:

Display Name Size Driver Family
Mini Color TFT 160x80 ST7735S
1.44" TFT Breakout 128x128 ST7735R
1.8" TFT Display 160x128 ST7735R
1.54" Wide Angle TFT 240x240 ST7789
tannewt commented 5 years ago

Why do we need subclasses for each? Is it worth having a separate display breakouts repo to handle display sizing? It would be kinda like the FeatherWing repo.

makermelissa commented 5 years ago

It was suggested by @ladyada in the link I have at the top. It would be to handle the displays listed above plus the ones like mentioned in this comment. # TODO(tannewt): Add support for Red tabs and non-R chips. https://github.com/adafruit/Adafruit-ST7735-Library/blob/master/Adafruit_ST7735.cpp If you have a preference for a different way to do it, I'm fine with that.

ladyada commented 5 years ago

we def need a subclass for each chip type (ST7735, ST7789...) but i dont think we need a full subclass of each display. that said, we do need to show the init values for each display because the inits do vary...

makermelissa commented 5 years ago

Thanks. That's actually the approach I was taking.

makermelissa commented 5 years ago

I'm making good progress on this. I got the Mini Color TFT finished and tested and plugged in the code for most of the other variants. Need to do some clean up code more, add the ST7789, test when more displays come, and add the black tabs variant.

makermelissa commented 5 years ago

Finished the ST7789 class, but I'm not sure if my ST7789 display is broken since it won't work on Arduino or CP. Just a black screen with a backlight. I tried new wires and a different controller board with the same results. I'll continue playing with it, but it may have to wait until more displays come back in stock.

makermelissa commented 5 years ago

I just noticed a small crack in my screen, so it must have gotten damaged in my move. :( Fortunately some more came back in stock, so now I can finish working on this.

makermelissa commented 5 years ago

Received the 1.44 Inch and 1.8 Inch displays today and now have those tested and working. Also verified that a couple non-Adafruit ST7735 displays that I have are working. I just need to test the ST7789 once that comes in and this should be done.

makermelissa commented 5 years ago

After thinking about it, I think the ST7789 should go in its own repo. Although it's a similar chipset, it really shares no code with the ST7735 and makes more sense to separate it. I'll have Kattni create a repo for that and I'll separate it out.

siddacious commented 5 years ago

I'm looking forward to this :) I have a bunch of the mini tfts that I've been eager to get displayio'd