diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 072a9d14d..9d666d986 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -101,7 +101,7 @@ static uint16_t displayWidth, displayHeight; #define SCREEN_WIDTH displayWidth #define SCREEN_HEIGHT displayHeight -#if defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS) +#if defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS) || defined(USE_ST7789) // The screen is bigger so use bigger fonts #define FONT_SMALL ArialMT_Plain_16 // Height: 19 #define FONT_MEDIUM ArialMT_Plain_24 // Height: 28 @@ -491,7 +491,7 @@ static void drawNodes(OLEDDisplay *display, int16_t x, int16_t y, NodeStatus *no { char usersString[20]; snprintf(usersString, sizeof(usersString), "%d/%d", nodeStatus->getNumOnline(), nodeStatus->getNumTotal()); -#if defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS) +#if defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS) || defined(USE_ST7789) display->drawFastImage(x, y + 3, 8, 8, imgUser); #else display->drawFastImage(x, y, 8, 8, imgUser); @@ -1487,7 +1487,7 @@ void DebugInfo::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 #ifdef ARCH_ESP32 if (millis() - storeForwardModule->lastHeartbeat > (storeForwardModule->heartbeatInterval * 1200)) { // no heartbeat, overlap a bit -#if defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS) +#if defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS) || defined(USE_ST7789) display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 3 + FONT_HEIGHT_SMALL, 12, 8, imgQuestionL1); display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 11 + FONT_HEIGHT_SMALL, 12, 8, @@ -1497,7 +1497,7 @@ void DebugInfo::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 imgQuestion); #endif } else { -#if defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS) +#if defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS) || defined(USE_ST7789) display->drawFastImage(x + SCREEN_WIDTH - 18 - display->getStringWidth(ourId), y + 3 + FONT_HEIGHT_SMALL, 16, 8, imgSFL1); display->drawFastImage(x + SCREEN_WIDTH - 18 - display->getStringWidth(ourId), y + 11 + FONT_HEIGHT_SMALL, 16, 8, @@ -1509,7 +1509,7 @@ void DebugInfo::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 } #endif } else { -#if defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS) +#if defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS) || defined(USE_ST7789) display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 3 + FONT_HEIGHT_SMALL, 12, 8, imgInfoL1); display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 11 + FONT_HEIGHT_SMALL, 12, 8, diff --git a/src/graphics/Screen.h b/src/graphics/Screen.h index 992a73285..a9ddc3316 100644 --- a/src/graphics/Screen.h +++ b/src/graphics/Screen.h @@ -380,7 +380,7 @@ class Screen : public concurrency::OSThread SH1106Wire dispdev; #elif defined(USE_SSD1306) SSD1306Wire dispdev; -#elif defined(ST7735_CS) || defined(ILI9341_DRIVER) +#elif defined(ST7735_CS) || defined(ILI9341_DRIVER) || defined(USE_ST7789) TFTDisplay dispdev; #elif defined(USE_EINK) EInkDisplay dispdev; diff --git a/src/graphics/TFTDisplay.cpp b/src/graphics/TFTDisplay.cpp index 8c07a4204..ed4367d42 100644 --- a/src/graphics/TFTDisplay.cpp +++ b/src/graphics/TFTDisplay.cpp @@ -1,6 +1,6 @@ #include "configuration.h" -#if defined(ST7735_CS) || defined(ILI9341_DRIVER) +#if defined(ST7735_CS) || defined(ILI9341_DRIVER) || defined(USE_ST7789) #include "SPILock.h" #include "TFTDisplay.h" #include diff --git a/src/graphics/images.h b/src/graphics/images.h index b1818e32c..6b7c91862 100644 --- a/src/graphics/images.h +++ b/src/graphics/images.h @@ -14,7 +14,7 @@ const uint8_t imgUser[] PROGMEM = {0x3C, 0x42, 0x99, 0xA5, 0xA5, 0x99, 0x42, 0x3 const uint8_t imgPositionEmpty[] PROGMEM = {0x20, 0x30, 0x28, 0x24, 0x42, 0xFF}; const uint8_t imgPositionSolid[] PROGMEM = {0x20, 0x30, 0x38, 0x3C, 0x7E, 0xFF}; -#if defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS) +#if defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS) || defined(USE_ST7789) const uint8_t imgQuestionL1[] PROGMEM = {0xff, 0x01, 0x01, 0x32, 0x7b, 0x49, 0x49, 0x6f, 0x26, 0x01, 0x01, 0xff}; const uint8_t imgQuestionL2[] PROGMEM = {0x0f, 0x08, 0x08, 0x08, 0x06, 0x0f, 0x0f, 0x06, 0x08, 0x08, 0x08, 0x0f}; const uint8_t imgInfoL1[] PROGMEM = {0xff, 0x01, 0x01, 0x01, 0x1e, 0x7f, 0x1e, 0x01, 0x01, 0x01, 0x01, 0xff}; diff --git a/variants/picomputer-s3/pins_arduino.h b/variants/picomputer-s3/pins_arduino.h new file mode 100644 index 000000000..ee0e34ebf --- /dev/null +++ b/variants/picomputer-s3/pins_arduino.h @@ -0,0 +1,37 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + +#define USB_VID 0x303a +#define USB_PID 0x1001 + +#define EXTERNAL_NUM_INTERRUPTS 46 +#define NUM_DIGITAL_PINS 48 +#define NUM_ANALOG_INPUTS 20 + +#define analogInputToDigitalPin(p) (((p) < 20) ? (analogChannelToDigitalPin(p)) : -1) +#define digitalPinToInterrupt(p) (((p) < 48) ? (p) : -1) +#define digitalPinHasPWM(p) (p < 46) + +static const uint8_t TX = 43; +static const uint8_t RX = 44; + +// The default Wire will be mapped to PMU and RTC +static const uint8_t SDA = 12; +static const uint8_t SCL = 14; + +// Default SPI will be mapped to Radio +static const uint8_t MISO = 39; +static const uint8_t SCK = 21; +static const uint8_t MOSI = 38; +static const uint8_t SS = 17; + +//#define SPI_MOSI (11) +//#define SPI_SCK (14) +//#define SPI_MISO (2) +//#define SPI_CS (13) + +//#define SDCARD_CS SPI_CS + +#endif /* Pins_Arduino_h */ \ No newline at end of file diff --git a/variants/picomputer-s3/platformio.ini b/variants/picomputer-s3/platformio.ini new file mode 100644 index 000000000..0cb58f23c --- /dev/null +++ b/variants/picomputer-s3/platformio.ini @@ -0,0 +1,27 @@ +[env:picomputer_s3] +extends = esp32s3_base +board = bpi_picow_esp32_s3 +board_level = extra +;OpenOCD flash method +;upload_protocol = esp-builtin +;Normal method +upload_protocol = esptool + +build_flags = + ${esp32_base.build_flags} + -D PRIVATE_HW + -I variants/picomputer-s3 + -DST7789_DRIVER + -DUSER_SETUP_LOADED + -DTFT_SDA_READ + -DTFT_MOSI=19 + -DTFT_MISO=-1 + -DTFT_SCLK=18 + -DTFT_CS=21 + -DTFT_DC=16 + -DTFT_BL=20 + -DDISABLE_ALL_LIBRARY_WARNINGS + +lib_deps = + ${esp32_base.lib_deps} + bodmer/TFT_eSPI@^2.4.76 \ No newline at end of file diff --git a/variants/picomputer-s3/variant.h b/variants/picomputer-s3/variant.h new file mode 100644 index 000000000..cbb8fe65e --- /dev/null +++ b/variants/picomputer-s3/variant.h @@ -0,0 +1,24 @@ +#define HAS_GPS 0 +#undef GPS_RX_PIN +#undef GPS_TX_PIN + +#define USE_ST7789 + +#define LED_PIN 48 // If defined we will blink this LED + +#define BUTTON_PIN 0 // If defined, this will be used for user button presses, + +#define BUTTON_NEED_PULLUP + +#define USE_RF95 // RFM95/SX127x + +#define RF95_SCK 10 +#define RF95_MISO 12 +#define RF95_MOSI 11 +#define RF95_NSS 13 +#define LORA_RESET RADIOLIB_NC + +// per SX1276_Receive_Interrupt/utilities.h +#define LORA_DIO0 28 +#define LORA_DIO1 RADIOLIB_NC +#define LORA_DIO2 RADIOLIB_NC \ No newline at end of file