|
Ersa Wearable Platform
Embedded smartwatch firmware and application framework
|
#include <display_manager.h>

Public Member Functions | |
| DisplayManager (hal::IDisplay &display) | |
| Result< void > | init () |
| void | tick (uint32_t currentUptimeMs) |
| void | markDirty (bool fullRefresh=false) |
| bool | isDirty () const |
| Return whether the panel needs a refresh. | |
| bool | updateIfDirty (uint32_t currentUptimeMs) |
| void | refresh (bool full=false, uint32_t currentUptimeMs=0) |
| void | refreshRect (const Rect &bounds, bool forceFull, uint32_t currentUptimeMs) |
| uint16_t | getPartialFrameCount () const |
| void | resetPartialFrameCount () |
| Reset the partial-frame refresh counter. | |
| hal::IDisplay & | getDisplay () |
Static Public Member Functions | |
| static DisplayManager & | instance () |
| Return the installed process-wide display manager. | |
| static void | setInstance (DisplayManager *instance) |
| Install a process-wide display manager for legacy service accessors. | |
Static Public Attributes | |
| static constexpr uint32_t | MIN_REFRESH_INTERVAL_MS = 500 |
| static constexpr uint16_t | FULL_REFRESH_FRAME_COUNT = 360 |
Private Attributes | |
| hal::IDisplay & | display_ |
| bool | dirty_ {true} |
| bool | fullNeeded_ {true} |
| uint16_t | partialFrames_ {0} |
| uint32_t | lastRefreshTime_ {0} |
Coalesces drawing changes and applies panel-specific refresh policy.
Apps only mark content dirty; this manager rate-limits physical refreshes and tracks partial-frame counts. E-paper drivers disable panel drive voltage after each refresh while retaining the visible image. Keeping those decisions here prevents fast UI events from causing excessive e-paper flashing or shortening panel lifetime.
|
explicit |
Bind the generic display; manager does not own the driver object.
| hal::IDisplay & ersa::services::DisplayManager::getDisplay | ( | ) |
Return the borrowed display HAL so coordinated services share one panel.
| uint16_t ersa::services::DisplayManager::getPartialFrameCount | ( | ) | const |
Read the ghosting-policy counter used to decide when to full-refresh.
| Result< void > ersa::services::DisplayManager::init | ( | ) |
Initialize the panel and seed refresh/idle bookkeeping.
|
static |
Return the installed process-wide display manager.
| bool ersa::services::DisplayManager::isDirty | ( | ) | const |
Return whether the panel needs a refresh.
| void ersa::services::DisplayManager::markDirty | ( | bool | fullRefresh = false | ) |
Record invalidated framebuffer content; repeated marks coalesce into one future refresh. A full request is sticky until serviced.
| void ersa::services::DisplayManager::refresh | ( | bool | full = false, |
| uint32_t | currentUptimeMs = 0 |
||
| ) |
Bypass dirty scheduling for explicit refresh requests, such as redraw.
| void ersa::services::DisplayManager::refreshRect | ( | const Rect & | bounds, |
| bool | forceFull, | ||
| uint32_t | currentUptimeMs | ||
| ) |
Refresh an invalidated region and centralize full-waveform cadence.
| bounds | Changed framebuffer area; ignored for a full waveform. |
| forceFull | Request a full waveform for first frame or known day change. |
| currentUptimeMs | Monotonic time used to update panel bookkeeping. |
| void ersa::services::DisplayManager::resetPartialFrameCount | ( | ) |
Reset the partial-frame refresh counter.
|
static |
Install a process-wide display manager for legacy service accessors.
| void ersa::services::DisplayManager::tick | ( | uint32_t | currentUptimeMs | ) |
Apply deferred display policy for the current uptime.
| bool ersa::services::DisplayManager::updateIfDirty | ( | uint32_t | currentUptimeMs | ) |
Submit one pending update only after the minimum refresh interval.
|
private |
|
private |
|
staticconstexpr |
Partial frames before policy requests a full ghost-clearing waveform.
|
private |
|
private |
|
staticconstexpr |
Minimum delay between refresh submissions, protecting panel timing.
|
private |