kopia lustrzana https://github.com/peterhinch/micropython-micro-gui
Update st7789 driver.
rodzic
d6cc79e714
commit
aa385845e8
|
@ -31,7 +31,8 @@ PORTRAIT = 4
|
||||||
# Display types
|
# Display types
|
||||||
GENERIC = (0, 0, 0)
|
GENERIC = (0, 0, 0)
|
||||||
TDISPLAY = (52, 40, 1)
|
TDISPLAY = (52, 40, 1)
|
||||||
|
PI_PICO_LCD_2 = (0, 0, 1) # Waveshare Pico LCD 2 determined by Mike Wilson.
|
||||||
|
DFR0995 = (34, 0, 0) # DFR0995 Contributed by @EdgarKluge
|
||||||
|
|
||||||
@micropython.viper
|
@micropython.viper
|
||||||
def _lcopy(dest:ptr16, source:ptr8, lut:ptr16, length:int):
|
def _lcopy(dest:ptr16, source:ptr8, lut:ptr16, length:int):
|
||||||
|
@ -61,8 +62,8 @@ class ST7789(framebuf.FrameBuffer):
|
||||||
disp_mode=LANDSCAPE, init_spi=False, display=GENERIC):
|
disp_mode=LANDSCAPE, init_spi=False, display=GENERIC):
|
||||||
if not 0 <= disp_mode <= 7:
|
if not 0 <= disp_mode <= 7:
|
||||||
raise ValueError('Invalid display mode:', disp_mode)
|
raise ValueError('Invalid display mode:', disp_mode)
|
||||||
if not display in (GENERIC, TDISPLAY):
|
if not display in (GENERIC, TDISPLAY, PI_PICO_LCD_2):
|
||||||
raise ValueError('Invalid display type.')
|
print("WARNING: unsupported display parameter value.")
|
||||||
self._spi = spi # Clock cycle time for write 16ns 62.5MHz max (read is 150ns)
|
self._spi = spi # Clock cycle time for write 16ns 62.5MHz max (read is 150ns)
|
||||||
self._rst = rst # Pins
|
self._rst = rst # Pins
|
||||||
self._dc = dc
|
self._dc = dc
|
||||||
|
|
Ładowanie…
Reference in New Issue