lv_binding_micropython icon indicating copy to clipboard operation
lv_binding_micropython copied to clipboard

Generic/ili9341 Driver

Open BrianPugh opened this issue 1 year ago • 1 comments

Here's a working generic driver for the ILI9341 chip. I couldn't figure out how to get the rp2_dma stuff working in general, but if it works for the St77xx chips, I imagine it would also work for this one.

BrianPugh avatar Oct 10 '22 15:10 BrianPugh

Addressed some comments; will wait to write up examples until we determine if we want to change the interface.

BrianPugh avatar Oct 14 '22 01:10 BrianPugh

will wait to write up examples until we determine if we want to change the interface.

Examples can be very short and simple. Just a boilerplate for using the driver.
See the example I gave above for ESP32:

>>> import ili9xxx
>>> from machine import SPI, Pin
>>> spi = SPI(1, baudrate=20000000, sck=Pin(19, Pin.OUT), miso=Pin(5, Pin.OUT), mosi=Pin(18, Pin.OUT))
>>> drv = ili9xxx.Ili9341((240,320), dc=32, cs=33, rst=4, spi=spi)

You use it on rp2 right? Or on some other port? Is SPI initialized the same way there?

amirgon avatar Oct 16 '22 21:10 amirgon

For hardware driver minimum, it is something like this (same as what you suggested, @amirgon): https://github.com/lvgl/lv_binding_micropython/blob/a69f4b514e426a129fc3e891e0bf22a5f88845a9/driver/generic/st77xx-test.py#L44-L58

@BrianPugh nice work, BTW, and I am glad the st77xx was useful as inspiration :)

eudoxos avatar Oct 17 '22 06:10 eudoxos

@amirgon I believe I have addressed all the feedback, with the register command being the only item remaining.

BrianPugh avatar Oct 19 '22 04:10 BrianPugh

Merged. Thank you very much for this contribution!

amirgon avatar Oct 21 '22 19:10 amirgon