Compare commits

..

7 Commits

Author SHA1 Message Date
DarkZeros 7e1eb82420
Merge f369b6f207 into 342eb48a49 2024-01-13 21:19:13 +00:00
Daniel Ansorregui f369b6f207 Allow AsyncPowerOn
* The display takes 16ms to power on
  During this time we can render the
  content and finally display it
* The call is optional if we do not call
  it then the old code path is used
* Moved the init to constructor
2024-01-13 19:11:22 +00:00
Daniel Ansorregui 8103df1499 Refactor DarkBorder
* Allow to be changed dynamically between
  display updated.
2024-01-13 19:08:52 +00:00
Daniel Ansorregui 84c0cd106c Set boosters configuration
* Reduce the phase on times from 40ms->10ms
* Increase the driving strength, this reduces
  a little the power usage as well
* Reduces 220ms the display update
  -80ms the power on of the display
  -140ms the display partial update
- Note: This may have side effects, but I saw none
  tested on Watchy v1.0, display should be same on
  other Watchy boards
2024-01-13 18:24:19 +00:00
Daniel Ansorregui 3ce125247d No soft reset after reset
* Avoid a redundant reset after a reset
  The display is always reset after a hard reset
  and there is no need to re-reset it
2024-01-13 18:24:04 +00:00
Daniel Ansorregui f2c0c91a61 Refactor Display Init
* It makes more sense to put it in the Display class
* The reset should be 2ms, 10ms is worst case
* Also there was a disable call based on display
  that makes more sense to put in the default
  boot switch statement
2024-01-13 18:23:45 +00:00
Daniel Ansorregui 2b21e50c2f Move Display specifics
* Move BusyCallback
* Move constructor pins
2024-01-13 18:19:37 +00:00
3 changed files with 14 additions and 4 deletions

View File

@ -31,6 +31,9 @@ WatchyDisplay::WatchyDisplay() :
// Setup callback and SPI by default
selectSPI(SPI, SPISettings(20000000, MSBFIRST, SPI_MODE0));
setBusyCallback(busyCallback);
}
void WatchyDisplay::initWatchy() {
// Watchy default initialization
init(0, displayFullInit, 2, true);
}
@ -419,11 +422,14 @@ void WatchyDisplay::_InitDisplay()
_transfer(0x00);
if (reduceBoosterTime) {
// SSD1675B controller datasheet
_transferCommand(0x0C); // BOOSTER_SOFT_START_CONTROL
_transfer(0x80); // Needs to be at least 0x80
_transfer(0x00); // Aggresive lowest possible delay, out of spec (worked ok for me)
_transfer(0x00); // Aggresive lowest possible delay, out of spec (worked ok for me)
_transfer(0x80); // Undocumented booster delay, 0x80 seems ok
// Set the driving strength of GDR for all phases to maximun 0b111 -> 0xF
// Set the minimum off time of GDR to minimum 0x4 (values below sould be same)
_transfer(0xF4); // Phase1 Default value 0x8B
_transfer(0xF4); // Phase2 Default value 0x9C
_transfer(0xF4); // Phase3 Default value 0x96
_transfer(0x00); // Duration of phases, Default 0xF = 0b00 11 11 (40ms Phase 1/2, 10ms Phase 3)
}
_transferCommand(0x18); // Read built-in temperature sensor

View File

@ -35,6 +35,7 @@ class WatchyDisplay : public GxEPD2_EPD
static const uint16_t partial_refresh_time = 500; // ms, e.g. 457282us
// constructor
WatchyDisplay();
void initWatchy();
void setDarkBorder(bool darkBorder);
void asyncPowerOn();
void _PowerOnAsync();

View File

@ -21,6 +21,9 @@ void Watchy::init(String datetime) {
Wire.begin(SDA, SCL); // init i2c
RTC.init();
// Init the display since is almost sure we will use it
display.epd2.initWatchy();
switch (wakeup_reason) {
case ESP_SLEEP_WAKEUP_EXT0: // RTC Alarm
RTC.read(currentTime);