Commit bc854ec4 authored by Mike Szczys's avatar Mike Szczys

Use hardware spi

parent 0bdcbe79
...@@ -9,7 +9,7 @@ ttgo_hello.py ...@@ -9,7 +9,7 @@ ttgo_hello.py
""" """
import random import random
from machine import Pin, SoftSPI from machine import Pin, SPI
import st7789 as st7789 import st7789 as st7789
import time import time
import utime import utime
...@@ -20,7 +20,7 @@ import vga1_8x16 as font ...@@ -20,7 +20,7 @@ import vga1_8x16 as font
def main(): def main():
tft = st7789.ST7789( tft = st7789.ST7789(
SoftSPI(baudrate=30000000, polarity=1, phase=1, sck=Pin(18), mosi=Pin(19), miso=Pin(21)), SPI(2, baudrate=30000000, polarity=1, phase=1, sck=Pin(18), mosi=Pin(19)),
135, 135,
240, 240,
reset=Pin(23, Pin.OUT), reset=Pin(23, Pin.OUT),
......
...@@ -8,7 +8,7 @@ ttgo_fonts.py ...@@ -8,7 +8,7 @@ ttgo_fonts.py
""" """
import utime import utime
import random import random
from machine import Pin, SoftSPI from machine import Pin, SPI
import st7789 import st7789
import vga1_8x8 as font1 import vga1_8x8 as font1
...@@ -19,7 +19,7 @@ import vga1_bold_16x32 as font4 ...@@ -19,7 +19,7 @@ import vga1_bold_16x32 as font4
def main(): def main():
tft = st7789.ST7789( tft = st7789.ST7789(
SoftSPI(baudrate=30000000, polarity=1, phase=1, sck=Pin(18), mosi=Pin(19), miso=Pin(21)), SPI(2, baudrate=30000000, polarity=1, phase=1, sck=Pin(18), mosi=Pin(19)),
135, 135,
240, 240,
reset=Pin(23, Pin.OUT), reset=Pin(23, Pin.OUT),
......
...@@ -8,7 +8,7 @@ ttgo_hello.py ...@@ -8,7 +8,7 @@ ttgo_hello.py
""" """
import random import random
from machine import Pin, SoftSPI from machine import Pin, SPI
import st7789 import st7789
import vga1_bold_16x32 as font import vga1_bold_16x32 as font
...@@ -16,7 +16,7 @@ import vga1_bold_16x32 as font ...@@ -16,7 +16,7 @@ import vga1_bold_16x32 as font
def main(): def main():
tft = st7789.ST7789( tft = st7789.ST7789(
SoftSPI(baudrate=30000000, polarity=1, phase=1, sck=Pin(18), mosi=Pin(19), miso=Pin(21)), SPI(2, baudrate=30000000, polarity=1, phase=1, sck=Pin(18), mosi=Pin(19)),
135, 135,
240, 240,
reset=Pin(23, Pin.OUT), reset=Pin(23, Pin.OUT),
......
...@@ -9,7 +9,7 @@ ttgo_hershey.py ...@@ -9,7 +9,7 @@ ttgo_hershey.py
import utime import utime
import random import random
import sys import sys
from machine import Pin, SoftSPI from machine import Pin, SPI
import st7789 import st7789
# Load several frozen fonts from flash # Load several frozen fonts from flash
...@@ -65,7 +65,7 @@ def main(): ...@@ -65,7 +65,7 @@ def main():
''' '''
# configure display # configure display
tft = st7789.ST7789( tft = st7789.ST7789(
SoftSPI(baudrate=30000000, polarity=1, phase=1, sck=Pin(18), mosi=Pin(19), miso=Pin(21)), SPI(2, baudrate=30000000, polarity=1, phase=1, sck=Pin(18), mosi=Pin(19)),
135, 135,
240, 240,
reset=Pin(23, Pin.OUT), reset=Pin(23, Pin.OUT),
......
...@@ -9,7 +9,7 @@ ttgo_scroll.py ...@@ -9,7 +9,7 @@ ttgo_scroll.py
""" """
import utime import utime
import random import random
from machine import Pin, SoftSPI from machine import Pin, SPI
import st7789 import st7789
import vga1_bold_16x16 as font import vga1_bold_16x16 as font
...@@ -30,7 +30,7 @@ def cycle(p): ...@@ -30,7 +30,7 @@ def cycle(p):
def main(): def main():
tft = st7789.ST7789( tft = st7789.ST7789(
SoftSPI(baudrate=30000000, polarity=1, phase=1, sck=Pin(18), mosi=Pin(19), miso=Pin(21)), SPI(2, baudrate=30000000, polarity=1, phase=1, sck=Pin(18), mosi=Pin(19)),
135, 135,
240, 240,
reset=Pin(23, Pin.OUT), reset=Pin(23, Pin.OUT),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment