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 )