Open kmatch98 opened 2 years ago
have you found any SPI displays that let you read pixel data? so far we've only seen this ability on the parallel interfaces
Yep I’ve got it working in Arduino by adding some found readPixel code to the Adafruit TFT library. I’ve demoed readPixel on your 2.8” capacitive touch breakout connected via SPI (this unit uses a ILI9341 driver chip) to the Metro M4 express.
(Note: I haven’t tested on ST7789 displays.)
Attached demo video is grabbing the pixels and redrawing pixels at an x,y offset.
I see that many of the Adafruit all-in-one display/micro controller boards don’t connect the MISO pin (Clue, PyGamer, PyBadge, MonsterMask, Hallowing, FunHouse). Perhaps a MISO pad could be added in future products to allow for full loop display hardware testing, and to catch display timing issues like https://github.com/adafruit/circuitpython/issues/4775
I think we may want to expand the lower level send
capability of FourWire and ParallelBus instead of providing something higher level. That will minimize the amount of code we need to add to the core but still give you the access you need.
There are some situations where you may want to read data from a display:
Note: With SPI displays, they will need to have the MISO (sometimes called SDO) pin connected to the microcontroller
desired functions
readPixel(x,y)
: returns an RGB value of the pixel at locationx,y
readRect(x1,y1,x2,y2,buffer)
: places into the buffer the RGB values of the pixels in the rectangular boundary specified byx1,y1
andx2,y2
CircuitPython additions required
To enable reading from displays in CircuitPython will require additions to the core. Here is my first look at what might be required:
displayio (also see questions below)
readPixel
andreadRect
- these are the high level commands that the user would normally use.Additions to display drivers
Add the specific display driver chip’s command constants that are sent to the display to trigger the
readPixel
orreadRect
operationerror handling
Questions
readPixel
andreadRect
commands fall into a separate module, unrelated to displayio?