diff --git a/DRIVERS.md b/DRIVERS.md index 7c792c6..4b3ac30 100644 --- a/DRIVERS.md +++ b/DRIVERS.md @@ -427,7 +427,8 @@ below. An example file for the Pi Pico is in `setup_examples/st7789_pico.py`. electrical issues such as lead lengths, PCB layout and grounding. * `cs` An initialised output pin. Initial value should be 1. * `dc` An initialised output pin. Initial value should be 0. - * `rst` An initialised output pin. Initial value should be 1. + * `rst=None` An initialised output pin with initial value 1. The default is for + vendors who do not provide an `rst` connection. * `height=240` Display dimensions in pixels. For portrait mode exchange `height` and `width` values: this ensures that `nano-gui` gets the correct aspect ratio. diff --git a/drivers/st7789/st7789_4bit.py b/drivers/st7789/st7789_4bit.py index 9f5c5b5..32ea1a2 100644 --- a/drivers/st7789/st7789_4bit.py +++ b/drivers/st7789/st7789_4bit.py @@ -81,7 +81,7 @@ class ST7789(framebuf.FrameBuffer): spi, cs, dc, - rst, + rst=None, height=240, width=240, disp_mode=LANDSCAPE, @@ -114,13 +114,14 @@ class ST7789(framebuf.FrameBuffer): # Hardware reset def _hwreset(self): - self._dc(0) - self._rst(1) - sleep_ms(1) - self._rst(0) - sleep_ms(1) - self._rst(1) - sleep_ms(1) + if self._rst is not None: + self._dc(0) + self._rst(1) + sleep_ms(1) + self._rst(0) + sleep_ms(1) + self._rst(1) + sleep_ms(1) # Write a command, a bytes instance (in practice 1 byte). def _wcmd(self, buf): diff --git a/drivers/st7789/st7789_8bit.py b/drivers/st7789/st7789_8bit.py index 85ee3d1..cb113c9 100644 --- a/drivers/st7789/st7789_8bit.py +++ b/drivers/st7789/st7789_8bit.py @@ -70,7 +70,7 @@ class ST7789(framebuf.FrameBuffer): spi, cs, dc, - rst, + rst=None, height=240, width=240, disp_mode=LANDSCAPE, @@ -103,13 +103,14 @@ class ST7789(framebuf.FrameBuffer): # Hardware reset def _hwreset(self): - self._dc(0) - self._rst(1) - sleep_ms(1) - self._rst(0) - sleep_ms(1) - self._rst(1) - sleep_ms(1) + if self._rst is not None: + self._dc(0) + self._rst(1) + sleep_ms(1) + self._rst(0) + sleep_ms(1) + self._rst(1) + sleep_ms(1) # Write a command, a bytes instance (in practice 1 byte). def _wcmd(self, buf):