adafruit / Adafruit_Blinka_Displayio

Displayio for Blinka
MIT License
14 stars 20 forks source link

Much slower pitft touchscreen performance when using displayio #59

Closed Jayguitar closed 8 months ago

Jayguitar commented 3 years ago

Using stmpe610 resistive touchscreen chip with blinka is very fast until the point when the hx8357 screen is initialised using displayio.

I realise they both use SPI but touchscreen responsiveness is dramatically slower compared with using the pitft as a primary display for raspberry pi.

Comparison can be seen by removing hash on line 18 of the code below:

import busio
import board
import displayio
import digitalio
from adafruit_stmpe610 import Adafruit_STMPE610_SPI
import adafruit_hx8357

displayio.release_displays()
spi = board.SPI()
tft_cs = board.CE0
tft_dc = board.D25

spi = board.SPI()
cs = digitalio.DigitalInOut(board.CE1)
st = Adafruit_STMPE610_SPI(spi, cs)

display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs)
#display = adafruit_hx8357.HX8357(display_bus, width=480, height=320, backlight_pin=board.D18)

while True:
    if not st.buffer_empty:
        print(st.read_data())

Thanks

makermelissa commented 3 years ago

Yeah, probably because it's not super optimized. #6 would help a lot with this.

makermelissa commented 11 months ago

It should be better at this point. The main slowdown is it is written in Python rather than c, but it now has optimizations in place. I'm not closing until I give this a test though.

makermelissa commented 8 months ago

Closing since there really isn't much more to do on this.