Skip to content

Commit

Permalink
Merge pull request #15 from gitcnd/master
Browse files Browse the repository at this point in the history
Working esp32-2432S028r st7789 config setup
  • Loading branch information
russhughes authored Aug 5, 2024
2 parents 30384db + 7c149e6 commit 7265925
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tft_configs/esp32-2432S028r_st7789/tft_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
""" ESP32-2432S028R 320x240 st7789 display sometimes known as "Cheap Yellow Board" (CYD) - this is the v3 board
"""

from machine import Pin, SPI
import st7789py as st7789

TFA = 40
BFA = 40
WIDE = 1
TALL = 0
SCROLL = 0 # orientation for scroll.py
FEATHERS = 1 # orientation for feathers.py

def config(rotation=0):
"""
Configures and returns an instance of the ST7789 display driver.
Args:
rotation (int): The rotation of the display (default: 0).
Returns:
ST7789: An instance of the ST7789 display driver.
"""

return st7789.ST7789(
SPI(1, baudrate=40000000, sck=Pin(14), mosi=Pin(13), miso=None),
240,
320,
reset=Pin(0, Pin.OUT),
cs=Pin(15, Pin.OUT),
dc=Pin(2, Pin.OUT),
backlight=Pin(21, Pin.OUT),
rotation=rotation)

0 comments on commit 7265925

Please sign in to comment.