Merge pull request #3032 from Quency-D/heltec-rc52

Add heltec rc52
This commit is contained in:
Liam Cottle authored and GitHub committed 2026-11-14 10:43:40 +13:00
commit 0c760a65ac
12 files changed
+824 -4

No files matched your search

+6
View File
@@ -425,7 +425,13 @@ bool NV3001BDisplay::begin() {
digitalWrite(PIN_TFT_DC, HIGH);
delay(20);
#if defined(NRF52_PLATFORM)
spi.begin();
#elif defined(ESP_PLATFORM) || defined(ESP32_PLATFORM)
spi.begin(PIN_TFT_SCL, PIN_TFT_MISO, PIN_TFT_SDA, PIN_TFT_CS);
#else
spi.begin();
#endif
if (PIN_TFT_RST >= 0) {
pinMode(PIN_TFT_RST, OUTPUT);
digitalWrite(PIN_TFT_RST, HIGH);
+16 -4
View File
@@ -20,12 +20,14 @@
#define NV3001B_PANEL_HEIGHT 220
#endif
class NV3001BDisplay : public DisplayDriver {
#if defined(ESP_PLATFORM) || defined(ESP32_PLATFORM)
#ifndef NV3001B_SPI_HOST
#define NV3001B_SPI_HOST HSPI
#endif
class NV3001BDisplay : public DisplayDriver {
SPIClass spi;
SPIClass owned_spi;
#endif
SPIClass& spi;
RefCountedDigitalPin* periph_power;
bool is_on = false;
uint16_t color = 0xffff;
@@ -43,8 +45,18 @@ class NV3001BDisplay : public DisplayDriver {
void drawChar(int x, int y, char ch);
public:
#if defined(ESP_PLATFORM) || defined(ESP32_PLATFORM)
NV3001BDisplay(RefCountedDigitalPin* power = nullptr) :
DisplayDriver(NV3001B_LOGICAL_WIDTH, NV3001B_LOGICAL_HEIGHT), spi(NV3001B_SPI_HOST), periph_power(power) { }
DisplayDriver(NV3001B_LOGICAL_WIDTH, NV3001B_LOGICAL_HEIGHT),
owned_spi(NV3001B_SPI_HOST), spi(owned_spi), periph_power(power) { }
NV3001BDisplay(SPIClass* displaySpi, RefCountedDigitalPin* power = nullptr) :
DisplayDriver(NV3001B_LOGICAL_WIDTH, NV3001B_LOGICAL_HEIGHT),
owned_spi(NV3001B_SPI_HOST), spi(displaySpi ? *displaySpi : owned_spi), periph_power(power) { }
#else
NV3001BDisplay(SPIClass* displaySpi = &SPI, RefCountedDigitalPin* power = nullptr) :
DisplayDriver(NV3001B_LOGICAL_WIDTH, NV3001B_LOGICAL_HEIGHT), spi(displaySpi ? *displaySpi : SPI), periph_power(power) { }
#endif
bool begin();
static const char* driverName() { return "NV3001B"; }