adafruit / Adafruit_Blinka_Displayio

Displayio for Blinka
MIT License
14 stars 20 forks source link

[WIP] Rewrite of Blinka DisplayIO from CircuitPython core #71

Open lesamouraipourpre opened 2 years ago

lesamouraipourpre commented 2 years ago

Work in Progress :: Rewrite of Adafruit_Blinka_Displayio from CircuitPython core

Repository/Branch: https://github.com/lesamouraipourpre/Adafruit_Blinka_Displayio/tree/display-core

Inception

This work started with the intent of translating display_core.c from CircuitPython core to Blinka to be used as the superclass of Display and EPaperDisplay. Without realising it, it quickly escalated into doing a full re-translation of core displayio to Blinka.

Goals

Open issues on Blinka DisplayIO

Testing

ST7735R (Color SPI) - Working correctly

0.96" SPI Colour LCD (160x80) from Pimoroni. _(Driver ST7735S - using Adafruit_CircuitPythonST7735R library)

SH1107 (B&W I2C) - Working correctly

1.12" Mono OLED (128x128, white/black) Breakout – I2C from Pimoroni. _(Driver SH1107 - using Adafruit_CircuitPython_DisplayIOSH1107)

SSD1608 / SSD1680 (eInk SPI) - Not working, not sure why

Inky pHAT Black&White - (SSD1608) Inky pHAT Yellow/Black/White - (Documented as SSD1608 which is only a B&W eInk controller, I'm assuming it is a SSD1680)

WHAT NOW?

If you have any hardware running Blinka and an available display to test with, please test the branch below and report: https://github.com/lesamouraipourpre/Adafruit_Blinka_Displayio/tree/display-core

Please report any successes or failures as an issue on my repository NOT on adafruit/Adafruit_Blinka_Displayio https://github.com/lesamouraipourpre/Adafruit_Blinka_Displayio/issues Note: It is Pure Python, so it WILL BE SLOW. Conversion of parts to NumPy (or alternative) will follow if testing is successful.

I'll try to update the Wiki on my repo as progress is made: https://github.com/lesamouraipourpre/Adafruit_Blinka_Displayio/wiki

lesamouraipourpre commented 2 years ago

SH1107 - 128x128 SH1107

ST7735S - 160x80 ST7735

makermelissa commented 2 years ago

Thank you for taking this on. When I originally wrote this library, it was based on CircuitPython 5 while the eInk and monochrome display support was still being added to the core, which is why those hadn't been added in and then I was pulled off the project.

I'm not surprised the eInk support isn't quite working as that tends to be the trickiest to work with since a lot of times if it doesn't work, a lot of times they just don't do anything. One way I've debugged eInk displays is to get everything that is being output (possibly using a logic analyzer or oscilloscope). Then get do the same with some kn own working code and try to get that as close as possible. If everything is exactly the same, then take a look at timing and delays.

makermelissa commented 2 years ago

Hi, what are your plans in regards to the rewrite here? I'm going to work on some of the open issues here and didn't want to duplicate your work too much. Also, it currently uses NumPy an dPillow unless you were referring to your rewrite.

stonehippo commented 2 years ago

I tried out the current display-core with a SSD1306 and the MCP2221A breakout, and it's close. The rendering issues I was seeing with the current release (drawing more than once caused some the display to flash, and nothing was rendered correctly), but it looks like the default bitmap font still doesn't display correctly.

I also tried this on Raspberry Pi Zero W. Similar results.

I used this example code to test.

SSD1306 with MCP2221 IMG_5352

SSD1306 with Raspberry Pi Zero W IMG_5353

AlexKlimaj commented 2 years ago

@lesamouraipourpre I am interested in your rewrite, but I am unable to install it on my Pi. It appears that non of the I2C OLEDs are currently working on Raspberry Pi's with Blinka Circuitpython.

makermelissa commented 11 months ago

Your work covers a lot of what I've already been doing. I've made use of some of the code from your branch and credited you accordingly. I did take some different directions with regards to the design and much of it is up to date with the latest CircuitPython code. I also have eInks finally working in #115.

There's still more features that you have in your branch which are still missing in the code here such as vectorio, parallelbus and the supervisor (which I may add to Blinka itself), so I have not closed this issue because of that.