Crowpanel 4.3, 5.0, 7.0 support (#6611)

* SD software SPI control
* fix notification crash;
* allow wake on touch
* don't build non-MUI variants
* use pwm buzzer
* Finalize support for Crowpanel TFT 2.4, 2.8 and 3.5
* add hardware ID for TFT panels
* Add stubs for the bigger panels. WIP!
* fix braces
* elecrow 4.3, 5.0, 7.0 support
* completed implementation 4.3, 5.0, 7.0 variants
* NodeDB default config & simplified light sleep macros
* trunk fmt
* remove flags
* removed leftovers (note: rtc gpios are only needed for deep sleep; the remove section caused issues with the elecrows)
---------
Co-authored-by: mverch67 <manuel.verch@gmx.de>
Co-authored-by: Manuel <71137295+mverch67@users.noreply.github.com>
Co-authored-by: Austin <vidplace7@gmail.com>
This commit is contained in:
Thomas Göttgens
2025-05-13 14:15:52 +02:00
committed by GitHub
parent e1417cff2e
commit cc66f7c79b
12 changed files with 98 additions and 189 deletions

View File

@@ -1,124 +1,14 @@
#define I2C_SDA 15
#define I2C_SCL 16
#if TFT_HEIGHT == 320 && not defined(HAS_TFT) // 2.4 and 2.8 TFT
// ST7789 TFT LCD
#define ST7789_CS 40
#define ST7789_RS 41 // DC
#define ST7789_SDA 39 // MOSI
#define ST7789_SCK 42
#define ST7789_RESET -1
#define ST7789_MISO 38
#define ST7789_BUSY -1
#define ST7789_BL 38
#define ST7789_SPI_HOST SPI2_HOST
#define TFT_BL 38
#define SPI_FREQUENCY 60000000
#define SPI_READ_FREQUENCY 16000000
#define TFT_OFFSET_ROTATION 0
#define SCREEN_ROTATE
#define TFT_DUMMY_READ_PIXELS 8
#define SCREEN_TRANSITION_FRAMERATE 5
#define BRIGHTNESS_DEFAULT 130 // Medium Low Brightness
#define HAS_TOUCHSCREEN 1
#if CROW_SELECT == 1
#define WAKE_ON_TOUCH
#define SCREEN_TOUCH_INT 47
#define SCREEN_TOUCH_RST 48
#define TOUCH_I2C_PORT 0
#define TOUCH_SLAVE_ADDRESS 0x38 // FT5x06
#define USE_POWERSAVE
#define SLEEP_TIME 180
#endif
#if TFT_HEIGHT == 480 && not defined(HAS_TFT) // 3.5 TFT
// ILI9488 TFT LCD
#define ILI9488_CS 40
#define ILI9488_RS 41 // DC
#define ILI9488_SDA 39 // MOSI
#define ILI9488_SCK 42
#define ILI9488_RESET -1
#define ILI9488_MISO 38
#define ILI9488_BUSY -1
#define ILI9488_BL 38
#define ILI9488_SPI_HOST SPI2_HOST
#define TFT_BL 38
#define SPI_FREQUENCY 40000000
#define SPI_READ_FREQUENCY 16000000
#define TFT_OFFSET_ROTATION 0
#define SCREEN_ROTATE
#define TFT_DUMMY_READ_PIXELS 8
#define SCREEN_TRANSITION_FRAMERATE 5
#define BRIGHTNESS_DEFAULT 130 // Medium Low Brightness
#define HAS_TOUCHSCREEN 1
#define SCREEN_TOUCH_INT 47
#define SCREEN_TOUCH_RST 48
#define TOUCH_I2C_PORT 0
#define TOUCH_SLAVE_ADDRESS 0x5D // GT911
#endif
#ifdef CROW_SELECT
#define ST72xx_DE 42
#define ST72xx_VSYNC 41
#define ST72xx_HSYNC 40
#define ST72xx_PCLK 39
#define ST72xx_R0 7
#define ST72xx_R1 17
#define ST72xx_R2 18
#define ST72xx_R3 3
#define ST72xx_R4 46
#define ST72xx_G0 9
#define ST72xx_G1 10
#define ST72xx_G2 11
#define ST72xx_G3 12
#define ST72xx_G4 13
#define ST72xx_G5 14
#define ST72xx_B0 21
#define ST72xx_B1 47
#define ST72xx_B2 48
#define ST72xx_B3 45
#define ST72xx_B4 38
#define HAS_TOUCHSCREEN 1
#define TOUCH_I2C_PORT 0
#define TOUCH_SLAVE_ADDRESS 0x5D // GT911
#endif
#if defined(CROW_SELECT) && CROW_SELECT == 1 // 4.3 TFT 800x480
#define ST7265_HSYNC_POLARITY 0
#define ST7265_HSYNC_FRONT_PORCH 24
#define ST7265_HSYNC_PULSE_WIDTH 8
#define ST7265_HSYNC_BACK_PORCH 24
#define ST7265_VSYNC_POLARITY 1
#define ST7265_VSYNC_FRONT_PORCH 24
#define ST7265_VSYNC_PULSE_WIDTH 8
#define ST7265_VSYNC_BACK_PORCH 24
#define ST7265_PCLK_ACTIVE_NEG 1
#endif
#if defined(CROW_SELECT) && CROW_SELECT == 2 // 5.0 TFT 800x480
#define ST7262_HSYNC_POLARITY 0
#define ST7262_HSYNC_FRONT_PORCH 8
#define ST7262_HSYNC_PULSE_WIDTH 4
#define ST7262_HSYNC_BACK_PORCH 8
#define ST7262_VSYNC_POLARITY 0
#define ST7262_VSYNC_FRONT_PORCH 8
#define ST7262_VSYNC_PULSE_WIDTH 4
#define ST7262_VSYNC_BACK_PORCH 8
#define ST7262_PCLK_ACTIVE_NEG 0
#endif
#if defined(CROW_SELECT) && CROW_SELECT == 3 // 7.0 TFT 800x480
#define SC7277_HSYNC_POLARITY 0
#define SC7277_HSYNC_FRONT_PORCH 8
#define SC7277_HSYNC_PULSE_WIDTH 4
#define SC7277_HSYNC_BACK_PORCH 8
#define SC7277_VSYNC_POLARITY 0
#define SC7277_VSYNC_FRONT_PORCH 8
#define SC7277_VSYNC_PULSE_WIDTH 4
#define SC7277_VSYNC_BACK_PORCH 8
#define SC7277_PCLK_ACTIVE_NEG 0
#endif
#if TFT_HEIGHT == 320 // 2.4-2.8 have I2S audio
#if CROW_SELECT == 1
// dac / amp
// #define HAS_I2S // didn't get I2S sound working
#define PIN_BUZZER 8 // using pwm buzzer instead (nobody will notice, lol)
@@ -131,10 +21,16 @@
#endif
// GPS via UART1 connector
#define HAS_GPS 1
#define GPS_DEFAULT_NOT_PRESENT 1
#define HAS_GPS 1
#if CROW_SELECT == 1
#define GPS_RX_PIN 18
#define GPS_TX_PIN 17
#else
// GPIOs shared with LoRa or MIC module
#define GPS_RX_PIN 19
#define GPS_TX_PIN 20
#endif
// Extension Slot Layout, viewed from above (2.4-3.5)
// DIO1/IO1 o o IO2/NRESET
@@ -158,9 +54,11 @@
// LoRa
#define USE_SX1262
#define LORA_CS 0 // GND
#if TFT_HEIGHT == 320 || TFT_HEIGHT == 480 // 2.4 - 3.5 TFT
#if CROW_SELECT == 1
// 2.4", 2.8, 3.5"""
#define HW_SPI1_DEVICE
#define LORA_CS 0
#define LORA_SCK 10
#define LORA_MISO 9
#define LORA_MOSI 3
@@ -173,6 +71,8 @@
#define SENSOR_POWER_CTRL_PIN 45
#define SENSOR_POWER_ON LOW
#else
// 4.3", 5.0", 7.0"
#define LORA_CS 0
#define LORA_SCK 5
#define LORA_MISO 4
#define LORA_MOSI 6
@@ -182,14 +82,9 @@
#define LORA_DIO2 2 // SX1262 BUSY
#endif
#define HW_SPI1_DEVICE
#define SX126X_CS LORA_CS
#define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY LORA_DIO2
#define SX126X_RESET LORA_RESET
#define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_DIO3_TCXO_VOLTAGE 3.3
#define USE_VIRTUAL_KEYBOARD 1
#define DISPLAY_CLOCK_FRAME 1