Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lesamouraipourpre opened this issue Sep 19, 2021 · 6 comments
Open
Milestone

Comments

@lesamouraipourpre
Copy link
Contributor

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

  • Phase 1
    • Expose the same API as is exposed from core displayio in CircuitPython 7. Done, only partially tested
    • If the API in Blinka is not the same as the API in CircuitPython core, the API in the core takes precedence. Do not care about breaking changes in Blinka DisplayIO. Done
    • To translate vectorio as part of displayio. Done, only partially tested
    • To translate bitmaptools as part of displayio. Done, not tested
  • Phase 2 Testing. Testing. And lots more testing.
  • Phase 3 Decide how best to speed up the code, by further translating some of it to use numpy and maybe PIL/Pillow

Open issues on Blinka DisplayIO

Testing

ST7735R (Color SPI) - Working correctly

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

SH1107 (B&W I2C) - Working correctly

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

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
Copy link
Contributor Author

SH1107 - 128x128
SH1107

ST7735S - 160x80
ST7735

@makermelissa
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link

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
Copy link

@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
Copy link
Collaborator

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.

@makermelissa makermelissa modified the milestones: 1.2.0, 1.3.0 Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants