RP2040-Touch-LCD-1.28

tft_configs/RP2040-Touch-LCD-1.28/tft_config.py

 1"""RP2040-Touch-LCD-1.28
 2"""
 3
 4from machine import Pin, SPI
 5import gc9a01
 6
 7TFA = 0
 8BFA = 0
 9WIDE = 0
10TALL = 1
11
12
13def config(rotation=0, buffer_size=0, options=0):
14    """Configure the display and return an instance of gc9a01.GC9A01."""
15
16    spi = SPI(1, baudrate=60000000, sck=Pin(10), mosi=Pin(11))
17    return gc9a01.GC9A01(
18        spi,
19        240,
20        240,
21        reset=Pin(13, Pin.OUT),
22        cs=Pin(9, Pin.OUT),
23        dc=Pin(8, Pin.OUT),
24        backlight=Pin(25, Pin.OUT),
25        rotation=rotation,
26        options=options,
27        buffer_size=buffer_size
28    )

tft_configs/RP2040-Touch-LCD-1.28/tft_buttons.py

 1"""RP2040-Touch-LCD-1.28
 2"""
 3
 4from machine import Pin
 5
 6
 7class Buttons:
 8    """Buttons class."""
 9
10    def __init__(self):
11        self.name = "RP2040-Touch-LCD-1.28"
12        self.left = 0
13        self.right = 0
14        self.hyper = 0
15        self.thrust = 0
16        self.fire = 0