LilyGo T-DISPLAY RP2040 135x240
https://www.lilygo.cc/products/t-display-rp2040
tft_configs/ttgo_tdisplay_rp2040/tft_config.py
1"""LilyGo T-DISPLAY RP2040 135x240
2
3https://www.lilygo.cc/products/t-display-rp2040
4
5"""
6from machine import Pin, SPI
7import st7789py as st7789
8
9TFA = 40
10BFA = 40
11WIDE = 1
12TALL = 0
13SCROLL = 0 # orientation for scroll.py
14FEATHERS = 1 # orientation for feathers.py
15
16def config(rotation=0):
17 """
18 Configures and returns an instance of the ST7789 display driver.
19
20 Args:
21 rotation (int): The rotation of the display (default: 0).
22
23 Returns:
24 ST7789: An instance of the ST7789 display driver.
25 """
26
27 return st7789.ST7789(
28 SPI(0, baudrate=60000000, sck=Pin(2), mosi=Pin(3), miso=None),
29 135,
30 240,
31 reset=Pin(0, Pin.OUT),
32 cs=Pin(5, Pin.OUT),
33 dc=Pin(1, Pin.OUT),
34 backlight=Pin(4, Pin.OUT),
35 rotation=rotation)