CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
EpaperDisplay.cpp File Reference
#include "cdc_hal/IDisplay.h"
#include "cdc_hal/hw_config.h"
#include "cdc_core/Raii.h"
#include "cdc_log.h"
#include "driver/ledc.h"
#include "nvs_flash.h"
#include "nvs.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"
#include <goodisplay/gdey029T94.h>
#include <Fonts/FreeMonoBold12pt7b.h>
#include <Fonts/FreeMonoBold9pt7b.h>
#include <cstring>
#include <cstdarg>

Go to the source code of this file.

Classes

class  cdc::hal::EpaperDisplay

Namespaces

namespace  cdc
namespace  cdc::hal

Functions

static bool cdc::hal::resolveFullRefresh (RefreshMode mode)
static int cdc::hal::refreshStrength (RefreshMode mode)
static void cdc::hal::applyBacklight (uint16_t level)
 Applies backlight PWM duty level.
static void cdc::hal::loadBacklight ()
 Loads persisted backlight level from NVS.
static void cdc::hal::persistBacklight (uint16_t level)
 Persists backlight level to NVS.
static void cdc::hal::renderTask (void *arg)
 Render worker task processing async flush requests.
IDisplaycdc::hal::getDisplayInstance ()
 Returns lazily created singleton display instance.
void cdc::hal::winkBacklight (uint8_t count=2, uint16_t period_ms=150)
 Blink the backlight as a visual "look at me" signal.

Variables

static const char * TAG = "EpaperDisplay"
static constexpr const char * SPLASH_TITLE = "CDC Badge"
 Splash-screen text defaults.
static constexpr const char * SPLASH_VERSION = "v" APP_VERSION
static constexpr ledc_timer_t cdc::hal::LEDC_TIMER = LEDC_TIMER_0
 LEDC backlight PWM configuration constants.
static constexpr ledc_mode_t cdc::hal::LEDC_MODE = LEDC_LOW_SPEED_MODE
static constexpr ledc_channel_t cdc::hal::LEDC_CHANNEL = LEDC_CHANNEL_0
static constexpr ledc_timer_bit_t cdc::hal::LEDC_DUTY_RES = LEDC_TIMER_10_BIT
static constexpr uint32_t cdc::hal::LEDC_FREQUENCY = 10000
static constexpr const char * cdc::hal::NVS_NAMESPACE = "display"
 NVS namespace and keys for display settings.
static constexpr const char * cdc::hal::NVS_KEY_BACKLIGHT = "backlight"
static constexpr uint16_t cdc::hal::WIDTH = 296
 Display timing and geometry constants.
static constexpr uint16_t cdc::hal::HEIGHT = 128
static constexpr uint16_t cdc::hal::BACKLIGHT_DEFAULT = 512
static constexpr uint16_t cdc::hal::BACKLIGHT_MAX = 1023
static EpdSpi * cdc::hal::s_epd_spi = nullptr
 Lazily initialized display objects to avoid global constructors.
static Gdey029T94 * cdc::hal::s_epd_display = nullptr
static bool cdc::hal::s_initialized = false
 Mutable display state cache.
static uint16_t cdc::hal::s_backlightLevel = BACKLIGHT_DEFAULT
static bool cdc::hal::s_backlightOn = true
static SemaphoreHandle_t cdc::hal::s_renderMutex = nullptr
 Render-task runtime state.
static TaskHandle_t cdc::hal::s_renderTask = nullptr
static volatile bool cdc::hal::s_renderPending = false
static volatile RefreshMode cdc::hal::s_renderMode = RefreshMode::PARTIAL
static SemaphoreHandle_t cdc::hal::s_panelMutex = nullptr
static uint16_t cdc::hal::s_partialsSinceFull = 0
static constexpr uint16_t cdc::hal::kMaxPartialsBeforeFull = 60
static EpaperDisplaycdc::hal::s_display = nullptr
 Lazily created singleton display instance.

Variable Documentation

◆ SPLASH_TITLE

const char* SPLASH_TITLE = "CDC Badge"
staticconstexpr

Splash-screen text defaults.

Definition at line 28 of file EpaperDisplay.cpp.

Referenced by cdc::hal::EpaperDisplay::showSplash().

◆ SPLASH_VERSION

const char* SPLASH_VERSION = "v" APP_VERSION
staticconstexpr

Definition at line 29 of file EpaperDisplay.cpp.

Referenced by cdc::hal::EpaperDisplay::showSplash().

◆ TAG

const char* TAG = "EpaperDisplay"
static

E-Paper Display HAL Implementation Wraps CalEPD library for Gdey029T94 (296x128 B/W)

WICHTIG: Alle Objekte werden LAZY initialisiert um Crashes durch globale Konstruktoren zu vermeiden!

Definition at line 25 of file EpaperDisplay.cpp.