Improve documentation of supported displays.

pull/34/head
Peter Hinch 2022-05-10 11:40:04 +01:00
rodzic 6d97e1f8ca
commit 6376ad8618
3 zmienionych plików z 97 dodań i 84 usunięć

Wyświetl plik

@ -1,30 +1,45 @@
# Displays tested with nano-gui and micro-gui
Drivers used in nano-gui and micro-gui are dentical.
Drivers used in [nano-gui](https://github.com/peterhinch/micropython-nano-gui)
and [micro-gui](https://github.com/peterhinch/micropython-micro-gui) are
identical. These displays and drivers are also compatible with the
[Writer class](https://github.com/peterhinch/micropython-font-to-py/blob/master/writer/WRITER.md).
Note that the supported ePaper/eInk displays are unsuitable for interactive use
owing to their long update time.
## Displays using drivers in this repo
Size is diagonal in inches. C/M color/monochrome.
Width and height are pixels.
| Size | width | height | tech | driver | manufacturer | Notes |
|:-----:|:-----:|:------:|:----:|:-------------:|:--------------------------:|:-----:|
| 0.96C | 94 | 64 | OLED | [ssd1331][1d] | [Adafruit 684][1m] | |
| 1.27C | 128 | 96 | OLED | [ssd1351][2d] | [Adafruit 1673][2m] | |
| 1.5C | 128 | 128 | OLED | [ssd1351][2d] | [Adafruit 1431][3m] | |
| 1.44C | 128 | 128 | TFT | [ST7735R][4d] | [Adafruit 2088][5m] | |
| 1.5C | 160 | 128 | TFT | [ST7735R][4d] | [Adafruit 358][6m] | |
| 1.3C | 240 | 240 | TFT | [ST7789][5d] | [Adafruit 4313][7m] | |
| 1.54C | 240 | 240 | TFT | [ST7789][5d] | [Adafruit 3787][8m] | |
| 1.14C | 240 | 135 | TFT | [ST7789][5d] | [T-Display][9m] | ESP32, attached display |
| 2.8C | 320 | 240 | TFT | [ST7789][5d] | [Waveshare pico 2.8][10m] | Display for Pi Pico |
| 1.14C | 240 | 135 | TFT | [ST7789][5d] | [Waveshare pico 1.14][11m] | For Pi Pico w. joystick for micro-gui |
| 3.2C | 320 | 240 | TFT | [ILI9341][6d] | [Adafruit 1743][12m] | Big display, cheap ones on eBay |
| 2.9m | 296 | 128 | eInk | [UC8151D][7d] | [Adafruit 4262][13m] | Flexible ePaper display |
| 2.9m | 296 | 128 | eInk | [UC8151D][7d] | [Adafruit 4777][15m] | FeatherWing ePaper display |
| 2.7m | 274 | 176 | eInk | [HAT][8d] | [Waveshare HAT][14m] | HAT designed for Raspberry Pi, repurposed. |
| Size | Width | Height | Tech | Driver | Description | Notes |
|:-----:|:-----:|:------:|:------|:--------------|:---------------------------|:------|
| 0.96C | 94 | 64 | OLED | [SSD1331][1d] | [Adafruit 684][1m] | |
| 1.27C | 128 | 96 | OLED | [SSD1351][2d] | [Adafruit 1673][2m] | |
| 1.5C | 128 | 128 | OLED | [SSD1351][2d] | [Adafruit 1431][3m] | |
| 1.44C | 128 | 128 | TFT | [ST7735R][4d] | [Adafruit 2088][5m] | |
| 1.5C | 160 | 128 | TFT | [ST7735R][4d] | [Adafruit 358][6m] | |
| 1.3C | 240 | 240 | TFT | [ST7789][5d] | [Adafruit 4313][7m] | |
| 1.54C | 240 | 240 | TFT | [ST7789][5d] | [Adafruit 3787][8m] | |
| 1.14C | 240 | 135 | TFT | [ST7789][5d] | [T-Display][9m] | ESP32 with attached display |
| 2.8C | 320 | 240 | TFT | [ST7789][5d] | [Waveshare pico 2.8][10m] | Display for Pi Pico |
| 1.14C | 240 | 135 | TFT | [ST7789][5d] | [Waveshare pico 1.14][11m] | For Pi Pico. Buttons good for micro-gui |
| 3.2C | 320 | 240 | TFT | [ILI9341][6d] | [Adafruit 1743][12m] | Big display. eBay equivalents work here. |
| 2.9M | 296 | 128 | eInk | [UC8151D][7d] | [Adafruit 4262][13m] | Flexible ePaper display |
| 2.9M | 296 | 128 | eInk | [UC8151D][7d] | [Adafruit 4777][15m] | FeatherWing ePaper display |
| 2.7M | 274 | 176 | eInk | [HAT][8d] | [Waveshare HAT][14m] | HAT designed for Raspberry Pi, repurposed. |
| 2.7M | 400 | 240 | Sharp | [Sharp][9d] | [Adafruit 4694][16m] | Micropower monochrome display. |
| 1.3M | 168 | 144 | Sharp | [Sharp][9d] | [Adafruit 3502][17m] | Ditto |
Monochrome OLED displays based on the SSD1306 chip are also supported. Use the
## Displays using compatible drivers
Monochrome OLED displays based on the SSD1306 chip are supported via the
[official driver][3d]. Displays are available from various sources and can use
I2C or SPI interfaces. An example is [Adafruit 938][4m]
I2C or SPI interfaces. An example is [Adafruit 938][4m].
Nokia 5110 (PCD8544) displays. [This driver](https://github.com/mcauser/micropython-pcd8544.git)
is compatible.
# Untested displays
@ -39,9 +54,10 @@ to be adapted.
[3d]: https://github.com/micropython/micropython/blob/master/drivers/display/ssd1306.py
[4d]: https://github.com/peterhinch/micropython-nano-gui/blob/master/DRIVERS.md#31-drivers-for-st7735r
[5d]: https://github.com/peterhinch/micropython-nano-gui/blob/master/DRIVERS.md#33-drivers-for-st7789
[6d]: https://github.com/peterhinch/micropython-nano-gui/blob/master/DRIVERS.md#5-drivers-for-ili9341
[7d]: https://github.com/peterhinch/micropython-nano-gui/blob/master/DRIVERS.md#71-adafruit-flexible-eink-displayUC8151D
[6d]: https://github.com/peterhinch/micropython-nano-gui/blob/master/DRIVERS.md#32-drivers-for-ili9341
[7d]: https://github.com/peterhinch/micropython-nano-gui/blob/master/DRIVERS.md#51-adafruit-monochrome-eink-displays
[8d]: https://github.com/peterhinch/micropython-nano-gui/blob/master/DRIVERS.md#52-waveshare-eink-display-hat
[9d]: https://github.com/peterhinch/micropython-nano-gui/blob/master/DRIVERS.md#4-drivers-for-sharp-displays
[1m]: https://www.adafruit.com/product/684
[2m]: https://www.adafruit.com/product/1673
@ -58,3 +74,6 @@ to be adapted.
[13m]: https://www.adafruit.com/product/4262
[14m]: https://www.waveshare.com/wiki/2.7inch_e-Paper_HAT
[15m]: https://www.adafruit.com/product/4777
[16m]: https://www.adafruit.com/product/4694
[17m]: https://www.adafruit.com/product/3502

Wyświetl plik

@ -35,7 +35,8 @@ access via the `Writer` and `CWriter` classes is documented
3.2 [Drivers for ILI9341](./DRIVERS.md#32-drivers-for-ili9341) Large TFTs
3.3 [Drivers for ST7789](./DRIVERS.md#33-drivers-for-st7789) Small high density TFTs
     3.3.1 [TTGO T Display](./DRIVERS.md#331-ttgo-t-display) Low cost ESP32 with integrated display
     3.3.2 [Troubleshooting](./DRIVERS.md#332-troubleshooting)
     3.3.2 [Waveshare Pico Res Touch](./DRIVERS.md#332-waveshare-pico-res-touch)
     3.3.3 [Troubleshooting](./DRIVERS.md#333-troubleshooting)
4. [Drivers for sharp displays](./DRIVERS.md#4-drivers-for-sharp-displays) Large low power monochrome displays
4.1 [Display characteristics](./DRIVERS.md#41-display-characteristics)
     4.1.1 [The VCOM bit](./DRIVERS.md#411-the-vcom-bit)
@ -518,7 +519,48 @@ URL's. More in `st7789_ttgo.py`
[Another MicroPython driver](https://github.com/jikegong/TTGO-Esp32-ST7789-Display-MicroPython/blob/2ed1816c41f25c8993038c35ef40b2efeb225dcc/st7789.py)
[Factory test (C)](https://github.com/Xinyuan-LilyGO/TTGO-T-Display/blob/master/TFT_eSPI/examples/FactoryTest/FactoryTest.ino)
### 3.3.2 Troubleshooting
### 3.3.2 Waveshare Pico Res Touch
This is a "plug and play" 2.8" color TFT for nano-gui and the Pi Pico. Users of
micro-gui will need to find a way to connect pushbuttons, either using stacking
headers on the Pico or soldering wires to its pads. The `color_setup.py` file
is as follows. Note the commented-out options and the Lewis Caroll nature of
the landscape/portrait constructor args. See `setup_examples/ws_pico_res_touch.py`.
```python
import gc
from machine import Pin, SPI
from drivers.st7789.st7789_4bit import *
SSD = ST7789
pdc = Pin(8, Pin.OUT, value=0)
pcs = Pin(9, Pin.OUT, value=1)
prst = Pin(15, Pin.OUT, value=1)
pbl = Pin(13, Pin.OUT, value=1)
gc.collect() # Precaution before instantiating framebuf
spi = SPI(1, 33_000_000, sck=Pin(10), mosi=Pin(11), miso=Pin(12))
# Define the display
# For portrait mode:
# ssd = SSD(spi, height=320, width=240, dc=pdc, cs=pcs, rst=prst)
# For landscape mode:
ssd = SSD(spi, height=240, width=320, disp_mode=PORTRAIT, dc=pdc, cs=pcs, rst=prst)
# Optional use of SD card.
from sdcard import SDCard
import os
sd = SDCard(spi, Pin(22, Pin.OUT), 33_000_000)
vfs = os.VfsFat(sd)
os.mount(vfs, "/fc")
```
The ST7789 is specified for baudrates upto 62.5MHz, however the maximum the
Pico can produce is 31.25MHz. The display uses a nonstandard pin for MISO. This
was proven to work by testing the SD card. This requires the official SD card
driver which may be found in the MicroPython source tree in
`drivers/sdcard/sdcard.py`. I am not an expert on SD cards. Mine worked fine at
31.25MHz but this may or may not be universally true.
### 3.3.3 Troubleshooting
If your display shows garbage, check the following (I have seen both):
* SPI baudrate too high for your physical layout.

Wyświetl plik

@ -82,21 +82,19 @@ wiring details, pin names and hardware issues.
This library provides a limited set of GUI objects (widgets) for displays whose
display driver is subclassed from the `FrameBuffer` class. Such drivers can be
tiny as the graphics primitives are supplied by the `FrameBuffer` class. A
range of device drivers is provided: [the device driver doc](./DRIVERS.md)
provides guidance on selecting the right driver for your display, platform and
application.
tiny as the graphics primitives are supplied by the `FrameBuffer` class.
Compatible and tested displays are detailed [here](./DISPLAYS.md). The
[device driver doc](./DRIVERS.md) provides guidance on selecting the right
driver for your display, platform and application.
The GUI is cross-platform. The device driver doc explains how to configure it
for a given display and MicroPython host by adapting a single small file. The
GUI supports multiple displays attached to a single target, but bear in mind
the RAM requirements for multiple frame buffers. The GUI has been tested on
Pyboard 1.1, Pyboard D and on the ESP32 reference board without SPIRAM. Running
on ESP8266 is possible but frozen bytecode must be used owing to its restricted
RAM.
As of 14th March 2021 it runs on the Raspberry Pi Pico; on that target firmware
must be of that date or later.
Pyboard 1.1, Pyboard D, Raspberry Pi Pico and on the ESP32 reference board
without SPIRAM. Running on ESP8266 is possible but frozen bytecode must be used
owing to its restricted RAM.
It uses synchronous code but is compatible with `uasyncio`. Some demo programs
illustrate this. Code is standard MicroPython, but some device drivers use the
@ -109,71 +107,25 @@ displays:
* [RA8875 large displays](https://github.com/peterhinch/micropython_ra8875)
* [SSD1963 large displays](https://github.com/peterhinch/micropython-tft-gui)
Input via pushbuttons or an encoder is offered by
[micro-gui](https://github.com/peterhinch/micropython-micro-gui). This supports
all displays supported by nano-gui.
For historical reasons and to ensure consistency, code and documentation for
my GUI's employ the American spelling of `color`.
## 1.1 Change log
10 May 2022 Support Waveshare Pi Pico displays.
7 Sep 2021 Code reduction and faster color text display. Color use now requires
firmware V1.17 or later.
26 Aug 2021 Support [PR7682](https://github.com/micropython/micropython/pull/7682)
for fast text rendering.
25 Apr 2021 Support TTGO T-Display.
26 Mar 2021 Add ST7789. Alter uasyncio support on ili9341.
14 Mar 2021 Tested on Pi Pico.
17 Jan 2021
Add ePaper drivers. Ensure monochrome and color setup requirements are
identical. Substantial update to docs.
16 Dec 2020
Add ILI9341 driver, 4-bit drivers and SPI bus sharing improvements. These mean
that `color_setup.py` should now set SPI baudrate.
29 Nov 2020
Add ST7735R TFT drivers.
17 Nov 2020
Add `Textbox` widget. `Scale` constructor arg `border` replaced by `bdcolor` as
per other widgets.
5 Nov 2020 - breaking change
This library has been refactored as a Python package. This reduces RAM usage:
widgets are imported on demand rather than unconditionally. This has enabled
the addition of new widgets with zero impact on existsing applications. Another
aim was to simplify installation with dependencies such as `writer` included in
the tree. Finally hardware configuration is contained in a single script: only
this file needs to be customised to run all demo scripts or to port an
application to different hardware.
Users of versions prior to this refactor should re-install from scratch. In
existing applications, import statements will need to be adapted as per the
demos. The GUI API is otherwise unchanged.
## 1.2 Description
Compatible and tested display drivers include:
* The official [SSD1306 driver](https://github.com/micropython/micropython/blob/master/drivers/display/ssd1306.py).
* The [PCD8544/Nokia 5110](https://github.com/mcauser/micropython-pcd8544.git).
* The [Adafruit 0.96 inch color OLED](https://www.adafruit.com/product/684)
with [this driver](./DRIVERS.md#3-drivers-for-ssd1331).
* A driver for [Adafruit 1.5 inch OLED](https://www.adafruit.com/product/1431)
and [Adafruit 1.27 inch OLED](https://www.adafruit.com/product/1673) is
documented [here](./DRIVERS.md#2-drivers-for-ssd1351).
* A driver for Sharp ultra low power consumption monochrome displays such as
[2.7 inch 400x240 pixels](https://www.adafruit.com/product/4694)
is documented [here](./DRIVERS.md#6-drivers-for-sharp-displays).
* Drivers for Adafruit ST7735R based TFT's:
[1.8 inch](https://www.adafruit.com/product/358) and
[1.44 inch](https://www.adafruit.com/product/2088) documented [here](./DRIVERS.md#4-drivers-for-st7735r).
* Drivers for Adafruit ST7789 TFT's and TTGO T-Display ESP32 with TFT display:
[1.3 inch](https://www.adafruit.com/product/4313) and
[1.54 inch](https://www.adafruit.com/product/3787).
[TTGO Product page](http://www.lilygo.cn/prod_view.aspx?TypeId=50033&Id=1126&FId=t3%3a50033%3a3&msclkid=b46a3d0ecf7d11ec88e6ae013d02d194)
* Drivers for ILI9341 such as [Adafruit 3.2 inch](https://www.adafruit.com/product/1743)
documented [here](./DRIVERS.md#5-drivers-for-ili9341).
* [Adafruit 2.9 inch ePaper display](https://www.adafruit.com/product/4262)
documented [here](./DRIVERS.md#71-adafruit-flexible-eink-display).
* [Waveshare 2.7 inch ePaper HAT](https://www.waveshare.com/wiki/2.7inch_e-Paper_HAT)
documented [here](./DRIVERS.md#72-waveshare-eink-display-hat). Please note the
warning regarding poor quality suspected clone units.
Widgets are intended for the display of data from physical devices such as
sensors. They are drawn using graphics primitives rather than icons to minimise
RAM usage. It also enables them to be effciently rendered at arbitrary scale by