yuri91 / ili9341-rs

A WIP, no_std, generic driver for the ILI9341 (and ILI9340C) TFT LCD display
Apache License 2.0
58 stars 50 forks source link

Generic interface #7

Closed Disasm closed 4 years ago

Disasm commented 4 years ago

This PR adds a generic interface suitable for 8080 MCU buses like FSMC in STM32. Additionally, pixel writes are now u16-sized, because pixels can be up to 18-bit wide, so u16 is more natural here. Implementing 16-bit bus on top of old 8-bit raw interface adds additional complications.

Note that this is a breaking change. Please test this PR against an SPI-interfaced LCD, because I do not have one.

Tested on GD32VF103 development board from SeeedStudio. The display on this board uses 16-bit data bus for communication.

See also: https://github.com/yuri91/ili9341-rs/issues/2

tarcieri commented 4 years ago

We can attempt to test this with the Adafruit PyPortal re #2

yuri91 commented 4 years ago

Hi, thanks for this PR!

I just skimmed through it and I think the design is fine. I am glad that we can start supporting more interfaces!

I will test this PR with my SPI-interfaced device when I will have time in the next days and then (hopefully) merge it

Disasm commented 4 years ago

@tarcieri It would be great if you test this PR too!

tarcieri commented 4 years ago

@Disasm we can attempt to test it on the PyPortal

yuri91 commented 4 years ago

This PR does not implement the parallel interface though, right? It would need to be added as an implementation of the Interface Trait.

Disasm commented 4 years ago

Parallel interface is quite device-specific, but generic GPIO-based interface could live there. My parallel implementation relies on GD32V EXMC peripheral, but could be reduced down to two VolatileCell<u16> pointers.

tarcieri commented 4 years ago

@Disasm a generic GPIO interface sounds good! For reference, here's what we're working with on the PyPortal side:

https://docs.rs/pyportal/0.4.0/pyportal/pins/struct.Display.html

flaminggoat commented 4 years ago

I have tested this with the SPI interface on my stm32f429discovery board and I have not seen any issues.

yuri91 commented 4 years ago

Alright I tested it successfully too! Thanks again!