From bc713041189078beceab9601b18da2c19c946621 Mon Sep 17 00:00:00 2001 From: Rei Vilo Date: Thu, 5 Sep 2024 10:09:51 +0200 Subject: [PATCH] Release 8.0.5 --- README.md | 9 +- library.properties | 2 +- src/Screen_EPD_EXT3.cpp | 5 +- src/Screen_EPD_EXT3.h | 16 ++-- src/Terminal12x16e.h | 8 +- src/Terminal16x24e.h | 8 +- src/Terminal6x8e.h | 8 +- src/Terminal8x12e.h | 8 +- src/hV_Board.h | 6 +- src/hV_Configuration.h | 8 +- src/hV_Documentation.h | 15 ++-- src/hV_HAL_Peripherals.cpp | 3 +- src/hV_HAL_Peripherals.h | 8 +- src/hV_List_Boards.h | 39 +++----- src/hV_List_Constants.h | 39 ++++---- src/hV_List_Options.h | 20 ++--- src/hV_List_Screens.h | 7 +- src/hV_Screen_Buffer.cpp | 178 ++++++++++++++++++++++++++++++++++++- src/hV_Screen_Buffer.h | 22 ++++- src/hV_Utilities_PDLS.cpp | 8 +- src/hV_Utilities_PDLS.h | 18 ++-- 21 files changed, 314 insertions(+), 121 deletions(-) diff --git a/README.md b/README.md index a87ce7a..0c78ea0 100755 --- a/README.md +++ b/README.md @@ -17,13 +17,16 @@ The **PDLS_EXT3_Basic_Touch** provides a high-level interface to drive the e-pap + Fast update + Graphics routines + Text routines ++ Four extended fonts with double-sized variants + Touch management + GUI with button and text -+ Four extended fonts ## Documentation and support -+ Go to the [documentation](https://rei-vilo.github.io/PDLS_EXT3_Basic_Documentation/index.html) ++ [Wiki](https://docs.pervasivedisplays.com/) ++ [User guide](https://pdls.pervasivedisplays.com/userguide/index.html) with commented examples ++ [Reference manual](https://rei-vilo.github.io/PDLS_EXT3_Basic_Documentation/index.html) + + For support, please refer to [PDLS_EXT3_Basic_Global](https://github.com/rei-vilo/PDLS_EXT3_Basic_Global/issues) for reporting issues and contributing pull requests. ## Installation @@ -33,7 +36,7 @@ Software + [Installing Additional Arduino Libraries](https://www.arduino.cc/en/guide/libraries) + Using the Library Manager - + Importing a .zip Library + + Importing a `.zip` Library Hardware diff --git a/library.properties b/library.properties index 742a27e..c87bb3e 100755 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=PDLS_EXT3_Basic_Touch -version=8.0.4 +version=8.0.5 author=Rei Vilo for Pervasive Displays maintainer=Rei Vilo sentence=Library for Pervasive Displays monochrome e-paper screens with touch and EXT3-1 + EXT3-Touch diff --git a/src/Screen_EPD_EXT3.cpp b/src/Screen_EPD_EXT3.cpp index 5f4ab76..910cbe4 100755 --- a/src/Screen_EPD_EXT3.cpp +++ b/src/Screen_EPD_EXT3.cpp @@ -36,6 +36,7 @@ // Release 802: Refactored CoG functions // Release 803: Added types for string and frame-buffer // Release 804: Improved power management +// Release 805: Improved stability // // Library header @@ -1012,7 +1013,7 @@ void Screen_EPD_EXT3_Fast::begin() setTemperatureC(25); // 25 Celsius = 77 Fahrenheit b_fsmPowerScreen = FSM_OFF; - setPowerProfile(MODE_MANUAL, SCOPE_GPIO_ONLY); + setPowerProfile(POWER_MODE_MANUAL, POWER_SCOPE_GPIO_ONLY); // Turn SPI on, initialise GPIOs and set GPIO levels // Reset panel and get tables @@ -1192,7 +1193,7 @@ void Screen_EPD_EXT3_Fast::s_flush(uint8_t updateMode) } // Suspend - if (u_suspendMode == MODE_AUTO) + if (u_suspendMode == POWER_MODE_AUTO) { suspend(u_suspendScope); } diff --git a/src/Screen_EPD_EXT3.h b/src/Screen_EPD_EXT3.h index e2d4e82..10997dc 100755 --- a/src/Screen_EPD_EXT3.h +++ b/src/Screen_EPD_EXT3.h @@ -16,8 +16,8 @@ /// * 3.70"-Touch reference xTP370PGH0x /// /// @author Rei Vilo -/// @date 21 Jul 2024 -/// @version 804 +/// @date 21 Aug 2024 +/// @version 805 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright All rights reserved @@ -71,8 +71,8 @@ #error Required hV_CONFIGURATION_RELEASE 803 #endif // hV_CONFIGURATION_RELEASE -#if (hV_SCREEN_BUFFER_RELEASE < 801) -#error Required hV_SCREEN_BUFFER_RELEASE 801 +#if (hV_SCREEN_BUFFER_RELEASE < 805) +#error Required hV_SCREEN_BUFFER_RELEASE 805 #endif // hV_SCREEN_BUFFER_RELEASE #if (hV_BOARD_RELEASE < 801) @@ -83,7 +83,7 @@ /// /// @brief Library release number /// -#define SCREEN_EPD_EXT3_RELEASE 804 +#define SCREEN_EPD_EXT3_RELEASE 805 /// /// @brief Library variant @@ -130,11 +130,11 @@ class Screen_EPD_EXT3_Fast final : public hV_Screen_Buffer, public hV_Utilities_ /// /// @brief Suspend - /// @param suspendScope default = SCOPE_GPIO_ONLY, otherwise SCOPE_NONE + /// @param suspendScope default = POWER_SCOPE_GPIO_ONLY, otherwise POWER_SCOPE_NONE /// @details Power off and set all GPIOs low - /// @note If panelPower is NOT_CONNECTED, SCOPE_GPIO_ONLY defaults to SCOPE_NONE + /// @note If panelPower is NOT_CONNECTED, POWER_SCOPE_GPIO_ONLY defaults to POWER_SCOPE_NONE /// - void suspend(uint8_t suspendScope = SCOPE_GPIO_ONLY); + void suspend(uint8_t suspendScope = POWER_SCOPE_GPIO_ONLY); /// /// @brief Resume after suspend() diff --git a/src/Terminal12x16e.h b/src/Terminal12x16e.h index bf11bdf..ee2f3ca 100755 --- a/src/Terminal12x16e.h +++ b/src/Terminal12x16e.h @@ -50,12 +50,12 @@ /// /// @copyright Font generated manually /// -//#if defined(ENERGIA) +// #if defined(ENERGIA) // unsigned char replaced by uint8_t static const uint8_t Terminal12x16e[224][24] = - //#elif defined(ARDUINO) || defined(MPIDE) || defined(WIRING) - //static prog_uchar Terminal12x16e[224][24] PROGMEM = - //#endif + // #elif defined(ARDUINO) || defined(MPIDE) || defined(WIRING) + // static prog_uchar Terminal12x16e[224][24] PROGMEM = + // #endif { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0xFF, 0x33, 0xFF, 0x33, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/src/Terminal16x24e.h b/src/Terminal16x24e.h index ad17e5d..068ee3d 100755 --- a/src/Terminal16x24e.h +++ b/src/Terminal16x24e.h @@ -57,12 +57,12 @@ /// /// @copyright Font generated manually /// -//#if defined(ENERGIA) +// #if defined(ENERGIA) // unsigned char replaced by uint8_t static const uint8_t Terminal16x24e[224][48] = - //#elif defined(ARDUINO) || defined(MPIDE) || defined(WIRING) - //static prog_uchar Terminal16x24e[224][48] PROGMEM = - //#endif + // #elif defined(ARDUINO) || defined(MPIDE) || defined(WIRING) + // static prog_uchar Terminal16x24e[224][48] PROGMEM = + // #endif { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // Code for char { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x3F, 0x07, 0xFC, 0x3F, 0x07, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // Code for char ! diff --git a/src/Terminal6x8e.h b/src/Terminal6x8e.h index 1ed4fc2..fe7c415 100755 --- a/src/Terminal6x8e.h +++ b/src/Terminal6x8e.h @@ -50,12 +50,12 @@ /// /// @copyright Font generated manually /// -//#if defined(ENERGIA) +// #if defined(ENERGIA) // unsigned char replaced by uint8_t static const uint8_t Terminal6x8e[224][6] = - //#elif defined(ARDUINO) || defined(MPIDE) || defined(WIRING) - //static prog_uchar Terminal6x8e[224][6] PROGMEM = - //#endif + // #elif defined(ARDUINO) || defined(MPIDE) || defined(WIRING) + // static prog_uchar Terminal6x8e[224][6] PROGMEM = + // #endif { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x5F, 0x06, 0x00, diff --git a/src/Terminal8x12e.h b/src/Terminal8x12e.h index 3ac8fd3..400420d 100755 --- a/src/Terminal8x12e.h +++ b/src/Terminal8x12e.h @@ -50,12 +50,12 @@ /// /// @copyright Font generated manually /// -//#if defined(ENERGIA) +// #if defined(ENERGIA) // unsigned char replaced by uint8_t static const uint8_t Terminal8x12e[224][16] = - //#elif defined(ARDUINO) || defined(MPIDE) || defined(WIRING) - //static prog_uchar Terminal8x12e[224][16] PROGMEM = - //#endif + // #elif defined(ARDUINO) || defined(MPIDE) || defined(WIRING) + // static prog_uchar Terminal8x12e[224][16] PROGMEM = + // #endif { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x7E, 0x03, 0x7E, 0x03, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/src/hV_Board.h b/src/hV_Board.h index 7d7b001..0d6af3d 100755 --- a/src/hV_Board.h +++ b/src/hV_Board.h @@ -8,8 +8,8 @@ /// * Edition: Advanced /// /// @author Rei Vilo -/// @date 21 Jul 2024 -/// @version 804 +/// @date 21 Aug 2024 +/// @version 805 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright All rights reserved @@ -44,7 +44,7 @@ /// /// @brief Library release number /// -#define hV_BOARD_RELEASE 804 +#define hV_BOARD_RELEASE 805 // Objects // diff --git a/src/hV_Configuration.h b/src/hV_Configuration.h index 029c101..de4913e 100755 --- a/src/hV_Configuration.h +++ b/src/hV_Configuration.h @@ -20,8 +20,8 @@ /// * 12. Set debug options /// /// @author Rei Vilo -/// @date 21 May 2024 -/// @version 803 +/// @date 21 Aug 2024 +/// @version 805 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright All rights reserved @@ -82,7 +82,7 @@ /// /// @brief Release /// -#define hV_CONFIGURATION_RELEASE 803 +#define hV_CONFIGURATION_RELEASE 805 /// /// @name 1- List of supported Pervasive Displays screens @@ -110,7 +110,7 @@ /// /// -/// @brief Type for framebuffer +/// @brief Type for frame-buffer /// @details Based on SRAM_MODE selection /// #define FRAMEBUFFER_TYPE uint8_t * diff --git a/src/hV_Documentation.h b/src/hV_Documentation.h index bff3670..a4ae856 100755 --- a/src/hV_Documentation.h +++ b/src/hV_Documentation.h @@ -23,12 +23,14 @@ /// * **PDLS_EXT3_Basic_Touch** for [monochrome screens with capacitive touch](https://www.pervasivedisplays.com/product/2-71-e-ink-display-aurora-mb-v231/); and /// * **PDLS_EXT3_Basic_BWRY** for [black-white-red-yellow screens](https://www.pervasivedisplays.com/product/). /// -/// The screens are connected to the [EPD Extension Kit Gen 3 (EXT3 or EXT3-1)](https://www.pervasivedisplays.com/product/epd-extension-kit-gen-3-EXT3/) and [Touch Expansion Board for EXT3 (EXT3-Touch)](https://www.pervasivedisplays.com/product/touch-expansion-board-ext3-touch/). +/// The screens are connected to the boards: +/// +/// + [EPD Extension Kit Gen 3 (EXT3 or EXT3-1)](https://www.pervasivedisplays.com/product/epd-extension-kit-gen-3-EXT3/) and [Touch Expansion Board for EXT3 (EXT3-Touch)](https://www.pervasivedisplays.com/product/touch-expansion-board-ext3-touch/); /// /// Two introductory kits are also available: /// -/// + The [EPD Pico Kit (EPDK)](https://www.pervasivedisplays.com/product/epd-pico-kit-epdk/) includes a Raspberry Pi Pico RP2040, an EXT3-1 extension board and a 2.66" monochrome panel; and -/// + The [EPD Pico Kit Touch (EPDK-271-Touch)](https://www.pervasivedisplays.com/product/touch-expansion-board-ext3-touch/#tab-3) includes a Raspberry Pi Pico RP2040, an EXT3-1 and EXT3-Touch boards and a 2.71"-Touch monochrome panel with embedded fast update. +/// + [EPD Pico Kit (EPDK-266)](https://www.pervasivedisplays.com/product/epd-pico-kit-epdk/), which includes a Raspberry Pi Pico RP2040, an EXT3-1 extension board and a 2.66" monochrome panel; and +/// + [EPD Pico Kit Touch (EPDK-271-Touch)](https://www.pervasivedisplays.com/product/touch-expansion-board-ext3-touch/#tab-3), which includes a Raspberry Pi Pico RP2040, an EXT3-1 and EXT3-Touch boards and a 2.71"-Touch monochrome panel with embedded fast update. /// /// @b Documentation /// @@ -41,16 +43,17 @@ /// 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 Jul 2024 -/// @version 804 +/// @date 21 Aug 2024 +/// @version 805 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @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/ +/// ([summary](https://creativecommons.org/licenses/by-sa/4.0/deed.en) and [legal code](https://creativecommons.org/licenses/by-sa/4.0/legalcode.en)) /// /// @n Consider the Evaluation or Commercial editions for professionals or organisations and for commercial usage /// diff --git a/src/hV_HAL_Peripherals.cpp b/src/hV_HAL_Peripherals.cpp index 021c3a4..187b801 100644 --- a/src/hV_HAL_Peripherals.cpp +++ b/src/hV_HAL_Peripherals.cpp @@ -23,6 +23,7 @@ // Release 801: Added SPI configuration // Release 803: Improved stability // Release 804: Improved power management +// Release 805: Improved stability // // Library header @@ -237,7 +238,7 @@ 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 + hV_HAL_SPI3_define(8, 9); // SCK SDA #elif defined(ARDUINO_ESP32_PICO) diff --git a/src/hV_HAL_Peripherals.h b/src/hV_HAL_Peripherals.h index 05698fc..86f569f 100755 --- a/src/hV_HAL_Peripherals.h +++ b/src/hV_HAL_Peripherals.h @@ -6,8 +6,8 @@ /// @n Based on highView technology /// /// @author Rei Vilo -/// @date 21 Jul 2024 -/// @version 804 +/// @date 21 Aug 2024 +/// @version 805 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright All rights reserved @@ -36,7 +36,7 @@ /// /// @brief Release /// -#define hV_HAL_PERIPHERALS_RELEASE 804 +#define hV_HAL_PERIPHERALS_RELEASE 805 /// /// @brief SDK library @@ -116,6 +116,8 @@ void hV_HAL_SPI3_begin(); /// @param pinClock clock, default = SCK /// @param pinData combined data, default = MOSI /// @note For manual configuration only +/// @warning SCK and MOSI provided by Arduino SDK +/// * Some boards require manual configuration /// void hV_HAL_SPI3_define(uint8_t pinClock = SCK, uint8_t pinData = MOSI); diff --git a/src/hV_List_Boards.h b/src/hV_List_Boards.h index 07cacfb..66a7182 100755 --- a/src/hV_List_Boards.h +++ b/src/hV_List_Boards.h @@ -11,10 +11,9 @@ /// * 2.2 Other boards /// * 2.3 Deprecated boards /// -/// /// @author Rei Vilo -/// @date 21 Mar 2024 -/// @version 801 +/// @date 21 Aug 2024 +/// @version 805 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright All rights reserved @@ -42,11 +41,14 @@ // SDK #include "stdint.h" +// Options +#include "hV_List_Options.h" + #ifndef hV_LIST_BOARDS_RELEASE /// /// @brief Release /// -#define hV_LIST_BOARDS_RELEASE 803 +#define hV_LIST_BOARDS_RELEASE 805 /// /// @brief Not connected pin @@ -54,8 +56,11 @@ #define NOT_CONNECTED (uint8_t)0xff /// -/// @brief Board configuration structure -/// +/// @brief EXT3 board configuration structure +/// @note +/// * Pins 1 to 10 are common to all EXT boards +/// * Other pins are specific to each EXT board, optional or external +/// struct pins_t { // ///< EXT3 and EXT3-1 pin 1 Black -> +3.3V @@ -83,26 +88,6 @@ struct pins_t /// @name 2.1 Recommended boards /// @{ -/// -/// @brief Arduino Nano Matter with Silicon Labs MGM240P, tested -/// @note Numbers refer to pins -/// @note Recommended board -/// -const pins_t boardArduinoNanoMatter = -{ - .panelBusy = 10, ///< EXT3 and EXT3-1 pin 3 Red -> D10 - .panelDC = 9, ///< EXT3 and EXT3-1 pin 4 Orange -> D9 - .panelReset = 8, ///< EXT3 and EXT3-1 pin 5 Yellow -> D8 - .flashCS = 7, ///< EXT3 and EXT3-1 pin 8 Violet -> D7 - .panelCS = 6, ///< EXT3 and EXT3-1 pin 9 Grey -> D6 - .panelCSS = NOT_CONNECTED, ///< EXT3 and EXT3-1 pin 12 Grey2 - .flashCSS = NOT_CONNECTED, ///< EXT3 pin 20 or EXT3-1 pin 11 Black2 - .touchInt = NOT_CONNECTED, ///< EXT3-Touch pin 3 Red - .touchReset = NOT_CONNECTED, ///< EXT3-Touch pin 4 Orange - .panelPower = 2, ///< Optional power circuit -> D2 - .cardCS = NOT_CONNECTED, ///< Separate SD-card board - .cardDetect = NOT_CONNECTED, ///< Separate SD-card board -}; /// /// @brief Raspberry Pi Pico and Pico W with default RP2040 configuration, tested @@ -436,6 +421,7 @@ const pins_t boardLaunchPad = /// /// @brief Texas Instruments LaunchPad MSP430FR5994 LaunchPad with SD-card configuration, tested +/// @deprecated Texas Instruments LaunchPad boards are deprecated (8.0.3) /// const pins_t boardMSP430FR5994 = { @@ -455,6 +441,7 @@ const pins_t boardMSP430FR5994 = /// /// @brief Texas Instruments LaunchPad CC1352 configuration, tested +/// @deprecated Texas Instruments LaunchPad boards are deprecated (8.0.3) /// const pins_t boardCC1352 = { diff --git a/src/hV_List_Constants.h b/src/hV_List_Constants.h index 53299b9..9fb6bd5 100755 --- a/src/hV_List_Constants.h +++ b/src/hV_List_Constants.h @@ -6,8 +6,8 @@ /// @n Based on highView technology /// /// @author Rei Vilo -/// @date 21 Jul 2024 -/// @version 804 +/// @date 21 Aug 2024 +/// @version 805 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright All rights reserved @@ -39,12 +39,12 @@ /// /// @brief Release /// -#define hV_LIST_CONSTANTS_RELEASE 801 +#define hV_LIST_CONSTANTS_RELEASE 805 /// /// * General parameters /// -/// @brief Specific features +/// @name Specific features /// @note Numbers are bit-based and or-combinable /// @{ #define FEATURE_FAST 0x01 ///< With embedded fast update @@ -60,7 +60,7 @@ /// @} /// -/// @brief Update mode +/// @name Update mode /// @note Numbers are sequential and exclusive /// @deprecated Partial update is removed. Use fast update instead (7.0.0). /// @{ @@ -71,7 +71,7 @@ /// @} /// -/// @brief Screens families +/// @name Screens families /// @note Numbers are sequential and exclusive /// @{ #define FAMILY_SMALL 0x01 ///< Small screens @@ -80,7 +80,7 @@ /// @} /// -/// @brief Large screens sub-panels selection +/// @name Large screens sub-panels selection /// @note Numbers are sequential and exclusive /// @{ #define PANEL_CS_MASTER 0x01 ///< Large screens sub-panels: first panel only @@ -89,23 +89,24 @@ /// @} /// -/// @brief Scopes for power profile +/// @name Scopes for power profile /// @note Numbers are sequential and exclusive /// @{ -#define SCOPE_NONE 0x00 ///< Nothing suspended -#define SCOPE_GPIO_ONLY 0x01 ///< GPIO only and if panelPower defined +#define POWER_SCOPE_NONE 0x00 ///< Nothing suspended +#define POWER_SCOPE_GPIO_ONLY 0x01 ///< GPIO only and if panelPower defined +#define POWER_SCOPE_BUS_GPIO 0x11 ///< Both bus and GPIO suspended /// @} /// -/// @brief Modes for power profile +/// @name Modes for power profile /// @note Numbers are sequential and exclusive /// @{ -#define MODE_AUTO 0x00 ///< Managed by the screen library -#define MODE_MANUAL 0x01 ///< Managed by the application code +#define POWER_MODE_AUTO 0x00 ///< Managed by the screen library +#define POWER_MODE_MANUAL 0x01 ///< Managed by the application code /// @} /// -/// @brief Power and GPIO state +/// @name Power and GPIO state /// @note Numbers are sequential and exclusive, except MASK /// @{ #define FSM_OFF 0x00 ///< Bus off, GPIO off or undefined @@ -116,7 +117,7 @@ /// @} /// -/// @brief Partial update state +/// @name Partial update state /// @deprecated Use fast update instead (6.1.0). /// @note Numbers are sequential and exclusive /// @{ @@ -126,7 +127,7 @@ /// @} /// -/// @brief Continuity mode state +/// @name Continuity mode state /// @note Numbers are sequential and exclusive /// /// @{ @@ -136,7 +137,7 @@ /// @} /// -/// @brief Touch events +/// @name Touch events /// @note Numbers are sequential and exclusive /// /// @{ @@ -148,7 +149,7 @@ /// /// -/// @brief Results +/// @name Results /// @note Numbers are sequential and exclusive /// /// @{ @@ -158,7 +159,7 @@ /// /// -/// @brief Orientation constants +/// @name Orientation constants /// @note Numbers are sequential and exclusive /// @{ /// diff --git a/src/hV_List_Options.h b/src/hV_List_Options.h index 20db7d3..126acd1 100755 --- a/src/hV_List_Options.h +++ b/src/hV_List_Options.h @@ -18,8 +18,8 @@ /// * 12. Set debug options /// /// @author Rei Vilo -/// @date 21 Jul 2024 -/// @version 804 +/// @date 21 Aug 2024 +/// @version 805 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright All rights reserved @@ -48,7 +48,7 @@ /// /// @brief Release /// -#define hV_LIST_OPTIONS_RELEASE 803 +#define hV_LIST_OPTIONS_RELEASE 805 /// /// @name 1- List of supported Pervasive Displays screens @@ -142,7 +142,7 @@ /// @} /// -/// @brief 8- Set haptic feedback mode +/// @name 8- Set haptic feedback mode /// * Basic edition: no haptic feedback /// * Evaluation edition: ERM or LRA /// * Commercial edition: ERM or LRA @@ -155,7 +155,7 @@ /// @} /// -/// @brief 9- Set GPIO expander mode +/// @name 9- Set GPIO expander mode /// * Basic edition: no expander /// * Evaluation edition: PCF8574 or PCA9536 /// * Commercial edition: PCF8574 or PCA9536 @@ -168,7 +168,7 @@ /// @} /// -/// @brief 10- Set string mode +/// @name 10- Set string mode /// * Basic edition: String object /// * Evaluation edition: char array /// * Commercial edition: String object or char array @@ -181,7 +181,7 @@ /// @} /// -/// @brief 11- Storage mode +/// @name 11- Storage mode /// * Basic edition: none /// * Evaluation edition: none /// * Commercial edition: option @@ -193,13 +193,13 @@ #define STORAGE_MODE USE_NONE ///< Selected options /// @} -#endif // hV_LIST_OPTIONS_RELEASE - /// -/// @brief 12- Debug options +/// @name 12- Debug options /// * Basic edition: none /// * Evaluation edition: all /// * Commercial edition: option /// * Viewer edition: option /// +#endif // hV_LIST_OPTIONS_RELEASE + diff --git a/src/hV_List_Screens.h b/src/hV_List_Screens.h index 455611c..31c8d46 100755 --- a/src/hV_List_Screens.h +++ b/src/hV_List_Screens.h @@ -10,8 +10,8 @@ /// * 1- List of supported Pervasive Displays screens /// /// @author Rei Vilo -/// @date 21 May 2024 -/// @version 803 +/// @date 21 Aug 2024 +/// @version 805 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright All rights reserved @@ -43,7 +43,7 @@ /// /// @brief Release /// -#define hV_LIST_SCREENS_RELEASE 803 +#define hV_LIST_SCREENS_RELEASE 805 /// @deprecated Screen name format (8.0.0) /// * Name format eScreen_EPD_EXT3___ is deprecated (8.0.0). @@ -217,6 +217,7 @@ #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_417_JS_0D SCREEN(SIZE_417, FILM_J, DRIVER_D) ///< reference xE2417JS0Dx #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 diff --git a/src/hV_Screen_Buffer.cpp b/src/hV_Screen_Buffer.cpp index ec39f97..9cc4b2b 100755 --- a/src/hV_Screen_Buffer.cpp +++ b/src/hV_Screen_Buffer.cpp @@ -20,6 +20,7 @@ // Release 700: Refactored screen and board functions // Release 703: Improved orientation function // Release 801: Improved functions names consistency +// Release 805: Added large variant for gText // // Library header @@ -595,8 +596,9 @@ void hV_Screen_Buffer::gText(uint16_t x0, uint16_t y0, String text, uint16_t textColour, uint16_t backColour) -#if (FONT_MODE == USE_FONT_TERMINAL) { +#if (FONT_MODE == USE_FONT_TERMINAL) + uint8_t c; uint8_t line, line1, line2, line3; uint16_t x, y; @@ -738,8 +740,182 @@ void hV_Screen_Buffer::gText(uint16_t x0, uint16_t y0, #endif // end MAX_FONT_SIZE > 2 #endif // end MAX_FONT_SIZE > 1 #endif // end MAX_FONT_SIZE > 0 +#endif // FONT_MODE } + +void hV_Screen_Buffer::gTextLarge(uint16_t x0, uint16_t y0, + String text, + uint16_t textColour, + uint16_t backColour) +{ +#if (FONT_MODE == USE_FONT_TERMINAL) + + uint8_t c; + uint8_t line, line1, line2, line3; + uint16_t x, y; + uint8_t i, j, k; + + uint8_t ix = 2; + uint8_t iy = 2; + + bool oldPenSolid = v_penSolid; + setPenSolid(true); + +#if (MAX_FONT_SIZE > 0) + if (f_fontSize == 0) + { + for (k = 0; k < text.length(); k++) + { + x = x0 + 6 * k * ix; + y = y0; + c = text.charAt(k) - ' '; + + for (i = 0; i < 6; i++) + { + line = f_getCharacter(c, i); + + for (j = 0; j < 8; j++) + { + if (bitRead(line, j)) + { + dRectangle(x + i * ix, y + j * iy, ix, iy, textColour); + } + else if (f_fontSolid) + { + dRectangle(x + i * ix, y + j * iy, ix, iy, backColour); + } + } + } + } + } + +#if (MAX_FONT_SIZE > 1) + else if (f_fontSize == 1) + { + for (k = 0; k < text.length(); k++) + { + x = x0 + 8 * k * ix; + y = y0; + c = text.charAt(k) - ' '; + + for (i = 0; i < 8; i++) + { + line = f_getCharacter(c, 2 * i); + line1 = f_getCharacter(c, 2 * i + 1); + + for (j = 0; j < 8; j++) + { + if (bitRead(line, j)) + { + dRectangle(x + i * ix, y0 + j * iy, ix, iy, textColour); + } + else if (f_fontSolid) + { + dRectangle(x + i * ix, y0 + j * iy, ix, iy, backColour); + } + if (bitRead(line1, j)) + { + dRectangle(x + i * ix, y0 + (8 + j) * iy, ix, iy, textColour); + } + else if ((f_fontSolid) and (j < 4)) + { + dRectangle(x + i * ix, y0 + (8 + j) * iy, ix, iy, backColour); + } + } + } + } + } + +#if (MAX_FONT_SIZE > 2) + else if (f_fontSize == 2) + { + + for (k = 0; k < text.length(); k++) + { + x = x0 + 12 * k * ix; + y = y0; + c = text.charAt(k) - ' '; + + for (i = 0; i < 12; i++) + { + line = f_getCharacter(c, 2 * i); + line1 = f_getCharacter(c, 2 * i + 1); + + for (j = 0; j < 8; j++) + { + if (bitRead(line, j)) + { + dRectangle(x + i * ix, y0 + j * iy, ix, iy, textColour); + } + else if (f_fontSolid) + { + dRectangle(x + i * ix, y0 + j * iy, ix, iy, backColour); + } + if (bitRead(line1, j)) + { + dRectangle(x + i * ix, y0 + (8 + j) * iy, ix, iy, textColour); + } + else if (f_fontSolid) + { + dRectangle(x + i * ix, y0 + (8 + j) * iy, ix, iy, backColour); + } + } + } + } + } +#if (MAX_FONT_SIZE > 3) + else if (f_fontSize == 3) + { + for (k = 0; k < text.length(); k++) + { + x = x0 + 16 * k * ix; + y = y0; + c = text.charAt(k) - ' '; + + for (i = 0; i < 16; 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)) + { + dRectangle(x + i * ix, y0 + j * iy, ix, iy, textColour); + } + else if (f_fontSolid) + { + dRectangle(x + i * ix, y0 + j * iy, ix, iy, backColour); + } + if (bitRead(line1, j)) + { + dRectangle(x + i * ix, y0 + (8 + j) * iy, ix, iy, textColour); + } + else if (f_fontSolid) + { + dRectangle(x + i * ix, y0 + (8 + j) * iy, ix, iy, backColour); + } + if (bitRead(line2, j)) + { + dRectangle(x + i * ix, y0 + (16 + j) * iy, ix, iy, textColour); + } + else if (f_fontSolid) + { + dRectangle(x + i * ix, y0 + (16 + j) * iy, ix, iy, backColour); + } + } + } + } + } +#endif // end MAX_FONT_SIZE > 3 +#endif // end MAX_FONT_SIZE > 2 +#endif // end MAX_FONT_SIZE > 1 +#endif // end MAX_FONT_SIZE > 0 + + setPenSolid(oldPenSolid); + #endif // FONT_MODE +} // // === End of Font section // diff --git a/src/hV_Screen_Buffer.h b/src/hV_Screen_Buffer.h index 89ec078..43f4e30 100755 --- a/src/hV_Screen_Buffer.h +++ b/src/hV_Screen_Buffer.h @@ -6,8 +6,8 @@ /// @n Based on highView technology /// /// @author Rei Vilo -/// @date 21 Mar 2024 -/// @version 801 +/// @date 21 Aug 2024 +/// @version 805 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright All rights reserved @@ -42,7 +42,7 @@ /// /// @brief Library release number /// -#define hV_SCREEN_BUFFER_RELEASE 801 +#define hV_SCREEN_BUFFER_RELEASE 805 // Other libraries #include "hV_Colours565.h" @@ -350,6 +350,22 @@ class hV_Screen_Buffer : protected hV_Font_Terminal String text, uint16_t textColour = myColours.black, uint16_t backColour = myColours.white); + + /// + /// @brief Draw ASCII Text (pixel coordinates) with selection of size + /// @param x0 point coordinate, x-axis + /// @param y0 point coordinate, y-axis + /// @param text text string + /// @param textColour 16-bit colour, default = white + /// @param backColour 16-bit colour, default = black + /// @note Previously gText() with ix and iy + /// + /// @n @b More: @ref Colour, @ref Fonts, @ref Coordinate + /// + virtual void gTextLarge(uint16_t x0, uint16_t y0, + String text, + uint16_t textColour = myColours.black, + uint16_t backColour = myColours.white); /// @} // diff --git a/src/hV_Utilities_PDLS.cpp b/src/hV_Utilities_PDLS.cpp index bf4513c..1e7650b 100755 --- a/src/hV_Utilities_PDLS.cpp +++ b/src/hV_Utilities_PDLS.cpp @@ -14,6 +14,8 @@ // Release 800: Read OTP memory // Release 801: Added number of colours // Release 803: Added types for string and frame-buffer +// Release 804: Improved power management +// Release 805: Improved stability // // Library header @@ -187,7 +189,7 @@ STRING_TYPE hV_Utilities_PDLS::screenNumber() char work[64] = {0}; u_screenNumber(work); - return formatString("Number %s", work); + return formatString("%s", work); } // @@ -303,8 +305,8 @@ void hV_Utilities_PDLS::setPowerProfile(uint8_t mode, uint8_t scope) if (b_pin.panelPower == NOT_CONNECTED) { - u_suspendMode = MODE_MANUAL; - u_suspendScope = SCOPE_NONE; + u_suspendMode = POWER_MODE_MANUAL; + u_suspendScope = POWER_SCOPE_NONE; } } diff --git a/src/hV_Utilities_PDLS.h b/src/hV_Utilities_PDLS.h index 40b7b4a..ed903c1 100755 --- a/src/hV_Utilities_PDLS.h +++ b/src/hV_Utilities_PDLS.h @@ -8,8 +8,8 @@ /// * Edition: Advanced /// /// @author Rei Vilo -/// @date 21 Jul 2024 -/// @version 804 +/// @date 21 Aug 2024 +/// @version 805 /// /// @copyright (c) Rei Vilo, 2010-2024 /// @copyright All rights reserved @@ -63,7 +63,7 @@ /// /// @brief Library release number /// -#define hV_UTILITIES_PDLS_RELEASE 804 +#define hV_UTILITIES_PDLS_RELEASE 805 // Objects // @@ -103,11 +103,11 @@ class hV_Utilities_PDLS : public hV_Board uint8_t checkTemperatureMode(uint8_t updateMode); /// @brief Set the power profile - /// @param mode default = MODE_AUTO, otherwise MODE_MANUAL - /// @param scope default = SCOPE_GPIO_ONLY, otherwise SCOPE_NONE - /// @note If panelPower is NOT_CONNECTED, (MODE_AUTO, SCOPE_GPIO_ONLY) defaults to (MODE_MANUAL, SCOPE_NONE) + /// @param mode default = POWER_MODE_AUTO, otherwise POWER_MODE_MANUAL + /// @param scope default = POWER_SCOPE_GPIO_ONLY, otherwise POWER_SCOPE_NONE + /// @note If panelPower is NOT_CONNECTED, (POWER_MODE_AUTO, POWER_SCOPE_GPIO_ONLY) defaults to (POWER_MODE_MANUAL, POWER_SCOPE_NONE) /// - void setPowerProfile(uint8_t mode = MODE_AUTO, uint8_t scope = SCOPE_GPIO_ONLY); + void setPowerProfile(uint8_t mode = POWER_MODE_AUTO, uint8_t scope = POWER_SCOPE_GPIO_ONLY); /// /// @brief Invert screen @@ -171,8 +171,8 @@ class hV_Utilities_PDLS : public hV_Board uint32_t u_pageColourSize; bool u_invert = false; bool u_flagOTP = false; - uint8_t u_suspendMode = MODE_AUTO; - uint8_t u_suspendScope = SCOPE_GPIO_ONLY; + uint8_t u_suspendMode = POWER_MODE_AUTO; + uint8_t u_suspendScope = POWER_SCOPE_GPIO_ONLY; /// @endcond };