mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-07-27 19:57:38 +00:00
[P096] Enable support for configurable SPI bus
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
#include "Adafruit_GFX.h"
|
||||
#include "LOLIN_EPD.h"
|
||||
|
||||
LOLIN_EPD::LOLIN_EPD(int width, int height, int8_t spi_mosi, int8_t spi_clock, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY):Adafruit_GFX(width, height)
|
||||
LOLIN_EPD::LOLIN_EPD(int width, int height, int8_t spi_mosi, int8_t spi_clock, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY, SPIClass& spi):Adafruit_GFX(width, height)
|
||||
{
|
||||
cs = CS;
|
||||
rst = RST;
|
||||
@@ -26,9 +26,10 @@ LOLIN_EPD::LOLIN_EPD(int width, int height, int8_t spi_mosi, int8_t spi_clock, i
|
||||
busy = BUSY;
|
||||
hwSPI = false;
|
||||
singleByteTxns = false;
|
||||
_spi = spi;
|
||||
}
|
||||
|
||||
LOLIN_EPD::LOLIN_EPD(int width, int height, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY):Adafruit_GFX(width, height)
|
||||
LOLIN_EPD::LOLIN_EPD(int width, int height, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY, SPIClass& spi):Adafruit_GFX(width, height)
|
||||
{
|
||||
|
||||
dc = DC;
|
||||
@@ -37,6 +38,7 @@ LOLIN_EPD::LOLIN_EPD(int width, int height, int8_t DC, int8_t RST, int8_t CS, in
|
||||
busy = BUSY;
|
||||
hwSPI = true;
|
||||
singleByteTxns = false;
|
||||
_spi = spi;
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
@@ -90,9 +92,9 @@ void LOLIN_EPD::begin(bool reset)
|
||||
}
|
||||
else
|
||||
{
|
||||
SPI.begin();
|
||||
// _spi.begin(); // Already done by ESPEasy
|
||||
#ifndef SPI_HAS_TRANSACTION
|
||||
SPI.setClockDivider(4);
|
||||
_spi.setClockDivider(4);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -194,12 +196,12 @@ uint8_t LOLIN_EPD::fastSPIwrite(uint8_t d)
|
||||
{
|
||||
uint8_t b;
|
||||
csLow();
|
||||
b = SPI.transfer(d);
|
||||
b = _spi.transfer(d);
|
||||
csHigh();
|
||||
return b;
|
||||
}
|
||||
else
|
||||
return SPI.transfer(d);
|
||||
return _spi.transfer(d);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -234,7 +236,7 @@ uint8_t LOLIN_EPD::fastSPIwrite(uint8_t d)
|
||||
void LOLIN_EPD::csHigh()
|
||||
{
|
||||
#ifdef SPI_HAS_TRANSACTION
|
||||
SPI.endTransaction();
|
||||
_spi.endTransaction();
|
||||
#endif
|
||||
#ifdef HAVE_PORTREG
|
||||
*csport |= cspinmask;
|
||||
@@ -251,7 +253,7 @@ void LOLIN_EPD::csHigh()
|
||||
void LOLIN_EPD::csLow()
|
||||
{
|
||||
#ifdef SPI_HAS_TRANSACTION
|
||||
SPI.beginTransaction(SPISettings(4000000, MSBFIRST, SPI_MODE0));
|
||||
_spi.beginTransaction(SPISettings(4000000, MSBFIRST, SPI_MODE0));
|
||||
#endif
|
||||
#ifdef HAVE_PORTREG
|
||||
*csport &= ~cspinmask;
|
||||
|
||||
@@ -60,8 +60,8 @@ enum
|
||||
class LOLIN_EPD: public Adafruit_GFX
|
||||
{
|
||||
public:
|
||||
LOLIN_EPD(int width, int height, int8_t SID, int8_t SCLK, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY = -1);
|
||||
LOLIN_EPD(int width, int height, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY = -1);
|
||||
LOLIN_EPD(int width, int height, int8_t SID, int8_t SCLK, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY = -1, SPIClass& spi = SPI);
|
||||
LOLIN_EPD(int width, int height, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY = -1, SPIClass& spi = SPI);
|
||||
|
||||
virtual ~LOLIN_EPD();
|
||||
virtual void begin(bool reset = true);
|
||||
@@ -111,6 +111,7 @@ protected:
|
||||
void dcLow();
|
||||
|
||||
private:
|
||||
SPIClass& _spi = SPI;
|
||||
};
|
||||
|
||||
#include "LOLIN_IL3897.h"
|
||||
|
||||
@@ -184,7 +184,7 @@ const unsigned char LUT_DATA_part[] PROGMEM = {
|
||||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
LOLIN_IL3897::LOLIN_IL3897(int width, int height, int8_t SID, int8_t SCLK, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY) : LOLIN_EPD(width, height, SID, SCLK, DC, RST, CS, BUSY)
|
||||
LOLIN_IL3897::LOLIN_IL3897(int width, int height, int8_t SID, int8_t SCLK, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY, SPIClass& spi) : LOLIN_EPD(width, height, SID, SCLK, DC, RST, CS, BUSY, spi)
|
||||
{
|
||||
|
||||
if ((height % 8) > 0)
|
||||
@@ -202,7 +202,7 @@ LOLIN_IL3897::LOLIN_IL3897(int width, int height, int8_t SID, int8_t SCLK, int8_
|
||||
red_bufsize = bw_bufsize;
|
||||
}
|
||||
|
||||
LOLIN_IL3897::LOLIN_IL3897(int width, int height, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY) : LOLIN_EPD(width, height, DC, RST, CS, BUSY)
|
||||
LOLIN_IL3897::LOLIN_IL3897(int width, int height, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY, SPIClass& spi) : LOLIN_EPD(width, height, DC, RST, CS, BUSY, spi)
|
||||
{
|
||||
|
||||
if ((height % 8) > 0)
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
class LOLIN_IL3897 : public LOLIN_EPD {
|
||||
public:
|
||||
|
||||
LOLIN_IL3897(int width, int height, int8_t SID, int8_t SCLK, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY = -1);
|
||||
LOLIN_IL3897(int width, int height, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY = -1);
|
||||
LOLIN_IL3897(int width, int height, int8_t SID, int8_t SCLK, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY = -1, SPIClass& spi = SPI);
|
||||
LOLIN_IL3897(int width, int height, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY = -1, SPIClass& spi = SPI);
|
||||
|
||||
void begin(bool reset=true);
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
LOLIN_SSD1680::LOLIN_SSD1680(int width, int height, int8_t SID, int8_t SCLK, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY) : LOLIN_EPD(width, height, SID, SCLK, DC, RST, CS, BUSY)
|
||||
LOLIN_SSD1680::LOLIN_SSD1680(int width, int height, int8_t SID, int8_t SCLK, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY, SPIClass& spi) : LOLIN_EPD(width, height, SID, SCLK, DC, RST, CS, BUSY, spi)
|
||||
{
|
||||
|
||||
if ((height % 8) > 0)
|
||||
@@ -39,7 +39,7 @@ LOLIN_SSD1680::LOLIN_SSD1680(int width, int height, int8_t SID, int8_t SCLK, int
|
||||
red_bufsize = bw_bufsize;
|
||||
}
|
||||
|
||||
LOLIN_SSD1680::LOLIN_SSD1680(int width, int height, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY) : LOLIN_EPD(width, height, DC, RST, CS, BUSY)
|
||||
LOLIN_SSD1680::LOLIN_SSD1680(int width, int height, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY, SPIClass& spi) : LOLIN_EPD(width, height, DC, RST, CS, BUSY, spi)
|
||||
{
|
||||
|
||||
if ((height % 8) > 0)
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
class LOLIN_SSD1680 : public LOLIN_EPD
|
||||
{
|
||||
public:
|
||||
LOLIN_SSD1680(int width, int height, int8_t SID, int8_t SCLK, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY = -1);
|
||||
LOLIN_SSD1680(int width, int height, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY = -1);
|
||||
LOLIN_SSD1680(int width, int height, int8_t SID, int8_t SCLK, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY = -1, SPIClass& spi = SPI);
|
||||
LOLIN_SSD1680(int width, int height, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY = -1, SPIClass& spi = SPI);
|
||||
|
||||
void begin(bool reset = true);
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
@param BUSY the busy pin to use
|
||||
*/
|
||||
/**************************************************************************/
|
||||
LOLIN_UC8151D::LOLIN_UC8151D(int width, int height, int8_t SID, int8_t SCLK, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY) : LOLIN_EPD(width, height, SID, SCLK, DC, RST, CS, BUSY)
|
||||
LOLIN_UC8151D::LOLIN_UC8151D(int width, int height, int8_t SID, int8_t SCLK, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY, SPIClass& spi) : LOLIN_EPD(width, height, SID, SCLK, DC, RST, CS, BUSY, spi)
|
||||
{
|
||||
|
||||
if ((height % 8) > 0)
|
||||
@@ -39,7 +39,7 @@ LOLIN_UC8151D::LOLIN_UC8151D(int width, int height, int8_t SID, int8_t SCLK, int
|
||||
red_bufsize = bw_bufsize;
|
||||
}
|
||||
|
||||
LOLIN_UC8151D::LOLIN_UC8151D(int width, int height, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY) : LOLIN_EPD(width, height, DC, RST, CS, BUSY)
|
||||
LOLIN_UC8151D::LOLIN_UC8151D(int width, int height, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY, SPIClass& spi) : LOLIN_EPD(width, height, DC, RST, CS, BUSY, spi)
|
||||
{
|
||||
|
||||
if ((height % 8) > 0)
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
class LOLIN_UC8151D : public LOLIN_EPD
|
||||
{
|
||||
public:
|
||||
LOLIN_UC8151D(int width, int height, int8_t SID, int8_t SCLK, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY = -1);
|
||||
LOLIN_UC8151D(int width, int height, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY = -1);
|
||||
LOLIN_UC8151D(int width, int height, int8_t SID, int8_t SCLK, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY = -1, SPIClass& spi = SPI);
|
||||
LOLIN_UC8151D(int width, int height, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY = -1, SPIClass& spi = SPI);
|
||||
|
||||
void begin(bool reset = true);
|
||||
|
||||
|
||||
@@ -76,8 +76,8 @@ static const unsigned char EPD_2in7_gray_lut_bb[] = {
|
||||
@param BUSY the busy pin to use
|
||||
*/
|
||||
|
||||
Waveshare_2in7::Waveshare_2in7(int width, int height, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY)
|
||||
: LOLIN_EPD(width, height, DC, RST, CS, BUSY) {
|
||||
Waveshare_2in7::Waveshare_2in7(int width, int height, int8_t DC, int8_t RST, int8_t CS, int8_t BUSY, SPIClass& spi)
|
||||
: LOLIN_EPD(width, height, DC, RST, CS, BUSY, spi) {
|
||||
if ((height % 8) > 0) {
|
||||
_height_8bit = (height / 8 + 1) * 8;
|
||||
} else {
|
||||
@@ -247,7 +247,7 @@ void Waveshare_2in7::drawPixel(int16_t x, int16_t y, uint16_t color) {
|
||||
if ((x < 0) || (x >= width()) || (y < 0) || (y >= height())) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Corrections by @kretzp (Peter Kretz) 2022-03-27
|
||||
// check rotation, move pixel around if necessary
|
||||
switch (getRotation()) {
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
#define WS2IN7_DATA_STOP 0x11
|
||||
#define WS2IN7_DISPLAY_REFRESH 0x12
|
||||
#define WS2IN7_DATA_START_TRANSMISSION_2 0x13
|
||||
#define WS2IN7_PARTIAL_DATA_START_TRANSMISSION_1 0x14
|
||||
#define WS2IN7_PARTIAL_DATA_START_TRANSMISSION_2 0x15
|
||||
#define WS2IN7_PARTIAL_DATA_START_TRANSMISSION_1 0x14
|
||||
#define WS2IN7_PARTIAL_DATA_START_TRANSMISSION_2 0x15
|
||||
#define WS2IN7_PARTIAL_DISPLAY_REFRESH 0x16
|
||||
#define WS2IN7_LUT_FOR_VCOM 0x20
|
||||
#define WS2IN7_LUT_FOR_VCOM 0x20
|
||||
#define WS2IN7_LUT_WHITE_TO_WHITE 0x21
|
||||
#define WS2IN7_LUT_BLACK_TO_WHITE 0x22
|
||||
#define WS2IN7_LUT_WHITE_TO_BLACK 0x23
|
||||
@@ -67,12 +67,13 @@ extern const unsigned char lut_wb[];
|
||||
class Waveshare_2in7 : public LOLIN_EPD {
|
||||
public:
|
||||
|
||||
Waveshare_2in7(int width,
|
||||
int height,
|
||||
int8_t DC,
|
||||
int8_t RST,
|
||||
int8_t CS,
|
||||
int8_t BUSY = -1);
|
||||
Waveshare_2in7(int width,
|
||||
int height,
|
||||
int8_t DC,
|
||||
int8_t RST,
|
||||
int8_t CS,
|
||||
int8_t BUSY = -1,
|
||||
SPIClass& spi = SPI);
|
||||
|
||||
void begin(bool reset = true);
|
||||
|
||||
|
||||
+18
-8
@@ -13,6 +13,11 @@
|
||||
|
||||
// #define PLUGIN_096_MAX_DISPLAY 1 // Unused
|
||||
|
||||
/** Changelog:
|
||||
* 2025-08-13 tonhuisman: Enable use of secondary SPI bus
|
||||
* 2025-08-13 tonhuisman: Start changelog
|
||||
*/
|
||||
|
||||
/* README.MD
|
||||
|
||||
|
||||
@@ -184,6 +189,7 @@ boolean Plugin_096(uint8_t function, struct EventStruct *event, String& string)
|
||||
dev.TimerOption = true;
|
||||
dev.TimerOptional = true;
|
||||
# endif // if P096_USE_EXTENDED_SETTINGS
|
||||
dev.SpiBusSelect = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -278,8 +284,8 @@ boolean Plugin_096(uint8_t function, struct EventStruct *event, String& string)
|
||||
options4,
|
||||
optionValues4);
|
||||
selector.addFormSelector(F("eInk display model"),
|
||||
F("_type"),
|
||||
P096_CONFIG_FLAG_GET_DISPLAYTYPE);
|
||||
F("_type"),
|
||||
P096_CONFIG_FLAG_GET_DISPLAYTYPE);
|
||||
}
|
||||
|
||||
addFormSubHeader(F("Layout"));
|
||||
@@ -292,7 +298,7 @@ boolean Plugin_096(uint8_t function, struct EventStruct *event, String& string)
|
||||
const __FlashStringHelper *options2[] = { F("Normal"), F("+90°"), F("+180°"), F("+270°") };
|
||||
int optionValues2[] = { 0, 1, 2, 3 };
|
||||
constexpr size_t optionCount = NR_ELEMENTS(optionValues2);
|
||||
const FormSelectorOptions selector( optionCount, options2, optionValues2);
|
||||
const FormSelectorOptions selector(optionCount, options2, optionValues2);
|
||||
selector.addFormSelector(F("Rotation"), F("_rotate"), P096_CONFIG_ROTATION);
|
||||
}
|
||||
# endif // ifdef P096_USE_ADA_GRAPHICS
|
||||
@@ -341,8 +347,8 @@ boolean Plugin_096(uint8_t function, struct EventStruct *event, String& string)
|
||||
}
|
||||
constexpr size_t optionCount = NR_ELEMENTS(colorDepthOptions);
|
||||
const FormSelectorOptions selector(optionCount, colorDepths, colorDepthOptions);
|
||||
selector.addFormSelector(F("Greyscale levels"),F("_colorDepth"),
|
||||
P096_CONFIG_FLAG_GET_COLORDEPTH);
|
||||
selector.addFormSelector(F("Greyscale levels"), F("_colorDepth"),
|
||||
P096_CONFIG_FLAG_GET_COLORDEPTH);
|
||||
}
|
||||
|
||||
AdaGFXFormTextPrintMode(F("_mode"), P096_CONFIG_FLAG_GET_MODE);
|
||||
@@ -379,7 +385,7 @@ boolean Plugin_096(uint8_t function, struct EventStruct *event, String& string)
|
||||
constexpr size_t optionCount = NR_ELEMENTS(commandTriggerOptions);
|
||||
const FormSelectorOptions selector(optionCount, commandTriggers, commandTriggerOptions);
|
||||
selector.addFormSelector(F("Write Command trigger"), F("_commandtrigger"),
|
||||
P096_CONFIG_FLAG_GET_CMD_TRIGGER);
|
||||
P096_CONFIG_FLAG_GET_CMD_TRIGGER);
|
||||
addFormNote(F("Select the command that is used to handle commands for this display."));
|
||||
}
|
||||
|
||||
@@ -502,7 +508,9 @@ boolean Plugin_096(uint8_t function, struct EventStruct *event, String& string)
|
||||
|
||||
case PLUGIN_INIT:
|
||||
{
|
||||
if (Settings.InitSPI != 0) {
|
||||
const uint8_t spi_bus = Settings.getSPIBusForTask(event->TaskIndex);
|
||||
|
||||
if (Settings.isSPI_valid(spi_bus)) {
|
||||
initPluginTaskData(event->TaskIndex,
|
||||
# if P096_USE_EXTENDED_SETTINGS
|
||||
new (std::nothrow) P096_data_struct(static_cast<EPD_type_e>(P096_CONFIG_FLAG_GET_DISPLAYTYPE),
|
||||
@@ -511,6 +519,7 @@ boolean Plugin_096(uint8_t function, struct EventStruct *event, String& string)
|
||||
static_cast<AdaGFXTextPrintMode>(P096_CONFIG_FLAG_GET_MODE),
|
||||
P096_CommandTrigger_toString(static_cast<P096_CommandTrigger>(
|
||||
P096_CONFIG_FLAG_GET_CMD_TRIGGER)),
|
||||
spi_bus,
|
||||
P096_CONFIG_GET_COLOR_FOREGROUND,
|
||||
P096_CONFIG_GET_COLOR_BACKGROUND,
|
||||
static_cast<AdaGFXColorDepth>(P096_CONFIG_FLAG_GET_COLORDEPTH),
|
||||
@@ -522,7 +531,8 @@ boolean Plugin_096(uint8_t function, struct EventStruct *event, String& string)
|
||||
P096_CONFIG_ROTATION,
|
||||
P096_CONFIG_FLAG_GET_FONTSCALE,
|
||||
AdaGFXTextPrintMode::ContinueToNextLine,
|
||||
F("epd"))
|
||||
F("epd"),
|
||||
spi_bus)
|
||||
# endif // if P096_USE_EXTENDED_SETTINGS
|
||||
);
|
||||
P096_data_struct *P096_data = static_cast<P096_data_struct *>(getPluginTaskData(event->TaskIndex));
|
||||
|
||||
@@ -75,6 +75,7 @@ P096_data_struct::P096_data_struct(EPD_type_e display,
|
||||
uint8_t fontscaling,
|
||||
AdaGFXTextPrintMode textmode,
|
||||
String commandTrigger,
|
||||
uint8_t spi_bus,
|
||||
uint16_t fgcolor,
|
||||
uint16_t bgcolor,
|
||||
AdaGFXColorDepth colorDepth,
|
||||
@@ -84,7 +85,7 @@ P096_data_struct::P096_data_struct(EPD_type_e display,
|
||||
_xpix(width), _ypix(height),
|
||||
# endif // if !P096_USE_EXTENDED_SETTINGS
|
||||
_rotation(rotation), _fontscaling(fontscaling), _textmode(textmode), _commandTrigger(commandTrigger),
|
||||
_fgcolor(fgcolor), _bgcolor(bgcolor), _colorDepth(colorDepth), _textBackFill(textBackFill)
|
||||
_spi_bus(spi_bus), _fgcolor(fgcolor), _bgcolor(bgcolor), _colorDepth(colorDepth), _textBackFill(textBackFill)
|
||||
{
|
||||
_commandTrigger.toLowerCase();
|
||||
_commandTriggerCmd = _commandTrigger;
|
||||
@@ -124,17 +125,33 @@ bool P096_data_struct::plugin_init(struct EventStruct *event) {
|
||||
|
||||
switch (_display) {
|
||||
case EPD_type_e::EPD_IL3897:
|
||||
eInkScreen = new (std::nothrow) LOLIN_IL3897(_xpix, _ypix, PIN(1), PIN(2), PIN(0), PIN(3)); // HSPI
|
||||
eInkScreen = new (std::nothrow) LOLIN_IL3897(_xpix, _ypix, PIN(1), PIN(2), PIN(0), PIN(3)
|
||||
# ifdef ESP32
|
||||
, 0 == _spi_bus ? SPI : SPI1
|
||||
# endif // ifdef ESP32
|
||||
); // HSPI
|
||||
break;
|
||||
case EPD_type_e::EPD_UC8151D:
|
||||
eInkScreen = new (std::nothrow) LOLIN_UC8151D(_xpix, _ypix, PIN(1), PIN(2), PIN(0), PIN(3)); // HSPI
|
||||
eInkScreen = new (std::nothrow) LOLIN_UC8151D(_xpix, _ypix, PIN(1), PIN(2), PIN(0), PIN(3)
|
||||
# ifdef ESP32
|
||||
, 0 == _spi_bus ? SPI : SPI1
|
||||
# endif // ifdef ESP32
|
||||
); // HSPI
|
||||
break;
|
||||
case EPD_type_e::EPD_SSD1680:
|
||||
eInkScreen = new (std::nothrow) LOLIN_SSD1680(_xpix, _ypix, PIN(1), PIN(2), PIN(0), PIN(3)); // HSPI
|
||||
eInkScreen = new (std::nothrow) LOLIN_SSD1680(_xpix, _ypix, PIN(1), PIN(2), PIN(0), PIN(3)
|
||||
# ifdef ESP32
|
||||
, 0 == _spi_bus ? SPI : SPI1
|
||||
# endif // ifdef ESP32
|
||||
); // HSPI
|
||||
break;
|
||||
# if P096_USE_WAVESHARE_2IN7
|
||||
case EPD_type_e::EPD_WS2IN7:
|
||||
eInkScreen = new (std::nothrow) Waveshare_2in7(_xpix, _ypix, PIN(1), PIN(2), PIN(0), PIN(3)); // HSPI
|
||||
eInkScreen = new (std::nothrow) Waveshare_2in7(_xpix, _ypix, PIN(1), PIN(2), PIN(0), PIN(3)
|
||||
# ifdef ESP32
|
||||
, 0 == _spi_bus ? SPI : SPI1
|
||||
# endif // ifdef ESP32
|
||||
); // HSPI
|
||||
break;
|
||||
# endif // if P096_USE_WAVESHARE_2IN7
|
||||
case EPD_type_e::EPD_MAX:
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include "../../_Plugin_Helper.h"
|
||||
#ifdef USES_P096
|
||||
|
||||
# include "../Globals/SPI1.h"
|
||||
|
||||
# include <Adafruit_GFX.h> // include Adafruit graphics library
|
||||
# include <LOLIN_EPD.h> // include Adafruit Lolin eInk/ePaper library
|
||||
|
||||
@@ -110,11 +112,12 @@ public:
|
||||
uint8_t fontscaling,
|
||||
AdaGFXTextPrintMode textmode,
|
||||
String commandTrigger,
|
||||
uint8_t spi_bus,
|
||||
uint16_t fgcolor = ADAGFX_WHITE,
|
||||
uint16_t bgcolor = ADAGFX_BLACK,
|
||||
AdaGFXColorDepth colorDepth = AdaGFXColorDepth::Monochrome,
|
||||
bool textBackFill = true);
|
||||
P096_data_struct() = delete;
|
||||
P096_data_struct() = delete;
|
||||
virtual ~P096_data_struct();
|
||||
|
||||
bool plugin_init(struct EventStruct *event);
|
||||
@@ -146,6 +149,7 @@ private:
|
||||
uint8_t _fontscaling;
|
||||
AdaGFXTextPrintMode _textmode;
|
||||
String _commandTrigger;
|
||||
uint8_t _spi_bus;
|
||||
uint16_t _fgcolor;
|
||||
uint16_t _bgcolor;
|
||||
AdaGFXColorDepth _colorDepth;
|
||||
|
||||
Reference in New Issue
Block a user