From d584dddd6808206f3a8ad2790a21af7a14c60a22 Mon Sep 17 00:00:00 2001 From: Rei Vilo Date: Tue, 25 Apr 2023 16:00:33 +0200 Subject: [PATCH] Release 6.0.8 --- src/Screen_EPD_EXT3.cpp | 62 ++++++++++++++++++++++++++++------------- src/Screen_EPD_EXT3.h | 8 +++--- src/hV_Constants.h | 15 ++++++++-- src/hV_Documentation.h | 4 +-- src/hV_GUI.cpp | 11 ++++++-- src/hV_GUI.h | 6 ++-- 6 files changed, 71 insertions(+), 35 deletions(-) diff --git a/src/Screen_EPD_EXT3.cpp b/src/Screen_EPD_EXT3.cpp index 99dabb5..27e0098 100755 --- a/src/Screen_EPD_EXT3.cpp +++ b/src/Screen_EPD_EXT3.cpp @@ -21,7 +21,8 @@ // Release 601: Added support for screens with embedded fast update // Release 602: Improved functions structure // Release 604: Improved stability -// Release 607: Improved screens names consistency +// Release 607: Improved screens names consistency +// Release 608: Added screen report // // Library header @@ -68,18 +69,21 @@ SPISettings _settingScreen; // Common settings // 0x00, soft-reset, temperature, active temperature, PSR0, PSR1 -uint8_t indexE5_data[] = {0x19}; // temperature -uint8_t indexE0_data[] = {0x02}; // activate temperature +uint8_t indexE5_data[] = {0x19}; // Temperature +uint8_t indexE0_data[] = {0x02}; // Activate temperature uint8_t index00_data[] = {0xff, 0x8f}; // PSR, constant -uint8_t index50a_data[] = {0x27}; // All, constant -uint8_t index50b_data[] = {0x07}; // All, constant +uint8_t index50a_data[] = {0x27}; // 154 213 266 and 370 screens, constant +uint8_t index50b_data[] = {0x07}; // 154 213 266 and 370 screens, constant +uint8_t index50c_work[] = {0x07}; // All screens, constant void Screen_EPD_EXT3_Fast::COG_initial(uint8_t updateMode) { // Work settings - uint8_t indexE5_work[1]; // temperature + uint8_t indexE0_work[1]; // Activate temperature + uint8_t indexE5_work[1]; // Temperature uint8_t index00_work[2]; // PSR + indexE0_work[0] = indexE0_data[0]; if ((_codeExtra & FEATURE_FAST) and (updateMode != UPDATE_GLOBAL)) // Specific settings for fast update { indexE5_work[0] = indexE5_data[0] | 0x40; // temperature | 0x40 @@ -88,7 +92,7 @@ void Screen_EPD_EXT3_Fast::COG_initial(uint8_t updateMode) } else // Common settings { - indexE5_work[0] = indexE5_data[0]; // temperature + indexE5_work[0] = indexE5_data[0]; // Temperature index00_work[0] = index00_data[0]; // PSR0 index00_work[1] = index00_data[1]; // PSR1 } // _codeExtra updateMode @@ -99,12 +103,23 @@ void Screen_EPD_EXT3_Fast::COG_initial(uint8_t updateMode) _waitBusy(); _sendIndexData(0xe5, indexE5_work, 1); // Input Temperature: 25C - _sendIndexData(0xe0, indexE0_data, 1); // Activate Temperature + _sendIndexData(0xe0, indexE0_work, 1); // Activate Temperature _sendIndexData(0x00, index00_work, 2); // PSR - if ((_codeExtra & FEATURE_FAST) and (updateMode != UPDATE_GLOBAL) and _flag50) // Specific settings for fast update + // Specific settings for fast update, all screens + if ((_codeExtra & FEATURE_FAST) and (updateMode != UPDATE_GLOBAL)) { - _sendIndexData(0x50, index50a_data, 1); // Vcom and data interval setting + uint8_t index50c_work[1]; // Vcom + index50c_work[0] = index50c_data[0]; // 0x07 + _sendIndexData(0x50, index50c_work, 1); // Vcom and data interval setting + } + + // Additional settings for fast update, 154 213 266 and 370 screens (_flag50) + if ((_codeExtra & FEATURE_FAST) and (updateMode != UPDATE_GLOBAL) and _flag50) + { + uint8_t index50a_work[1]; // Vcom + index50a_work[0] = index50a_data[0]; // 0x27 + _sendIndexData(0x50, index50a_work, 1); // Vcom and data interval setting } } @@ -147,9 +162,12 @@ void Screen_EPD_EXT3_Fast::COG_sendImageDataFast() void Screen_EPD_EXT3_Fast::COG_update(uint8_t updateMode) { - if ((_codeExtra & FEATURE_FAST) and (updateMode != UPDATE_GLOBAL) and _flag50) // Specific settings for fast update + // Specific settings for fast update, 154 213 266 and 370 screens (_flag50) + if ((_codeExtra & FEATURE_FAST) and (updateMode != UPDATE_GLOBAL) and _flag50) { - _sendIndexData(0x50, index50b_data, 1); // Vcom and data interval setting + uint8_t index50b_work[1]; // Vcom + index50b_work[0] = index50b_data[0]; // 0x07 + _sendIndexData(0x50, index50b_work, 1); // Vcom and data interval setting } _sendCommand8(0x04); // Power on @@ -197,11 +215,11 @@ void Screen_EPD_EXT3_Fast::begin() switch (_codeSize) { - case 0x27: // 2.70"-Touch + case 0x27: // 2.71"-Touch _screenSizeV = 264; // vertical = wide size _screenSizeH = 176; // horizontal = small size - _screenDiagonal = 270; // 270 for touch + _screenDiagonal = 271; break; case 0x37: // 3.70"-Touch @@ -341,6 +359,10 @@ void Screen_EPD_EXT3_Fast::begin() _penSolid = false; _invert = false; + // Report + Serial.println("= Screen %s %ix%i", WhoAmI(), screenSizeX(), screenSizeY()); + Serial.println("= PDLS v%i", SCREEN_EPD_EXT3_RELEASE); + clear(); // @@ -501,7 +523,7 @@ void Screen_EPD_EXT3_Fast::_setOrientation(uint8_t orientation) bool Screen_EPD_EXT3_Fast::_orientCoordinates(uint16_t & x, uint16_t & y) { - bool flag = true; // false = success, true = error + bool flagError = true; // false = success, true = error switch (_orientation) { case 3: // checked, previously 1 @@ -509,7 +531,7 @@ bool Screen_EPD_EXT3_Fast::_orientCoordinates(uint16_t & x, uint16_t & y) if ((x < _screenSizeV) and (y < _screenSizeH)) { x = _screenSizeV - 1 - x; - flag = false; + flagError = false; } break; @@ -520,7 +542,7 @@ bool Screen_EPD_EXT3_Fast::_orientCoordinates(uint16_t & x, uint16_t & y) x = _screenSizeH - 1 - x; y = _screenSizeV - 1 - y; swap(x, y); - flag = false; + flagError = false; } break; @@ -529,7 +551,7 @@ bool Screen_EPD_EXT3_Fast::_orientCoordinates(uint16_t & x, uint16_t & y) if ((x < _screenSizeV) and (y < _screenSizeH)) { y = _screenSizeH - 1 - y; - flag = false; + flagError = false; } break; @@ -538,12 +560,12 @@ bool Screen_EPD_EXT3_Fast::_orientCoordinates(uint16_t & x, uint16_t & y) if ((x < _screenSizeH) and (y < _screenSizeV)) { swap(x, y); - flag = false; + flagError = false; } break; } - return flag; + return flagError; } uint32_t Screen_EPD_EXT3_Fast::_getZ(uint16_t x1, uint16_t y1) diff --git a/src/Screen_EPD_EXT3.h b/src/Screen_EPD_EXT3.h index f4039a4..433efb4 100755 --- a/src/Screen_EPD_EXT3.h +++ b/src/Screen_EPD_EXT3.h @@ -12,12 +12,12 @@ /// * Feature: none /// /// @n Supported screens with touch -/// * 2.70"-Touch reference xTP270PGH0x +/// * 2.71"-Touch reference xTP271PGH0x /// * 3.70"-Touch reference xTP370PGH0x /// /// @author Rei Vilo -/// @date 20 Mar 2023 -/// @version 607 +/// @date 20 Apr 2023 +/// @version 608 /// /// @copyright (c) Rei Vilo, 2010-2023 /// @copyright Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) @@ -50,7 +50,7 @@ /// /// @brief Library release number /// -#define SCREEN_EPD_EXT3_RELEASE 607 +#define SCREEN_EPD_EXT3_RELEASE 608 // Other libraries #include "SPI.h" diff --git a/src/hV_Constants.h b/src/hV_Constants.h index 4a16192..bdb04c4 100644 --- a/src/hV_Constants.h +++ b/src/hV_Constants.h @@ -6,8 +6,8 @@ /// @n Based on highView technology /// /// @author Rei Vilo -/// @date 22 Feb 2023 -/// @version 606 +/// @date 20 Apr 2023 +/// @version 608 /// /// @copyright (c) Rei Vilo, 2010-2023 /// @copyright All rights reserved @@ -29,7 +29,7 @@ /// /// @brief Release /// -#define hV_CONSTANTS_RELEASE 606 +#define hV_CONSTANTS_RELEASE 608 #endif // hV_CONSTANTS_RELEASE /// @@ -45,6 +45,7 @@ #define FEATURE_FAST 0x01 ///< With capacitive touch panel #define FEATURE_TOUCH 0x02 ///< With embedded fast update #define FEATURE_ARMOR 0x04 ///< With protection +#define FEATURE_WIDE_TEMPERATURE 0x08 ///< With wide operating temperature /// @} /// @@ -88,3 +89,11 @@ #define TOUCH_EVENT_MOVE 3 ///< Touch move event /// @} /// + +/// +/// @brief Results +/// @{ +#define RESULT_SUCCESS 0 ///< Success +#define RESULT_ERROR 1 ///< Error +/// @} +/// diff --git a/src/hV_Documentation.h b/src/hV_Documentation.h index 22ab18b..c71ac5a 100755 --- a/src/hV_Documentation.h +++ b/src/hV_Documentation.h @@ -40,8 +40,8 @@ /// 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 20 Mar 2023 -/// @version 607 +/// @date 20 Apr 2023 +/// @version 608 /// /// @copyright (c) Rei Vilo, 2010-2023 /// @copyright All rights reserved diff --git a/src/hV_GUI.cpp b/src/hV_GUI.cpp index e4b472e..0181eb1 100755 --- a/src/hV_GUI.cpp +++ b/src/hV_GUI.cpp @@ -16,6 +16,7 @@ // // Release 531: Improved performance // Release 605: Improved elements link to GUI +// Release 608: Shared common debouncing module // // Library header @@ -149,12 +150,16 @@ bool Button::check(bool mode) draw(fsmTouched); - do + // do + // { + // delay(100); + // _pGUI->_pScreen->getTouch(x, y, z, t); + // } + // while (t != TOUCH_EVENT_RELEASE); + while (_pGUI->_pScreen->getTouch(x, y, z, t)) // Debounce { delay(100); - _pGUI->_pScreen->getTouch(x, y, z, t); } - while (t != TOUCH_EVENT_RELEASE); // Released if ((x >= _x0) and (x < _x0 + _dx) and (y >= _y0) and (y < _y0 + _dy)) diff --git a/src/hV_GUI.h b/src/hV_GUI.h index ea268ce..e47e8c0 100755 --- a/src/hV_GUI.h +++ b/src/hV_GUI.h @@ -6,8 +6,8 @@ /// @n Based on highView technology /// /// @author Rei Vilo -/// @date 25 Jan 2023 -/// @version 605 +/// @date 20 Apr 2023 +/// @version 608 /// /// @copyright (c) Rei Vilo, 2010-2023 /// @copyright Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) @@ -29,7 +29,7 @@ /// /// @brief Library release number /// -#define hV_GUI_BASIC_RELEASE 605 +#define hV_GUI_BASIC_RELEASE 608 // SDK #if defined(ENERGIA) // LaunchPad specific