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