RGB565 SSD1351 driver fixed and tested.

ili9341
Peter Hinch 2019-06-25 12:08:48 +01:00
rodzic 38e6a12050
commit 2277bea154
2 zmienionych plików z 16 dodań i 5 usunięć

Wyświetl plik

@ -1,12 +1,16 @@
# Drivers for SSD1351
There are two versions.
There are three versions.
* `ssd1351.py` This is optimised for STM (e.g. Pyboard) platforms.
* `ssd1351_generic.py` Cross-platform version.
* `ssd1351_16bit.py` Cross-platform. Uses 16 bit RGB565 color.
The cross-platform version includes the `micropythn.viper` decorator. If your
platform does not support this, comment it out and remove the type annotations.
You may be able to use the native decorator.
To conserve RAM the first two use 8 bit (rrrgggbb) color. This works well with
the GUI if saturated colors are used to render text and controls.
The `ssd1351_generic.py` version includes the `micropython.viper` decorator. If
your platform does not support this, comment it out and remove the type
annotations. You may be able to use the `micropython.native` decorator.
If the platform supports the viper emitter performance should still be good: on
a Pyboard V1 this driver perorms a refresh of a 128*128 color display in 47ms.
@ -16,5 +20,10 @@ of these figures is consumed by the data transfer over the SPI interface.
If the viper and native decorators are unsupported a screen redraw takes 272ms
(on Pyboard 1.0) which is visibly slow.
The `ssd1351_16bit` version on a 128x128 display requires 32KiB for the frame
buffer; this means it is only usable on platforms with plenty of RAM. Testing
was done on a Pyboard D SF2W. With the GUI this version offers little benefit,
but it delivers major advantages in applications such as rendering images.
This driver was tested on official Adafruit 1.5 and 1.27 inch displays, also a
Chinese 1.5 inch unit.

Wyświetl plik

@ -113,8 +113,10 @@ class SSD1351(framebuf.FrameBuffer):
self._write(mvb[start : start + bw], 1) # Send a line
else:
for l in range(128):
if l < 96:
if l < 64:
start = (63 -l) * self.width * 2 # 63 62 .. 1 0
elif l < 96:
start = 0
else:
start = (191 - l) * self.width * 2 # 127 126 .. 95
self._write(mvb[start : start + bw], 1) # Send a line