From c073bb8a9208568ae0868198cbe8bd7dfb05c650 Mon Sep 17 00:00:00 2001 From: Rei Vilo Date: Mon, 25 Mar 2024 18:05:56 +0100 Subject: [PATCH] Pre-release 8.0.1 --- README.md | 2 + .../Example_Fast_Line/Example_Fast_Line.ino | 39 +- .../Example_Fast_Orientation.ino | 37 +- .../Example_Fast_Speed/Example_Fast_Speed.ino | 43 +- .../Example_Fast_Temperature.ino | 45 +- library.properties | 2 +- src/PDLS_EXT3_Basic_Fast.h | 24 +- src/Screen_EPD_EXT3.cpp | 862 ++++++++++-------- src/Screen_EPD_EXT3.h | 96 +- src/Terminal12x16e.h | 16 +- src/Terminal16x24e.h | 16 +- src/Terminal6x8e.h | 16 +- src/Terminal8x12e.h | 16 +- src/hV_Board.cpp | 194 ++-- src/hV_Board.h | 73 +- src/hV_Colours565.cpp | 1 + src/hV_Colours565.h | 27 +- src/hV_Common.h | 19 +- src/hV_Configuration.h | 29 +- src/hV_Documentation.h | 13 +- src/hV_Font.h | 43 +- src/hV_Font_Terminal.cpp | 3 +- src/hV_Font_Terminal.h | 23 +- src/hV_HAL_Peripherals.cpp | 240 +++++ src/hV_HAL_Peripherals.h | 108 ++- src/hV_List_Boards.h | 64 +- src/hV_List_Constants.h | 20 +- src/hV_List_Options.h | 13 +- src/hV_List_Screens.h | 329 +++++-- src/hV_List_Screens_Legacy.h | 173 ++++ src/hV_Screen_Buffer.cpp | 111 ++- src/hV_Screen_Buffer.h | 44 +- src/hV_Utilities_Common.cpp | 23 +- src/hV_Utilities_Common.h | 24 +- src/hV_Utilities_PDLS.cpp | 181 +++- src/hV_Utilities_PDLS.h | 77 +- 36 files changed, 2134 insertions(+), 912 deletions(-) create mode 100644 src/hV_HAL_Peripherals.cpp create mode 100644 src/hV_List_Screens_Legacy.h diff --git a/README.md b/README.md index 5f64b22..2ccffe8 100755 --- a/README.md +++ b/README.md @@ -52,6 +52,8 @@ Hardware **Copyright** © Rei Vilo, 2010-2024 +For exclusive use with Pervasive Displays screens + **Licence** [Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)](./LICENCE.md) ![](img/by-sa.svg) diff --git a/examples/Example_Fast_Line/Example_Fast_Line.ino b/examples/Example_Fast_Line/Example_Fast_Line.ino index dcaf65f..db4241e 100755 --- a/examples/Example_Fast_Line/Example_Fast_Line.ino +++ b/examples/Example_Fast_Line/Example_Fast_Line.ino @@ -5,11 +5,12 @@ /// @details Library for Pervasive Displays EXT3 - Basic level /// /// @author Rei Vilo -/// @date 20 Mar 2023 -/// @version 607 +/// @date 21 Mar 2024 +/// @version 801 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +/// @copyright For exclusive use with Pervasive Displays screens /// /// @see ReadMe.txt for references /// @n @@ -34,7 +35,7 @@ // Define structures and classes // Define variables and constants -Screen_EPD_EXT3_Fast myScreen(eScreen_EPD_EXT3_271_09_Fast, boardRaspberryPiPico_RP2040); +Screen_EPD_EXT3_Fast myScreen(eScreen_EPD_271_PS_09, boardRaspberryPiPico_RP2040); // Prototypes @@ -47,10 +48,10 @@ void wait(uint8_t second) { for (uint8_t i = second; i > 0; i--) { - Serial.print(formatString(" > %i \r", i)); + mySerial..print(formatString(" > %i \r", i)); delay(1000); } - Serial.print(" \r"); + mySerial..print(" \r"); } // Functions @@ -61,8 +62,8 @@ void flush_ms() { uint32_t chrono = (uint32_t)millis(); myScreen.flush(); - Serial.print(millis() - chrono); - Serial.println(" ms"); + mySerial..print(millis() - chrono); + mySerial..println(" ms"); } #if (DISPLAY_FAST_LINE == 1) @@ -91,7 +92,7 @@ void displayFastLine() myScreen.dRectangle(index, dy, 32, dy * 4, myColours.grey); chrono = millis(); myScreen.flush(); - Serial.println(formatString("%i - %i = %i", chrono, millis(), millis() - chrono)); + mySerial..println(formatString("%i - %i = %i", chrono, millis(), millis() - chrono)); } } @@ -103,32 +104,32 @@ void displayFastLine() /// void setup() { - Serial.begin(115200); + mySerial..begin(115200); delay(500); - Serial.println(); - Serial.println("=== " __FILE__); - Serial.println("=== " __DATE__ " " __TIME__); - Serial.println(); + mySerial..println(); + mySerial..println("=== " __FILE__); + mySerial..println("=== " __DATE__ " " __TIME__); + mySerial..println(); - Serial.print("begin... "); + mySerial..print("begin... "); myScreen.begin(); - Serial.println(formatString("%s %ix%i", myScreen.WhoAmI().c_str(), myScreen.screenSizeX(), myScreen.screenSizeY())); + mySerial..println(formatString("%s %ix%i", myScreen.WhoAmI().c_str(), myScreen.screenSizeX(), myScreen.screenSizeY())); #if (DISPLAY_FAST_LINE == 1) - Serial.println("DISPLAY_FAST_LINE... "); + mySerial..println("DISPLAY_FAST_LINE... "); myScreen.clear(); displayFastLine(); wait(4); #endif // DISPLAY_FAST_LINE - Serial.println("White... "); + mySerial..println("White... "); myScreen.clear(); flush_ms(); - Serial.println("=== "); - Serial.println(); + mySerial..println("=== "); + mySerial..println(); } // Add loop code diff --git a/examples/Example_Fast_Orientation/Example_Fast_Orientation.ino b/examples/Example_Fast_Orientation/Example_Fast_Orientation.ino index 5234f66..cd70742 100755 --- a/examples/Example_Fast_Orientation/Example_Fast_Orientation.ino +++ b/examples/Example_Fast_Orientation/Example_Fast_Orientation.ino @@ -5,11 +5,12 @@ /// @details Library for Pervasive Displays EXT3 - Basic level /// /// @author Rei Vilo -/// @date 20 Mar 2023 -/// @version 607 +/// @date 21 Mar 2024 +/// @version 801 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +/// @copyright For exclusive use with Pervasive Displays screens /// /// @see ReadMe.txt for references /// @n @@ -34,7 +35,7 @@ // Define structures and classes // Define variables and constants -Screen_EPD_EXT3_Fast myScreen(eScreen_EPD_EXT3_271_09_Fast, boardRaspberryPiPico_RP2040); +Screen_EPD_EXT3_Fast myScreen(eScreen_EPD_271_PS_09, boardRaspberryPiPico_RP2040); // Prototypes @@ -47,10 +48,10 @@ void wait(uint8_t second) { for (uint8_t i = second; i > 0; i--) { - Serial.print(formatString(" > %i \r", i)); + mySerial..print(formatString(" > %i \r", i)); delay(1000); } - Serial.print(" \r"); + mySerial..print(" \r"); } // Functions @@ -61,8 +62,8 @@ void flush_ms() { uint32_t chrono = (uint32_t)millis(); myScreen.flush(); - Serial.print(millis() - chrono); - Serial.println(" ms"); + mySerial..print(millis() - chrono); + mySerial..println(" ms"); } #if (DISPLAY_FAST_ORIENTATION == 1) @@ -88,32 +89,32 @@ void displayFastOrientation() /// void setup() { - Serial.begin(115200); + mySerial..begin(115200); delay(500); - Serial.println(); - Serial.println("=== " __FILE__); - Serial.println("=== " __DATE__ " " __TIME__); - Serial.println(); + mySerial..println(); + mySerial..println("=== " __FILE__); + mySerial..println("=== " __DATE__ " " __TIME__); + mySerial..println(); - Serial.print("begin... "); + mySerial..print("begin... "); myScreen.begin(); - Serial.println(formatString("%s %ix%i", myScreen.WhoAmI().c_str(), myScreen.screenSizeX(), myScreen.screenSizeY())); + mySerial..println(formatString("%s %ix%i", myScreen.WhoAmI().c_str(), myScreen.screenSizeX(), myScreen.screenSizeY())); #if (DISPLAY_FAST_ORIENTATION == 1) - Serial.println("DISPLAY_FAST_ORIENTATION... "); + mySerial..println("DISPLAY_FAST_ORIENTATION... "); myScreen.clear(); displayFastOrientation(); wait(4); #endif // DISPLAY_FAST_ORIENTATION - Serial.println("White... "); + mySerial..println("White... "); myScreen.clear(); flush_ms(); - Serial.println("=== "); - Serial.println(); + mySerial..println("=== "); + mySerial..println(); } // Add loop code diff --git a/examples/Example_Fast_Speed/Example_Fast_Speed.ino b/examples/Example_Fast_Speed/Example_Fast_Speed.ino index 4056ef7..d6bcd3d 100755 --- a/examples/Example_Fast_Speed/Example_Fast_Speed.ino +++ b/examples/Example_Fast_Speed/Example_Fast_Speed.ino @@ -6,11 +6,12 @@ /// @n Based on highView technology /// /// @author Rei Vilo -/// @date 21 Nov 2023 -/// @version 702 +/// @date 21 Mar 2024 +/// @version 801 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +/// @copyright For exclusive use with Pervasive Displays screens /// /// @see ReadMe.md for references /// @n @@ -39,11 +40,9 @@ // Define structures and classes // Define constants and variables -// Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_271, boardRaspberryPiPico_RP2040); -// Screen_EPD_EXT3 myScreen(eScreen_EPD_EXT3_370, boardRaspberryPiPico_RP2040); - -// Screen_EPD_EXT3_Fast myScreen(eScreen_EPD_EXT3_271_09_Fast, boardRaspberryPiPico_RP2040); -Screen_EPD_EXT3_Fast myScreen(eScreen_EPD_EXT3_370_0C_Fast, boardRaspberryPiPico_RP2040); +// Define constants and variables +// Screen_EPD_EXT3 myScreen(eScreen_EPD_271_CS_09, boardRaspberryPiPico_RP2040); +Screen_EPD_EXT3_Fast myScreen(eScreen_EPD_271_PS_09, boardRaspberryPiPico_RP2040); // Prototypes @@ -56,10 +55,10 @@ void wait(uint8_t second) { for (uint8_t i = second; i > 0; i--) { - Serial.print(formatString(" > %i \r", i)); + mySerial..print(formatString(" > %i \r", i)); delay(1000); } - Serial.print(" \r"); + mySerial..print(" \r"); } // Functions @@ -85,7 +84,7 @@ void performTest() // 0 dy = (dz - myScreen.characterSizeY()) / 2; text = myScreen.WhoAmI() + " - " + String(SCREEN_EPD_EXT3_RELEASE); - Serial.println(text); + mySerial..println(text); dx = (x - myScreen.stringSizeX(text)) / 2; myScreen.gText(dx, dy, text); myScreen.dRectangle(0, dz * 0, x, dz, myColours.black); @@ -98,7 +97,7 @@ void performTest() dy += dz; // text = formatString("Global update= %i ms", chrono); text = formatString("Fast update= %i ms", chrono); - Serial.println(text); + mySerial..println(text); dx = (x - myScreen.stringSizeX(text)) / 2; myScreen.gText(dx, dy, text); myScreen.dRectangle(0, dz * 1, x, dz, myColours.black); @@ -112,28 +111,28 @@ void performTest() /// void setup() { - Serial.begin(115200); + mySerial..begin(115200); delay(500); - Serial.println(); - Serial.println("=== " __FILE__); - Serial.println("=== " __DATE__ " " __TIME__); - Serial.println(); + mySerial..println(); + mySerial..println("=== " __FILE__); + mySerial..println("=== " __DATE__ " " __TIME__); + mySerial..println(); - Serial.println("begin... "); + mySerial..println("begin... "); myScreen.begin(); - Serial.println(formatString("%s %ix%i", myScreen.WhoAmI().c_str(), myScreen.screenSizeX(), myScreen.screenSizeY())); + mySerial..println(formatString("%s %ix%i", myScreen.WhoAmI().c_str(), myScreen.screenSizeX(), myScreen.screenSizeY())); - Serial.println("Speed... "); + mySerial..println("Speed... "); myScreen.clear(); performTest(); wait(8); - Serial.println("White... "); + mySerial..println("White... "); myScreen.clear(); myScreen.flush(); - Serial.println("=== "); - Serial.println(); + mySerial..println("=== "); + mySerial..println(); } // Add loop code diff --git a/examples/Example_Fast_Temperature/Example_Fast_Temperature.ino b/examples/Example_Fast_Temperature/Example_Fast_Temperature.ino index 24cf3c1..afbce3b 100644 --- a/examples/Example_Fast_Temperature/Example_Fast_Temperature.ino +++ b/examples/Example_Fast_Temperature/Example_Fast_Temperature.ino @@ -5,11 +5,12 @@ /// @details Library for Pervasive Displays EXT3 - Basic level /// /// @author Rei Vilo -/// @date 21 Jan 2024 -/// @version 704 +/// @date 21 Mar 2024 +/// @version 801 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +/// @copyright For exclusive use with Pervasive Displays screens /// /// @see ReadMe.txt for references /// @n @@ -32,10 +33,9 @@ // Define structures and classes - // Define variables and constants -Screen_EPD_EXT3_Fast myScreen(eScreen_EPD_EXT3_271_09_Fast, boardRaspberryPiPico_RP2040); -// Screen_EPD_EXT3_Fast myScreen(eScreen_EPD_EXT3_271_09_Wide, boardRaspberryPiPico_RP2040); +Screen_EPD_EXT3_Fast myScreen(eScreen_EPD_271_PS_09_Fast, boardRaspberryPiPico_RP2040); +// Screen_EPD_EXT3_Fast myScreen(eScreen_EPD_271_PS_09_Wide, boardRaspberryPiPico_RP2040); // Prototypes @@ -47,16 +47,18 @@ void check(int8_t temperatureC, uint8_t expectedMode) const char * stringMode[] = { "NONE", "GLOBAL", "FAST", "PARTIAL" }; myScreen.setTemperatureC(temperatureC); uint8_t recommendedMode = myScreen.checkTemperatureMode(expectedMode); + // Raspberry Pi SDK core for RP2040 - // Serial.printf("Temperature= %+3i C - Mode: %8s -> %-8s", temperatureC, stringMode[expectedMode], stringMode[recommendedMode]); + // mySerial..printf("Temperature= %+3i C - Mode: %8s -> %-8s", temperatureC, stringMode[expectedMode], stringMode[recommendedMode]); + // Arduino core for RP2040 - Serial.print("Temperature= "); - Serial.print(temperatureC); - Serial.print(" C - Mode: "); - Serial.print(stringMode[expectedMode]); - Serial.print(" -> "); - Serial.print(stringMode[recommendedMode]); - Serial.println(); + mySerial..print("Temperature= "); + mySerial..print(temperatureC); + mySerial..print(" C - Mode: "); + mySerial..print(stringMode[expectedMode]); + mySerial..print(" -> "); + mySerial..print(stringMode[recommendedMode]); + mySerial..println(); } void performTest() @@ -76,21 +78,22 @@ void performTest() /// void setup() { - Serial.begin(115200); + mySerial..begin(115200); - Serial.println(); - Serial.println("=== " __FILE__); - Serial.println("=== " __DATE__ " " __TIME__); - Serial.println(); + mySerial..println(); + mySerial..println("=== " __FILE__); + mySerial..println("=== " __DATE__ " " __TIME__); + mySerial..println(); + // Screen myScreen.begin(); - Serial.println(formatString("=== %s %ix%i", myScreen.WhoAmI().c_str(), myScreen.screenSizeX(), myScreen.screenSizeY())); + mySerial..println(formatString("=== %s %ix%i", myScreen.WhoAmI().c_str(), myScreen.screenSizeX(), myScreen.screenSizeY())); performTest(); - Serial.println("=== "); - Serial.println(); + mySerial..println("=== "); + mySerial..println(); } // Add loop code diff --git a/library.properties b/library.properties index ce30d17..babfb26 100755 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=PDLS_EXT3_Basic_Fast -version=7.0.4 +version=8.0.1 author=Rei Vilo for Pervasive Displays maintainer=Rei Vilo sentence=Library for Pervasive Displays iTC monochrome screens with embedded fast update and EXT3-1 board diff --git a/src/PDLS_EXT3_Basic_Fast.h b/src/PDLS_EXT3_Basic_Fast.h index 586c71e..a3c1138 100755 --- a/src/PDLS_EXT3_Basic_Fast.h +++ b/src/PDLS_EXT3_Basic_Fast.h @@ -1,24 +1,34 @@ /// -/// @file PDLS_EXT3_Basic_Global.h +/// @file PDLS_EXT3_Basic_Fast.h /// @brief Driver for Pervasive Displays iTC screens and EXT3 extension board /// /// @details Project Pervasive Displays Library Suite /// @n Based on highView technology /// /// @author Rei Vilo -/// @date 21 Dec 2023 -/// @version 703 +/// @date 21 Mar 2024 +/// @version 801 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright All rights reserved +/// @copyright For exclusive use with Pervasive Displays screens /// /// * Basic edition: for hobbyists and for basic usage /// @n Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +/// @see https://creativecommons.org/licenses/by-sa/4.0/ /// -/// * Evaluation edition: for professionals or organisations -/// @n All rights reserved, evaluation only, no commercial usage +/// @n Consider the Evaluation or Commercial editions for professionals or organisations and for commercial usage /// -/// * Commercial edition: for professionals or organisations, for commercial usage +/// * Evaluation edition: for professionals or organisations, evaluation only, no commercial usage +/// @n All rights reserved +/// +/// * Commercial edition: for professionals or organisations, commercial usage +/// @n All rights reserved +/// +/// * Viewer edition: for professionals or organisations +/// @n All rights reserved +/// +/// * Documentation /// @n All rights reserved /// @@ -29,7 +39,7 @@ /// /// @brief Library release number /// -#define PDLS_EXT3_BASIC_FAST_RELEASE 703 +#define PDLS_EXT3_BASIC_FAST_RELEASE 801 #include "Screen_EPD_EXT3.h" diff --git a/src/Screen_EPD_EXT3.cpp b/src/Screen_EPD_EXT3.cpp index 56cebf3..ef67036 100755 --- a/src/Screen_EPD_EXT3.cpp +++ b/src/Screen_EPD_EXT3.cpp @@ -10,6 +10,7 @@ // // Copyright (c) Rei Vilo, 2010-2024 // Licence Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +// Portions (c) Pervasive Displays, 2010-2024 // // Release 509: Added eScreen_EPD_EXT3_271_Fast // Release 527: Added support for ESP32 PSRAM @@ -27,55 +28,49 @@ // Release 701: Added support for eScreen_EPD_EXT3_290_0F_Wide xE2290KS0Fx // Release 702: Added support for eScreen_EPD_EXT3_206_0E_Wide xE2206KS0Ex // Release 703: Added support for eScreen_EPD_EXT3_152_0J_Wide xE2152KS0Jx +// Release 800: Read OTP memory +// Release 801: Improved OTP implementation // // Library header #include "Screen_EPD_EXT3.h" -#if defined(ENERGIA) -/// -/// @brief Proxy for SPISettings -/// @details Not implemented in Energia -/// @see https://www.arduino.cc/en/Reference/SPISettings -/// -struct _SPISettings_s -{ - uint32_t clock; ///< in Hz, checked against SPI_CLOCK_MAX = 16000000 - uint8_t bitOrder; ///< LSBFIRST, MSBFIRST - uint8_t dataMode; ///< SPI_MODE0, SPI_MODE1, SPI_MODE2, SPI_MODE3 -}; -/// -/// @brief SPI settings for screen -/// -_SPISettings_s _settingScreen; -#else -/// -/// @brief SPI settings for screen -/// -SPISettings _settingScreen; -#endif // ENERGIA - -#ifndef SPI_CLOCK_MAX -#define SPI_CLOCK_MAX 16000000 -#endif +#define DEBUG_OTP 1 // // === COG section // /// @cond -// Common settings -// 0x00, soft-reset, temperature, active temperature, PSR0, PSR1 -uint8_t indexE5_data[] = {0x19}; // Temperature 0x19 = 25 °C -uint8_t indexE0_data[] = {0x02}; // Activate temperature -uint8_t index00_data[] = {0xff, 0x8f}; // PSR, constant -uint8_t index50a_data[] = {0x27}; // Only 154 213 266 and 370 screens, constant -uint8_t index50b_data[] = {0x07}; // Only 154 213 266 and 370 screens, constant -uint8_t index50c_data[] = {0x07}; // All screens, constant +void Screen_EPD_EXT3_Fast::COG_reset() +{ + // Application note § 2. Power on COG driver + switch (u_codeSize) + { + case SIZE_565: // 5.65" + case SIZE_581: // 5.81" + case SIZE_741: // 7.41" + + b_reset(200, 20, 200, 50, 5); // medium + break; + + case SIZE_969: // 9.69" + case SIZE_1198: // 11.98" + + b_reset(200, 20, 200, 200, 5); // large + break; + + default: + + b_reset(5, 5, 10, 5, 5); // small + break; + } // u_codeSize +} void Screen_EPD_EXT3_Fast::COG_initial(uint8_t updateMode) { - if (_flag152 == true) + // Application note § 4. Input initial command + if ((u_eScreen_EPD == eScreen_EPD_150_KS_0J) or (u_eScreen_EPD == eScreen_EPD_152_KS_0J)) { // Soft reset b_sendCommand8(0x12); @@ -98,34 +93,31 @@ void Screen_EPD_EXT3_Fast::COG_initial(uint8_t updateMode) else { // Work settings - uint8_t indexE0_work[1]; // Activate temperature - uint8_t indexE5_work[1]; // Temperature + uint8_t indexE5_work; // Temperature uint8_t index00_work[2]; // PSR - indexE0_work[0] = indexE0_data[0]; - indexE5_data[0] = u_temperature; - if ((u_codeExtra & FEATURE_FAST) and (updateMode != UPDATE_GLOBAL)) // Specific settings for fast update + // FILM_P and FILM_K already checked + if (updateMode != UPDATE_GLOBAL) // Specific settings for fast update { - indexE5_work[0] = indexE5_data[0] | 0x40; // temperature | 0x40 - index00_work[0] = index00_data[0] | 0x10; // PSR0 | 0x10 - index00_work[1] = index00_data[1] | 0x02; // PSR1 | 0x02 + indexE5_work = u_temperature | 0x40; // temperature | 0x40 + index00_work[0] = COG_initialData[0] | 0x10; // PSR0 | 0x10 + index00_work[1] = COG_initialData[1] | 0x02; // PSR1 | 0x02 } else // Common settings { - indexE5_work[0] = indexE5_data[0]; // Temperature - index00_work[0] = index00_data[0]; // PSR0 - index00_work[1] = index00_data[1]; // PSR1 + indexE5_work = u_temperature; // Temperature + index00_work[0] = COG_initialData[0]; // PSR0 + index00_work[1] = COG_initialData[1]; // PSR1 } // u_codeExtra updateMode // New algorithm - uint8_t index00_reset[] = {0x0e}; - b_sendIndexData(0x00, index00_reset, 1); // Soft-reset + b_sendCommandData8(0x00, 0x0e); // Soft-reset b_waitBusy(); - b_sendIndexData(0xe5, indexE5_work, 1); // Input Temperature - b_sendIndexData(0xe0, indexE0_work, 1); // Activate Temperature + b_sendCommandData8(0xe5, indexE5_work); // Input Temperature + b_sendCommandData8(0xe0, 0x02); // Activate Temperature - if (u_codeSize == 0x29) // No PSR + if (u_codeSize == SIZE_290) // No PSR { b_sendCommandData8(0x4d, 0x55); b_sendCommandData8(0xe9, 0x02); @@ -136,106 +128,289 @@ void Screen_EPD_EXT3_Fast::COG_initial(uint8_t updateMode) } // Specific settings for fast update, all screens - if ((u_codeExtra & FEATURE_FAST) and (updateMode != UPDATE_GLOBAL)) + // if (((u_codeFilm == FILM_P) or (u_codeFilm == FILM_K)) and (updateMode != UPDATE_GLOBAL)) + // FILM_P and FILM_K already checked + if (updateMode != UPDATE_GLOBAL) { - uint8_t index50c_work[1]; // Vcom - index50c_work[0] = index50c_data[0]; // 0x07 - b_sendIndexData(0x50, index50c_work, 1); // Vcom and data interval setting + b_sendCommandData8(0x50, 0x07); // Vcom and data interval setting } - // Additional settings for fast update, 154 213 266 and 370 screens (_flag50) - if ((u_codeExtra & FEATURE_FAST) and (updateMode != UPDATE_GLOBAL) and _flag50) + // Additional settings for fast update, 154 213 266 and 370 screens (s_flag50) + // if (((u_codeFilm == FILM_P) or (u_codeFilm == FILM_K)) and (updateMode != UPDATE_GLOBAL) and s_flag50) + // FILM_P and FILM_K already checked + if ((updateMode != UPDATE_GLOBAL) and s_flag50) { - uint8_t index50a_work[1]; // Vcom - index50a_work[0] = index50a_data[0]; // 0x27 - b_sendIndexData(0x50, index50a_work, 1); // Vcom and data interval setting + b_sendCommandData8(0x50, 0x27); // Vcom and data interval setting } } } -void Screen_EPD_EXT3_Fast::COG_getUserData() +void Screen_EPD_EXT3_Fast::COG_getDataOTP() { - if (_flag152 == true) +#if defined(ARDUINO_FEATHER_ESP32) + + hV_HAL_SPI3_define(SCK, MOSI) // SCK SDA + +#elif defined(ARDUINO_XIAO_ESP32C3) + + // Board Xiao ESP32-C3 crashes if pins are not specified. + hV_HAL_SPI3_define(8, 9) // SCK SDA + +#elif defined(ARDUINO_NANO_ESP32) + + // Board Arduino Nano ESP32 arduino_nano_nora v2.0.11 + hV_HAL_SPI3_define(SCK, MOSI) // SCK SDA + +#elif defined(ARDUINO_ARCH_ESP32) + + // void begin(int8_t sck=-1, int8_t miso=-1, int8_t mosi=-1, int8_t ss=-1); + // Board ESP32-Pico-DevKitM-2 crashes if pins are not specified. + hV_HAL_SPI3_define(14, 12) // SCK SDA + +#else + + hV_HAL_SPI3_define(SCK, MOSI); // SCK SDA + +#endif // ARDUINO + + // Application note § 3. Read OTP memory + // Register 0x50 flag + // Additional settings for fast update, 154 213 266 and 370 screens (s_flag50) + switch (u_eScreen_EPD) + { + case eScreen_EPD_154_PS_0C: + case eScreen_EPD_154_KS_0C: + case eScreen_EPD_206_KS_0E: + case eScreen_EPD_213_PS_0E: + case eScreen_EPD_213_KS_0E: + case eScreen_EPD_266_PS_0C: + case eScreen_EPD_266_KS_0C: + case eScreen_EPD_271_KS_0C: // 2.71(A) + case eScreen_EPD_370_PS_0C: + case eScreen_EPD_370_PS_0C_Touch: + case eScreen_EPD_370_KS_0C: + case eScreen_EPD_437_PS_0C: + case eScreen_EPD_437_KS_0C: + + s_flag50 = true; + break; + + default: + + s_flag50 = false; + break; + } + + // Screens with no OTP + if ((u_eScreen_EPD == eScreen_EPD_290_KS_0F) or (u_eScreen_EPD == eScreen_EPD_150_KS_0J) or (u_eScreen_EPD == eScreen_EPD_152_KS_0J)) { - // Empty - _flag50 = false; + u_flagOTP = true; + return; // No PSR } - else + + // GPIO + COG_reset(); // Although not mentioned, reset to ensure stable state + + // Debug +#if (DEBUG_OTP == 1) + uint8_t debugOTP[4096] = {0x00}; + uint16_t debugIndex = 0; +#endif // DEBUG_OTP + + // Read OTP + uint8_t ui8 = 0; + uint16_t offsetA5 = 0x0000; + uint16_t offsetPSR = 0x0000; + uint16_t u_readBytes = 2; + + digitalWrite(b_pin.panelDC, LOW); // Command + digitalWrite(b_pin.panelCS, LOW); // Select + hV_HAL_SPI3_write(0xa2); + digitalWrite(b_pin.panelCS, HIGH); // Unselect + delay(10); + + digitalWrite(b_pin.panelDC, HIGH); // Data + digitalWrite(b_pin.panelCS, LOW); // Select + ui8 = hV_HAL_SPI3_read(); // Dummy + digitalWrite(b_pin.panelCS, HIGH); // Unselect + // hV_HAL_log(LEVEL_DEBUG, "Dummy read 0x%02x", ui8); + + digitalWrite(b_pin.panelCS, LOW); // Select + ui8 = hV_HAL_SPI3_read(); // First byte to be checked + digitalWrite(b_pin.panelCS, HIGH); // Unselect + // hV_HAL_log(LEVEL_INFO, "ui8= 0x%02x", ui8); + +#if (DEBUG_OTP == 1) + debugOTP[debugIndex] = ui8; + debugIndex += 1; +#endif // DEBUG_OTP + + // Check bank + uint8_t bank = ((ui8 == 0xa5) ? 0 : 1); + + switch (u_eScreen_EPD) { - uint16_t u_codeSizeType = u_eScreen_EPD_EXT3 & 0xffff; + case eScreen_EPD_271_KS_09: + case eScreen_EPD_271_KS_09_Touch: - // Size cSize cType Driver - switch (u_codeSizeType) - { - case 0x150C: // 1.54” = 0xcf, 0x02 - case 0x210E: // 2.13” = 0xcf, 0x02 - case 0x260C: // 2.66” = 0xcf, 0x02 + offsetPSR = 0x004b; + offsetA5 = 0x0000; - index00_data[0] = 0xcf; - index00_data[1] = 0x02; - _flag50 = true; - break; + if (bank > 0) + { + COG_initialData[0] = 0xcf; + COG_initialData[1] = 0x82; + return; + } + break; - case 0x200E: // 2.06” = 0xcf, 0x02 + case eScreen_EPD_271_PS_09: + case eScreen_EPD_271_PS_09_Touch: + // case eScreen_EPD_287_KS_09: + case eScreen_EPD_287_PS_09: - index00_data[0] = 0xcf; - index00_data[1] = 0x02; - _flag50 = true; - break; + offsetPSR = 0x004b; + offsetA5 = 0x0000; - case 0x2709: // 2.71” = 0xcf, 0x8d + if (bank > 0) + { + mySerial.println(); + mySerial.println(formatString("hV * OTP check failed - Bank %i, first 0x%02x, expected 0x%02x", bank, ui8, 0xa5)); + mySerial.flush(); + while (true); + } + break; - index00_data[0] = 0xcf; - index00_data[1] = 0x8d; - _flag50 = false; - break; + case eScreen_EPD_154_KS_0C: + case eScreen_EPD_154_PS_0C: + case eScreen_EPD_266_KS_0C: + case eScreen_EPD_266_PS_0C: + case eScreen_EPD_271_KS_0C: // 2.71(A) + case eScreen_EPD_370_KS_0C: + case eScreen_EPD_370_PS_0C: + case eScreen_EPD_370_PS_0C_Touch: + case eScreen_EPD_437_PS_0C: - case 0x2809: // 2.87” = 0xcf, 0x8d + offsetPSR = (bank == 0) ? 0x0fb4 : 0x1fb4; + offsetA5 = (bank == 0) ? 0x0000 : 0x1000; - index00_data[0] = 0xcf; - index00_data[1] = 0x8d; - _flag50 = false; - break; + break; - case 0x290F: // 2.90” - No PSR + case eScreen_EPD_206_KS_0E: + case eScreen_EPD_213_KS_0E: + case eScreen_EPD_213_PS_0E: - index00_data[0] = 0x00; - index00_data[1] = 0x00; - _flag50 = false; - break; + offsetPSR = (bank == 0) ? 0x0b1b : 0x171b; + offsetA5 = (bank == 0) ? 0x0000 : 0x0c00; + break; - case 0x370C: // 3.70” = 0xcf, 0x0f + case eScreen_EPD_417_PS_0D: + case eScreen_EPD_417_KS_0D: - index00_data[0] = 0xcf; - index00_data[1] = 0x8f; - _flag50 = true; - break; + offsetPSR = (bank == 0) ? 0x0b1f : 0x171f; + offsetA5 = (bank == 0) ? 0x0000 : 0x0c00; + break; - case 0x410D:// 4.17” = 0x0f, 0x0e + default: - index00_data[0] = 0x0f; - index00_data[1] = 0x0e; - _flag50 = false; - break; + mySerial.println(formatString("hV * OTP check failed - Screen %i-%cS-0%c not supported", u_codeSize, u_codeFilm, u_codeDriver)); + mySerial.flush(); + while (true); + break; + } - case 0x430C: // 4.37” = 0x0f, 0x0e + // Check second bank + if (offsetA5 > 0x0000) + { + for (uint16_t index = 1; index < offsetA5; index += 1) + { + digitalWrite(b_pin.panelCS, LOW); // Select + ui8 = hV_HAL_SPI3_read(); + digitalWrite(b_pin.panelCS, HIGH); // Unselect + +#if (DEBUG_OTP == 1) + debugOTP[debugIndex] = ui8; + debugIndex += 1; +#endif // DEBUG_OTP + } - index00_data[0] = 0x0f; - index00_data[1] = 0x0e; - _flag50 = true; - break; + digitalWrite(b_pin.panelCS, LOW); // Select + ui8 = hV_HAL_SPI3_read(); // First byte to be checked + digitalWrite(b_pin.panelCS, HIGH); // Unselect - case 0x580B: // 5.81" +#if (DEBUG_OTP == 1) + debugOTP[debugIndex] = ui8; + debugIndex += 1; +#endif // DEBUG_OTP - _flag50 = false; - break; + if (ui8 != 0xa5) + { + mySerial.println(); + mySerial.println(formatString("hV * OTP check failed - Bank %i, first 0x%02x, expected 0x%02x", bank, ui8, 0xa5)); + mySerial.flush(); + while (true); + } + } - default: + mySerial.println(formatString("hV . OTP check passed - Bank %i, first 0x%02x as expected", bank, ui8)); - _flag50 = false; - break; + // Ignore bytes 1..offsetPSR + for (uint16_t index = offsetA5 + 1; index < offsetPSR; index += 1) + { + digitalWrite(b_pin.panelCS, LOW); // Select + ui8 = hV_HAL_SPI3_read(); + digitalWrite(b_pin.panelCS, HIGH); // Unselect + +#if (DEBUG_OTP == 1) + debugOTP[debugIndex] = ui8; + debugIndex += 1; +#endif // DEBUG_OTP + } + + // Populate COG_initialData + for (uint16_t index = 0; index < u_readBytes; index += 1) + { + digitalWrite(b_pin.panelCS, LOW); // Select + ui8 = hV_HAL_SPI3_read(); // Read OTP + COG_initialData[index] = ui8; + digitalWrite(b_pin.panelCS, HIGH); // Unselect + +#if (DEBUG_OTP == 1) + debugOTP[debugIndex] = ui8; + debugIndex += 1; +#endif // DEBUG_OTP + } + + u_flagOTP = true; + + // Debug COG_initialData +#if (DEBUG_OTP == 1) + debugIndex |= 0x0f; + debugIndex += 1; + mySerial.print(formatString("const uint8_t debugOTP[%i] =", debugIndex)); + mySerial.println(); + mySerial.print("{"); + for (uint16_t index = 0; index < debugIndex; index += 1) + { + if ((index % 8) == 0) + { + mySerial.println(); + mySerial.print(" "); + } + + mySerial.print(formatString("0x%02x", debugOTP[index])); + mySerial.print(formatString("%s ", (index + 1 < debugIndex ? "," : " "))); // no comma on last value + + if (((index + 1) % 8) == 0) + { + mySerial.print(formatString(" // 0x%04x..%04x", index - 7, index)); } } + mySerial.println(); + + mySerial.print(formatString("} // %i", debugIndex)); + mySerial.println(); +#endif // DEBUG_OTP } void Screen_EPD_EXT3_Fast::COG_sendImageDataFast() @@ -243,7 +418,7 @@ void Screen_EPD_EXT3_Fast::COG_sendImageDataFast() uint8_t * nextBuffer = u_newImage; uint8_t * previousBuffer = u_newImage + u_pageColourSize; - if (_flag152 == true) + if ((u_eScreen_EPD == eScreen_EPD_150_KS_0J) or (u_eScreen_EPD == eScreen_EPD_152_KS_0J)) { b_sendIndexData(0x24, previousBuffer, u_frameSize); // Previous frame b_sendIndexData(0x26, nextBuffer, u_frameSize); // Next frame @@ -258,21 +433,22 @@ void Screen_EPD_EXT3_Fast::COG_sendImageDataFast() void Screen_EPD_EXT3_Fast::COG_update(uint8_t updateMode) { - if (_flag152 == true) + // Application note § 6. Send updating command + if ((u_eScreen_EPD == eScreen_EPD_150_KS_0J) or (u_eScreen_EPD == eScreen_EPD_152_KS_0J)) { - b_waitBusy(LOW); // 150 specific + b_waitBusy(LOW); // 152 specific b_sendCommand8(0x20); // Display Refresh digitalWrite(b_pin.panelCS, HIGH); // CS# = 1 - b_waitBusy(LOW); // 150 specific + b_waitBusy(LOW); // 152 specific } else { - // Specific settings for fast update, 154 213 266 and 370 screens (_flag50) - if ((u_codeExtra & FEATURE_FAST) and (updateMode != UPDATE_GLOBAL) and _flag50) + // Specific settings for fast update, 154 213 266 and 370 screens (s_flag50) + // FILM_P and FILM_K already checked + if ((updateMode != UPDATE_GLOBAL) and s_flag50) + { - uint8_t index50b_work[1]; // Vcom - index50b_work[0] = index50b_data[0]; // 0x07 - b_sendIndexData(0x50, index50b_work, 1); // Vcom and data interval setting + b_sendCommandData8(0x50, 0x07); // Vcom and data interval setting } b_sendCommand8(0x04); // Power on @@ -287,7 +463,8 @@ void Screen_EPD_EXT3_Fast::COG_update(uint8_t updateMode) void Screen_EPD_EXT3_Fast::COG_powerOff() { - if (_flag152 == true) + // Application note § 7. Turn-off DC/DC + if ((u_eScreen_EPD == eScreen_EPD_150_KS_0J) or (u_eScreen_EPD == eScreen_EPD_152_KS_0J)) { // Empty } @@ -306,148 +483,177 @@ void Screen_EPD_EXT3_Fast::COG_powerOff() // // === Class section // -Screen_EPD_EXT3_Fast::Screen_EPD_EXT3_Fast(eScreen_EPD_EXT3_t eScreen_EPD_EXT3, pins_t board) +Screen_EPD_EXT3_Fast::Screen_EPD_EXT3_Fast(eScreen_EPD_t eScreen_EPD_EXT3, pins_t board) { - u_eScreen_EPD_EXT3 = eScreen_EPD_EXT3; + u_eScreen_EPD = eScreen_EPD_EXT3; b_pin = board; u_newImage = 0; // nullptr } void Screen_EPD_EXT3_Fast::begin() { - u_codeExtra = (u_eScreen_EPD_EXT3 >> 16) & 0xff; - u_codeSize = (u_eScreen_EPD_EXT3 >> 8) & 0xff; - u_codeType = u_eScreen_EPD_EXT3 & 0xff; - _screenColourBits = 2; // BWR and BWRY - - _flag152 = ((u_codeSize == 0x15) and (u_codeType == 0x4A)); + u_eScreen_EPD = u_eScreen_EPD; + u_codeSize = SCREEN_SIZE(u_eScreen_EPD); + u_codeFilm = SCREEN_FILM(u_eScreen_EPD); + u_codeDriver = SCREEN_DRIVER(u_eScreen_EPD); + u_codeExtra = SCREEN_EXTRA(u_eScreen_EPD); + v_screenColourBits = 2; // BWR and BWRY - // Configure board - switch (u_codeSize) + // Checks + switch (u_codeFilm) { - case 0x58: // 5.81" - case 0x74: // 7.41" + case FILM_P: // BWR, fast update + case FILM_K: // BWR, fast update and wide temperature - b_begin(b_pin, FAMILY_MEDIUM, 50); break; default: - b_begin(b_pin, FAMILY_SMALL, 50); + mySerial.println(); + mySerial.println(formatString("hV * Screen %i-%cS-0%c with no fast update", u_codeSize, u_codeFilm, u_codeDriver)); + while (true); break; } + // Configure board switch (u_codeSize) { - case 0x15: // 1.54" + case SIZE_581: // 5.81" + case SIZE_741: // 7.41" - if (_flag152) - { - _screenSizeV = 200; // vertical = wide size - _screenSizeH = 200; // horizontal = small size - _screenDiagonal = 152; + b_begin(b_pin, FAMILY_MEDIUM, 0); + break; - } - else - { - _screenSizeV = 152; // vertical = wide size - _screenSizeH = 152; // horizontal = small size - _screenDiagonal = 154; - } + case SIZE_969: // 9.69" + case SIZE_1198: // 11.98" + + b_begin(b_pin, FAMILY_LARGE, 50); break; - case 0x20: // 2.06" + default: - _screenSizeV = 248; // vertical = wide size - _screenSizeH = 128; // horizontal = small size - _screenDiagonal = 206; + b_begin(b_pin, FAMILY_SMALL, 0); break; + } - case 0x21: // 2.13" + // Sizes + switch (u_codeSize) + { + case SIZE_150: // 1.50" + case SIZE_152: // 1.52" - _screenSizeV = 212; // vertical = wide size - _screenSizeH = 104; // horizontal = small size - _screenDiagonal = 213; + v_screenSizeV = 200; // vertical = wide size + v_screenSizeH = 200; // horizontal = small size break; - case 0x26: // 2.66" + case SIZE_154: // 1.54" - _screenSizeV = 296; // vertical = wide size - _screenSizeH = 152; // horizontal = small size - _screenDiagonal = 266; + v_screenSizeV = 152; // vertical = wide size + v_screenSizeH = 152; // horizontal = small size break; - case 0x27: // 2.71" and 2.71"-Touch + case SIZE_206: // 2.06" - _screenSizeV = 264; // vertical = wide size - _screenSizeH = 176; // horizontal = small size - _screenDiagonal = 271; + v_screenSizeV = 248; // vertical = wide size + v_screenSizeH = 128; // horizontal = small size break; - case 0x28: // 2.87" + case SIZE_213: // 2.13" - _screenSizeV = 296; // vertical = wide size - _screenSizeH = 128; // horizontal = small size - _screenDiagonal = 287; + v_screenSizeV = 212; // vertical = wide size + v_screenSizeH = 104; // horizontal = small size break; - case 0x29: // 2.90" + case SIZE_266: // 2.66" - _screenSizeV = 384; // vertical = wide size - _screenSizeH = 168; // horizontal = small size - _screenDiagonal = 290; + v_screenSizeV = 296; // vertical = wide size + v_screenSizeH = 152; // horizontal = small size break; - case 0x37: // 3.70" and 3.70"-Touch + case SIZE_271: // 2.71" and 2.71"-Touch - _screenSizeV = 416; // vertical = wide size - _screenSizeH = 240; // horizontal = small size - _screenDiagonal = 370; + v_screenSizeV = 264; // vertical = wide size + v_screenSizeH = 176; // horizontal = small size break; - case 0x41: // 4.17" + case SIZE_287: // 2.87" - _screenSizeV = 300; // vertical = wide size - _screenSizeH = 400; // horizontal = small size - _screenDiagonal = 417; + v_screenSizeV = 296; // vertical = wide size + v_screenSizeH = 128; // horizontal = small size break; - case 0x43: // 4.37" + case SIZE_290: // 2.90" - _screenSizeV = 480; // vertical = wide size - _screenSizeH = 176; // horizontal = small size - _screenDiagonal = 437; + v_screenSizeV = 384; // vertical = wide size + v_screenSizeH = 168; // horizontal = small size break; - case 0x56: // 5.65" + case SIZE_370: // 3.70" and 3.70"-Touch - _screenSizeV = 600; // v = wide size - _screenSizeH = 448; // h = small size - _screenDiagonal = 565; + v_screenSizeV = 416; // vertical = wide size + v_screenSizeH = 240; // horizontal = small size break; - case 0x58: // 5.81" + case SIZE_417: // 4.17" - _screenSizeV = 720; // v = wide size - _screenSizeH = 256; // h = small size - _screenDiagonal = 581; + v_screenSizeV = 300; // vertical = wide size + v_screenSizeH = 400; // horizontal = small size break; - case 0x74: // 7.40" + case SIZE_437: // 4.37" - _screenSizeV = 800; // v = wide size - _screenSizeH = 480; // h = small size - _screenDiagonal = 741; + v_screenSizeV = 480; // vertical = wide size + v_screenSizeH = 176; // horizontal = small size break; + // Those screens are not available with embedded fast update + // case SIZE_565: // 5.65" + // + // v_screenSizeV = 600; // v = wide size + // v_screenSizeH = 448; // h = small size + // break; + // + // case SIZE_581: // 5.81" + // + // v_screenSizeV = 720; // v = wide size + // v_screenSizeH = 256; // h = small size + // break; + // + // case SIZE_741: // 7.41" + // + // v_screenSizeV = 800; // v = wide size + // v_screenSizeH = 480; // h = small size + // break; + // + // case SIZE_969: // 9.69" + // + // v_screenSizeV = 672; // v = wide size + // v_screenSizeH = 960; // Actually, 960 = 480 x 2, h = small size + // break; + // + // case SIZE_1198: // 11.98" + // + // v_screenSizeV = 768; // v = wide size + // v_screenSizeH = 960; // Actually, 960 = 480 x 2, h = small size + // break; + default: + mySerial.println(); + mySerial.println(formatString("hV * Screen %i-%cS-0%c is not supported", u_codeSize, u_codeFilm, u_codeDriver)); + while (true); break; } // u_codeSize + v_screenDiagonal = u_codeSize; + + // Report + mySerial.println(formatString("= Screen %s %ix%i", WhoAmI().c_str(), screenSizeX(), screenSizeY())); + mySerial.println(formatString("= PDLS %s v%i.%i.%i", SCREEN_EPD_EXT3_VARIANT, SCREEN_EPD_EXT3_RELEASE / 100, (SCREEN_EPD_EXT3_RELEASE / 10) % 10, SCREEN_EPD_EXT3_RELEASE % 10)); + - u_bufferDepth = _screenColourBits; // 2 colours - u_bufferSizeV = _screenSizeV; // vertical = wide size - u_bufferSizeH = _screenSizeH / 8; // horizontal = small size 112 / 8, 1 bit per pixel + u_bufferDepth = v_screenColourBits; // 2 colours + u_bufferSizeV = v_screenSizeV; // vertical = wide size + u_bufferSizeH = v_screenSizeH / 8; // horizontal = small size 112 / 8, 1 bit per pixel // Force conversion for two unit16_t multiplication into uint32_t. // Actually for 1 colour; BWR requires 2 pages. @@ -457,8 +663,8 @@ void Screen_EPD_EXT3_Fast::begin() // 9.69 and 11.98 combine two half-screens, hence two frames with adjusted size switch (u_codeSize) { - case 0x96: // 9.69" - case 0xB9: // 11.98" + case SIZE_969: // 9.69" + case SIZE_1198: // 11.98" u_frameSize = u_pageColourSize / 2; break; @@ -491,142 +697,70 @@ void Screen_EPD_EXT3_Fast::begin() memset(u_newImage, 0x00, u_pageColourSize * u_bufferDepth); - // Initialise the /CS pins - pinMode(b_pin.panelCS, OUTPUT); - digitalWrite(b_pin.panelCS, HIGH); // CS# = 1 - - // New generic solution - pinMode(b_pin.panelDC, OUTPUT); - pinMode(b_pin.panelReset, OUTPUT); - pinMode(b_pin.panelBusy, INPUT); // All Pins 0 + // Turn SPI on, initialise GPIOs and set GPIO levels + // Reset panel and get tables + resume(); - // Initialise Flash /CS as HIGH - if (b_pin.flashCS != NOT_CONNECTED) - { - pinMode(b_pin.flashCS, OUTPUT); - digitalWrite(b_pin.flashCS, HIGH); - } - - // Initialise slave panel /CS as HIGH - if (b_pin.panelCSS != NOT_CONNECTED) - { - pinMode(b_pin.panelCSS, OUTPUT); - digitalWrite(b_pin.panelCSS, HIGH); - } - - // Initialise slave Flash /CS as HIGH - if (b_pin.flashCSS != NOT_CONNECTED) - { - pinMode(b_pin.flashCSS, OUTPUT); - digitalWrite(b_pin.flashCSS, HIGH); - } - - // Initialise SD-card /CS as HIGH - if (b_pin.cardCS != NOT_CONNECTED) + // Fonts + hV_Screen_Buffer::begin(); // Standard + if (f_fontMax() > 0) { - pinMode(b_pin.cardCS, OUTPUT); - digitalWrite(b_pin.cardCS, HIGH); + f_selectFont(0); } + f_fontSolid = false; - // Initialise SPI - _settingScreen = {4000000, MSBFIRST, SPI_MODE0}; - -#if defined(ENERGIA) - - SPI.begin(); - SPI.setBitOrder(_settingScreen.bitOrder); - SPI.setDataMode(_settingScreen.dataMode); - SPI.setClockDivider(SPI_CLOCK_MAX / min(SPI_CLOCK_MAX, _settingScreen.clock)); - -#else - -#if defined(ARDUINO_XIAO_ESP32C3) - - // Board Xiao ESP32-C3 crashes if pins are specified. - SPI.begin(8, 9, 10); // SCK MISO MOSI - -#elif defined(ARDUINO_NANO_ESP32) - - // Board Arduino Nano ESP32 arduino_nano_nora v2.0.11 - SPI.begin(); - -#elif defined(ARDUINO_ARCH_ESP32) - - // Board ESP32-Pico-DevKitM-2 crashes if pins are not specified. - SPI.begin(14, 12, 13); // SCK MISO MOSI + // Orientation + setOrientation(0); -#else + v_penSolid = false; + u_invert = false; - SPI.begin(); + setTemperatureC(25); // 25 Celsius = 77 Fahrenheit +} -#endif // ARDUINO_ARCH_ESP32 +String Screen_EPD_EXT3_Fast::WhoAmI() +{ + char work[64] = {0}; + u_WhoAmI(work); - SPI.beginTransaction(_settingScreen); + return formatString("iTC %i.%02i\"%s", v_screenDiagonal / 100, v_screenDiagonal % 100, work); +} -#endif // ENERGIA +void Screen_EPD_EXT3_Fast::resume() +{ + b_resume(); - // Reset - switch (u_codeSize) + // Check type and get tables + if (u_flagOTP == false) { - case 0x56: // 5.65" - case 0x58: // 5.81" - case 0x74: // 7.40" - - b_reset(200, 20, 200, 50, 5); // medium - break; - - case 0x96: // 9.69" - case 0xB9: // 11.98" - - b_reset(200, 20, 200, 200, 5); // large - break; - - default: + hV_HAL_SPI3_begin(); // Define 3-wire SPI pins + COG_getDataOTP(); // 3-wire SPI read OTP memory + } - b_reset(5, 5, 10, 5, 5); // small - break; - } // u_codeSize + // Reset + COG_reset(); // Check after reset - if (_flag152 == true) + if ((u_eScreen_EPD == eScreen_EPD_150_KS_0J) or (u_eScreen_EPD == eScreen_EPD_152_KS_0J)) { if (digitalRead(b_pin.panelBusy) == HIGH) { - Serial.println(); - Serial.println("* ERROR - Incorrect type for 1.52-Wide"); - while (true); + mySerial.println(); + mySerial.println("hV * Incorrect type for 1.52-Wide"); + while(0x01); } } - // Check type and get tables - COG_getUserData(); // nothing sent to panel - - // Standard - hV_Screen_Buffer::begin(); - - setOrientation(0); - if (f_fontMax() > 0) + // Start SPI and Wire + if ((u_eScreen_EPD == eScreen_EPD_150_KS_0J) or (u_eScreen_EPD == eScreen_EPD_152_KS_0J)) { - f_selectFont(0); + hV_HAL_SPI_begin(16000000); // 1.52" tested with 4, 8, 16 and 32 MHz } - f_fontSolid = false; - - _penSolid = false; - u_invert = false; - - // Report - Serial.println(formatString("= Screen %s %ix%i", WhoAmI().c_str(), screenSizeX(), screenSizeY())); - Serial.println(formatString("= PDLS %s v%i.%i.%i", SCREEN_EPD_EXT3_VARIANT, SCREEN_EPD_EXT3_RELEASE / 100, (SCREEN_EPD_EXT3_RELEASE / 10) % 10, SCREEN_EPD_EXT3_RELEASE % 10)); - - clear(); -} - -String Screen_EPD_EXT3_Fast::WhoAmI() -{ - char work[64] = {0}; - u_WhoAmI(work); - - return formatString("iTC %i.%02i\"%s", _screenDiagonal / 100, _screenDiagonal % 100, work); + else + { + hV_HAL_SPI_begin(); // Standard 8 MHz + } + // hV_HAL_Wire_begin(); } uint8_t Screen_EPD_EXT3_Fast::flushMode(uint8_t updateMode) @@ -638,12 +772,12 @@ uint8_t Screen_EPD_EXT3_Fast::flushMode(uint8_t updateMode) case UPDATE_FAST: case UPDATE_GLOBAL: - _flushFast(); + s_flushFast(); break; default: - Serial.println("* PDLS - UPDATE_NONE invoked"); + mySerial.println("hV ! PDLS - UPDATE_NONE invoked"); break; } @@ -655,7 +789,7 @@ void Screen_EPD_EXT3_Fast::flush() flushMode(UPDATE_FAST); } -void Screen_EPD_EXT3_Fast::_flushFast() +void Screen_EPD_EXT3_Fast::s_flushFast() { // Configure COG_initial(UPDATE_FAST); @@ -673,9 +807,10 @@ void Screen_EPD_EXT3_Fast::clear(uint16_t colour) { if (colour == myColours.grey) { + // black = 0-1, white = 0-0 for (uint16_t i = 0; i < u_bufferSizeV; i++) { - uint16_t pattern = (i % 2) ? 0b10101010 : 0b01010101; + uint8_t pattern = (i % 2) ? 0b10101010 : 0b01010101; for (uint16_t j = 0; j < u_bufferSizeH; j++) { u_newImage[i * u_bufferSizeH + j] = pattern; @@ -684,17 +819,17 @@ void Screen_EPD_EXT3_Fast::clear(uint16_t colour) } else if ((colour == myColours.white) xor u_invert) { - // physical black 00 + // physical black 0-0 memset(u_newImage, 0x00, u_pageColourSize); } else { - // physical white 10 + // physical white 1-0 memset(u_newImage, 0xff, u_pageColourSize); } } -void Screen_EPD_EXT3_Fast::regenerate() +void Screen_EPD_EXT3_Fast::regenerate(uint8_t mode) { clear(myColours.black); flush(); @@ -705,11 +840,10 @@ void Screen_EPD_EXT3_Fast::regenerate() delay(100); } -void Screen_EPD_EXT3_Fast::_setPoint(uint16_t x1, uint16_t y1, uint16_t colour) +void Screen_EPD_EXT3_Fast::s_setPoint(uint16_t x1, uint16_t y1, uint16_t colour) { // Orient and check coordinates are within screen - // _orientCoordinates() returns false = success, true = error - if (_orientCoordinates(x1, y1) == RESULT_ERROR) + if (s_orientCoordinates(x1, y1) == RESULT_ERROR) { return; } @@ -730,47 +864,47 @@ void Screen_EPD_EXT3_Fast::_setPoint(uint16_t x1, uint16_t y1, uint16_t colour) } // Coordinates - uint32_t z1 = _getZ(x1, y1); - uint16_t b1 = _getB(x1, y1); + uint32_t z1 = s_getZ(x1, y1); + uint16_t b1 = s_getB(x1, y1); // Basic colours if ((colour == myColours.white) xor u_invert) { - // physical black 00 + // physical black 0-0 bitClear(u_newImage[z1], b1); } else if ((colour == myColours.black) xor u_invert) { - // physical white 10 + // physical white 1-0 bitSet(u_newImage[z1], b1); } } -void Screen_EPD_EXT3_Fast::_setOrientation(uint8_t orientation) +void Screen_EPD_EXT3_Fast::s_setOrientation(uint8_t orientation) { - _orientation = orientation % 4; + v_orientation = orientation % 4; } -bool Screen_EPD_EXT3_Fast::_orientCoordinates(uint16_t & x, uint16_t & y) +bool Screen_EPD_EXT3_Fast::s_orientCoordinates(uint16_t & x, uint16_t & y) { bool _flagResult = RESULT_ERROR; // false = success, true = error - switch (_orientation) + switch (v_orientation) { case 3: // checked, previously 1 - if ((x < _screenSizeV) and (y < _screenSizeH)) + if ((x < v_screenSizeV) and (y < v_screenSizeH)) { - x = _screenSizeV - 1 - x; + x = v_screenSizeV - 1 - x; _flagResult = RESULT_SUCCESS; } break; case 2: // checked - if ((x < _screenSizeH) and (y < _screenSizeV)) + if ((x < v_screenSizeH) and (y < v_screenSizeV)) { - x = _screenSizeH - 1 - x; - y = _screenSizeV - 1 - y; + x = v_screenSizeH - 1 - x; + y = v_screenSizeV - 1 - y; swap(x, y); _flagResult = RESULT_SUCCESS; } @@ -778,16 +912,16 @@ bool Screen_EPD_EXT3_Fast::_orientCoordinates(uint16_t & x, uint16_t & y) case 1: // checked, previously 3 - if ((x < _screenSizeV) and (y < _screenSizeH)) + if ((x < v_screenSizeV) and (y < v_screenSizeH)) { - y = _screenSizeH - 1 - y; + y = v_screenSizeH - 1 - y; _flagResult = RESULT_SUCCESS; } break; default: // checked - if ((x < _screenSizeH) and (y < _screenSizeV)) + if ((x < v_screenSizeH) and (y < v_screenSizeV)) { swap(x, y); _flagResult = RESULT_SUCCESS; @@ -798,18 +932,33 @@ bool Screen_EPD_EXT3_Fast::_orientCoordinates(uint16_t & x, uint16_t & y) return _flagResult; } -uint32_t Screen_EPD_EXT3_Fast::_getZ(uint16_t x1, uint16_t y1) +uint32_t Screen_EPD_EXT3_Fast::s_getZ(uint16_t x1, uint16_t y1) { uint32_t z1 = 0; // According to 11.98 inch Spectra Application Note - // at http:// www.pervasivedisplays.com/LiteratureRetrieve.aspx?ID=245146 + // at http://www.pervasivedisplays.com/LiteratureRetrieve.aspx?ID=245146 + switch (u_codeSize) + { + case SIZE_969: + case SIZE_1198: + + if (y1 >= (v_screenSizeH >> 1)) + { + y1 -= (v_screenSizeH >> 1); // rebase y1 + z1 += (u_pageColourSize >> 1); // buffer second half + } + z1 += (uint32_t)x1 * (u_bufferSizeH >> 1) + (y1 >> 3); + break; - z1 = (uint32_t)x1 * u_bufferSizeH + (y1 >> 3); + default: + z1 = (uint32_t)x1 * u_bufferSizeH + (y1 >> 3); + break; + } return z1; } -uint16_t Screen_EPD_EXT3_Fast::_getB(uint16_t x1, uint16_t y1) +uint16_t Screen_EPD_EXT3_Fast::s_getB(uint16_t x1, uint16_t y1) { uint16_t b1 = 0; @@ -818,21 +967,20 @@ uint16_t Screen_EPD_EXT3_Fast::_getB(uint16_t x1, uint16_t y1) return b1; } -uint16_t Screen_EPD_EXT3_Fast::_getPoint(uint16_t x1, uint16_t y1) +uint16_t Screen_EPD_EXT3_Fast::s_getPoint(uint16_t x1, uint16_t y1) { // Orient and check coordinates are within screen - // _orientCoordinates() returns false = success, true = error - if (_orientCoordinates(x1, y1) == RESULT_ERROR) + if (s_orientCoordinates(x1, y1) == RESULT_ERROR) { - return 0; + return 0x0000; } uint16_t _result = 0; uint8_t _value = 0; // Coordinates - uint32_t z1 = _getZ(x1, y1); - uint16_t b1 = _getB(x1, y1); + uint32_t z1 = s_getZ(x1, y1); + uint16_t b1 = s_getB(x1, y1); _value = bitRead(u_newImage[z1], b1); _value <<= 4; diff --git a/src/Screen_EPD_EXT3.h b/src/Screen_EPD_EXT3.h index 87f0441..f6df998 100755 --- a/src/Screen_EPD_EXT3.h +++ b/src/Screen_EPD_EXT3.h @@ -10,12 +10,12 @@ /// * Family: Small, Medium /// * Update: Fast /// * Feature: none -/// * Temperature: 15 to 30 °C /// /// @n Supported screens with embedded fast update /// * 1.50 reference xE2150PS0Jx /// * 1.52 reference xE2152PS0Jx /// * 1.54 reference xE2154PS0Cx +/// * 2.06 reference xE2206KS0Ex /// * 2.13 reference xE2213PS0Ex /// * 2.66 reference xE2266PS0Cx /// * 2.71 reference xE2271PS09x @@ -26,21 +26,32 @@ /// * 4.37 reference xE2437PS0Cx /// /// @author Rei Vilo -/// @date 21 Dec 2023 -/// @version 703 +/// @date 21 Mar 2024 +/// @version 801 /// /// @copyright (c) Rei Vilo, 2010-2024 -/// @copyright Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) -/// -/// The highView Library Suite is shared under the Creative Commons licence Attribution-ShareAlike 4.0 International (CC BY-SA 4.0). +/// @copyright All rights reserved +/// @copyright For exclusive use with Pervasive Displays screens +/// @copyright Portions (c) Pervasive Displays, 2010-2024 /// /// * Basic edition: for hobbyists and for basic usage /// @n Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) -/// /// @see https://creativecommons.org/licenses/by-sa/4.0/ /// /// @n Consider the Evaluation or Commercial editions for professionals or organisations and for commercial usage /// +/// * Evaluation edition: for professionals or organisations, evaluation only, no commercial usage +/// @n All rights reserved +/// +/// * Commercial edition: for professionals or organisations, commercial usage +/// @n All rights reserved +/// +/// * Viewer edition: for professionals or organisations +/// @n All rights reserved +/// +/// * Documentation +/// @n All rights reserved +/// // SDK #include "hV_HAL_Peripherals.h" @@ -58,27 +69,27 @@ #include "hV_Utilities_PDLS.h" // Checks -#if (hV_HAL_PERIPHERALS_RELEASE < 700) -#error Required hV_HAL_PERIPHERALS_RELEASE 700 +#if (hV_HAL_PERIPHERALS_RELEASE < 801) +#error Required hV_HAL_PERIPHERALS_RELEASE 801 #endif // hV_HAL_PERIPHERALS_RELEASE -#if (hV_CONFIGURATION_RELEASE < 702) -#error Required hV_CONFIGURATION_RELEASE 702 +#if (hV_CONFIGURATION_RELEASE < 801) +#error Required hV_CONFIGURATION_RELEASE 801 #endif // hV_CONFIGURATION_RELEASE -#if (hV_SCREEN_BUFFER_RELEASE < 700) -#error Required hV_SCREEN_BUFFER_RELEASE 700 +#if (hV_SCREEN_BUFFER_RELEASE < 801) +#error Required hV_SCREEN_BUFFER_RELEASE 801 #endif // hV_SCREEN_BUFFER_RELEASE -#if (hV_BOARD_RELEASE < 700) -#error Required hV_BOARD_RELEASE 700 +#if (hV_BOARD_RELEASE < 801) +#error Required hV_BOARD_RELEASE 801 #endif // hV_BOARD_RELEASE #ifndef SCREEN_EPD_EXT3_RELEASE /// /// @brief Library release number /// -#define SCREEN_EPD_EXT3_RELEASE 703 +#define SCREEN_EPD_EXT3_RELEASE 801 /// /// @brief Library variant @@ -88,10 +99,17 @@ // Other libraries #include "hV_Screen_Buffer.h" -#if (hV_SCREEN_BUFFER_RELEASE < 700) -#error Required hV_SCREEN_BUFFER_RELEASE 700 +#if (hV_SCREEN_BUFFER_RELEASE < 801) +#error Required hV_SCREEN_BUFFER_RELEASE 801 #endif // hV_SCREEN_BUFFER_RELEASE +/// +/// @name Constants for features +/// @{ +#define WITH_FAST ///< Fast update capability +#define WITH_FAST_FRIENDS ///< File and serial access +/// @} + // Objects // /// @@ -114,7 +132,7 @@ class Screen_EPD_EXT3_Fast final : public hV_Screen_Buffer, public hV_Utilities_ /// @note Frame-buffer generated by the class /// @note To be used with begin() with no parameter /// - Screen_EPD_EXT3_Fast(eScreen_EPD_EXT3_t eScreen_EPD_EXT3, pins_t board); + Screen_EPD_EXT3_Fast(eScreen_EPD_t eScreen_EPD_EXT3, pins_t board); /// /// @brief Initialisation @@ -123,6 +141,12 @@ class Screen_EPD_EXT3_Fast final : public hV_Screen_Buffer, public hV_Utilities_ /// void begin(); + /// + /// @brief Resume after suspend() + /// @details Turn SPI on and set all GPIOs levels + /// + void resume(); + /// /// @brief Who Am I /// @return Who Am I string @@ -137,21 +161,25 @@ class Screen_EPD_EXT3_Fast final : public hV_Screen_Buffer, public hV_Utilities_ void clear(uint16_t colour = myColours.white); /// - /// @brief Update the display, fast update - /// @note Display next frame-buffer on screen and copy next frame-buffer into old frame-buffer + /// @brief Update the display, global update + /// @note + /// 1. Send the frame-buffer to the screen + /// 2. Refresh the screen + /// 3. Copy next frame-buffer into old frame-buffer /// void flush(); /// /// @brief Regenerate the panel /// @details White-to-black-to-white cycle to reduce ghosting + /// @param mode default = UPDATE_FAST = fast mode /// - void regenerate(); + void regenerate(uint8_t mode = UPDATE_FAST); /// /// @brief Update the display /// @details Display next frame-buffer on screen and copy next frame-buffer into old frame-buffer - /// @param updateMode expected update mode + /// @param updateMode expected update mode, default = UPDATE_FAST /// @return uint8_t recommended mode /// @note Mode checked with checkTemperatureMode() /// @@ -165,7 +193,7 @@ class Screen_EPD_EXT3_Fast final : public hV_Screen_Buffer, public hV_Utilities_ /// @brief Set orientation /// @param orientation 1..3, 6, 7 /// - void _setOrientation(uint8_t orientation); // compulsory + void s_setOrientation(uint8_t orientation); // compulsory /// /// @brief Check and orient coordinates, logical coordinates @@ -173,7 +201,7 @@ class Screen_EPD_EXT3_Fast final : public hV_Screen_Buffer, public hV_Utilities_ /// @param y y-axis coordinate, modified /// @return RESULT_SUCCESS = false = success, RESULT_ERROR = true = error /// - bool _orientCoordinates(uint16_t & x, uint16_t & y); // compulsory + bool s_orientCoordinates(uint16_t & x, uint16_t & y); // compulsory // Write and Read /// @brief Set point @@ -182,7 +210,7 @@ class Screen_EPD_EXT3_Fast final : public hV_Screen_Buffer, public hV_Utilities_ /// @param colour 16-bit colour /// @n @b More: @ref Colour, @ref Coordinate /// - void _setPoint(uint16_t x1, uint16_t y1, uint16_t colour); + void s_setPoint(uint16_t x1, uint16_t y1, uint16_t colour); /// @brief Get point /// @param x1 x coordinate @@ -190,7 +218,7 @@ class Screen_EPD_EXT3_Fast final : public hV_Screen_Buffer, public hV_Utilities_ /// @return colour 16-bit colour /// @n @b More: @ref Colour, @ref Coordinate /// - uint16_t _getPoint(uint16_t x1, uint16_t y1); + uint16_t s_getPoint(uint16_t x1, uint16_t y1); // Position /// @@ -199,7 +227,7 @@ class Screen_EPD_EXT3_Fast final : public hV_Screen_Buffer, public hV_Utilities_ /// @param y1 y-axis coordinate /// @return index for u_newImage[] /// - uint32_t _getZ(uint16_t x1, uint16_t y1); + uint32_t s_getZ(uint16_t x1, uint16_t y1); /// /// @brief Convert @@ -207,7 +235,7 @@ class Screen_EPD_EXT3_Fast final : public hV_Screen_Buffer, public hV_Utilities_ /// @param y1 y-axis coordinate /// @return bit for u_newImage[] /// - uint16_t _getB(uint16_t x1, uint16_t y1); + uint16_t s_getB(uint16_t x1, uint16_t y1); // // === Energy section @@ -218,17 +246,19 @@ class Screen_EPD_EXT3_Fast final : public hV_Screen_Buffer, public hV_Utilities_ // // * Other functions specific to the screen + uint8_t COG_initialData[128]; // OTP + + void COG_reset(); void COG_initial(uint8_t updateMode); - void COG_getUserData(); + void COG_getDataOTP(); void COG_sendImageDataFast(); void COG_update(uint8_t updateMode); void COG_powerOff(); // * Flush - void _flushFast(); + void s_flushFast(); - bool _flag50; - bool _flag152; + bool s_flag50; // Register 0x50 // // === Touch section diff --git a/src/Terminal12x16e.h b/src/Terminal12x16e.h index 1b22044..bf11bdf 100755 --- a/src/Terminal12x16e.h +++ b/src/Terminal12x16e.h @@ -6,14 +6,18 @@ /// @n Based on highView technology /// /// @author Rei Vilo -/// @date 02 Aug 2021 -/// @version 507 +/// @date 21 Mar 2024 +/// @version 801 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright All rights reserved +/// @copyright For exclusive use with Pervasive Displays screens /// /// * Basic edition: for hobbyists and for basic usage /// @n Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +/// @see https://creativecommons.org/licenses/by-sa/4.0/ +/// +/// @n Consider the Evaluation or Commercial editions for professionals or organisations and for commercial usage /// /// * Evaluation edition: for professionals or organisations, evaluation only, no commercial usage /// @n All rights reserved @@ -21,6 +25,12 @@ /// * Commercial edition: for professionals or organisations, commercial usage /// @n All rights reserved /// +/// * Viewer edition: for professionals or organisations +/// @n All rights reserved +/// +/// * Documentation +/// @n All rights reserved +/// // // Terminal12e.h @@ -31,7 +41,7 @@ /// /// @brief Release /// -#define TERMINAL12E_FONT_RELEASE 507 +#define TERMINAL12E_FONT_RELEASE 801 /// /// @brief Font Terminal12x16e diff --git a/src/Terminal16x24e.h b/src/Terminal16x24e.h index ae175f6..ad17e5d 100755 --- a/src/Terminal16x24e.h +++ b/src/Terminal16x24e.h @@ -6,14 +6,18 @@ /// @n Based on highView technology /// /// @author Rei Vilo -/// @date 02 Aug 2021 -/// @version 507 +/// @date 21 Mar 2024 +/// @version 801 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright All rights reserved +/// @copyright For exclusive use with Pervasive Displays screens /// /// * Basic edition: for hobbyists and for basic usage /// @n Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +/// @see https://creativecommons.org/licenses/by-sa/4.0/ +/// +/// @n Consider the Evaluation or Commercial editions for professionals or organisations and for commercial usage /// /// * Evaluation edition: for professionals or organisations, evaluation only, no commercial usage /// @n All rights reserved @@ -21,6 +25,12 @@ /// * Commercial edition: for professionals or organisations, commercial usage /// @n All rights reserved /// +/// * Viewer edition: for professionals or organisations +/// @n All rights reserved +/// +/// * Documentation +/// @n All rights reserved +/// // // Terminal16e.h @@ -38,7 +48,7 @@ /// /// @brief Library release number /// -#define TERMINAL16E_FONT_RELEASE 507 +#define TERMINAL16E_FONT_RELEASE 801 /// /// @brief Font Terminal16x24 diff --git a/src/Terminal6x8e.h b/src/Terminal6x8e.h index b39f4f3..1ed4fc2 100755 --- a/src/Terminal6x8e.h +++ b/src/Terminal6x8e.h @@ -6,14 +6,18 @@ /// @n Based on highView technology /// /// @author Rei Vilo -/// @date 02 Aug 2021 -/// @version 507 +/// @date 21 Mar 2024 +/// @version 801 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright All rights reserved +/// @copyright For exclusive use with Pervasive Displays screens /// /// * Basic edition: for hobbyists and for basic usage /// @n Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +/// @see https://creativecommons.org/licenses/by-sa/4.0/ +/// +/// @n Consider the Evaluation or Commercial editions for professionals or organisations and for commercial usage /// /// * Evaluation edition: for professionals or organisations, evaluation only, no commercial usage /// @n All rights reserved @@ -21,6 +25,12 @@ /// * Commercial edition: for professionals or organisations, commercial usage /// @n All rights reserved /// +/// * Viewer edition: for professionals or organisations +/// @n All rights reserved +/// +/// * Documentation +/// @n All rights reserved +/// // // Terminal6e.h @@ -31,7 +41,7 @@ /// /// @brief Release /// -#define TERMINAL6E_FONT_RELEASE 507 +#define TERMINAL6E_FONT_RELEASE 801 /// /// @brief Font Terminal6x8e diff --git a/src/Terminal8x12e.h b/src/Terminal8x12e.h index 0c08845..3ac8fd3 100755 --- a/src/Terminal8x12e.h +++ b/src/Terminal8x12e.h @@ -6,14 +6,18 @@ /// @n Based on highView technology /// /// @author Rei Vilo -/// @date 02 Aug 2021 -/// @version 507 +/// @date 21 Mar 2024 +/// @version 801 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright All rights reserved +/// @copyright For exclusive use with Pervasive Displays screens /// /// * Basic edition: for hobbyists and for basic usage /// @n Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +/// @see https://creativecommons.org/licenses/by-sa/4.0/ +/// +/// @n Consider the Evaluation or Commercial editions for professionals or organisations and for commercial usage /// /// * Evaluation edition: for professionals or organisations, evaluation only, no commercial usage /// @n All rights reserved @@ -21,6 +25,12 @@ /// * Commercial edition: for professionals or organisations, commercial usage /// @n All rights reserved /// +/// * Viewer edition: for professionals or organisations +/// @n All rights reserved +/// +/// * Documentation +/// @n All rights reserved +/// // // Terminal8e.h @@ -31,7 +41,7 @@ /// /// @brief Release /// -#define TERMINAL8E_FONT_RELEASE 507 +#define TERMINAL8E_FONT_RELEASE 801 /// /// @brief Font Terminal8x12e diff --git a/src/hV_Board.cpp b/src/hV_Board.cpp index becf1d7..a416744 100755 --- a/src/hV_Board.cpp +++ b/src/hV_Board.cpp @@ -11,6 +11,9 @@ // Copyright (c) Rei Vilo, 2010-2024 // Licence All rights reserved // +// Release 700: Initial release +// Release 801: Improved double-panel screen management +// // Library header #include "hV_Board.h" @@ -56,12 +59,99 @@ void hV_Board::b_suspend() void hV_Board::b_resume() { - // Not implemented + // Optional power circuit + if (b_pin.panelPower != NOT_CONNECTED) // generic + { + pinMode(b_pin.panelPower, OUTPUT); + digitalWrite(b_pin.panelPower, HIGH); + } + + // Configure GPIOs + pinMode(b_pin.panelBusy, INPUT); + + pinMode(b_pin.panelDC, OUTPUT); + digitalWrite(b_pin.panelDC, HIGH); + + pinMode(b_pin.panelReset, OUTPUT); + digitalWrite(b_pin.panelReset, HIGH); + + pinMode(b_pin.panelCS, OUTPUT); + digitalWrite(b_pin.panelCS, HIGH); // CS# = 1 + + if (b_pin.panelCSS != NOT_CONNECTED) // generic + { + pinMode(b_pin.panelCSS, OUTPUT); + digitalWrite(b_pin.panelCSS, HIGH); + } + + // External SPI memory + if (b_pin.flashCS != NOT_CONNECTED) // generic + { + pinMode(b_pin.flashCS, OUTPUT); + digitalWrite(b_pin.flashCS, HIGH); + } + if (b_pin.flashCSS != NOT_CONNECTED) // generic + { + pinMode(b_pin.flashCSS, OUTPUT); + digitalWrite(b_pin.flashCSS, HIGH); + } + + // External SD card + if (b_pin.cardCS != NOT_CONNECTED) // generic + { + pinMode(b_pin.cardCS, OUTPUT); + digitalWrite(b_pin.cardCS, HIGH); + } + if (b_pin.cardDetect != NOT_CONNECTED) // generic + { + pinMode(b_pin.cardCS, INPUT); + } } void hV_Board::b_sendIndexFixed(uint8_t index, uint8_t data, uint32_t size) { - // Not implemented + digitalWrite(b_pin.panelDC, LOW); // DC Low = Command + digitalWrite(b_pin.panelCS, LOW); // CS High = Select Master + + delayMicroseconds(b_delayCS); + SPI.transfer(index); + delayMicroseconds(b_delayCS); + + digitalWrite(b_pin.panelDC, HIGH); // DC High = Data + + delayMicroseconds(b_delayCS); + for (uint32_t i = 0; i < size; i++) + { + SPI.transfer(data); // b_sendIndexFixed + } + delayMicroseconds(b_delayCS); + + digitalWrite(b_pin.panelCS, HIGH); // CS High = Unselect +} + +void hV_Board::b_sendIndexFixedSelect(uint8_t index, uint8_t data, uint32_t size, uint8_t select) +{ + digitalWrite(b_pin.panelDC, LOW); // DC Low = Command + b_select(select); // Select half of large screen + + delayMicroseconds(b_delayCS); // Longer delay for large screens + SPI.transfer(index); + delayMicroseconds(b_delayCS); // Longer delay for large screens + + digitalWrite(b_pin.panelDC, HIGH); // DC High = Data + + delayMicroseconds(b_delayCS); // Longer delay for large screens + for (uint32_t i = 0; i < size; i++) + { + SPI.transfer(data); // b_sendIndexFixed + } + delayMicroseconds(b_delayCS); // Longer delay for large screens + + digitalWrite(b_pin.panelCS, HIGH); // CS High = Unselect Master + if (b_pin.panelCSS != NOT_CONNECTED) + { + digitalWrite(b_pin.panelCSS, HIGH); // CSS High = Unselect Slave + } } void hV_Board::b_sendIndexData(uint8_t index, const uint8_t * data, uint32_t size) @@ -104,6 +194,7 @@ void hV_Board::b_sendIndexData(uint8_t index, const uint8_t * data, uint32_t siz SPI.transfer(data[i]); } delayMicroseconds(b_delayCS); + digitalWrite(b_pin.panelCS, HIGH); // CS High if (b_family == FAMILY_LARGE) { if (b_pin.panelCSS != NOT_CONNECTED) @@ -112,26 +203,20 @@ void hV_Board::b_sendIndexData(uint8_t index, const uint8_t * data, uint32_t siz digitalWrite(b_pin.panelCSS, HIGH); } } - digitalWrite(b_pin.panelCS, HIGH); // CS High + delayMicroseconds(b_delayCS); } // Software SPI Master protocol setup -void hV_Board::b_sendIndexDataBoth(uint8_t index, const uint8_t * data, uint32_t size) +void hV_Board::b_sendIndexDataSelect(uint8_t index, const uint8_t * data, uint32_t size, uint8_t select) { digitalWrite(b_pin.panelDC, LOW); // DC Low = Command - digitalWrite(b_pin.panelCS, LOW); // CS Low = Select - if (b_pin.panelCSS != NOT_CONNECTED) - { - digitalWrite(b_pin.panelCSS, LOW); // CS Low = Select - } + b_select(select); // Select half of large screen delayMicroseconds(b_delayCS); // Longer delay for large screens SPI.transfer(index); delayMicroseconds(b_delayCS); // Longer delay for large screens - // digitalWrite(b_pin.panelCS, HIGH); // CS High = Unselect digitalWrite(b_pin.panelDC, HIGH); // DC High = Data - // digitalWrite(b_pin.panelCS, LOW); // CS Low = Select delayMicroseconds(b_delayCS); // Longer delay for large screens for (uint32_t i = 0; i < size; i++) @@ -140,73 +225,66 @@ void hV_Board::b_sendIndexDataBoth(uint8_t index, const uint8_t * data, uint32_t } delayMicroseconds(b_delayCS); // Longer delay for large screens - digitalWrite(b_pin.panelCS, HIGH); // CS High = Unselect + digitalWrite(b_pin.panelCS, HIGH); // CS high = Unselect Master if (b_pin.panelCSS != NOT_CONNECTED) { - digitalWrite(b_pin.panelCSS, HIGH); // CS High = Unselect + digitalWrite(b_pin.panelCSS, HIGH); // CSS High = Unselect Slave } } -void hV_Board::b_sendIndexDataMaster(uint8_t index, const uint8_t * data, uint32_t size) +void hV_Board::b_select(uint8_t select) { - if (b_pin.panelCSS != NOT_CONNECTED) + switch (select) { - digitalWrite(b_pin.panelCSS, HIGH); // CS slave HIGH - } - digitalWrite(b_pin.panelDC, LOW); // DC Low = Command - digitalWrite(b_pin.panelCS, LOW); // CS Low = Select - delayMicroseconds(500); - SPI.transfer(index); - delayMicroseconds(500); - digitalWrite(b_pin.panelCS, HIGH); // CS High = Unselect - digitalWrite(b_pin.panelDC, HIGH); // DC High = Data - digitalWrite(b_pin.panelCS, LOW); // CS Low = Select - delayMicroseconds(500); + case PANEL_CS_MASTER: - for (uint32_t i = 0; i < size; i++) - { - SPI.transfer(data[i]); - } - delayMicroseconds(500); - digitalWrite(b_pin.panelCS, HIGH); // CS High= Unselect -} + digitalWrite(b_pin.panelCS, LOW); // CS Low = Select Master + if (b_pin.panelCSS != NOT_CONNECTED) + { + digitalWrite(b_pin.panelCSS, HIGH); // CSS High = Unselect Slave + } + break; -// Software SPI Slave protocol setup -void hV_Board::b_sendIndexDataSlave(uint8_t index, const uint8_t * data, uint32_t size) -{ - digitalWrite(b_pin.panelCS, HIGH); // CS Master High - digitalWrite(b_pin.panelDC, LOW); // DC Low= Command - if (b_pin.panelCSS != NOT_CONNECTED) - { - digitalWrite(b_pin.panelCSS, LOW); // CS slave LOW - } + case PANEL_CS_SLAVE: - delayMicroseconds(500); - SPI.transfer(index); - delayMicroseconds(500); + digitalWrite(b_pin.panelCS, HIGH); // CS high = Unselect Master + if (b_pin.panelCSS != NOT_CONNECTED) + { + digitalWrite(b_pin.panelCSS, LOW); // CSS Low = Select Slave + } + break; - if (b_pin.panelCSS != NOT_CONNECTED) - { - digitalWrite(b_pin.panelCSS, HIGH); // CS slave HIGH - } + default: - digitalWrite(b_pin.panelDC, HIGH); // DC High = Data + digitalWrite(b_pin.panelCS, LOW); // CS Low = Select Master + if (b_pin.panelCSS != NOT_CONNECTED) + { + digitalWrite(b_pin.panelCSS, LOW); // CSS Low = Select Slave + } + break; + } if (b_pin.panelCSS != NOT_CONNECTED) { - digitalWrite(b_pin.panelCSS, LOW); // CS slave LOW + delayMicroseconds(450); // 450 + 50 = 500 } + delayMicroseconds(b_delayCS); // Longer delay for large screens +} - delayMicroseconds(500); +void hV_Board::b_sendCommandDataSelect8(uint8_t command, uint8_t data, uint8_t select) +{ + digitalWrite(b_pin.panelDC, LOW); // LOW = command + b_select(select); // Select half of large screen - for (uint32_t i = 0; i < size; i++) - { - SPI.transfer(data[i]); - } - delayMicroseconds(500); + SPI.transfer(command); + + digitalWrite(b_pin.panelDC, HIGH); // HIGH = data + SPI.transfer(data); + + digitalWrite(b_pin.panelCS, HIGH); if (b_pin.panelCSS != NOT_CONNECTED) { - digitalWrite(b_pin.panelCSS, HIGH); // CS slave HIGH + digitalWrite(b_pin.panelCSS, HIGH); } } diff --git a/src/hV_Board.h b/src/hV_Board.h index e1e8da4..75c8683 100755 --- a/src/hV_Board.h +++ b/src/hV_Board.h @@ -8,14 +8,30 @@ /// * Edition: Advanced /// /// @author Rei Vilo -/// @date 21 Aug 2023 -/// @version 700 +/// @date 21 Mar 2024 +/// @version 801 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright All rights reserved +/// @copyright For exclusive use with Pervasive Displays screens +/// +/// * Basic edition: for hobbyists and for basic usage +/// @n Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +/// @see https://creativecommons.org/licenses/by-sa/4.0/ +/// +/// @n Consider the Evaluation or Commercial editions for professionals or organisations and for commercial usage +/// +/// * Evaluation edition: for professionals or organisations, evaluation only, no commercial usage +/// @n All rights reserved /// -/// * Evaluation edition: for professionals or organisations, no commercial usage /// * Commercial edition: for professionals or organisations, commercial usage +/// @n All rights reserved +/// +/// * Viewer edition: for professionals or organisations +/// @n All rights reserved +/// +/// * Documentation +/// @n All rights reserved /// // SDK @@ -28,7 +44,7 @@ /// /// @brief Library release number /// -#define hV_BOARD_RELEASE 700 +#define hV_BOARD_RELEASE 801 // Objects // @@ -88,43 +104,37 @@ class hV_Board void b_sendIndexFixed(uint8_t index, uint8_t data, uint32_t len); /// - /// @brief Send data through SPI - /// @param index register - /// @param data data - /// @param size number of bytes - /// @note On large screens, b_sendIndexData() sends to both sub-panels - /// - void b_sendIndexData(uint8_t index, const uint8_t * data, uint32_t size); - - /// - /// @brief Send data through SPI to the two halves of large screens + /// @brief Send fixed value through SPI /// @param index register - /// @param data data - /// @param size number of bytes + /// @param data data, one byte covers 8 pixels + /// @param len number of bytes + /// @param select default = PANEL_CS_BOTH, otherwise PANEL_CS_MASTER or PANEL_CS_SLAVE /// @note Valid only for 9.7 and 12.20" screens /// - void b_sendIndexDataBoth(uint8_t index, const uint8_t * data, uint32_t size); + void b_sendIndexFixedSelect(uint8_t index, uint8_t data, uint32_t len, uint8_t select = PANEL_CS_BOTH); /// - /// @brief Send data through SPI to first half of large screens + /// @brief Send data through SPI /// @param index register /// @param data data /// @param size number of bytes - /// @note Valid only for 9.7 and 12.20" screens + /// @note On large screens, b_sendIndexData() sends to both sub-panels /// - void b_sendIndexDataMaster(uint8_t index, const uint8_t * data, uint32_t size); + void b_sendIndexData(uint8_t index, const uint8_t * data, uint32_t size); - /// @brief Send data through SPI to second half of large screens + /// + /// @brief Send data through SPI to selected half of large screen /// @param index register /// @param data data /// @param size number of bytes + /// @param select default = PANEL_CS_BOTH, otherwise PANEL_CS_MASTER or PANEL_CS_SLAVE /// @note Valid only for 9.7 and 12.20" screens /// - void b_sendIndexDataSlave(uint8_t index, const uint8_t * data, uint32_t size); + void b_sendIndexDataSelect(uint8_t index, const uint8_t * data, uint32_t size, uint8_t select = PANEL_CS_BOTH); /// /// @brief Wait for ready - /// @details Wait for panelBusy to reach state + /// @details Wait for panelBusy signal to reach state /// @note Signal is busy until reaching state /// @param state to reach HIGH = default, LOW /// @@ -133,7 +143,7 @@ class hV_Board /// /// @brief Send a command /// @param command command - /// @note If needed, set panelCS HIGH manually after + /// @note panelDC is kept high, to be changed manually after /// void b_sendCommand8(uint8_t command); @@ -145,6 +155,21 @@ class hV_Board /// void b_sendCommandData8(uint8_t command, uint8_t data); + /// + /// @brief Send a command and one byte of data to selected half of large screen + /// @param command command + /// @param data uint8_t data + /// @param select default = PANEL_CS_BOTH, otherwise PANEL_CS_MASTER or PANEL_CS_SLAVE + /// @note panelDC is kept high, to be changed manually after + /// + void b_sendCommandDataSelect8(uint8_t command, uint8_t data, uint8_t select = PANEL_CS_BOTH); + + /// @brief Select one half of large screens + /// @param select default = PANEL_CS_BOTH, otherwise PANEL_CS_MASTER or PANEL_CS_SLAVE + /// @note Valid only for 9.69 and 11.98" screens + /// + void b_select(uint8_t select = PANEL_CS_BOTH); + /// /// @brief Suspend /// diff --git a/src/hV_Colours565.cpp b/src/hV_Colours565.cpp index ef6dc4f..e9ac005 100755 --- a/src/hV_Colours565.cpp +++ b/src/hV_Colours565.cpp @@ -10,6 +10,7 @@ // // Copyright (c) Rei Vilo, 2010-2024 // Licence Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +// For exclusive use with Pervasive Displays screens // // See hV_Colours565.h for references // diff --git a/src/hV_Colours565.h b/src/hV_Colours565.h index bd8b186..a98d319 100755 --- a/src/hV_Colours565.h +++ b/src/hV_Colours565.h @@ -6,11 +6,30 @@ /// @n Based on highView technology /// /// @author Rei Vilo -/// @date 21 Sep 2023 -/// @version 700 +/// @date 21 Mar 2024 +/// @version 801 /// /// @copyright (c) Rei Vilo, 2010-2024 -/// @copyright Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +/// @copyright All rights reserved +/// @copyright For exclusive use with Pervasive Displays screens +/// +/// * Basic edition: for hobbyists and for basic usage +/// @n Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +/// @see https://creativecommons.org/licenses/by-sa/4.0/ +/// +/// @n Consider the Evaluation or Commercial editions for professionals or organisations and for commercial usage +/// +/// * Evaluation edition: for professionals or organisations, evaluation only, no commercial usage +/// @n All rights reserved +/// +/// * Commercial edition: for professionals or organisations, commercial usage +/// @n All rights reserved +/// +/// * Viewer edition: for professionals or organisations +/// @n All rights reserved +/// +/// * Documentation +/// @n All rights reserved /// // SDK @@ -23,7 +42,7 @@ /// /// @brief Library release number /// -#define hV_COLOURS_RELEASE 700 +#define hV_COLOURS_RELEASE 801 /// /// @class hV_Colours565 diff --git a/src/hV_Common.h b/src/hV_Common.h index 7b2be80..8115a41 100755 --- a/src/hV_Common.h +++ b/src/hV_Common.h @@ -6,27 +6,37 @@ /// @n Based on highView technology /// /// @author Rei Vilo -/// @date 21 Nov 2023 -/// @version 702 +/// @date 21 Mar 2024 +/// @version 801 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright All rights reserved +/// @copyright For exclusive use with Pervasive Displays screens /// /// * Basic edition: for hobbyists and for basic usage /// @n Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +/// @see https://creativecommons.org/licenses/by-sa/4.0/ /// -/// * Evaluation edition: for professionals or organisations, no commercial usage +/// @n Consider the Evaluation or Commercial editions for professionals or organisations and for commercial usage +/// +/// * Evaluation edition: for professionals or organisations, evaluation only, no commercial usage /// @n All rights reserved /// /// * Commercial edition: for professionals or organisations, commercial usage /// @n All rights reserved /// +/// * Viewer edition: for professionals or organisations +/// @n All rights reserved +/// +/// * Documentation +/// @n All rights reserved +/// #ifndef hV_COMMON_RELEASE /// /// @brief Library release number /// -#define hV_COMMON_RELEASE 702 +#define hV_COMMON_RELEASE 801 // SDK #include "hV_HAL_Peripherals.h" @@ -37,6 +47,7 @@ #include "hV_List_Options.h" #include "hV_List_Boards.h" #include "hV_List_Screens.h" +#include "hV_List_Screens_Legacy.h" #include "hV_Documentation.h" diff --git a/src/hV_Configuration.h b/src/hV_Configuration.h index 8d458b7..13f5837 100755 --- a/src/hV_Configuration.h +++ b/src/hV_Configuration.h @@ -19,11 +19,12 @@ /// * 11. Set storage mode, not implemented /// /// @author Rei Vilo -/// @date 21 Dec 2023 -/// @version 703 +/// @date 21 Mar 2024 +/// @version 801 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright All rights reserved +/// @copyright For exclusive use with Pervasive Displays screens /// /// * Basic edition: for hobbyists and for basic usage /// @n Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) @@ -37,6 +38,12 @@ /// * Commercial edition: for professionals or organisations, commercial usage /// @n All rights reserved /// +/// * Viewer edition: for professionals or organisations +/// @n All rights reserved +/// +/// * Documentation +/// @n All rights reserved +/// // SDK #include "hV_HAL_Peripherals.h" @@ -54,23 +61,27 @@ #include "hV_List_Screens.h" // Checks -#if (hV_LIST_CONSTANTS_RELEASE < 700) -#error Required hV_LIST_CONSTANTS_RELEASE 700 +#if (hV_LIST_CONSTANTS_RELEASE < 801) +#error Required hV_LIST_CONSTANTS_RELEASE 801 #endif // hV_LIST_CONSTANTS_RELEASE -#if (hV_LIST_BOARDS_RELEASE < 700) -#error Required hV_LIST_BOARDS_RELEASE 700 +#if (hV_LIST_OPTIONS_RELEASE < 801) +#error Required hV_LIST_OPTIONS_RELEASE 801 +#endif // hV_LIST_OPTIONS_RELEASE + +#if (hV_LIST_BOARDS_RELEASE < 801) +#error Required hV_LIST_BOARDS_RELEASE 801 #endif // hV_LIST_BOARDS_RELEASE -#if (hV_LIST_SCREENS_RELEASE < 702) -#error Required hV_LIST_SCREENS_RELEASE 702 +#if (hV_LIST_SCREENS_RELEASE < 801) +#error Required hV_LIST_SCREENS_RELEASE 801 #endif // hV_LIST_SCREENS_RELEASE #ifndef hV_CONFIGURATION_RELEASE /// /// @brief Release /// -#define hV_CONFIGURATION_RELEASE 703 +#define hV_CONFIGURATION_RELEASE 801 /// /// @name 1- List of supported Pervasive Displays screens diff --git a/src/hV_Documentation.h b/src/hV_Documentation.h index ceccad7..40af983 100755 --- a/src/hV_Documentation.h +++ b/src/hV_Documentation.h @@ -41,16 +41,20 @@ /// Additionally, the **[Wiki](https://docs.pervasivedisplays.com/)** provides a gradual introduction to the e-paper technology and how to use it. /// /// @author Rei Vilo -/// @date 21 Dec 2023 -/// @version 703 +/// @date 21 Mar 2024 +/// @version 801 /// -/// @copyright © Rei Vilo, 2010-2024 +/// @copyright (c) Rei Vilo, 2010-2024 /// @copyright All rights reserved +/// @copyright For exclusive use with Pervasive Displays screens /// /// * Basic edition: for hobbyists and for basic usage /// @n Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +/// @see https://creativecommons.org/licenses/by-sa/4.0/ /// -/// * Evaluation edition: for professionals or organisations, for evaluation only, no commercial usage +/// @n Consider the Evaluation or Commercial editions for professionals or organisations and for commercial usage +/// +/// * Evaluation edition: for professionals or organisations, evaluation only, no commercial usage /// @n All rights reserved /// /// * Commercial edition: for professionals or organisations, commercial usage @@ -109,3 +113,4 @@ /// @image html BWRY_Contrasts.jpg /// @image latex BWRY_Contrasts.jpg width=8cm /// + diff --git a/src/hV_Font.h b/src/hV_Font.h index 844f10f..77c5615 100755 --- a/src/hV_Font.h +++ b/src/hV_Font.h @@ -6,14 +6,18 @@ /// @n Based on highView technology /// /// @author Rei Vilo -/// @date 02 Aug 2021 -/// @version 507 +/// @date 21 Mar 2024 +/// @version 801 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright All rights reserved +/// @copyright For exclusive use with Pervasive Displays screens /// /// * Basic edition: for hobbyists and for basic usage /// @n Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +/// @see https://creativecommons.org/licenses/by-sa/4.0/ +/// +/// @n Consider the Evaluation or Commercial editions for professionals or organisations and for commercial usage /// /// * Evaluation edition: for professionals or organisations, evaluation only, no commercial usage /// @n All rights reserved @@ -21,6 +25,12 @@ /// * Commercial edition: for professionals or organisations, commercial usage /// @n All rights reserved /// +/// * Viewer edition: for professionals or organisations +/// @n All rights reserved +/// +/// * Documentation +/// @n All rights reserved +/// /// @warning 8- and 16-bit limitations /// /// Some 8- and 16-bit platforms limit arrays to 16 KB. Some header fonts require higher arrays. @@ -41,26 +51,29 @@ // Configuration #include "hV_Configuration.h" -// The Arduino IDE doesn't allow to select the libraries, hence this condition. +// The Arduino IDE does not allow to select the libraries, hence this condition. #if (FONT_MODE == USE_FONT_TERMINAL) -#ifndef hV_FONT_HEADER_STRUCTURE_RELEASE +#ifndef hV_FONT_TERMINAL_STRUCTURE_RELEASE /// /// @brief hV_Font release number /// -#define hV_FONT_HEADER_STRUCTURE_RELEASE 507 +#define hV_FONT_TERMINAL_STRUCTURE_RELEASE 801 /// /// @brief Structure for character width +/// @deprecated uint16_t index (8.0.0) +/// @warning uint32_t index (8.0.0) /// struct width_s { uint16_t pixel; ///< width in pixel - uint16_t index; ///< relative address + uint32_t index; ///< relative address }; /// /// @brief Structure for font +/// @details Fonts read from header file in internal MCU Flash /// @note /// * Kind of font: see details below /// * Height: set during font generation @@ -71,16 +84,16 @@ struct width_s /// /// @n Font kind /// * 0x4-..0x1- 0b7654 -/// - b7 = 0x8- = high definition, 2 bits per pixel -/// - b6 = 0x4- = Monospace -/// - b5 = 0x2- = Sans Serif -/// - b4 = 0x1- = Serif +/// - b7 = 0x8- = high definition, 2 bits per pixel +/// - b6 = 0x4- = Monospace +/// - b5 = 0x2- = Sans Serif +/// - b4 = 0x1- = Serif /// * 0x-1..0x-f 0b3210 -/// - b3 = 0x-8 = d8 = italic -/// - b2 = 0x-4 = d4 = bold -/// - b10 = 0x-0..0x-3 = d0..d3 = variant number +/// - b3 = 0x-8 = d8 = italic +/// - b2 = 0x-4 = d4 = bold +/// - b10 = 0x-0..0x-3 = d0..d3 = variant number /// -/// @bug font_s.table needs to be uint8_t instead of unsigned short +/// @warning font_s.table needs to be uint8_t instead of unsigned short /// @n Otherwise on TM4C129, font_s.table written as uint16_t /// struct font_s @@ -94,4 +107,4 @@ struct font_s #endif // USE_FONT_TERMINAL -#endif // hV_FONT_HEADER_STRUCTURE_RELEASE +#endif // hV_FONT_TERMINAL_STRUCTURE_RELEASE diff --git a/src/hV_Font_Terminal.cpp b/src/hV_Font_Terminal.cpp index cdeebc2..b214a9d 100755 --- a/src/hV_Font_Terminal.cpp +++ b/src/hV_Font_Terminal.cpp @@ -21,9 +21,8 @@ // #include "hV_Font_Terminal.h" -//#include "hV_Utilities_Common.h" -// The Arduino IDE doesn't allow to select the libraries, hence this condition. +// The Arduino IDE does not allow to select the libraries, hence this condition. #if (FONT_MODE == USE_FONT_TERMINAL) // Code diff --git a/src/hV_Font_Terminal.h b/src/hV_Font_Terminal.h index 6d1fc28..1e047e9 100755 --- a/src/hV_Font_Terminal.h +++ b/src/hV_Font_Terminal.h @@ -6,14 +6,18 @@ /// @n Based on highView technology /// /// @author Rei Vilo -/// @date 02 Aug 2021 -/// @version 507 +/// @date 21 Mar 2024 +/// @version 801 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright All rights reserved +/// @copyright For exclusive use with Pervasive Displays screens /// /// * Basic edition: for hobbyists and for basic usage /// @n Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +/// @see https://creativecommons.org/licenses/by-sa/4.0/ +/// +/// @n Consider the Evaluation or Commercial editions for professionals or organisations and for commercial usage /// /// * Evaluation edition: for professionals or organisations, evaluation only, no commercial usage /// @n All rights reserved @@ -21,6 +25,12 @@ /// * Commercial edition: for professionals or organisations, commercial usage /// @n All rights reserved /// +/// * Viewer edition: for professionals or organisations +/// @n All rights reserved +/// +/// * Documentation +/// @n All rights reserved +/// /// @see Font generated with MikroElektronika GLCD Font Creator 1.2.0.0 and edited manually /// MikroeElektronika 2011 http://www.mikroe.com /// @@ -31,21 +41,21 @@ // Configuration #include "hV_Configuration.h" -// The Arduino IDE doesn't allow to select the libraries, hence this condition. +// The Arduino IDE does not allow to select the libraries, hence this condition. #if (FONT_MODE == USE_FONT_TERMINAL) #ifndef hV_FONT_TERMINAL_RELEASE /// /// @brief Release /// -#define hV_FONT_TERMINAL_RELEASE 507 +#define hV_FONT_TERMINAL_RELEASE 801 #include "hV_Utilities_Common.h" #include "hV_Font.h" /// /// @brief Biggest font size -/// @details Based on the MCU, by default=0 +/// @details Based on the MCU, by default = 0 /// #if (MAX_FONT_SIZE > 0) #include "Terminal6x8e.h" @@ -124,7 +134,7 @@ class hV_Font_Terminal /// /// @brief Character size, x-axis - /// @param character character to evaluate, default=0=font general size + /// @param character character to evaluate, default = 0 = font general size /// @return horizontal size of character for current font, in pixels /// @note With setSpaceX included /// @note In variable font, each character has a specific size. The general size is indicative. @@ -197,6 +207,7 @@ class hV_Font_Terminal uint8_t f_fontSpaceX; ///< pixels between two characters, horizontal axis uint8_t f_fontSpaceY; ///< pixels between two characters, vertical axis bool f_fontSolid; ///< + /// @} }; /// @endcond diff --git a/src/hV_HAL_Peripherals.cpp b/src/hV_HAL_Peripherals.cpp new file mode 100644 index 0000000..491fefc --- /dev/null +++ b/src/hV_HAL_Peripherals.cpp @@ -0,0 +1,240 @@ +// +// hV_HAL_Peripherals.cpp +// C++ code +// ---------------------------------- +// +// Project highView Library Suite +// +// Created by Rei Vilo, 08 Jan 2024 +// +// Copyright (c) Rei Vilo, 2010-2024 +// Licence All rights reserved +// +// * Basic edition: for hobbyists and for basic usage +// Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +// +// * Evaluation edition: for professionals or organisations, evaluation only, no commercial usage +// All rights reserved +// +// * Commercial edition: for professionals or organisations, commercial usage +// All rights reserved +// +// Release 800: Added 3-wire SPI +// Release 801: Added SPI configuration + +#include "hV_HAL_Peripherals.h" + +#if defined(ENERGIA) +/// +/// @brief Proxy for SPISettings +/// @details Not implemented in Energia +/// @see https://www.arduino.cc/en/Reference/SPISettings +/// +struct _SPISettings_s +{ + uint32_t clock; ///< in Hz, checked against SPI_CLOCK_MAX = 16000000 + uint8_t bitOrder; ///< LSBFIRST, MSBFIRST + uint8_t dataMode; ///< SPI_MODE0, SPI_MODE1, SPI_MODE2, SPI_MODE3 +}; +/// +/// @brief SPI settings for screen +/// +_SPISettings_s _settingScreen; +#else +/// +/// @brief SPI settings for screen +/// +SPISettings _settingScreen; +#endif // ENERGIA + +#ifndef SPI_CLOCK_MAX +#define SPI_CLOCK_MAX 16000000 +#endif + +struct h_pinSPI3_t +{ + uint8_t pinClock; + uint8_t pinData; +}; + +h_pinSPI3_t h_pinSPI3; + +void hV_HAL_begin() +{ + // Empty +} + +// +// === SPI section +// +void hV_HAL_SPI_begin(uint32_t speed) +{ + _settingScreen = {speed, MSBFIRST, SPI_MODE0}; + +#if defined(ENERGIA) + + SPI.begin(); + SPI.setBitOrder(_settingScreen.bitOrder); + SPI.setDataMode(_settingScreen.dataMode); + SPI.setClockDivider(SPI_CLOCK_MAX / min(SPI_CLOCK_MAX, _settingScreen.clock)); + +#else + +#if defined(ARDUINO_XIAO_ESP32C3) + + // Board Xiao ESP32-C3 crashes if pins are specified. + SPI.begin(8, 9, 10); // SCK MISO MOSI + +#elif defined(ARDUINO_ESP32_PICO) + + // Board ESP32-Pico-DevKitM-2 crashes if pins are not specified. + SPI.begin(14, 12, 13); // SCK MISO MOSI + +#else // General case + + SPI.begin(); + +#endif // SPI specifics + + SPI.beginTransaction(_settingScreen); + +#endif // ENERGIA +} +// +// === End of SPI section +// + +// +// === Wire section +// +void hV_HAL_Wire_begin() +{ + Wire.begin(); + +#if defined(ENERGIA) + +#if defined(ENERGIA_ARCH_MSP430ELF) + + Wire.setClock(100000UL); // 100 kHz for MSP430 + +#endif // ENERGIA_ARCH_MSP430ELF + +#else // ARDUINO + + Wire.setClock(400000L); // 400 kHz + +#endif // ENERGIA ARDUINO +} + +void hV_HAL_Wire_end() +{ + Wire.end(); +} + +void hV_HAL_Wire_transfer(uint8_t address, uint8_t * dataWrite, size_t sizeWrite, uint8_t * dataRead, size_t sizeRead) +{ + if (sizeWrite > 0) + { + Wire.beginTransmission(address); + + for (uint8_t index = 0; index < sizeWrite; index++) + { + Wire.write(dataWrite[index]); + } + + Wire.endTransmission(); + +#if defined(ENERGIA) + + // Energia-MT I2C thread may hang + delay(4); + +#endif // ENERGIA + } + + if (sizeRead > 0) + { + memset(dataRead, 0x00, sizeRead); + Wire.requestFrom(address, sizeRead); + while (Wire.available() < sizeRead) + { + delay(4); + } + + for (uint8_t index = 0; index < sizeRead; index++) + { + dataRead[index] = Wire.read(); + } + } +} +// +// === End of Wire section +// + +// +// === 3-wire SPI section +// +void hV_HAL_SPI3_begin() +{ +#if defined(ARDUINO_XIAO_ESP32C3) + + // Board Xiao ESP32-C3 crashes if pins are not specified. + hV_HAL_SPI3_define(8, 9) // SCK SDA + +#elif defined(ARDUINO_ESP32_PICO) + + // void begin(int8_t sck=-1, int8_t miso=-1, int8_t mosi=-1, int8_t ss=-1); + // Board ESP32-Pico-DevKitM-2 crashes if pins are not specified. + hV_HAL_SPI3_define(14, 12); // SCK SDA + +#else // General case + + hV_HAL_SPI3_define(SCK, MOSI); // SCK SDA + +#endif // ARDUINO +} + +void hV_HAL_SPI3_define(uint8_t pinClock, uint8_t pinData) +{ + h_pinSPI3.pinClock = pinClock; + h_pinSPI3.pinData = pinData; +} + +uint8_t hV_HAL_SPI3_read() +{ + uint8_t value = 0; + + pinMode(h_pinSPI3.pinClock, OUTPUT); + pinMode(h_pinSPI3.pinData, INPUT); + + for (uint8_t i = 0; i < 8; ++i) + { + digitalWrite(h_pinSPI3.pinClock, HIGH); + delayMicroseconds(1); + value |= digitalRead(h_pinSPI3.pinData) << (7 - i); + digitalWrite(h_pinSPI3.pinClock, LOW); + delayMicroseconds(1); + } + + return value; +} + +void hV_HAL_SPI3_write(uint8_t value) +{ + pinMode(h_pinSPI3.pinClock, OUTPUT); + pinMode(h_pinSPI3.pinData, OUTPUT); + + for (uint8_t i = 0; i < 8; i++) + { + digitalWrite(h_pinSPI3.pinData, !!(value & (1 << (7 - i)))); + delayMicroseconds(1); + digitalWrite(h_pinSPI3.pinClock, HIGH); + delayMicroseconds(1); + digitalWrite(h_pinSPI3.pinClock, LOW); + delayMicroseconds(1); + } +} +// +// === End of 3-wire SPI section +// + diff --git a/src/hV_HAL_Peripherals.h b/src/hV_HAL_Peripherals.h index 1c66452..7787d6f 100755 --- a/src/hV_HAL_Peripherals.h +++ b/src/hV_HAL_Peripherals.h @@ -6,27 +6,37 @@ /// @n Based on highView technology /// /// @author Rei Vilo -/// @date 21 Sep 2023 -/// @version 700 +/// @date 21 Mar 2024 +/// @version 801 /// /// @copyright (c) Rei Vilo, 2010-2024 -/// @copyright Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) -/// -/// The highView Library Suite is shared under the Creative Commons licence Attribution-ShareAlike 4.0 International (CC BY-SA 4.0). +/// @copyright All rights reserved +/// @copyright For exclusive use with Pervasive Displays screens /// /// * Basic edition: for hobbyists and for basic usage /// @n Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) -/// /// @see https://creativecommons.org/licenses/by-sa/4.0/ /// /// @n Consider the Evaluation or Commercial editions for professionals or organisations and for commercial usage /// +/// * Evaluation edition: for professionals or organisations, evaluation only, no commercial usage +/// @n All rights reserved +/// +/// * Commercial edition: for professionals or organisations, commercial usage +/// @n All rights reserved +/// +/// * Viewer edition: for professionals or organisations +/// @n All rights reserved +/// +/// * Documentation +/// @n All rights reserved +/// #ifndef hV_HAL_PERIPHERALS_RELEASE /// /// @brief Release /// -#define hV_HAL_PERIPHERALS_RELEASE 700 +#define hV_HAL_PERIPHERALS_RELEASE 801 /// /// @brief SDK library @@ -49,4 +59,88 @@ #include #include +#define mySerial Serial + +/// +/// @brief General initialisation +/// +void hV_HAL_begin(); + +/// +/// @brief Configure and start SPI +/// @param speed SPI speed in Hz, 8000000 = default +/// @note Other parameters are +/// * Bit order: MSBFIRST +/// * Data mode: SPI_MODE0 +/// +void hV_HAL_SPI_begin(uint32_t speed = 8000000); + +/// +/// @name 3-wire SPI bus +/// @warning +/// * Arduino does not support 3-wire SPI, bit-bang simulation +/// * Viewer: For compatibility only, not implemented in Linux +/// @note hV_HAL_SPI3_begin() sets the pins for 3-wire SPI. +/// @{ + +/// +/// @brief Configure 3-wire SPI +/// @note Select default SCK as clock and MOSI as data (SDIO) +/// +void hV_HAL_SPI3_begin(); + +/// +/// @brief Set the 3-wire SPI pins +/// @param pinClock clock, default = SCK +/// @param pinData combined data, default = MOSI +/// +void hV_HAL_SPI3_define(uint8_t pinClock = SCK, uint8_t pinData = MOSI); + +/// +/// @brief Read a single byte +/// @return read byte +/// @note Configure the clock pin as output and data pin as input. +/// @warning /CS to be managed externally. +/// +uint8_t hV_HAL_SPI3_read(); + +/// +/// @brief Write a single byte +/// @param data byte +/// @note Configure the clock and data pins as output. +/// @warning /CS to be managed externally. +/// +void hV_HAL_SPI3_write(uint8_t value); + +/// +/// @name Wire bus +/// +/// @{ + +/// +/// @brief Configure and start Wire bus +/// @note Master mode only +/// +void hV_HAL_Wire_begin(); + +/// +/// @brief End Wire bus +/// +void hV_HAL_Wire_end(); + +/// +/// @brief Combined write and read +/// +/// @param[in] address I2C device address +/// @param[in] dataWrite buffer to write +/// @param[in] sizeWrite number of bytes +/// @param[out] dataRead buffer to read +/// @param[in] sizeRead number of bytes +/// @note If sizeRead = 0, no read performed +/// +void hV_HAL_Wire_transfer(uint8_t address, uint8_t * dataWrite, size_t sizeWrite, uint8_t * dataRead = 0, size_t sizeRead = 0); + +/// @} + #endif // hV_HAL_PERIPHERALS_RELEASE + diff --git a/src/hV_List_Boards.h b/src/hV_List_Boards.h index b9a2252..9a1988f 100755 --- a/src/hV_List_Boards.h +++ b/src/hV_List_Boards.h @@ -9,14 +9,18 @@ /// * 2- List of pre-configured boards /// /// @author Rei Vilo -/// @date 21 Sep 2023 -/// @version 700 +/// @date 21 Mar 2024 +/// @version 801 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright All rights reserved +/// @copyright For exclusive use with Pervasive Displays screens /// /// * Basic edition: for hobbyists and for basic usage /// @n Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +/// @see https://creativecommons.org/licenses/by-sa/4.0/ +/// +/// @n Consider the Evaluation or Commercial editions for professionals or organisations and for commercial usage /// /// * Evaluation edition: for professionals or organisations, evaluation only, no commercial usage /// @n All rights reserved @@ -24,6 +28,12 @@ /// * Commercial edition: for professionals or organisations, commercial usage /// @n All rights reserved /// +/// * Viewer edition: for professionals or organisations +/// @n All rights reserved +/// +/// * Documentation +/// @n All rights reserved +/// // SDK #include "stdint.h" @@ -32,7 +42,7 @@ /// /// @brief Release /// -#define hV_LIST_BOARDS_RELEASE 700 +#define hV_LIST_BOARDS_RELEASE 801 /// /// @brief Not connected pin @@ -70,7 +80,7 @@ struct pins_t /// @{ /// -/// @brief Raspberry Pi Pico and Pico W +/// @brief Raspberry Pi Pico and Pico W with default RP2040 configuration, tested /// @note Numbers refer to GPIOs, not pins /// @see https://github.com/earlephilhower/arduino-pico /// @note Recommended board @@ -82,15 +92,12 @@ const pins_t boardRaspberryPiPico_RP2040 = .panelBusy = 13, ///< EXT3 and EXT3-1 pin 3 Red -> GP13 .panelDC = 12, ///< EXT3 and EXT3-1 pin 4 Orange -> GP12 .panelReset = 11, ///< EXT3 and EXT3-1 pin 5 Yellow -> GP11 - ///< EXT3 and EXT3-1 pin 6 Green -> SPI MISO GP16 - ///< EXT3 and EXT3-1 pin 7 Blue -> SPI MOSI GP19 + ///< EXT3 and EXT3-1 pin 6 Green -> SPI MISO or NC GP16 + ///< EXT3 and EXT3-1 pin 7 Blue -> SPI MOSI or SDIO GP19 .flashCS = 10, ///< EXT3 and EXT3-1 pin 8 Violet -> GP10 .panelCS = 17, ///< EXT3 and EXT3-1 pin 9 Grey -> GP17 .panelCSS = 14, ///< EXT3 and EXT3-1 pin 12 Grey2 -> GP14 .flashCSS = 15, ///< EXT3 pin 20 or EXT3-1 pin 11 Black2 -> GP15 - ///< EXT3 and EXT3-1 pin 10 White -> GROUND - ///< EXT3-Touch pin 1 Brown -> I2C SDA GP5 - ///< EXT3-Touch pin 2 Black -> I2C SCL GP4 .touchInt = NOT_CONNECTED, ///< EXT3-Touch pin 3 Red -> GP2 .touchReset = NOT_CONNECTED, ///< EXT3-Touch pin 4 Orange -> GP3 .panelPower = NOT_CONNECTED, ///< Optional power circuit @@ -158,16 +165,16 @@ const pins_t boardESP32DevKitC = /// const pins_t boardLaunchPad = { - .panelBusy = 11, ///< EXT3 and EXT3-1 pin 3 Red - .panelDC = 12, ///< EXT3 and EXT3-1 pin 4 Orange - .panelReset = 13, ///< EXT3 and EXT3-1 pin 5 Yellow - .flashCS = 18, ///< EXT3 and EXT3-1 pin 8 Violet - .panelCS = 19, ///< EXT3 and EXT3-1 pin 9 Grey + .panelBusy = 11, ///< EXT3 and EXT3-1 pin 3 Red -> 11 + .panelDC = 12, ///< EXT3 and EXT3-1 pin 4 Orange -> 12 + .panelReset = 13, ///< EXT3 and EXT3-1 pin 5 Yellow -> 13 + .flashCS = 18, ///< EXT3 and EXT3-1 pin 8 Violet -> 18 + .panelCS = 19, ///< EXT3 and EXT3-1 pin 9 Grey -> 19 .panelCSS = 39, ///< EXT3 and EXT3-1 pin 12 Grey2 -> 39 .flashCSS = 38, ///< EXT3 pin 20 or EXT3-1 pin 11 Black2 -> 38 .touchInt = NOT_CONNECTED, ///< EXT3-Touch pin 3 Red -> 8 .touchReset = NOT_CONNECTED, ///< EXT3-Touch pin 4 Orange -> 6 - .panelPower = NOT_CONNECTED, ///< Optional power circuit + .panelPower = NOT_CONNECTED, ///< Optional power circuit -> 2 .cardCS = NOT_CONNECTED, ///< Separate SD-card board -> 5 .cardDetect = NOT_CONNECTED, ///< Separate SD-card board }; @@ -233,7 +240,7 @@ const pins_t boardRaspberryPiZeroB_RasPiArduino = }; /// -/// @brief Raspberry Pi Pico Arduino mbed configuration, tested +/// @brief Raspberry Pi Pico Arduino Mbed-OS configuration, not recommended, tested /// @warning Not recommended /// @deprecated Use boardRaspberryPiPico_RP2040 instead (7.0.0) /// @see https://github.com/arduino/ArduinoCore-mbed @@ -410,6 +417,31 @@ const pins_t boardXiaoRP2040 .cardDetect = NOT_CONNECTED, ///< Separate SD-card board }; +/// +/// @brief Silicon Labs EFR32xG24 Explorer Kit (xG24-EK2703A) configuration, tested +/// @note Numbers refer to GPIOs, not pins +/// @see https://github.com/earlephilhower/arduino-pico +/// @note Recommended board +/// +const pins_t boardSiLabsBG24Explorer = +{ + .panelBusy = 0x20, ///< EXT3 and EXT3-1 pin 3 Red -> PC00 + .panelDC = 0x28, ///< EXT3 and EXT3-1 pin 4 Orange -> PC08 + .panelReset = 0x10, ///< EXT3 and EXT3-1 pin 5 Yellow -> PB00 + .flashCS = 0x00, ///< EXT3 and EXT3-1 pin 8 Violet -> PA00 + .panelCS = 0x11, ///< EXT3 and EXT3-1 pin 9 Grey -> PB01 + .panelCSS = NOT_CONNECTED, ///< EXT3 and EXT3-1 pin 12 Grey2 -> P.0. + .flashCSS = NOT_CONNECTED, ///< EXT3 pin 20 or EXT3-1 pin 11 Black2 -> P.0. + ///< EXT3 and EXT3-1 pin 10 White -> GROUND + // .i2cSDA = 0x15, ///< EXT3-Touch pin 1 Brown -> I2C SDA PB05 + // .i2cSCL = 0x14, ///< EXT3-Touch pin 2 Black -> I2C SCL PB04 + .touchInt = NOT_CONNECTED, ///< EXT3-Touch pin 3 Red -> PD05 + .touchReset = NOT_CONNECTED, ///< EXT3-Touch pin 4 Orange -> PD04 + .panelPower = NOT_CONNECTED, ///< Optional power circuit + .cardCS = NOT_CONNECTED, ///< Separate SD-card board + .cardDetect = NOT_CONNECTED, ///< Separate SD-card board +}; + /// /// @brief Teensy 3.x configuration, tested /// diff --git a/src/hV_List_Constants.h b/src/hV_List_Constants.h index 49ce695..de950c1 100755 --- a/src/hV_List_Constants.h +++ b/src/hV_List_Constants.h @@ -6,14 +6,18 @@ /// @n Based on highView technology /// /// @author Rei Vilo -/// @date 21 Sep 2023 -/// @version 700 +/// @date 21 Mar 2024 +/// @version 801 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright All rights reserved +/// @copyright For exclusive use with Pervasive Displays screens /// /// * Basic edition: for hobbyists and for basic usage /// @n Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +/// @see https://creativecommons.org/licenses/by-sa/4.0/ +/// +/// @n Consider the Evaluation or Commercial editions for professionals or organisations and for commercial usage /// /// * Evaluation edition: for professionals or organisations, evaluation only, no commercial usage /// @n All rights reserved @@ -21,6 +25,12 @@ /// * Commercial edition: for professionals or organisations, commercial usage /// @n All rights reserved /// +/// * Viewer edition: for professionals or organisations +/// @n All rights reserved +/// +/// * Documentation +/// @n All rights reserved +/// // SDK #include "stdint.h" @@ -29,7 +39,7 @@ /// /// @brief Release /// -#define hV_LIST_CONSTANTS_RELEASE 700 +#define hV_LIST_CONSTANTS_RELEASE 801 /// /// * General parameters @@ -73,8 +83,8 @@ /// @brief Large screens sub-panels selection /// @note Numbers are sequential and exclusive /// @{ -#define PANEL_CS_MAIN 0x01 ///< Large screens sub-panels: first panel only -#define PANEL_CS_SECOND 0x02 ///< Large screens sub-panels: second panel only +#define PANEL_CS_MASTER 0x01 ///< Large screens sub-panels: first panel only +#define PANEL_CS_SLAVE 0x02 ///< Large screens sub-panels: second panel only #define PANEL_CS_BOTH 0x03 ///< Large screens sub-panels: both panels /// @} diff --git a/src/hV_List_Options.h b/src/hV_List_Options.h index 7270618..128eab3 100755 --- a/src/hV_List_Options.h +++ b/src/hV_List_Options.h @@ -17,11 +17,12 @@ /// * 11. Set storage mode, not implemented /// /// @author Rei Vilo -/// @date 21 Nov 2023 -/// @version 702 +/// @date 21 Mar 2024 +/// @version 801 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright All rights reserved +/// @copyright For exclusive use with Pervasive Displays screens /// /// * Basic edition: for hobbyists and for basic usage /// @n Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) @@ -35,12 +36,18 @@ /// * Commercial edition: for professionals or organisations, commercial usage /// @n All rights reserved /// +/// * Viewer edition: for professionals or organisations +/// @n All rights reserved +/// +/// * Documentation +/// @n All rights reserved +/// #ifndef hV_LIST_OPTIONS_RELEASE /// /// @brief Release /// -#define hV_LIST_OPTIONS_RELEASE 702 +#define hV_LIST_OPTIONS_RELEASE 801 /// /// @name 1- List of supported Pervasive Displays screens diff --git a/src/hV_List_Screens.h b/src/hV_List_Screens.h index ad41029..e47896b 100755 --- a/src/hV_List_Screens.h +++ b/src/hV_List_Screens.h @@ -10,14 +10,18 @@ /// * 1- List of supported Pervasive Displays screens /// /// @author Rei Vilo -/// @date 21 Nov 2023 -/// @version 702 +/// @date 21 Mar 2024 +/// @version 801 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright All rights reserved +/// @copyright For exclusive use with Pervasive Displays screens /// /// * Basic edition: for hobbyists and for basic usage /// @n Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +/// @see https://creativecommons.org/licenses/by-sa/4.0/ +/// +/// @n Consider the Evaluation or Commercial editions for professionals or organisations and for commercial usage /// /// * Evaluation edition: for professionals or organisations, evaluation only, no commercial usage /// @n All rights reserved @@ -25,6 +29,12 @@ /// * Commercial edition: for professionals or organisations, commercial usage /// @n All rights reserved /// +/// * Viewer edition: for professionals or organisations +/// @n All rights reserved +/// +/// * Documentation +/// @n All rights reserved +/// // SDK #include "stdint.h" @@ -33,12 +43,103 @@ /// /// @brief Release /// -#define hV_LIST_SCREENS_RELEASE 702 +#define hV_LIST_SCREENS_RELEASE 801 + +/// @deprecated Screen name format (8.0.0) +/// * Name format eScreen_EPD_EXT3___ is deprecated (8.0.0). +/// * Use name format eScreen_EPD___ instead (8.0.0). +/// /// /// @brief Screen type /// -#define eScreen_EPD_EXT3_t uint32_t +#define eScreen_EPD_t uint32_t + +/// +/// @brief Function for screen macros +/// +#define SCREEN(S, F, D) ((uint32_t)((S & 0x0fff) << 16 | (F & 0xff) << 8 | (D & 0xff))) + +/// +/// @brief Function for extra macros +/// +#define EXTRA(E) ((uint32_t)((E & 0x0f) << 28)) + +/// +/// @name Functions for features from screen macros +/// +#define SCREEN_SIZE(X) ((uint16_t)((X >> 16) & 0x0fff)) ///< Get size +#define SCREEN_FILM(X) ((uint8_t)((X >> 8) & 0xff)) ///< Get family +#define SCREEN_DRIVER(X) ((uint8_t)(X & 0xff)) ///< Get type +#define SCREEN_EXTRA(X) ((uint8_t)((X >> 28) & 0x0f)) ///< Get extra + +/// +/// @name Size, mask 0x0fff = 0..4095 +/// @{ +/// +#define SIZE_150 150 ///< 1.50" +#define SIZE_152 152 ///< 1.52" +#define SIZE_154 154 ///< 1.54" +#define SIZE_206 206 ///< 2.06" +#define SIZE_213 213 ///< 2.13" +#define SIZE_215 215 ///< 2.15" +#define SIZE_266 266 ///< 2.66" +#define SIZE_271 271 ///< 2.71" +#define SIZE_287 287 ///< 2.87" +#define SIZE_290 290 ///< 2.90" +#define SIZE_343 343 ///< 3.43" +#define SIZE_350 350 ///< 3.50" +#define SIZE_370 370 ///< 3.70" +#define SIZE_417 417 ///< 4.17" +#define SIZE_437 437 ///< 4.37" +#define SIZE_565 565 ///< 5.65" +#define SIZE_581 581 ///< 5.81" +#define SIZE_741 741 ///< 7.41" +#define SIZE_969 969 ///< 9.69" +#define SIZE_B98 1198 ///< 11.98" +#define SIZE_1198 1198 ///< 11.98", synonym for SIZE_B98 +/// @} + +/// +/// @name Film type, mask 0xff +/// @{ +/// +#define FILM_C 'C' ///< Film C, Standard +#define FILM_E 'E' ///< Film E, BWR, deprecated +#define FILM_F 'F' ///< Film E, BWR, deprecated +#define FILM_G 'G' ///< Film G, BWY, deprecated +#define FILM_H 'H' ///< Film H, Freezer +#define FILM_J 'J' ///< Film J, BWR, "Spectra" +#define FILM_K 'K' ///< Film K, Fast update + Wide temperature +#define FILM_P 'P' ///< Film P, Fast update +#define FILM_Q 'Q' ///< Film Q, BWRY, "Spectra 4" +/// @} + +/// +/// @name Driver type, mask 0xff +/// @{ +/// +#define DRIVER_5 '5' ///< Driver 5 +#define DRIVER_6 '6' ///< Driver 6 +#define DRIVER_8 '8' ///< Driver 8 +#define DRIVER_9 '9' ///< Driver 9 +#define DRIVER_A 'A' ///< Driver A +#define DRIVER_B 'B' ///< Driver B +#define DRIVER_C 'C' ///< Driver C +#define DRIVER_D 'D' ///< Driver D +#define DRIVER_E 'E' ///< Driver E +#define DRIVER_F 'F' ///< Driver F +#define DRIVER_H 'H' ///< Driver H +#define DRIVER_J 'J' ///< Driver J +/// @} + +/// +/// @name Extra, mask 0x0f = 0..15 +/// @{ +/// +#define EXTRA_TOUCH 1 ///< Touch +#define EXTRA_DEMO 2 ///< Demo +/// @} /// /// @name Monochrome screens @@ -46,20 +147,28 @@ /// @see https://www.pervasivedisplays.com/products/?_sft_etc_itc=itc&_sft_product_colour=black-white /// @{ /// -#define eScreen_EPD_EXT3_154 (uint32_t)0x1500 ///< reference xE2154CSxxx -#define eScreen_EPD_EXT3_213 (uint32_t)0x2100 ///< reference xE2213CSxxx -#define eScreen_EPD_EXT3_266 (uint32_t)0x2600 ///< reference xE2266CSxxx -#define eScreen_EPD_EXT3_271 (uint32_t)0x2700 ///< reference xE2271CSxxx -#define eScreen_EPD_EXT3_287 (uint32_t)0x2800 ///< reference xE2287CSxxx -#define eScreen_EPD_EXT3_290 (uint32_t)0x2900 ///< reference xE2290CSxxx -#define eScreen_EPD_EXT3_370 (uint32_t)0x3700 ///< reference xE2370CSxxx -#define eScreen_EPD_EXT3_417 (uint32_t)0x4100 ///< reference xE2417CSxxx -#define eScreen_EPD_EXT3_437 (uint32_t)0x4300 ///< reference xE2437CSxxx -#define eScreen_EPD_EXT3_565 (uint32_t)0x5600 ///< reference xE2565CSxxx -#define eScreen_EPD_EXT3_581 (uint32_t)0x580B ///< reference xE2581CS0Bx -#define eScreen_EPD_EXT3_741 (uint32_t)0x740B ///< reference xE2741CS0Bx -#define eScreen_EPD_EXT3_969 (uint32_t)0x960B ///< reference xE2969CS0Bx -#define eScreen_EPD_EXT3_B98 (uint32_t)0xB90B ///< reference xE2B98CS0Bx +#define eScreen_EPD_154_CS_0C SCREEN(SIZE_154, FILM_C, DRIVER_C) ///< reference xE2154CS0Cx +#define eScreen_EPD_213_CS_0C SCREEN(SIZE_213, FILM_C, DRIVER_C) ///< reference xE2213CS0Cx +#define eScreen_EPD_215_CS_06 SCREEN(SIZE_215, FILM_C, DRIVER_6) ///< reference xE2215CS06x +#define eScreen_EPD_266_CS_09 SCREEN(SIZE_266, FILM_C, DRIVER_9) ///< reference xE2266xS09x +#define eScreen_EPD_266_CS_0C SCREEN(SIZE_266, FILM_C, DRIVER_C) ///< reference xE2266CS0Cx +#define eScreen_EPD_271_CS_09 SCREEN(SIZE_271, FILM_C, DRIVER_9) ///< reference xE2271CS09x +#define eScreen_EPD_287_CS_05 SCREEN(SIZE_287, FILM_C, DRIVER_5) ///< reference xE2287CS05x +#define eScreen_EPD_287_CS_09 SCREEN(SIZE_287, FILM_C, DRIVER_9) ///< reference xE2287CS09x +#define eScreen_EPD_370_CS_0C SCREEN(SIZE_370, FILM_C, DRIVER_C) ///< reference xE2370CS0Cx +#define eScreen_EPD_417_CS_05 SCREEN(SIZE_417, FILM_C, DRIVER_5) ///< reference xE2417CS05x +#define eScreen_EPD_417_CS_0D SCREEN(SIZE_417, FILM_C, DRIVER_D) ///< reference xE2417CS0Dx +#define eScreen_EPD_437_CS_08 SCREEN(SIZE_437, FILM_C, DRIVER_8) ///< reference xE2437CS08x +#define eScreen_EPD_437_CS_0C SCREEN(SIZE_437, FILM_C, DRIVER_C) ///< reference xE2437CS0Cx +#define eScreen_EPD_581_CS_0B SCREEN(SIZE_581, FILM_C, DRIVER_B) ///< reference xE2581CS0Bx +#define eScreen_EPD_741_CS_08 SCREEN(SIZE_741, FILM_C, DRIVER_8) ///< reference xE2741CS08x +#define eScreen_EPD_741_CS_0B SCREEN(SIZE_741, FILM_C, DRIVER_B) ///< reference xE2741CS0Bx +#define eScreen_EPD_969_CS_08 SCREEN(SIZE_969, FILM_C, DRIVER_8) ///< reference xE2969CS08x +#define eScreen_EPD_969_CS_0B SCREEN(SIZE_969, FILM_C, DRIVER_B) ///< reference xE2969CS0Bx +#define eScreen_EPD_B98_CS_0B SCREEN(SIZE_B98, FILM_C, DRIVER_B) ///< reference xE2B98CS0Bx + +#define eScreen_EPD_213_HS_09 SCREEN(SIZE_213, FILM_H, DRIVER_9) ///< reference xE2213HS09x +#define eScreen_EPD_266_HS_09 SCREEN(SIZE_266, FILM_H, DRIVER_9) ///< reference xE2266HS09x /// @} /// @@ -68,20 +177,42 @@ /// @see https://www.pervasivedisplays.com/products/?_sft_etc_itc=itc&_sft_product_colour=black-white-red /// @{ /// -#define eScreen_EPD_EXT3_154_BWR (uint32_t)0x101500 ///< reference xE2154CSxxx -#define eScreen_EPD_EXT3_213_BWR (uint32_t)0x102100 ///< reference xE2213CSxxx -#define eScreen_EPD_EXT3_266_BWR (uint32_t)0x102600 ///< reference xE2266CSxxx -#define eScreen_EPD_EXT3_271_BWR (uint32_t)0x102700 ///< reference xE2271CSxxx -#define eScreen_EPD_EXT3_287_BWR (uint32_t)0x102800 ///< reference xE2287CSxxx -#define eScreen_EPD_EXT3_290_BWR (uint32_t)0x102900 ///< reference xE2290CSxxx -#define eScreen_EPD_EXT3_370_BWR (uint32_t)0x103700 ///< reference xE2370CSxxx -#define eScreen_EPD_EXT3_417_BWR (uint32_t)0x104100 ///< reference xE2417CSxxx -#define eScreen_EPD_EXT3_437_BWR (uint32_t)0x104300 ///< reference xE2437CSxxx -#define eScreen_EPD_EXT3_565_BWR (uint32_t)0x105600 ///< reference xE2565CSxxx -#define eScreen_EPD_EXT3_581_0B_BWR (uint32_t)0x10580B ///< reference xE2581CS0Bx -#define eScreen_EPD_EXT3_741_0B_BWR (uint32_t)0x10740B ///< reference xE2741CS0Bx -#define eScreen_EPD_EXT3_969_0B_BWR (uint32_t)0x10960B ///< reference xE2969CS0Bx -#define eScreen_EPD_EXT3_B98_0B_BWR (uint32_t)0x10B90B ///< reference xE2B98CS0Bx +#define eScreen_EPD_213_ES_09 SCREEN(SIZE_213, FILM_E, DRIVER_9) ///< reference xE2213ES09x +#define eScreen_EPD_287_ES_05 SCREEN(SIZE_287, FILM_E, DRIVER_5) ///< reference xE2287ES05x + +#define eScreen_EPD_154_FS_09 SCREEN(SIZE_154, FILM_F, DRIVER_9) ///< reference xE2154FS09x +#define eScreen_EPD_266_FS_09 SCREEN(SIZE_266, FILM_F, DRIVER_9) ///< reference xE2266FS09x +#define eScreen_EPD_271_FS_09 SCREEN(SIZE_271, FILM_F, DRIVER_9) ///< reference xE2271FS09x +#define eScreen_EPD_287_FS_09 SCREEN(SIZE_287, FILM_F, DRIVER_9) ///< reference xE2287FS09x +#define eScreen_EPD_370_FS_08 SCREEN(SIZE_370, FILM_F, DRIVER_8) ///< reference xE2370FS08x +#define eScreen_EPD_417_FS_05 SCREEN(SIZE_417, FILM_F, DRIVER_5) ///< reference xE2417FS05x +#define eScreen_EPD_437_FS_08 SCREEN(SIZE_437, FILM_F, DRIVER_8) ///< reference xE2437FS08x +#define eScreen_EPD_581_FS_08 SCREEN(SIZE_581, FILM_F, DRIVER_8) ///< reference xE2581FS08x +#define eScreen_EPD_741_FS_08 SCREEN(SIZE_741, FILM_F, DRIVER_8) ///< reference xE2741FS08x +#define eScreen_EPD_B98_FS_08 SCREEN(SIZE_B98, FILM_F, DRIVER_8) ///< reference xE2B98FS08x + +#define eScreen_EPD_154_GS_09 SCREEN(SIZE_154, FILM_G, DRIVER_9) ///< reference xE2154GS09x +#define eScreen_EPD_213_GS_09 SCREEN(SIZE_213, FILM_G, DRIVER_9) ///< reference xE2213GS09x +#define eScreen_EPD_266_GS_09 SCREEN(SIZE_266, FILM_G, DRIVER_9) ///< reference xE2266GS09x +#define eScreen_EPD_417_GS_05 SCREEN(SIZE_417, FILM_G, DRIVER_5) ///< reference xE2417GS05x +#define eScreen_EPD_437_GS_08 SCREEN(SIZE_437, FILM_G, DRIVER_8) ///< reference xE2437GS08x +#define eScreen_EPD_741_GS_08 SCREEN(SIZE_741, FILM_G, DRIVER_8) ///< reference xE2741GS08x +#define eScreen_EPD_B98_GS_08 SCREEN(SIZE_B98, FILM_G, DRIVER_8) ///< reference xE2B98GS08x + +#define eScreen_EPD_154_JS_0C SCREEN(SIZE_154, FILM_J, DRIVER_C) ///< reference xE2154JS0Cx +#define eScreen_EPD_213_JS_0C SCREEN(SIZE_213, FILM_J, DRIVER_C) ///< reference xE2213JS0Cx +#define eScreen_EPD_266_JS_0C SCREEN(SIZE_266, FILM_J, DRIVER_C) ///< reference xE2266JS0Cx +#define eScreen_EPD_271_JS_09 SCREEN(SIZE_271, FILM_J, DRIVER_9) ///< reference xE2271JS09x +#define eScreen_EPD_287_JS_09 SCREEN(SIZE_287, FILM_J, DRIVER_9) ///< reference xE2287JS09x +#define eScreen_EPD_290_JS_0F SCREEN(SIZE_290, FILM_J, DRIVER_F) ///< reference xE2290JS0Fx +#define eScreen_EPD_370_JS_0C SCREEN(SIZE_370, FILM_J, DRIVER_C) ///< reference xE2370JS0Cx +#define eScreen_EPD_437_JS_08 SCREEN(SIZE_437, FILM_J, DRIVER_8) ///< reference xE2437JS08x +#define eScreen_EPD_565_JS_08 SCREEN(SIZE_565, FILM_J, DRIVER_8) ///< reference xE2565JS08x +#define eScreen_EPD_581_JS_0B SCREEN(SIZE_581, FILM_J, DRIVER_B) ///< reference xE2581JS0Bx +#define eScreen_EPD_741_JS_0B SCREEN(SIZE_741, FILM_J, DRIVER_B) ///< reference xE2741JS0Bx +#define eScreen_EPD_969_JS_08 SCREEN(SIZE_969, FILM_J, DRIVER_8) ///< reference xE2969JS08x +#define eScreen_EPD_969_JS_0B SCREEN(SIZE_969, FILM_J, DRIVER_B) ///< reference xE2969JS0Bx +#define eScreen_EPD_B98_JS_0B SCREEN(SIZE_B98, FILM_J, DRIVER_B) ///< reference xE2B98JS0Bx /// @} /// @@ -90,10 +221,10 @@ /// @see https://www.pervasivedisplays.com/products/?_sft_etc_itc=itc&_sft_product_colour=black-white-red-yellow /// @{ /// -#define eScreen_EPD_EXT3_154_BWRY (uint32_t)0x20150F ///< reference xE2154QS0Fx -#define eScreen_EPD_EXT3_213_BWRY (uint32_t)0x20210F ///< reference xE2213QS0Fx -#define eScreen_EPD_EXT3_266_BWRY (uint32_t)0x20260F ///< reference xE2266QS0Fx -#define eScreen_EPD_EXT3_417_BWRY (uint32_t)0x20410A ///< reference xE2417QS0Ax +#define eScreen_EPD_154_QS_0F SCREEN(SIZE_154, FILM_Q, DRIVER_F) ///< reference xE2154QS0Fx +#define eScreen_EPD_213_QS_0F SCREEN(SIZE_213, FILM_Q, DRIVER_F) ///< reference xE2213QS0Fx +#define eScreen_EPD_266_QS_0F SCREEN(SIZE_266, FILM_Q, DRIVER_F) ///< reference xE2266QS0Fx +#define eScreen_EPD_417_QS_0A SCREEN(SIZE_417, FILM_Q, DRIVER_A) ///< reference xE2417QS0Ax /// @} /// @@ -103,12 +234,10 @@ /// @see https://www.pervasivedisplays.com/products /// @{ /// -#define eScreen_EPD_EXT3_271_09_Touch (uint32_t)0x032709 ///< reference xTP271PGH0x -#define eScreen_EPD_EXT3_270_09_Touch (uint32_t)0x032709 ///< reference xTP270PGH0x, legacy name -#define eScreen_EPD_EXT3_370_0C_Touch (uint32_t)0x03370C ///< reference xTP370PGH0x -#define eScreen_EPD_EXT3_270_Touch (uint32_t)0x032709 ///< reference xTP270PGH0x, legacy name -#define eScreen_EPD_EXT3_271_Touch (uint32_t)0x032709 ///< reference xTP271PGH0x, legacy name -#define eScreen_EPD_EXT3_370_Touch (uint32_t)0x03370C ///< reference xTP370PGH0x, legacy name +#define eScreen_EPD_271_PS_09_Touch SCREEN(SIZE_271, FILM_P, DRIVER_9) | EXTRA(EXTRA_TOUCH) ///< reference xE2271PS09x +#define eScreen_EPD_271_KS_09_Touch SCREEN(SIZE_271, FILM_K, DRIVER_9) | EXTRA(EXTRA_TOUCH) ///< reference xE2271KS09x +#define eScreen_EPD_343_PS_0B_Touch SCREEN(SIZE_343, FILM_P, DRIVER_B) | EXTRA(EXTRA_TOUCH) ///< reference xE2343PS0Bx +#define eScreen_EPD_370_PS_0C_Touch SCREEN(SIZE_370, FILM_P, DRIVER_C) | EXTRA(EXTRA_TOUCH) ///< reference xE2370PS0Cx /// @} /// @name Monochrome screens with embedded fast update @@ -116,23 +245,22 @@ /// @see https://www.pervasivedisplays.com/products/?_sft_etc_itc=pu+itc /// @{ /// -#define eScreen_EPD_EXT3_154_0C_Fast (uint32_t)0x01150C ///< reference xE2154PS0Cx -#define eScreen_EPD_EXT3_213_0E_Fast (uint32_t)0x01210E ///< reference xE2213PS0Ex -#define eScreen_EPD_EXT3_266_0C_Fast (uint32_t)0x01260C ///< reference xE2266PS0Cx -#define eScreen_EPD_EXT3_271_09_Fast (uint32_t)0x012709 ///< reference xE2271PS09x -#define eScreen_EPD_EXT3_270_09_Fast (uint32_t)0x012709 ///< reference xE2271PS09x, legacy name -#define eScreen_EPD_EXT3_287_09_Fast (uint32_t)0x012809 ///< reference xE2287PS09x -#define eScreen_EPD_EXT3_370_0C_Fast (uint32_t)0x01370C ///< reference xE2370PS0Cx -#define eScreen_EPD_EXT3_417_0D_Fast (uint32_t)0x01410D ///< reference xE2417PS0Dx -#define eScreen_EPD_EXT3_437_0C_Fast (uint32_t)0x01430C ///< reference xE2437PS0Cx -/// @todo eScreen_EPD_EXT3_581_0B_Fast not tested -#define eScreen_EPD_EXT3_581_0B_Fast (uint32_t)0x01580B ///< reference xE2581PS0Bx, not tested -/// @todo eScreen_EPD_EXT3_741_0B_Fast not tested -#define eScreen_EPD_EXT3_741_0B_Fast (uint32_t)0x01740B ///< reference xE2741PS0Bx, not tested -/// @todo eScreen_EPD_EXT3_969_0B_Fast not tested -#define eScreen_EPD_EXT3_969_0B_Fast (uint32_t)0x01960B ///< reference xE2969PS0Bx, not tested -/// @todo eScreen_EPD_EXT3_B98_0B_Fast not tested -#define eScreen_EPD_EXT3_B98_0B_Fast (uint32_t)0x01B90B ///< reference xE2B98PS0Bx, not tested +#define eScreen_EPD_154_PS_0C SCREEN(SIZE_154, FILM_P, DRIVER_C) ///< reference xE2154PS0Cx +#define eScreen_EPD_213_PS_0E SCREEN(SIZE_213, FILM_P, DRIVER_E) ///< reference xE2213PS0Ex +#define eScreen_EPD_266_PS_0C SCREEN(SIZE_266, FILM_P, DRIVER_C) ///< reference xE2266PS0Cx +#define eScreen_EPD_271_PS_09 SCREEN(SIZE_271, FILM_P, DRIVER_9) ///< reference xE2271PS09x +#define eScreen_EPD_287_PS_09 SCREEN(SIZE_287, FILM_P, DRIVER_9) ///< reference xE2287PS09x +#define eScreen_EPD_370_PS_0C SCREEN(SIZE_370, FILM_P, DRIVER_C) ///< reference xE2370PS0Cx +#define eScreen_EPD_417_PS_0D SCREEN(SIZE_417, FILM_P, DRIVER_D) ///< reference xE2417PS0Dx +#define eScreen_EPD_437_PS_0C SCREEN(SIZE_437, FILM_P, DRIVER_C) ///< reference xE2437PS0Cx +// /// @todo eScreen_EPD_581_PS_0B not tested +// #define eScreen_EPD_581_PS_0B SCREEN(SIZE_581, FILM_P, DRIVER_B) ///< reference xE2581PS0Bx, not tested +// /// @todo eScreen_EPD_741_PS_0B not tested +// #define eScreen_EPD_741_PS_0B SCREEN(SIZE_741, FILM_P, DRIVER_B) ///< reference xE2741PS0Bx, not tested +// /// @todo eScreen_EPD_969_PS_0B not tested +// #define eScreen_EPD_969_PS_0B SCREEN(SIZE_969, FILM_P, DRIVER_B) ///< reference xE2969PS0Bx, not tested +// /// @todo eScreen_EPD_B98_PS_0B not tested +// #define eScreen_EPD_B98_PS_0B SCREEN(SIZE_B98, FILM_P, DRIVER_B) ///< reference xE2B98PS0Bx, not tested /// @} /// @name Monochrome screens with embedded fast update and wide temperature @@ -140,27 +268,27 @@ /// @see https://www.pervasivedisplays.com/products/?_sft_etc_itc=pu+itc&_sft_temperature_range=m15c-to-p60c /// @{ /// -#define eScreen_EPD_EXT3_150_0J_Wide (uint32_t)0x49154A ///< reference xE2150KS0Jx -#define eScreen_EPD_EXT3_152_0J_Wide (uint32_t)0x49154A ///< reference xE2152KS0Jx -#define eScreen_EPD_EXT3_154_0C_Wide (uint32_t)0x09150C ///< reference xE2154KS0Cx -#define eScreen_EPD_EXT3_206_0E_Wide (uint32_t)0x09200E ///< reference xE2206KS0Ex -#define eScreen_EPD_EXT3_213_0E_Wide (uint32_t)0x09210E ///< reference xE2213KS0Ex -#define eScreen_EPD_EXT3_266_0C_Wide (uint32_t)0x09260C ///< reference xE2266KS0Cx -#define eScreen_EPD_EXT3_271_09_Wide (uint32_t)0x092709 ///< reference xE2271KS09x -/// @todo eScreen_EPD_EXT3_287_09_Wide not tested -#define eScreen_EPD_EXT3_287_09_Wide (uint32_t)0x092809 ///< reference xE2287PS09x, not tested -#define eScreen_EPD_EXT3_290_0F_Wide (uint32_t)0x09290F ///< reference xE2290KS0Fx -#define eScreen_EPD_EXT3_370_0C_Wide (uint32_t)0x09370C ///< reference xE2370KS0Cx -#define eScreen_EPD_EXT3_417_0D_Wide (uint32_t)0x09410D ///< reference xE2417KS0Dx -/// @todo eScreen_EPD_EXT3_437_0C_Wide not tested -#define eScreen_EPD_EXT3_437_0C_Wide (uint32_t)0x09430C ///< reference xE2437KS0Cx, not tested -#define eScreen_EPD_EXT3_581_06_Wide (uint32_t)0x09580B ///< reference xE2581KS0Bx -/// @todo eScreen_EPD_EXT3_741_0B_Wide not tested -#define eScreen_EPD_EXT3_741_0B_Wide (uint32_t)0x09740B ///< reference xE2741KS0Bx, not tested -/// @todo eScreen_EPD_EXT3_969_0B_Wide not tested -#define eScreen_EPD_EXT3_969_0B_Wide (uint32_t)0x09960B ///< reference xE2969KS0Bx, not tested -/// @todo eScreen_EPD_EXT3_B98_0B_Wide not tested -#define eScreen_EPD_EXT3_B98_0B_Wide (uint32_t)0x09B90B ///< reference xE2B98KS0Bx, not tested +#define eScreen_EPD_150_KS_0J SCREEN(SIZE_150, FILM_K, DRIVER_J) ///< reference xE2150KS0Jx +#define eScreen_EPD_152_KS_0J SCREEN(SIZE_152, FILM_K, DRIVER_J) ///< reference xE2152KS0Jx +#define eScreen_EPD_154_KS_0C SCREEN(SIZE_154, FILM_K, DRIVER_C) ///< reference xE2154KS0Cx +#define eScreen_EPD_206_KS_0E SCREEN(SIZE_206, FILM_K, DRIVER_E) ///< reference xE2206KS0Ex +#define eScreen_EPD_213_KS_0E SCREEN(SIZE_213, FILM_K, DRIVER_E) ///< reference xE2213KS0Ex +#define eScreen_EPD_266_KS_0C SCREEN(SIZE_266, FILM_K, DRIVER_C) ///< reference xE2266KS0Cx +#define eScreen_EPD_271_KS_09 SCREEN(SIZE_271, FILM_K, DRIVER_9) ///< reference xE2271KS09x +#define eScreen_EPD_271_KS_0C SCREEN(SIZE_271, FILM_K, DRIVER_C) ///< reference xE2271KS0Cx +#define eScreen_EPD_290_KS_0F SCREEN(SIZE_290, FILM_K, DRIVER_F) ///< reference xE2290KS0Fx +#define eScreen_EPD_370_KS_0C SCREEN(SIZE_370, FILM_K, DRIVER_C) ///< reference xE2370KS0Cx +#define eScreen_EPD_417_KS_0D SCREEN(SIZE_417, FILM_K, DRIVER_D) ///< reference xE2417KS0Dx +/// @todo eScreen_EPD_437_KS_0C not tested +#define eScreen_EPD_437_KS_0C SCREEN(SIZE_437, FILM_K, DRIVER_C) ///< reference xE2437KS0Cx, not tested +// /// @todo eScreen_EPD_581_KS_0B not tested +// #define eScreen_EPD_581_KS_0B SCREEN(SIZE_581, FILM_K, DRIVER_B) ///< reference xE2581KS0Bx, not tested +// /// @todo eScreen_EPD_741_KS_0B not tested +// #define eScreen_EPD_741_KS_0B SCREEN(SIZE_741, FILM_K, DRIVER_B) ///< reference xE2741KS0Bx, not tested +// /// @todo eScreen_EPD_969_KS_0B not tested +// #define eScreen_EPD_969_KS_0B SCREEN(SIZE_969, FILM_K, DRIVER_B) ///< reference xE2969KS0Bx, not tested +// /// @todo eScreen_EPD_B98_KS_0B not tested +// #define eScreen_EPD_B98_KS_0B SCREEN(SIZE_B98, FILM_K, DRIVER_B) ///< reference xE2B98KS0Bx, not tested /// @} /// @@ -169,30 +297,31 @@ /// * Black-white-red screens and monochrome screens /// @n Frame-buffer size = width * height / 8 * depth, uint32_t /// @n Depth = 2 -/// * Black-white-red_yellow screens +/// * Black-white-red-yellow screens /// @n Frame-buffer size = width * height / 4 * depth, uint32_t /// @n Depth = 1 /// @{ /// -#define frameSize_EPD_EXT3_150 (uint32_t)(10000) ///< reference xE2150xS0xx -#define frameSize_EPD_EXT3_152 (uint32_t)(10000) ///< reference xE2152xS0xx -#define frameSize_EPD_EXT3_154 (uint32_t)(5776) ///< reference xE2154xS0xx -#define frameSize_EPD_EXT3_206 (uint32_t)(7936) ///< reference xE2206xS0xx -#define frameSize_EPD_EXT3_213 (uint32_t)(5512) ///< reference xE2213xS0xx -#define frameSize_EPD_EXT3_266 (uint32_t)(11248) ///< reference xE2266xS0xx -#define frameSize_EPD_EXT3_270 (uint32_t)(11616) ///< reference xE2271xS0xx, legacy name -#define frameSize_EPD_EXT3_271 (uint32_t)(11616) ///< reference xE2271xS0xx -#define frameSize_EPD_EXT3_287 (uint32_t)(9472) ///< reference xE2287xS0xx -#define frameSize_EPD_EXT3_290 (uint32_t)(16128) ///< reference xE2290xS0xx -#define frameSize_EPD_EXT3_350 (uint32_t)(24960) ///< reference xE2350xS0xx -#define frameSize_EPD_EXT3_370 (uint32_t)(24960) ///< reference xE2370xS0xx -#define frameSize_EPD_EXT3_417 (uint32_t)(30000) ///< reference xE2417xS0xx -#define frameSize_EPD_EXT3_437 (uint32_t)(21120) ///< reference xE2437xS0xx -#define frameSize_EPD_EXT3_565 (uint32_t)(33600) ///< reference xE2565xS0xx -#define frameSize_EPD_EXT3_581 (uint32_t)(46080) ///< reference xE2581xS0xx -#define frameSize_EPD_EXT3_741 (uint32_t)(96000) ///< reference xE2741xS0xx -#define frameSize_EPD_EXT3_969 (uint32_t)(161280) ///< reference xE2969xS0xx -#define frameSize_EPD_EXT3_B98 (uint32_t)(184320) ///< reference xE21198xS0xx +#define frameSize_EPD_150 (uint32_t)(10000) ///< reference xE2150xS0xx +#define frameSize_EPD_152 (uint32_t)(10000) ///< reference xE2152xS0xx +#define frameSize_EPD_154 (uint32_t)(5776) ///< reference xE2154xS0xx +#define frameSize_EPD_206 (uint32_t)(7936) ///< reference xE2206xS0xx +#define frameSize_EPD_213 (uint32_t)(5512) ///< reference xE2213xS0xx +#define frameSize_EPD_266 (uint32_t)(11248) ///< reference xE2266xS0xx +#define frameSize_EPD_270 (uint32_t)(11616) ///< reference xE2271xS0xx, legacy name +#define frameSize_EPD_271 (uint32_t)(11616) ///< reference xE2271xS0xx +#define frameSize_EPD_287 (uint32_t)(9472) ///< reference xE2287xS0xx +#define frameSize_EPD_290 (uint32_t)(16128) ///< reference xE2290xS0xx +#define frameSize_EPD_343 (uint32_t)(22344) ///< reference xE2343xS0xx +#define frameSize_EPD_350 (uint32_t)(24960) ///< reference xE2350xS0xx +#define frameSize_EPD_370 (uint32_t)(24960) ///< reference xE2370xS0xx +#define frameSize_EPD_417 (uint32_t)(30000) ///< reference xE2417xS0xx +#define frameSize_EPD_437 (uint32_t)(21120) ///< reference xE2437xS0xx +#define frameSize_EPD_565 (uint32_t)(33600) ///< reference xE2565xS0xx +#define frameSize_EPD_581 (uint32_t)(46080) ///< reference xE2581xS0xx +#define frameSize_EPD_741 (uint32_t)(96000) ///< reference xE2741xS0xx +#define frameSize_EPD_969 (uint32_t)(161280) ///< reference xE2969xS0xx +#define frameSize_EPD_B98 (uint32_t)(184320) ///< reference xE21198xS0xx /// @} #endif // hV_LIST_SCREENS_RELEASE diff --git a/src/hV_List_Screens_Legacy.h b/src/hV_List_Screens_Legacy.h new file mode 100644 index 0000000..f32d2a1 --- /dev/null +++ b/src/hV_List_Screens_Legacy.h @@ -0,0 +1,173 @@ +/// +/// @file hV_List_Screens_Legacy.h +/// @brief List of supported Pervasive Displays screens +/// @note Legacy screens are listed in the corresponding screen libraries +/// +/// @details Project Pervasive Displays Library Suite +/// @n Based on highView technology +/// +/// @n Content +/// * 1- List of supported Pervasive Displays screens +/// +/// @author Rei Vilo +/// @date 21 Mar 2024 +/// @version 801 +/// +/// @copyright (c) Rei Vilo, 2010-2024 +/// @copyright All rights reserved +/// @copyright For exclusive use with Pervasive Displays screens +/// +/// * Basic edition: for hobbyists and for basic usage +/// @n Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +/// @see https://creativecommons.org/licenses/by-sa/4.0/ +/// +/// @n Consider the Evaluation or Commercial editions for professionals or organisations and for commercial usage +/// +/// * Evaluation edition: for professionals or organisations, evaluation only, no commercial usage +/// @n All rights reserved +/// +/// * Commercial edition: for professionals or organisations, commercial usage +/// @n All rights reserved +/// +/// * Viewer edition: for professionals or organisations +/// @n All rights reserved +/// +/// * Documentation +/// @n All rights reserved +/// + +// SDK +#include "stdint.h" + +#ifndef hV_LIST_SCREENS_LEGACY_RELEASE +/// +/// @brief Release +/// +#define hV_LIST_SCREENS_LEGACY_RELEASE 801 + +// Current list +#include "hV_List_Screens.h" + +/// +/// @name Monochrome screens +/// @note Global update mode +/// @see https://www.pervasivedisplays.com/products/?_sft_etc_itc=itc&_sft_product_colour=black-white +/// @{ +/// +#define eScreen_EPD_EXT3_154 eScreen_EPD_154_CS_0C ///< reference xE2154CSxxx +#define eScreen_EPD_EXT3_213 eScreen_EPD_213_CS_0C ///< reference xE2213CSxxx +#define eScreen_EPD_EXT3_266 eScreen_EPD_266_HS_09 ///< reference xE2266CSxxx +#define eScreen_EPD_EXT3_271 eScreen_EPD_271_CS_09 ///< reference xE2271CSxxx +#define eScreen_EPD_EXT3_287 eScreen_EPD_287_CS_09 ///< reference xE2287CSxxx +#define eScreen_EPD_EXT3_370 eScreen_EPD_370_CS_0C ///< reference xE2370CSxxx +#define eScreen_EPD_EXT3_417 eScreen_EPD_417_CS_0D ///< reference xE2417CSxxx +#define eScreen_EPD_EXT3_437 eScreen_EPD_437_CS_0C ///< reference xE2437CSxxx +#define eScreen_EPD_EXT3_581 eScreen_EPD_581_CS_0B ///< reference xE2581CS0Bx +#define eScreen_EPD_EXT3_741 eScreen_EPD_741_CS_0B ///< reference xE2741CS0Bx +#define eScreen_EPD_EXT3_969 eScreen_EPD_969_CS_0B ///< reference xE2969CS0Bx +#define eScreen_EPD_EXT3_B98 eScreen_EPD_B98_CS_0B ///< reference xE2B98CS0Bx +/// @} + +/// +/// @name Colour black-white-red "Spectra" screens +/// @note Global update mode +/// @see https://www.pervasivedisplays.com/products/?_sft_etc_itc=itc&_sft_product_colour=black-white-red +/// @{ +/// +#define eScreen_EPD_EXT3_154_BWR eScreen_EPD_154_JS_0C ///< reference xE2154CSxxx +#define eScreen_EPD_EXT3_213_BWR eScreen_EPD_213_JS_0C ///< reference xE2213CSxxx +#define eScreen_EPD_EXT3_266_BWR eScreen_EPD_266_JS_0C ///< reference xE2266CSxxx +#define eScreen_EPD_EXT3_271_BWR eScreen_EPD_271_JS_09 ///< reference xE2271CSxxx +#define eScreen_EPD_EXT3_287_BWR eScreen_EPD_287_JS_09 ///< reference xE2287CSxxx +#define eScreen_EPD_EXT3_290_BWR eScreen_EPD_290_JS_0F ///< reference xE2290CSxxx +#define eScreen_EPD_EXT3_370_BWR eScreen_EPD_370_JS_0C ///< reference xE2370CSxxx +#define eScreen_EPD_EXT3_417_BWR eScreen_EPD_741_FS_08 ///< reference xE2417CSxxx +#define eScreen_EPD_EXT3_437_BWR eScreen_EPD_437_JS_08 ///< reference xE2437CSxxx +#define eScreen_EPD_EXT3_565_BWR eScreen_EPD_565_JS_08 ///< reference xE2565CSxxx +#define eScreen_EPD_EXT3_581_0B_BWR eScreen_EPD_581_JS_0B ///< reference xE2581CS0Bx +#define eScreen_EPD_EXT3_741_0B_BWR eScreen_EPD_741_JS_0B ///< reference xE2741CS0Bx +#define eScreen_EPD_EXT3_969_0B_BWR eScreen_EPD_969_JS_0B ///< reference xE2969CS0Bx +#define eScreen_EPD_EXT3_B98_0B_BWR eScreen_EPD_B98_JS_0B ///< reference xE2B98CS0Bx +/// @} + +/// +/// @name Colour black-white-red-yellow "Spectra 4" screens +/// @note Global update mode +/// @see https://www.pervasivedisplays.com/products/?_sft_etc_itc=itc&_sft_product_colour=black-white-red-yellow +/// @{ +/// +#define eScreen_EPD_EXT3_154_BWRY eScreen_EPD_154_QS_0F ///< reference xE2154QS0Fx +#define eScreen_EPD_EXT3_213_BWRY eScreen_EPD_213_QS_0F ///< reference xE2213QS0Fx +#define eScreen_EPD_EXT3_266_BWRY eScreen_EPD_266_QS_0F ///< reference xE2266QS0Fx +#define eScreen_EPD_EXT3_417_BWRY eScreen_EPD_417_QS_0A ///< reference xE2417QS0Ax +/// @} + +/// +/// @name Monochrome touch screens with embedded fast update +/// @note Global and fast update modes +/// @deprecated Partial update is removed. Use fast update instead (7.0.0). +/// @see https://www.pervasivedisplays.com/products +/// @{ +/// +#define eScreen_EPD_EXT3_271_09_Touch eScreen_EPD_271_PS_09_Touch ///< reference xTP271PGH0x +#define eScreen_EPD_EXT3_270_09_Touch eScreen_EPD_271_PS_09_Touch ///< reference xTP270PGH0x, legacy name +#define eScreen_EPD_EXT3_370_0C_Touch eScreen_EPD_370_PS_0C_Touch ///< reference xTP370PGH0x +#define eScreen_EPD_EXT3_270_Touch eScreen_EPD_271_PS_09_Touch ///< reference xTP270PGH0x, legacy name +#define eScreen_EPD_EXT3_271_Touch eScreen_EPD_271_PS_09_Touch ///< reference xTP271PGH0x, legacy name +#define eScreen_EPD_EXT3_370_Touch eScreen_EPD_370_PS_0C_Touch ///< reference xTP370PGH0x, legacy name +/// @} + +/// @name Monochrome screens with embedded fast update +/// @note Global and fast update modes +/// @see https://www.pervasivedisplays.com/products/?_sft_etc_itc=pu+itc +/// @{ +/// +#define eScreen_EPD_EXT3_154_0C_Fast eScreen_EPD_154_PS_0C ///< reference xE2154PS0Cx +#define eScreen_EPD_EXT3_213_0E_Fast eScreen_EPD_213_PS_0E ///< reference xE2213PS0Ex +#define eScreen_EPD_EXT3_266_0C_Fast eScreen_EPD_266_PS_0C ///< reference xE2266PS0Cx +#define eScreen_EPD_EXT3_271_09_Fast eScreen_EPD_271_PS_09 ///< reference xE2271PS09x +#define eScreen_EPD_EXT3_270_09_Fast eScreen_EPD_271_PS_09 ///< reference xE2271PS09x, legacy name +#define eScreen_EPD_EXT3_287_09_Fast eScreen_EPD_287_PS_09 ///< reference xE2287PS09x +#define eScreen_EPD_EXT3_370_0C_Fast eScreen_EPD_370_PS_0C ///< reference xE2370PS0Cx +#define eScreen_EPD_EXT3_417_0D_Fast eScreen_EPD_417_PS_0D ///< reference xE2417PS0Dx +#define eScreen_EPD_EXT3_437_0C_Fast eScreen_EPD_437_PS_0C ///< reference xE2437PS0Cx +// /// @todo eScreen_EPD_EXT3_581_0B_Fast not tested +// #define eScreen_EPD_EXT3_581_0B_Fast eScreen_EPD_581_PS_0B ///< reference xE2581PS0Bx, not tested +// /// @todo eScreen_EPD_EXT3_741_0B_Fast not tested +// #define eScreen_EPD_EXT3_741_0B_Fast eScreen_EPD_741_PS_0B ///< reference xE2741PS0Bx, not tested +// /// @todo eScreen_EPD_EXT3_969_0B_Fast not tested +// #define eScreen_EPD_EXT3_969_0B_Fast eScreen_EPD_969_PS_0B ///< reference xE2969PS0Bx, not tested +// /// @todo eScreen_EPD_EXT3_B98_0B_Fast not tested +// #define eScreen_EPD_EXT3_B98_0B_Fast eScreen_EPD_B98_PS_0B ///< reference xE2B98PS0Bx, not tested +/// @} + +/// @name Monochrome screens with embedded fast update and wide temperature +/// @note Global and fast update modes +/// @see https://www.pervasivedisplays.com/products/?_sft_etc_itc=pu+itc&_sft_temperature_range=m15c-to-p60c +/// @{ +/// +#define eScreen_EPD_EXT3_150_0J_Wide eScreen_EPD_150_KS_0J ///< reference xE2150KS0Jx +#define eScreen_EPD_EXT3_152_0J_Wide eScreen_EPD_152_KS_0J ///< reference xE2152KS0Jx +#define eScreen_EPD_EXT3_154_0C_Wide eScreen_EPD_154_KS_0C ///< reference xE2154KS0Cx +#define eScreen_EPD_EXT3_206_0E_Wide eScreen_EPD_206_KS_0E ///< reference xE2206KS0Ex +#define eScreen_EPD_EXT3_213_0E_Wide eScreen_EPD_213_KS_0E ///< reference xE2213KS0Ex +#define eScreen_EPD_EXT3_266_0C_Wide eScreen_EPD_266_KS_0C ///< reference xE2266KS0Cx +#define eScreen_EPD_EXT3_271_09_Wide eScreen_EPD_271_KS_09 ///< reference xE2271KS09x +// /// @todo eScreen_EPD_EXT3_287_09_Wide not tested +// #define eScreen_EPD_EXT3_287_09_Wide eScreen_EPD_287_KS_09 ///< reference xE2287PS09x, not tested +#define eScreen_EPD_EXT3_290_0F_Wide eScreen_EPD_290_KS_0F ///< reference xE2290KS0Fx +#define eScreen_EPD_EXT3_370_0C_Wide eScreen_EPD_370_KS_0C ///< reference xE2370KS0Cx +#define eScreen_EPD_EXT3_417_0D_Wide eScreen_EPD_417_KS_0D ///< reference xE2417KS0Dx +// /// @todo eScreen_EPD_EXT3_437_0C_Wide not tested +// #define eScreen_EPD_EXT3_437_0C_Wide eScreen_EPD_437_KS_0C ///< reference xE2437KS0Cx, not tested +// #define eScreen_EPD_EXT3_581_06_Wide eScreen_EPD_581_KS_0B ///< reference xE2581KS0Bx +// /// @todo eScreen_EPD_EXT3_741_0B_Wide not tested +// #define eScreen_EPD_EXT3_741_0B_Wide eScreen_EPD_741_KS_0B ///< reference xE2741KS0Bx, not tested +// /// @todo eScreen_EPD_EXT3_969_0B_Wide not tested +// #define eScreen_EPD_EXT3_969_0B_Wide eScreen_EPD_969_KS_0B ///< reference xE2969KS0Bx, not tested +// /// @todo eScreen_EPD_EXT3_B98_0B_Wide not tested +// #define eScreen_EPD_EXT3_B98_0B_Wide eScreen_EPD_B98_KS_0B ///< reference xE2B98KS0Bx, not tested +/// @} + +#endif // hV_LIST_SCREENS_LEGACY_RELEASE + diff --git a/src/hV_Screen_Buffer.cpp b/src/hV_Screen_Buffer.cpp index 0126275..636cedb 100755 --- a/src/hV_Screen_Buffer.cpp +++ b/src/hV_Screen_Buffer.cpp @@ -10,6 +10,7 @@ // // Copyright (c) Rei Vilo, 2010-2024 // Licence Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +// For exclusive use with Pervasive Displays screens // // See hV_Screen_Buffer.h for references // @@ -17,6 +18,8 @@ // Release 523: Fixed rounded rectangles // Release 526: Improved touch management // Release 700: Refactored screen and board functions +// Release 703: Improved orientation function +// Release 801: Improved functions names consistency // // Library header @@ -30,18 +33,18 @@ hV_Screen_Buffer::hV_Screen_Buffer() f_fontNumber = 0; f_fontSolid = true; f_fontSpaceX = 1; - _penSolid = false; + v_penSolid = false; } void hV_Screen_Buffer::begin() { - f_begin(); // hV_font_... + f_begin(); // hV_Font_... } void hV_Screen_Buffer::clear(uint16_t colour) { - uint8_t oldOrientation = _orientation; - bool oldPenSolid = _penSolid; + uint8_t oldOrientation = v_orientation; + bool oldPenSolid = v_penSolid; setOrientation(0); setPenSolid(); rectangle(0, 0, screenSizeX() - 1, screenSizeY() - 1, colour); @@ -58,56 +61,56 @@ void hV_Screen_Buffer::setOrientation(uint8_t orientation) { switch (orientation) { - case 6: + case ORIENTATION_PORTRAIT: - _orientation = 0; - _setOrientation(_orientation); + v_orientation = 0; + s_setOrientation(v_orientation); if (screenSizeX() > screenSizeY()) { - _orientation = 1; - _setOrientation(_orientation); + v_orientation += 1; + s_setOrientation(v_orientation); } break; - case 7: + case ORIENTATION_LANDSCAPE: - _orientation = 0; - _setOrientation(_orientation); + v_orientation = 2; + s_setOrientation(v_orientation); if (screenSizeX() < screenSizeY()) { - _orientation = 1; - _setOrientation(_orientation); + v_orientation += 1; + s_setOrientation(v_orientation); } break; default: - _orientation = orientation % 4; - _setOrientation(_orientation); + v_orientation = orientation % 4; + s_setOrientation(v_orientation); break; } } uint8_t hV_Screen_Buffer::getOrientation() { - return _orientation; + return v_orientation; } uint16_t hV_Screen_Buffer::screenSizeX() { - switch (_orientation) + switch (v_orientation) { case 1: case 3: - return _screenSizeV; // _maxX + return v_screenSizeV; // _maxX break; // case 0: // case 2: default: - return _screenSizeH; // _maxX + return v_screenSizeH; // _maxX break; } return 0; @@ -115,19 +118,19 @@ uint16_t hV_Screen_Buffer::screenSizeX() uint16_t hV_Screen_Buffer::screenSizeY() { - switch (_orientation) + switch (v_orientation) { case 1: case 3: - return _screenSizeH; // _maxY + return v_screenSizeH; // _maxY break; // case 0: // case 2: default: - return _screenSizeV; // _maxY + return v_screenSizeV; // _maxY break; } return 0; @@ -135,12 +138,12 @@ uint16_t hV_Screen_Buffer::screenSizeY() uint16_t hV_Screen_Buffer::screenDiagonal() { - return _screenDiagonal; + return v_screenDiagonal; } uint8_t hV_Screen_Buffer::screenColourBits() { - return _screenColourBits; + return v_screenColourBits; } void hV_Screen_Buffer::circle(uint16_t x0, uint16_t y0, uint16_t radius, uint16_t colour) @@ -151,7 +154,7 @@ void hV_Screen_Buffer::circle(uint16_t x0, uint16_t y0, uint16_t radius, uint16_ int16_t x = 0; int16_t y = radius; - if (_penSolid == false) + if (v_penSolid == false) { point(x0, y0 + radius, colour); point(x0, y0 - radius, colour); @@ -216,7 +219,7 @@ void hV_Screen_Buffer::line(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, { if ((x1 == x2) and (y1 == y2)) { - _setPoint(x1, y1, colour); + s_setPoint(x1, y1, colour); } else if (x1 == x2) { @@ -226,7 +229,7 @@ void hV_Screen_Buffer::line(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, } for (uint16_t y = y1; y <= y2; y++) { - _setPoint(x1, y, colour); + s_setPoint(x1, y, colour); } } else if (y1 == y2) @@ -237,7 +240,7 @@ void hV_Screen_Buffer::line(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, } for (uint16_t x = x1; x <= x2; x++) { - _setPoint(x, y1, colour); + s_setPoint(x, y1, colour); } } else @@ -278,11 +281,11 @@ void hV_Screen_Buffer::line(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, { if (flag) { - _setPoint(wy1, wx1, colour); + s_setPoint(wy1, wx1, colour); } else { - _setPoint(wx1, wy1, colour); + s_setPoint(wx1, wy1, colour); } err -= dy; @@ -297,17 +300,17 @@ void hV_Screen_Buffer::line(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, void hV_Screen_Buffer::setPenSolid(bool flag) { - _penSolid = flag; + v_penSolid = flag; } void hV_Screen_Buffer::point(uint16_t x1, uint16_t y1, uint16_t colour) { - _setPoint(x1, y1, colour); + s_setPoint(x1, y1, colour); } void hV_Screen_Buffer::rectangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t colour) { - if (_penSolid == false) + if (v_penSolid == false) { line(x1, y1, x1, y2, colour); line(x1, y1, x2, y1, colour); @@ -328,7 +331,7 @@ void hV_Screen_Buffer::rectangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t { for (uint16_t y = y1; y <= y2; y++) { - _setPoint(x, y, colour); + s_setPoint(x, y, colour); } } } @@ -339,7 +342,7 @@ void hV_Screen_Buffer::dRectangle(uint16_t x0, uint16_t y0, uint16_t dx, uint16_ rectangle(x0, y0, x0 + dx - 1, y0 + dy - 1, colour); } -void hV_Screen_Buffer::_triangleArea(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t x3, uint16_t y3, uint16_t colour) +void hV_Screen_Buffer::s_triangleArea(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t x3, uint16_t y3, uint16_t colour) { int16_t wx1 = (int16_t)x1; int16_t wy1 = (int16_t)y1; @@ -453,7 +456,7 @@ void hV_Screen_Buffer::triangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t { line(x1, y1, x2, y2, colour); } - else if (_penSolid) + else if (v_penSolid) { bool b = true; @@ -478,25 +481,28 @@ void hV_Screen_Buffer::triangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t if (y2 == y3) { - _triangleArea(x1, y1, x2, y2, x3, y3, colour); + s_triangleArea(x1, y1, x2, y2, x3, y3, colour); } else if (y1 == y2) { - _triangleArea(x3, y3, x1, y1, x2, y2, colour); + s_triangleArea(x3, y3, x1, y1, x2, y2, colour); } else { uint16_t x4 = (uint16_t)((int32_t)x1 + (y2 - y1) * (x3 - x1) / (y3 - y1)); uint16_t y4 = y2; - _triangleArea(x1, y1, x2, y2, x4, y4, colour); + s_triangleArea(x1, y1, x2, y2, x4, y4, colour); + #if defined(ESP8266) delay(1); #else delayMicroseconds(1000); // delay(1); #endif // ESP8266 + delayMicroseconds(1000); // delay(1); - _triangleArea(x3, y3, x2, y2, x4, y4, colour); + s_triangleArea(x3, y3, x2, y2, x4, y4, colour); + #if defined(ESP8266) delay(1); #else @@ -512,7 +518,9 @@ void hV_Screen_Buffer::triangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t } } -// Font functions +// +// === Font section +// void hV_Screen_Buffer::setFontSolid(bool flag) { f_setFontSolid(flag); @@ -578,7 +586,7 @@ void hV_Screen_Buffer::setFontSpaceY(uint8_t number) f_setFontSpaceY(number); } -uint8_t hV_Screen_Buffer::_getCharacter(uint8_t character, uint8_t index) +uint8_t hV_Screen_Buffer::s_getCharacter(uint8_t character, uint8_t index) { return f_getCharacter(character, index); } @@ -667,11 +675,11 @@ void hV_Screen_Buffer::gText(uint16_t x0, uint16_t y0, { if (bitRead(line, j)) { - point(x0 + 12 * k + i, y0 + j, textColour); + point(x0 + 12 * k + i, y0 + j, textColour); } else if (f_fontSolid) { - point(x0 + 12 * k + i, y0 + j, backColour); + point(x0 + 12 * k + i, y0 + j, backColour); } if (bitRead(line1, j)) { @@ -693,26 +701,26 @@ void hV_Screen_Buffer::gText(uint16_t x0, uint16_t y0, c = text.charAt(k) - ' '; for (i = 0; i < 16; i++) { - line = f_getCharacter(c, 3 * i); + line = f_getCharacter(c, 3 * i); line1 = f_getCharacter(c, 3 * i + 1); line2 = f_getCharacter(c, 3 * i + 2); for (j = 0; j < 8; j++) { if (bitRead(line, j)) { - point(x0 + 16 * k + i, y0 + j, textColour); + point(x0 + 16 * k + i, y0 + j, textColour); } else if (f_fontSolid) { - point(x0 + 16 * k + i, y0 + j, backColour); + point(x0 + 16 * k + i, y0 + j, backColour); } if (bitRead(line1, j)) { - point(x0 + 16 * k + i, y0 + 8 + j, textColour); + point(x0 + 16 * k + i, y0 + 8 + j, textColour); } else if (f_fontSolid) { - point(x0 + 16 * k + i, y0 + 8 + j, backColour); + point(x0 + 16 * k + i, y0 + 8 + j, backColour); } if (bitRead(line2, j)) { @@ -732,4 +740,7 @@ void hV_Screen_Buffer::gText(uint16_t x0, uint16_t y0, #endif // end MAX_FONT_SIZE > 0 } #endif // FONT_MODE +// +// === End of Font section +// diff --git a/src/hV_Screen_Buffer.h b/src/hV_Screen_Buffer.h index 3a30383..74595b5 100755 --- a/src/hV_Screen_Buffer.h +++ b/src/hV_Screen_Buffer.h @@ -6,21 +6,31 @@ /// @n Based on highView technology /// /// @author Rei Vilo -/// @date 21 Sep 2023 -/// @version 700 +/// @date 21 Mar 2024 +/// @version 801 /// /// @copyright (c) Rei Vilo, 2010-2024 -/// @copyright Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) -/// -/// The highView Library Suite is shared under the Creative Commons licence Attribution-ShareAlike 4.0 International (CC BY-SA 4.0). +/// @copyright All rights reserved +/// @copyright For exclusive use with Pervasive Displays screens /// /// * Basic edition: for hobbyists and for basic usage /// @n Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) -/// /// @see https://creativecommons.org/licenses/by-sa/4.0/ /// /// @n Consider the Evaluation or Commercial editions for professionals or organisations and for commercial usage /// +/// * Evaluation edition: for professionals or organisations, evaluation only, no commercial usage +/// @n All rights reserved +/// +/// * Commercial edition: for professionals or organisations, commercial usage +/// @n All rights reserved +/// +/// * Viewer edition: for professionals or organisations +/// @n All rights reserved +/// +/// * Documentation +/// @n All rights reserved +/// // SDK #include "hV_HAL_Peripherals.h" @@ -32,7 +42,7 @@ /// /// @brief Library release number /// -#define hV_SCREEN_BUFFER_RELEASE 700 +#define hV_SCREEN_BUFFER_RELEASE 801 // Other libraries #include "hV_Colours565.h" @@ -351,7 +361,7 @@ class hV_Screen_Buffer : protected hV_Font_Terminal /// @brief Set orientation /// @param orientation same as setOrientation() /// - virtual void _setOrientation(uint8_t orientation) = 0; // compulsory + virtual void s_setOrientation(uint8_t orientation) = 0; // compulsory /// /// @brief Orient coordinates and check within screen @@ -359,7 +369,7 @@ class hV_Screen_Buffer : protected hV_Font_Terminal /// @param[out] y1 y coordinate /// @return RESULT_SUCCESS = false = success, RESULT_ERROR = true = error /// - virtual bool _orientCoordinates(uint16_t & x1, uint16_t & y1) = 0; // compulsory + virtual bool s_orientCoordinates(uint16_t & x1, uint16_t & y1) = 0; // compulsory // Position /// @@ -369,7 +379,7 @@ class hV_Screen_Buffer : protected hV_Font_Terminal /// @param colour 16-bit colour /// @n @b More: @ref Colour, @ref Coordinate /// - virtual void _setPoint(uint16_t x1, uint16_t y1, uint16_t colour) = 0; // compulsory + virtual void s_setPoint(uint16_t x1, uint16_t y1, uint16_t colour) = 0; // compulsory // Write and Read @@ -385,7 +395,7 @@ class hV_Screen_Buffer : protected hV_Font_Terminal /// @param y3 third point coordinate, y-axis /// @param colour 16-bit colour /// - void _triangleArea(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t x3, uint16_t y3, uint16_t colour); + void s_triangleArea(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t x3, uint16_t y3, uint16_t colour); // required by gText() /// @@ -394,13 +404,15 @@ class hV_Screen_Buffer : protected hV_Font_Terminal /// @param index column index /// @return definition for line of character /// - uint8_t _getCharacter(uint8_t character, uint8_t index); + uint8_t s_getCharacter(uint8_t character, uint8_t index); + + uint8_t * u_newImage; // Variables provided by hV_Screen_Virtual - bool _penSolid, _flagRead, _flagStorage, _flagEnergy; - uint16_t _screenSizeH, _screenSizeV, _screenDiagonal, _screenMarginH, _screenMarginV; - uint8_t _orientation, _intensity; - uint16_t _screenColourBits; + bool v_penSolid, v_flagRead, v_flagStorage, v_flagEnergy; + uint16_t v_screenSizeH, v_screenSizeV, v_screenDiagonal, v_screenMarginH, v_screenMarginV; + uint8_t v_orientation, v_intensity; + uint16_t v_screenColourBits; /// @endcond }; diff --git a/src/hV_Utilities_Common.cpp b/src/hV_Utilities_Common.cpp index 863ce82..d4c734c 100755 --- a/src/hV_Utilities_Common.cpp +++ b/src/hV_Utilities_Common.cpp @@ -9,6 +9,7 @@ // // Copyright (c) Rei Vilo, 2010-2024 // Licence Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +// For exclusive use with Pervasive Displays screens // // See hV_Utilities_Common.h for references // @@ -36,8 +37,7 @@ String formatString(const char * format, ...) memset(&bufferOut, 0x00, sizeof(bufferOut)); va_list args; va_start(args, format); - vsprintf(bufferOut, format, args); - + vsnprintf(bufferOut, 127, format, args); va_end(args); return String(bufferOut); } @@ -200,15 +200,6 @@ String utf2iso(String s) memset(&bufferOut, 0x00, sizeof(bufferOut)); - // Serial.print("> "); - // Serial.print(s); - // Serial.print(" : "); - // for (uint8_t i=0; i "); - // Serial.print(s); - // Serial.print(" : "); - // for (uint8_t i=0; i 0) + switch (u_codeFilm) + { + case FILM_P: // Film P, Fast update + + strcat(answer, "-Fast"); + break; + + case FILM_K: // Film K, Fast update + Wide temperature + + strcat(answer, "-Wide"); + break; + + case FILM_J: // Film J, BWR, "Spectra" + case FILM_E: // Film E, BWR, deprecated + case FILM_F: // Film F, BWR, deprecated + case FILM_G: // Film G, BWY, deprecated + + strcat(answer, "-BWR"); + break; + + case FILM_Q: // Film Q, BWRY, "Spectra 4" + + strcat(answer, "-BWRY"); + break; + + case FILM_C: ///< Film C, Standard + + strcat(answer, "-BW"); + break; + + default: + + strcat(answer, "-?"); + break; + } + + switch (u_codeExtra) { - strcat(answer, "-"); - if (u_codeExtra & FEATURE_FAST) - { - strcat(answer, "F"); - } - if (u_codeExtra & FEATURE_TOUCH) - { - strcat(answer, "T"); - } - if (u_codeExtra & FEATURE_OTHER) - { - strcat(answer, "b"); - } - if (u_codeExtra & FEATURE_WIDE_TEMPERATURE) - { - strcat(answer, "W"); - } - if (u_codeExtra & FEATURE_RED) - { - strcat(answer, "BWR"); - } - if (u_codeExtra & FEATURE_RED_YELLOW) - { - strcat(answer, "BWRY"); - } - strcat(answer, " "); + case EXTRA_TOUCH: + + strcat(answer, "+Touch"); + break; + + case EXTRA_DEMO: + + strcat(answer, "+Demo"); + break; + + default: + + break; } - strcat(answer, "-"); + strcat(answer, " "); #if (SRAM_MODE == USE_INTERNAL_MCU) strcat(answer, "i"); @@ -85,6 +112,74 @@ void hV_Utilities_PDLS::invert(bool flag) u_invert = flag; } +uint8_t hV_Utilities_PDLS::screenColours() +{ + uint8_t result; + + switch (u_codeFilm) + { + case FILM_C: // Film C, Standard + case FILM_P: // Film P, Fast update + case FILM_K: // Film K, Fast update + Wide temperature + + result = 2; + break; + + case FILM_J: // Film J, BWR, "Spectra" + case FILM_E: // Film E, BWR, deprecated + case FILM_F: // Film F, BWR, deprecated + case FILM_G: // Film G, BWY, deprecated + + result = 3; + break; + + case FILM_Q: // Film Q, BWRY, "Spectra 4" + + result = 4; + break; + + default: + + result = 0; // error + break; + } + + return result; +} + +String hV_Utilities_PDLS::screenNumber() +{ + char work[64] = {0}; + u_screenNumber(work); + + return formatString("Number %s", work); +} + +void hV_Utilities_PDLS::u_screenNumber(char * answer) +{ + memcpy(answer, 0x00, strlen(answer)); + + // strcpy(answer, u_codeSize); + sprintf(answer, "%i-%cS-0%c", u_codeSize, u_codeFilm, u_codeDriver); + + switch (u_codeExtra) + { + case EXTRA_TOUCH: + + strcat(answer, "-Touch"); + break; + + case EXTRA_DEMO: + + strcat(answer, "-Demo"); + break; + + default: + + break; + } +} + // // === Temperature section // @@ -113,20 +208,9 @@ void hV_Utilities_PDLS::setTemperatureF(int16_t temperatureF) uint8_t hV_Utilities_PDLS::checkTemperatureMode(uint8_t updateMode) { - // #define FEATURE_FAST 0x01 ///< With embedded fast update - // #define FEATURE_TOUCH 0x02 ///< With capacitive touch panel - // #define FEATURE_OTHER 0x04 ///< With other feature - // #define FEATURE_WIDE_TEMPERATURE 0x08 ///< With wide operating temperature - // #define FEATURE_RED 0x10 ///< With red colour - // #define FEATURE_RED_YELLOW 0x20 ///< With red and yellow colours - // #define FEATURE_BW 0x00 ///< Monochrome - // #define FEATURE_BWR 0x10 ///< With red colour - // #define FEATURE_BWRY 0x20 ///< With red and yellow colours - // #define FEATURE_HIGH_DEFINITION 0x40 ///< With high definition - - switch (u_codeExtra & 0x19) + switch (u_codeFilm) { - case FEATURE_FAST: // PS series + case FILM_P: // Film P, Fast update // Fast PS Embedded fast update FU: +15 to +30 °C GU: 0 to +50 °C if (updateMode == UPDATE_FAST) // Fast update @@ -145,7 +229,7 @@ uint8_t hV_Utilities_PDLS::checkTemperatureMode(uint8_t updateMode) } break; - case (FEATURE_FAST | FEATURE_WIDE_TEMPERATURE): // KS series + case FILM_K: // Film K, Fast update + Wide temperature // Wide KS Wide temperature and embedded fast update FU: 0 to +50 °C GU: -15 to +60 °C if (updateMode == UPDATE_FAST) // Fast update @@ -164,7 +248,7 @@ uint8_t hV_Utilities_PDLS::checkTemperatureMode(uint8_t updateMode) } break; - case FEATURE_WIDE_TEMPERATURE: // HS series + case FILM_H: // HS series // Freezer HS Global update below 0 °C FU: - GU: -25 to +30 °C updateMode = UPDATE_GLOBAL; @@ -174,10 +258,11 @@ uint8_t hV_Utilities_PDLS::checkTemperatureMode(uint8_t updateMode) } break; - case FEATURE_BWR: // JS series - // case FEATURE_RED: // JS series - case FEATURE_BWRY: // QS series - // case FEATURE_RED_YELLOW: // QS series + case FILM_J: // Film J, BWR, "Spectra" + case FILM_E: // Film E, BWR, deprecated + case FILM_F: // Film F, BWR, deprecated + case FILM_G: // Film G, BWY, deprecated + case FILM_Q: // Film Q, BWRY, "Spectra 4" // BWR JS Red colour FU: - GU: 0 to +40 °C // BWRY QS Red and yellow colours FU: - GU: 0 to +40 °C @@ -187,7 +272,7 @@ uint8_t hV_Utilities_PDLS::checkTemperatureMode(uint8_t updateMode) } break; - default: // CS series + default: // Film C, Standard // Normal CS Global update above 0 °C FU: - GU: 0 to +50 °C updateMode = UPDATE_GLOBAL; diff --git a/src/hV_Utilities_PDLS.h b/src/hV_Utilities_PDLS.h index 45aef73..94db69f 100755 --- a/src/hV_Utilities_PDLS.h +++ b/src/hV_Utilities_PDLS.h @@ -8,14 +8,30 @@ /// * Edition: Advanced /// /// @author Rei Vilo -/// @date 21 Aug 2023 -/// @version 700 +/// @date 21 Mar 2024 +/// @version 801 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright All rights reserved +/// @copyright For exclusive use with Pervasive Displays screens +/// +/// * Basic edition: for hobbyists and for basic usage +/// @n Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +/// @see https://creativecommons.org/licenses/by-sa/4.0/ +/// +/// @n Consider the Evaluation or Commercial editions for professionals or organisations and for commercial usage +/// +/// * Evaluation edition: for professionals or organisations, evaluation only, no commercial usage +/// @n All rights reserved /// -/// * Evaluation edition: for professionals or organisations, no commercial usage /// * Commercial edition: for professionals or organisations, commercial usage +/// @n All rights reserved +/// +/// * Viewer edition: for professionals or organisations +/// @n All rights reserved +/// +/// * Documentation +/// @n All rights reserved /// // SDK @@ -31,23 +47,23 @@ #include "hV_Utilities_Common.h" // Checks -#if (hV_HAL_PERIPHERALS_RELEASE < 700) -#error Required hV_HAL_PERIPHERALS_RELEASE 700 +#if (hV_HAL_PERIPHERALS_RELEASE < 801) +#error Required hV_HAL_PERIPHERALS_RELEASE 801 #endif // hV_HAL_PERIPHERALS_RELEASE -#if (hV_CONFIGURATION_RELEASE < 700) -#error Required hV_CONFIGURATION_RELEASE 700 +#if (hV_CONFIGURATION_RELEASE < 801) +#error Required hV_CONFIGURATION_RELEASE 801 #endif // hV_CONFIGURATION_RELEASE -#if (hV_BOARD_RELEASE < 700) -#error Required hV_BOARD_RELEASE 700 +#if (hV_BOARD_RELEASE < 801) +#error Required hV_BOARD_RELEASE 801 #endif // hV_BOARD_RELEASE #ifndef hV_UTILITIES_PDLS_RELEASE /// /// @brief Library release number /// -#define hV_UTILITIES_PDLS_RELEASE 700 +#define hV_UTILITIES_PDLS_RELEASE 801 // Objects // @@ -93,6 +109,22 @@ class hV_Utilities_PDLS : public hV_Board /// void invert(bool flag); + /// + /// @brief Get number of colours + /// + /// @return uint8_t number of colours + /// * 2 = monochrome + /// * 3 = black-white-red or black-white-yellow + /// * 4 = black-white-red-yellow + /// + uint8_t screenColours(); + + /// + /// @brief Screen number + /// @return Screen number as string + /// + virtual String screenNumber(); + /// @cond protected: @@ -107,25 +139,24 @@ class hV_Utilities_PDLS : public hV_Board /// void u_WhoAmI(char * answer); - // Screen dependent variables -#if (SRAM_MODE == USE_INTERNAL_MCU) - - uint8_t * u_newImage; - -#elif (SRAM_MODE == USE_EXTERNAL_SPI) - - uint32_t u_newImage; - -#endif // SRAM_MODE + /// + /// @brief Screen number for screenNumber + /// @param[out] answer Screen specifications + /// @note Format is size-film-driver[-Touch|-Demo] + /// + void u_screenNumber(char * answer); - eScreen_EPD_EXT3_t u_eScreen_EPD_EXT3; + // Screen dependent variables + eScreen_EPD_t u_eScreen_EPD; int8_t u_temperature = 25; + uint16_t u_codeSize; + uint8_t u_codeFilm; + uint8_t u_codeDriver; uint8_t u_codeExtra; - uint8_t u_codeSize; - uint8_t u_codeType; uint16_t u_bufferSizeV, u_bufferSizeH, u_bufferDepth; uint32_t u_pageColourSize, u_frameSize; bool u_invert = false; + bool u_flagOTP = false; /// @endcond };