diff --git a/drivers/gc9a01/gc9a01.py b/drivers/gc9a01/gc9a01.py index 747e4fc..bc30eb4 100644 --- a/drivers/gc9a01/gc9a01.py +++ b/drivers/gc9a01/gc9a01.py @@ -77,12 +77,12 @@ class GC9A01(framebuf.FrameBuffer): self.width = width self._spi_init = init_spi self._gscale = False # Interpret buffer as index into color LUT - mode = framebuf.GS4_HMSB - self.palette = BoolPalette(mode) + self.mode = framebuf.GS4_HMSB + self.palette = BoolPalette(self.mode) gc.collect() buf = bytearray(height * width // 2) # Frame buffer self.mvb = memoryview(buf) - super().__init__(buf, width, height, mode) + super().__init__(buf, width, height, self.mode) self._linebuf = bytearray(width * 2) # Line buffer (16-bit colors) # Hardware reset diff --git a/drivers/gc9a01/gc9a01_8_bit.py b/drivers/gc9a01/gc9a01_8_bit.py index 5c447d4..4fa537a 100644 --- a/drivers/gc9a01/gc9a01_8_bit.py +++ b/drivers/gc9a01/gc9a01_8_bit.py @@ -63,12 +63,12 @@ class GC9A01(framebuf.FrameBuffer): self.height = height # Logical dimensions for GUIs self.width = width self._spi_init = init_spi - mode = framebuf.GS8 # Use 8bit greyscale for 8 bit color. - self.palette = BoolPalette(mode) + self.mode = framebuf.GS8 # Use 8bit greyscale for 8 bit color. + self.palette = BoolPalette(self.mode) gc.collect() buf = bytearray(height * width) # Frame buffer self.mvb = memoryview(buf) - super().__init__(buf, width, height, mode) + super().__init__(buf, width, height, self.mode) self._linebuf = bytearray(width * 2) # Line buffer (16-bit colors) # Hardware reset diff --git a/drivers/ili93xx/ili9341.py b/drivers/ili93xx/ili9341.py index 778c1ab..299e41d 100644 --- a/drivers/ili93xx/ili9341.py +++ b/drivers/ili93xx/ili9341.py @@ -62,12 +62,12 @@ class ILI9341(framebuf.FrameBuffer): self.width = width self._spi_init = init_spi self._gscale = False # Interpret buffer as index into color LUT - mode = framebuf.GS4_HMSB - self.palette = BoolPalette(mode) + self.mode = framebuf.GS4_HMSB + self.palette = BoolPalette(self.mode) gc.collect() buf = bytearray(self.height * self.width // 2) self.mvb = memoryview(buf) - super().__init__(buf, self.width, self.height, mode) + super().__init__(buf, self.width, self.height, self.mode) self._linebuf = bytearray(self.width * 2) # Hardware reset self._rst(0) diff --git a/drivers/ili94xx/ili9486.py b/drivers/ili94xx/ili9486.py index 8461306..8c24053 100644 --- a/drivers/ili94xx/ili9486.py +++ b/drivers/ili94xx/ili9486.py @@ -92,12 +92,12 @@ class ILI9486(framebuf.FrameBuffer): self._short = min(height, width) self._spi_init = init_spi self._gscale = False # Interpret buffer as index into color LUT - mode = framebuf.GS4_HMSB - self.palette = BoolPalette(mode) + self.mode = framebuf.GS4_HMSB + self.palette = BoolPalette(self.mode) gc.collect() buf = bytearray(height * width // 2) self.mvb = memoryview(buf) - super().__init__(buf, width, height, mode) # Logical aspect ratio + super().__init__(buf, width, height, self.mode) # Logical aspect ratio self._linebuf = bytearray(self._short * 2) # Hardware reset diff --git a/drivers/st7789/st7789_4bit.py b/drivers/st7789/st7789_4bit.py index 8f13f85..c207193 100644 --- a/drivers/st7789/st7789_4bit.py +++ b/drivers/st7789/st7789_4bit.py @@ -96,12 +96,12 @@ class ST7789(framebuf.FrameBuffer): self._spi_init = init_spi # Possible user callback self._lock = asyncio.Lock() self._gscale = False # Interpret buffer as index into color LUT - mode = framebuf.GS4_HMSB # Use 4bit greyscale. - self.palette = BoolPalette(mode) + self.mode = framebuf.GS4_HMSB # Use 4bit greyscale. + self.palette = BoolPalette(self.mode) gc.collect() buf = bytearray(height * -(-width // 2)) # Ceiling division for odd widths self.mvb = memoryview(buf) - super().__init__(buf, width, height, mode) + super().__init__(buf, width, height, self.mode) self._linebuf = bytearray(self.width * 2) # 16 bit color out self._init(disp_mode, orientation) self.show()