Skip to content

Commit

Permalink
Release 6.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
rei-vilo committed Apr 25, 2023
1 parent f1bdb1f commit d584ddd
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 35 deletions.
62 changes: 42 additions & 20 deletions src/Screen_EPD_EXT3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
}
}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();

//
Expand Down Expand Up @@ -501,15 +523,15 @@ 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

if ((x < _screenSizeV) and (y < _screenSizeH))
{
x = _screenSizeV - 1 - x;
flag = false;
flagError = false;
}
break;

Expand All @@ -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;

Expand All @@ -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;

Expand All @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions src/Screen_EPD_EXT3.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"
Expand Down
15 changes: 12 additions & 3 deletions src/hV_Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -29,7 +29,7 @@
///
/// @brief Release
///
#define hV_CONSTANTS_RELEASE 606
#define hV_CONSTANTS_RELEASE 608
#endif // hV_CONSTANTS_RELEASE

///
Expand All @@ -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
/// @}

///
Expand Down Expand Up @@ -88,3 +89,11 @@
#define TOUCH_EVENT_MOVE 3 ///< Touch move event
/// @}
///

///
/// @brief Results
/// @{
#define RESULT_SUCCESS 0 ///< Success
#define RESULT_ERROR 1 ///< Error
/// @}
///
4 changes: 2 additions & 2 deletions src/hV_Documentation.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 8 additions & 3 deletions src/hV_GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
//
// Release 531: Improved performance
// Release 605: Improved elements link to GUI
// Release 608: Shared common debouncing module
//

// Library header
Expand Down Expand Up @@ -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))
Expand Down
6 changes: 3 additions & 3 deletions src/hV_GUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit d584ddd

Please sign in to comment.