peterhinch / micropython-micro-gui

A lightweight MicroPython GUI library for display drivers based on framebuf, allows input via pushbuttons. See also micropython-touch.
MIT License
269 stars 40 forks source link

Driver: st7735r support not connected Reset #3

Closed petrkr closed 2 years ago

petrkr commented 2 years ago

Not always "reset" pin is needed, so I suggest to do something like if reset pin is "None" just ignore it..

something like https://github.com/octopusengine/octopuslab/commit/f3e7a8fd5d2ba39620bf6dad74c3c00be3240610#diff-9b6c2fa4ba580b8f61113f06bf19d60f3e351823d08aa5bccc4c2f34997e8fad

petrkr commented 2 years ago

Workarounded it by using DummyPin instead

class DummyPin():
    def __init__(self, value = 0):
        self._value = value

    def value(self, value = None):
        if not value:
            return self._value

        self._value = value

    def __call__(self, value = None):
        self.value(value)
TFT_RST = DummyPin()

Closing as workaround works