LilyGo T-QT Pro 128x128 (GC9107)
https://www.lilygo.cc/products/t-qt-pro
tft_configs/t_qt_pro/tft_config.py
1"""LilyGo T-QT Pro 128x128 (GC9107)
2
3https://www.lilygo.cc/products/t-qt-pro
4
5"""
6
7from machine import Pin, SPI
8import st7789py as st7789
9
10TFA = 1
11BFA = 3
12WIDE = 2
13TALL = 3
14SCROLL = 0 # orientation for scroll.py
15FEATHERS = 1 # orientation for feathers.py
16
17def config(rotation=0):
18 """
19 Configures and returns an instance of the ST7789 display driver.
20
21 Args:
22 rotation (int): The rotation of the display (default: 0).
23
24 Returns:
25 ST7789: An instance of the ST7789 display driver.
26 """
27
28 custom_rotations = (
29 (0x00, 128, 128, 2, 1, False),
30 (0x60, 128, 128, 1, 2, False),
31 (0xc0, 128, 128, 2, 1, False),
32 (0xa0, 128, 128, 1, 2, False),
33 )
34
35 return st7789.ST7789(
36 SPI(2, baudrate=40000000, sck=Pin(3), mosi=Pin(2), miso=None),
37 128,
38 128,
39 reset=Pin(1, Pin.OUT),
40 cs=Pin(5, Pin.OUT),
41 dc=Pin(6, Pin.OUT),
42 #backlight=Pin(10, Pin.OUT),
43 rotation=rotation,
44 custom_rotations=custom_rotations,
45 color_order=st7789.BGR
46 )