From f74dfc450c5733d37b3599462a684dc1b3c4ce6a Mon Sep 17 00:00:00 2001 From: Peter Hinch Date: Mon, 3 Jun 2024 10:01:53 +0100 Subject: [PATCH] ST7789 driver: remove warning message. --- DRIVERS.md | 20 ++++++++++---------- drivers/st7789/st7789_4bit.py | 2 -- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/DRIVERS.md b/DRIVERS.md index b277e2f..9909c65 100644 --- a/DRIVERS.md +++ b/DRIVERS.md @@ -828,9 +828,8 @@ Two versions are provided: * `gc9a01_8_bit.py` 8-bit driver, requires 57,600 bytes. For use with the three GUI options the 4-bit version is normally preferred. The -8-bit version allows more colors to be displayed on any given screen. It also -offers a mode in which 8-bit greyscale full-screen bitmap images can be -displayed. Both have identical constructor args. +8-bit version allows more colors to be displayed on any given screen. Both have +identical constructor args and method. #### GC9A01 Constructor args: @@ -845,14 +844,15 @@ displayed. Both have identical constructor args. * `mirror=False` If `True` a mirror-image is displayed * `init_spi=False` For shared SPI bus applications. See note below. - #### Method (8-bit version only) + #### Method - * `greyscale(gs=None)` By default the frame buffer contents are interpreted as - `rrrgggbb` color values. If `True` is passed, the contents will be treated as - 8-bit greyscale values. This mode will persist until the method is called with - `False`. Returns the current greyscale state. It is possible to superimpose - widgets on an image, but the mapping of colors onto the greyscale may yield - unexpected grey values. `WHITE` and `BLACK` work well. In + * `greyscale(gs=None)` Setting `gs=True` enables the screen to be used to show +a full screen monochrome image. By default the frame buffer contents are +interpreted as color values. In greyscale mode the contents are treated as +greyscale values. This mode persists until the method is called with +`gs=False`. The method returns the current greyscale state. It is possible to +superimpose widgets on an image, but the mapping of colors onto the greyscale +may yield unexpected shades of grey. `WHITE` and `BLACK` work well. In [micro-gui](https://github.com/peterhinch/micropython-micro-gui) and [micropython-touch](https://github.com/peterhinch/micropython-touch) the `after_open` method should be used to render the image to the framebuf and to diff --git a/drivers/st7789/st7789_4bit.py b/drivers/st7789/st7789_4bit.py index 13756f2..0261980 100644 --- a/drivers/st7789/st7789_4bit.py +++ b/drivers/st7789/st7789_4bit.py @@ -78,8 +78,6 @@ class ST7789(framebuf.FrameBuffer): ): if not 0 <= disp_mode <= 7: raise ValueError("Invalid display mode:", disp_mode) - if not display in (GENERIC, TDISPLAY, PI_PICO_LCD_2): - print("WARNING: unsupported display parameter value.") self._spi = spi # Clock cycle time for write 16ns 62.5MHz max (read is 150ns) self._rst = rst # Pins self._dc = dc