From 0be986ef13034f3b52cef899bf9f018a184f0224 Mon Sep 17 00:00:00 2001 From: Lars Veldscholte Date: Thu, 21 Dec 2023 10:15:46 +0100 Subject: [PATCH] Use software SPI for the display for the Teensy 4.0 --- src/config.h | 2 ++ src/main.cpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/config.h b/src/config.h index 5aeb0cd..d658431 100644 --- a/src/config.h +++ b/src/config.h @@ -107,6 +107,8 @@ namespace config { /// ST7920 LCD pins const uint8_t PIN_LCD_CS = 10; + const uint8_t PIN_LCD_MOSI = 11; + const uint8_t PIN_LCD_SCLK = 13; /// @name Thermistor pins ///@{ diff --git a/src/main.cpp b/src/main.cpp index 13b0fae..cafac15 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -70,7 +70,12 @@ CharDisplayUI ui(&liquidCrystal, &buttonReader, &humidistat, trs); SetpointProfileRunner spr(&humidistat); +#ifdef ARDUINO_TEENSYLC U8G2_ST7920_128X64_F_HW_SPI u8g2(U8G2_R0, config::PIN_LCD_CS); +#endif +#ifdef ARDUINO_TEENSY40 +U8G2_ST7920_128X64_F_SW_SPI u8g2(U8G2_R0, config::PIN_LCD_SCLK, config::PIN_LCD_MOSI, config::PIN_LCD_CS); +#endif GraphicalDisplayUI ui(&u8g2, &buttonReader, &humidistat, trs, &eepromConfig, &spr); #endif