kopia lustrzana https://github.com/peterhinch/micropython-nano-gui
ws_pico_res_touch.py Add SD card nd baudrate notes.
rodzic
03c067fd5d
commit
a544cb7484
|
@ -15,12 +15,20 @@ prst = Pin(15, Pin.OUT, value=1)
|
|||
pbl = Pin(13, Pin.OUT, value=1)
|
||||
|
||||
gc.collect() # Precaution before instantiating framebuf
|
||||
# Runs at 60MHz here, supported by ST7789 datasheet.
|
||||
# If problems arise, try reducing to 30MHz.
|
||||
spi = SPI(1, 60_000_000, sck=Pin(10), mosi=Pin(11), miso=Pin(12))
|
||||
# Max baudrate produced by Pico is 31_250_000. ST7789 datasheet allows <= 62.5MHz.
|
||||
# Note non-standard MISO pin. This works, verified by SD card.
|
||||
spi = SPI(1, 33_000_000, sck=Pin(10), mosi=Pin(11), miso=Pin(12))
|
||||
|
||||
# Define the display
|
||||
# For portrait mode:
|
||||
# ssd = SSD(spi, height=320, width=240, dc=pdc, cs=pcs, rst=prst)
|
||||
# For landscape mode:
|
||||
ssd = SSD(spi, height=240, width=320, disp_mode=PORTRAIT, dc=pdc, cs=pcs, rst=prst)
|
||||
|
||||
# Optional use of SD card. Requires official driver. In my testing the
|
||||
# 31.25MHz baudrate works. Other SD cards may have different ideas.
|
||||
# from sdcard import SDCard
|
||||
# import os
|
||||
# sd = SDCard(spi, Pin(22, Pin.OUT), 33_000_000)
|
||||
# vfs = os.VfsFat(sd)
|
||||
# os.mount(vfs, "/fc")
|
||||
|
|
Ładowanie…
Reference in New Issue