mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-23 17:13:38 +00:00

* chore: todo.txt
* chore: InkHUD documentation
Word salad for maintainers
* refactor: don't init system applets using onActivate
System applets cannot be deactivated, so we will avoid using onActivate / onDeactivate methods entirely.
* chore: update the example applets
* fix: SSD16XX reset pulse
Allow time for controller IC to wake. Aligns with manufacturer's suggestions.
T-Echo button timing adjusted to prevent bouncing as a result(?) of slightly faster refreshes.
* fix: allow timeout if display update fails
Result is not graceful, but avoids total display lockup requiring power cycle.
Typical cause of failure is poor wiring / power supply.
* fix: improve display health on shutdown
Two extra full refreshes, masquerading as a "shutting down" screen. One is drawn white-on-black, to really shake the pixels up.
* feat: driver for display HINK_E042A87
As of Feb. 2025, these panels are used for "WeActStudio 4.2in B&W" display modules.
* fix: inkhud rotation should default to 0
* Revert "chore: todo.txt"
This reverts commit bea7df44a7
.
* fix: more generous timeout for display updates
Previously this was tied to the expected duration of the update, but this didn't account for any delay if our polling thread got held up by an unrelated firmware task.
* fix: don't use the full shutdown screen during reboot
* fix: cooldown period during the display shutdown display sequence
Observed to prevent border pixels from being locked in place with some residual charge?
57 lines
2.3 KiB
C++
57 lines
2.3 KiB
C++
/*
|
|
|
|
Base class for E-Ink display drivers
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS
|
|
#include "configuration.h"
|
|
|
|
#include "concurrency/OSThread.h"
|
|
#include <SPI.h>
|
|
|
|
namespace NicheGraphics::Drivers
|
|
{
|
|
|
|
class EInk : private concurrency::OSThread
|
|
{
|
|
public:
|
|
// Different possible operations used to update an E-Ink display
|
|
// Some displays will not support all operations
|
|
// Each value needs a unique bit. In some cases, we might set more than one bit (e.g. EInk::supportedUpdateType)
|
|
enum UpdateTypes : uint8_t {
|
|
UNSPECIFIED = 0,
|
|
FULL = 1 << 0,
|
|
FAST = 1 << 1, // "Partial Refresh"
|
|
};
|
|
|
|
EInk(uint16_t width, uint16_t height, UpdateTypes supported);
|
|
virtual void begin(SPIClass *spi, uint8_t pin_dc, uint8_t pin_cs, uint8_t pin_busy, uint8_t pin_rst = -1) = 0;
|
|
virtual void update(uint8_t *imageData, UpdateTypes type) = 0; // Change the display image
|
|
void await(); // Wait for an in-progress update to complete before proceeding
|
|
bool supports(UpdateTypes type); // Can display perform a certain update type
|
|
bool busy() { return updateRunning; } // Display able to update right now?
|
|
|
|
const uint16_t width; // Public so that NicheGraphics implementations can access. Safe because const.
|
|
const uint16_t height;
|
|
|
|
protected:
|
|
void beginPolling(uint32_t interval, uint32_t expectedDuration); // Begin checking repeatedly if update finished
|
|
virtual bool isUpdateDone() = 0; // Check once if update finished
|
|
virtual void finalizeUpdate() {} // Run any post-update code
|
|
bool failed = false; // If an error occurred during update
|
|
|
|
private:
|
|
int32_t runOnce() override; // Repeated checking if update finished
|
|
|
|
const UpdateTypes supportedUpdateTypes; // Capabilities of a derived display class
|
|
bool updateRunning = false; // see EInk::busy()
|
|
uint32_t pollingInterval = 0; // How often to check if update complete (ms)
|
|
uint32_t pollingBegunAt = 0; // To timeout during polling
|
|
};
|
|
|
|
} // namespace NicheGraphics::Drivers
|
|
|
|
#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS
|