adafruit / Adafruit_Blinka_Displayio

Displayio for Blinka
MIT License
14 stars 20 forks source link

Revamp Displayio and Add grayscale #114

Closed makermelissa closed 1 year ago

makermelissa commented 1 year ago

This change brings Displayio to being much closer in line with the current circuitpython builds, which makes it very accurate, but at this point it is not optimized for running in Python due to some removal of PIL. This adds dirty rectangle tracking as well. I have a bit more testing to do before optimization but it should support monochrome and grayscale OLEDs and allow me to close a number of outstanding issues.

Fixes #105 Fixes #95 Fixes #94 Fixes #54 Fixes #36 Fixes #32 Fixes #7 Fixes #6 Fixes #4

makermelissa commented 1 year ago

I just tested the SSD1327 and that's now working. IMG_5375

tannewt commented 1 year ago

Feel free to add me as reviewer when it is ready. Thanks for doing this!

makermelissa commented 1 year ago

I just tested the SSD1306. It's close, but still needs a little debugging done. IMG_5377

makermelissa commented 1 year ago

Closer... IMG_5378

makermelissa commented 1 year ago

If I had to guess, I'd say it's a row and column offset issue at this point.

makermelissa commented 1 year ago

SSD1325 tested good, which is useful since there's currently no Blinka drivers. IMG_5380

makermelissa commented 1 year ago

SH1107 isn't super close, but maybe if I can get that working, the SSD1306 will work... IMG_5382

makermelissa commented 1 year ago

Apparently it helps if you use the correct test script. IMG_5383

makermelissa commented 1 year ago

I'm going to fix the SSD1306 and I think the PR will be ready at that point. The other possibility is that it's throwing some garbage to the display prior to writing as the right side of the rectangle does wrap to the left side.

makermelissa commented 1 year ago

The numbers were looking correct, so I decided to compare byte for byte what was being sent to the display. Here's the place where it differs between blinka and cp: missing bytes

The bytes circled in red are not being sent, but the green ones are, which happens in the core's set_region_to_update() function, which is what I suspected. I think those are the command bytes that are missing.

makermelissa commented 1 year ago

Much better IMG_5385

makermelissa commented 1 year ago

@FoamyGuy I added you as a reviewer since this change will likely affect https://github.com/FoamyGuy/Blinka_Displayio_PyGameDisplay since some of the "protected" functions have been renamed to match the ones used in the core.

The plan is to release this as 1.0.0 after this PR is merged, so it will be a new major version anyways.

makermelissa commented 1 year ago

You're welcome. I think I found one more bug that needs fixing first.