CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
cdc::hal Namespace Reference

Namespaces

namespace  GattProp
namespace  GattPerm
namespace  BleAdvParser

Classes

struct  BleScanResult
struct  BleBondInfo
struct  BleUuid
struct  GattDescriptor
struct  GattCharacteristic
struct  GattServiceDef
class  IBluetoothController
class  IDisplay
class  IEspHardware
class  II2cBus
class  IKeypad
class  IPowerManager
class  IRtc
class  ISecureElement
struct  SleepCallbackEntry
class  ISleepController
struct  WifiScanResult
class  IWifiController
struct  lt_dev_esp32_t
class  BluetoothControllerStub
class  BQ25895Power
class  EpaperDisplay
class  EspHardware
struct  I2cDevice
class  I2cBusImpl
class  Esp32Rtc
class  SecureElementStub
class  Esp32SleepController
class  TCA9535Keypad
class  Tropic01Element
 Secure-element implementation backed by libtropic. More...
class  WifiController

Typedefs

using GattWriteCallback
using GattReadCallback
using ListenerToken = IBluetoothController::ListenerToken
using I2cDeviceHandle = void*
using KeyCallback = void(*)(Key key, bool pressed)
using SleepCallback = void (*)(void* context)

Enumerations

enum class  GattDescriptorKind : uint8_t { NONE = 0 , REPORT_REFERENCE = 1 }
enum class  RefreshMode : uint8_t { FULL , PARTIAL , PARTIAL_LIGHT }
enum class  Key : char {
  KEY_1 = '1' , KEY_2 = '2' , KEY_3 = '3' , KEY_4 = '4' ,
  KEY_5 = '5' , KEY_6 = '6' , KEY_7 = '7' , KEY_8 = '8' ,
  KEY_9 = '9' , KEY_NO = 'N' , KEY_0 = '0' , KEY_YES = 'Y' ,
  KEY_NONE = 0
}
enum class  ChargeStatus : uint8_t {
  NOT_CHARGING , PRE_CHARGE , FAST_CHARGE , CHARGE_DONE ,
  FAULT
}
enum class  PowerSource : uint8_t { BATTERY , USB , UNKNOWN }
enum class  EccCurve : uint8_t { P256 , ED25519 }
enum class  SeResult : uint8_t {
  OK , ERROR , SESSION_REQUIRED , SLOT_EMPTY ,
  SLOT_OCCUPIED , INVALID_PARAM , ALARM_MODE , NOT_SUPPORTED
}
enum class  SleepMode : uint8_t { NONE , LIGHT_SLEEP , DEEP_SLEEP }
enum class  WakeupSource : uint8_t {
  UNKNOWN , TIMER , GPIO , TOUCHPAD ,
  EXT0 , EXT1
}
enum class  WifiMode : uint8_t { OFF , STA , AP , STA_AP }
enum class  WifiSecurity : uint8_t {
  OPEN , WEP , WPA_PSK , WPA2_PSK ,
  WPA3_PSK , WPA2_ENTERPRISE
}
enum class  WifiState : uint8_t {
  DISCONNECTED , CONNECTING , CONNECTED , CONNECTION_FAILED ,
  GOT_IP
}

Functions

IBluetoothControllergetBluetoothControllerInstance ()
 Returns singleton Bluetooth stub when NimBLE is unavailable.
IDisplaygetDisplayInstance ()
 Returns lazily created singleton display instance.
void winkBacklight (uint8_t count=2, uint16_t period_ms=150)
 Blink the backlight as a visual "look at me" signal.
IEspHardwaregetEspHardwareInstance ()
II2cBusgetI2cBus0 ()
 Returns singleton instance of I2C bus 0.
II2cBusgetI2cBus1 ()
 Returns singleton instance of I2C bus 1.
IKeypadgetKeypadInstance ()
 Returns the singleton keypad service instance.
IPowerManagergetPowerManagerInstance ()
 Returns the singleton power manager instance.
IRtcgetRtcInstance ()
 Returns the singleton RTC service instance.
uint8_t curveByte (EccCurve c)
 Maps an EccCurve to the module-level curve byte.
EccCurve curveFromByte (uint8_t b)
 Maps a curve byte to its EccCurve enum.
ISecureElementgetSecureElementInstance ()
 Returns singleton secure-element stub instance.
ISleepControllergetSleepControllerInstance ()
 Returns the singleton sleep controller service instance.
spi_host_device_t getSharedSpiHost ()
 Returns shared SPI host identifier.
esp_err_t initSharedSpiBus ()
 Initializes shared SPI bus once for all SPI peripherals.
IWifiControllergetWifiControllerInstance ()
 Returns the singleton Wi-Fi controller service instance.
static void charger_isr (void *arg)
 GPIO interrupt handler for the charger IRQ pin.
static bool resolveFullRefresh (RefreshMode mode)
static int refreshStrength (RefreshMode mode)
static void applyBacklight (uint16_t level)
 Applies backlight PWM duty level.
static void loadBacklight ()
 Loads persisted backlight level from NVS.
static void persistBacklight (uint16_t level)
 Persists backlight level to NVS.
static void renderTask (void *arg)
 Render worker task processing async flush requests.
static constexpr uint16_t maskForBit (uint8_t bit)
 Builds the active-low raw state for a single pressed key.
static Key rawToKey (uint16_t raw)
 Converts raw 16-bit keypad state to a Key enum value.
static uint16_t keyToMask (Key key)
 Converts a Key enum value to its expected raw 12-bit mask.
static void wifiEventHandler (void *arg, esp_event_base_t eventBase, int32_t eventId, void *eventData)
 Wi-Fi event callback bridge.
static void ipEventHandler (void *arg, esp_event_base_t eventBase, int32_t eventId, void *eventData)
 IP event callback bridge.

Variables

constexpr ListenerToken INVALID_LISTENER = IBluetoothController::INVALID_LISTENER
static BluetoothControllerStub g_bluetoothController
static constexpr uint8_t BQ_REG_INPUT_CTRL = 0x00
 BQ25895 register map constants.
static constexpr uint8_t BQ_REG_ADC_CTRL = 0x02
static constexpr uint8_t BQ_REG_CHG_CTRL = 0x03
static constexpr uint8_t BQ_REG_FAST_CHG = 0x04
static constexpr uint8_t BQ_REG_TIMER = 0x07
static constexpr uint8_t BQ_REG_MISC = 0x09
static constexpr uint8_t BQ_REG_SYS_STATUS = 0x0B
static constexpr uint8_t BQ_REG_FAULT = 0x0C
static constexpr uint8_t BQ_REG_BATV = 0x0E
static constexpr uint8_t BQ_REG_SYSV = 0x0F
static constexpr uint8_t BQ_REG_TS = 0x10
static constexpr uint8_t BQ_REG_VBUS = 0x11
static constexpr uint8_t BQ_REG_ICHG = 0x12
static constexpr uint8_t BQ_REG_VINDPM = 0x13
static constexpr uint8_t BQ_REG_VENDOR = 0x14
static constexpr uint8_t BQ_ICHG_STEP_MA = 64
 Charge current and safety threshold constants.
static constexpr uint16_t BQ_SYS_MIN_MV = 3300
static constexpr uint16_t CHARGE_CURRENT_SLOW = 512
static constexpr uint16_t CHARGE_CURRENT_FAST = 1000
static constexpr uint16_t CHARGE_CURRENT_MIN = 64
static constexpr uint16_t CHARGE_CURRENT_MAX = 1024
static constexpr uint16_t BATTERY_MIN_MV = 2800
 Battery voltage thresholds for state estimation. LiPo battery characteristics (3.7V nominal, 4.2V max).
static constexpr uint16_t BATTERY_EMPTY_MV = 3200
static constexpr uint16_t BATTERY_FULL_MV = 4200
static constexpr uint16_t BATTERY_MAX_MV = 4250
static constexpr uint16_t BATTERY_USB_PASSTHRU_MIN_MV = 4000
static constexpr uint16_t BATTERY_USB_PASSTHRU_MAX_MV = BATTERY_MAX_MV
static constexpr uint32_t kPowerButtonLongPressMs = 3000
 Hold duration on the power/flash button that triggers ship mode.
static volatile bool charger_irq_pending = false
 Charger IRQ flag set by ISR and consumed in update().
static BQ25895Power g_powerManager
 Singleton power manager instance.
static constexpr ledc_timer_t LEDC_TIMER = LEDC_TIMER_0
 LEDC backlight PWM configuration constants.
static constexpr ledc_mode_t LEDC_MODE = LEDC_LOW_SPEED_MODE
static constexpr ledc_channel_t LEDC_CHANNEL = LEDC_CHANNEL_0
static constexpr ledc_timer_bit_t LEDC_DUTY_RES = LEDC_TIMER_10_BIT
static constexpr uint32_t LEDC_FREQUENCY = 10000
static constexpr const char * NVS_NAMESPACE = "display"
 NVS namespace and keys for display settings.
static constexpr const char * NVS_KEY_BACKLIGHT = "backlight"
static constexpr uint16_t WIDTH = 296
 Display timing and geometry constants.
static constexpr uint16_t HEIGHT = 128
static constexpr uint16_t BACKLIGHT_DEFAULT = 512
static constexpr uint16_t BACKLIGHT_MAX = 1023
static EpdSpi * s_epd_spi = nullptr
 Lazily initialized display objects to avoid global constructors.
static Gdey029T94 * s_epd_display = nullptr
static bool s_initialized = false
 Mutable display state cache.
static uint16_t s_backlightLevel = BACKLIGHT_DEFAULT
static bool s_backlightOn = true
static SemaphoreHandle_t s_renderMutex = nullptr
 Render-task runtime state.
static TaskHandle_t s_renderTask = nullptr
static volatile bool s_renderPending = false
static volatile RefreshMode s_renderMode = RefreshMode::PARTIAL
static SemaphoreHandle_t s_panelMutex = nullptr
static uint16_t s_partialsSinceFull = 0
static constexpr uint16_t kMaxPartialsBeforeFull = 60
static EpaperDisplays_display = nullptr
 Lazily created singleton display instance.
static EspHardware g_espHardware
static constexpr uint32_t I2C_FREQ_HZ = 100000
 I2C bus timing configuration constants.
static constexpr uint32_t I2C_TIMEOUT_MS = 100
static I2cBusImpl g_i2c0 (I2C_NUM_0, I2C0_SDA_PIN, I2C0_SCL_PIN, "i2c0")
 Singleton instances for both hardware I2C ports.
static I2cBusImpl g_i2c1 (I2C_NUM_1, I2C1_SDA_PIN, I2C1_SCL_PIN, "i2c1")
static constexpr const char * NVS_NAMESPACE = "rtc"
 NVS namespace used to persist RTC state across resets.
static constexpr const char * NVS_KEY_TZ = "tz_offset"
static constexpr const char * NVS_KEY_TS = "last_ts"
static Esp32Rtc g_rtc
 Singleton RTC implementation instance.
static SecureElementStub g_secureElementStub
static constexpr uint32_t DEFAULT_LIGHT_SLEEP_INTERVAL_S = 60
 Default light-sleep timer interval in seconds.
static constexpr const char * NVS_NAMESPACE = "sleep"
 NVS namespace/key for persisted sleep interval.
static constexpr const char * NVS_KEY_INTERVAL = "interval"
static constexpr size_t MAX_CALLBACKS = 8
 Maximum number of registered callbacks per callback list.
static RTC_DATA_ATTR bool g_was_in_deep_sleep = false
 RTC-retained flag indicating previous deep-sleep state.
static RTC_DATA_ATTR uint32_t g_diag_boot_count = 0
static RTC_DATA_ATTR uint32_t g_diag_deep_sleep_count = 0
static Esp32SleepController g_sleepController
 Singleton sleep-controller instance.
static constexpr spi_host_device_t SPI_BUS_HOST = SPI2_HOST
 Shared SPI host selection for ESP32-S3 user peripherals.
static constexpr uint32_t SPI_DMA_CHAN = SPI_DMA_CH_AUTO
static std::atomic< bool > g_spiInitialized {false}
static constexpr uint8_t REG_INPUT_0 = 0x00
 TCA9535 register-address constants.
static constexpr uint8_t REG_INPUT_1 = 0x01
static constexpr uint8_t REG_OUTPUT_0 = 0x02
static constexpr uint8_t REG_OUTPUT_1 = 0x03
static constexpr uint8_t REG_POLARITY_0 = 0x04
static constexpr uint8_t REG_POLARITY_1 = 0x05
static constexpr uint8_t REG_CONFIG_0 = 0x06
static constexpr uint8_t REG_CONFIG_1 = 0x07
static constexpr uint32_t TASK_STACK_SIZE = 6144
 Keypad task scheduling configuration.
static constexpr UBaseType_t TASK_PRIORITY = 5
static constexpr uint32_t POLL_TIMEOUT_MS = 50
static constexpr uint32_t DEBOUNCE_MS = 10
static constexpr uint32_t LONG_PRESS_THRESHOLD_MS = 800
 Default long-press detection threshold in milliseconds. Long enough to avoid accidental triggers, short enough to feel responsive.
static constexpr size_t KEY_BUFFER_SIZE = 16
 Ring-buffer configuration for queued key events.
static constexpr uint8_t KEY_BIT_0 = 0
 Bit positions of each physical key on the TCA9535 P0/P1 ports. Active-low: a pressed key drives its corresponding bit to 0.
static constexpr uint8_t KEY_BIT_1 = 1
static constexpr uint8_t KEY_BIT_2 = 2
static constexpr uint8_t KEY_BIT_3 = 3
static constexpr uint8_t KEY_BIT_4 = 4
static constexpr uint8_t KEY_BIT_5 = 5
static constexpr uint8_t KEY_BIT_6 = 6
static constexpr uint8_t KEY_BIT_7 = 7
static constexpr uint8_t KEY_BIT_8 = 8
static constexpr uint8_t KEY_BIT_9 = 9
static constexpr uint8_t KEY_BIT_NO = 11
static constexpr uint8_t KEY_BIT_YES = 10
static constexpr uint16_t KEY_MASK_ALL = 0x0FFF
 Mask of all 12 keypad bits (P0.0..P1.3).
static constexpr uint16_t KEY_STATE_IDLE = KEY_MASK_ALL
 Idle state: every key released, all 12 bits high.
static constexpr uint16_t KEY_STATE_INVALID = 0xFFFF
 Sentinel value returned when an I2C read fails or no key is mapped.
static constexpr uint16_t PANIC_CHORD_BITS = (1u << KEY_BIT_NO) | (1u << KEY_BIT_YES)
 Reserved rescue chord: N and Y held together (anti-block instant lock).
static TCA9535Keypad g_keypad
 Singleton keypad instance.
static Tropic01Element g_secureElement
 Global singleton instance of TROPIC secure-element implementation.
static WifiController g_wifiController
 Singleton Wi-Fi controller instance.

Typedef Documentation

◆ GattReadCallback

Initial value:
std::function<int(uint16_t connHandle, uint16_t attrHandle,
uint8_t* buf, uint16_t* len)>

GATT read callback for characteristic reads

Definition at line 96 of file IBluetoothController.h.

◆ GattWriteCallback

Initial value:
std::function<int(uint16_t connHandle, uint16_t attrHandle,
const uint8_t* data, uint16_t len)>

GATT write callback for characteristic writes

Definition at line 90 of file IBluetoothController.h.

◆ I2cDeviceHandle

Definition at line 10 of file II2cBus.h.

◆ KeyCallback

using cdc::hal::KeyCallback = void(*)(Key key, bool pressed)

Keypad event callback

Definition at line 27 of file IKeypad.h.

◆ ListenerToken

◆ SleepCallback

using cdc::hal::SleepCallback = void (*)(void* context)

Callback types for sleep/wakeup events

Definition at line 32 of file ISleepController.h.

Enumeration Type Documentation

◆ ChargeStatus

enum class cdc::hal::ChargeStatus : uint8_t
strong

Charging status

Enumerator
NOT_CHARGING 
PRE_CHARGE 
FAST_CHARGE 
CHARGE_DONE 
FAULT 

Definition at line 11 of file IPowerManager.h.

◆ EccCurve

enum class cdc::hal::EccCurve : uint8_t
strong

ECC curve types

Enumerator
P256 
ED25519 

Definition at line 12 of file ISecureElement.h.

◆ GattDescriptorKind

enum class cdc::hal::GattDescriptorKind : uint8_t
strong

GATT descriptor type identifiers used by GattDescriptor.kind

Enumerator
NONE 
REPORT_REFERENCE 

Definition at line 102 of file IBluetoothController.h.

◆ Key

enum class cdc::hal::Key : char
strong

Key codes for the 12-button keypad Physical layout: [1] [2] [3] [4] [5] [6] [7] [8] [9] [N] [0] [Y] (N=Cancel, Y=OK)

Enumerator
KEY_1 
KEY_2 
KEY_3 
KEY_4 
KEY_5 
KEY_6 
KEY_7 
KEY_8 
KEY_9 
KEY_NO 
KEY_0 
KEY_YES 
KEY_NONE 

Definition at line 16 of file IKeypad.h.

◆ PowerSource

enum class cdc::hal::PowerSource : uint8_t
strong

Power source

Enumerator
BATTERY 
USB 
UNKNOWN 

Definition at line 22 of file IPowerManager.h.

◆ RefreshMode

enum class cdc::hal::RefreshMode : uint8_t
strong

Display refresh modes

Enumerator
FULL 
PARTIAL 
PARTIAL_LIGHT 

Definition at line 11 of file IDisplay.h.

◆ SeResult

enum class cdc::hal::SeResult : uint8_t
strong

Secure Element operation result

Enumerator
OK 
ERROR 
SESSION_REQUIRED 
SLOT_EMPTY 
SLOT_OCCUPIED 
INVALID_PARAM 
ALARM_MODE 
NOT_SUPPORTED 

Definition at line 38 of file ISecureElement.h.

◆ SleepMode

enum class cdc::hal::SleepMode : uint8_t
strong

Sleep mode types

Enumerator
NONE 
LIGHT_SLEEP 
DEEP_SLEEP 

Definition at line 11 of file ISleepController.h.

◆ WakeupSource

enum class cdc::hal::WakeupSource : uint8_t
strong

Wakeup source

Enumerator
UNKNOWN 
TIMER 
GPIO 
TOUCHPAD 
EXT0 
EXT1 

Definition at line 20 of file ISleepController.h.

◆ WifiMode

enum class cdc::hal::WifiMode : uint8_t
strong

WiFi operating modes

Enumerator
OFF 
STA 
AP 
STA_AP 

Definition at line 12 of file IWifiController.h.

◆ WifiSecurity

enum class cdc::hal::WifiSecurity : uint8_t
strong

WiFi security types

Enumerator
OPEN 
WEP 
WPA_PSK 
WPA2_PSK 
WPA3_PSK 
WPA2_ENTERPRISE 

Definition at line 22 of file IWifiController.h.

◆ WifiState

enum class cdc::hal::WifiState : uint8_t
strong

WiFi connection state

Enumerator
DISCONNECTED 
CONNECTING 
CONNECTED 
CONNECTION_FAILED 
GOT_IP 

Definition at line 34 of file IWifiController.h.

Function Documentation

◆ applyBacklight()

void cdc::hal::applyBacklight ( uint16_t level)
static

Applies backlight PWM duty level.

Parameters
levelDuty value in LEDC resolution units.

Definition at line 108 of file EpaperDisplay.cpp.

References LEDC_CHANNEL, and LEDC_MODE.

Referenced by cdc::hal::EpaperDisplay::backlightOff(), cdc::hal::EpaperDisplay::backlightOn(), cdc::hal::EpaperDisplay::setBacklight(), cdc::hal::EpaperDisplay::start(), and cdc::hal::EpaperDisplay::stop().

◆ charger_isr()

void cdc::hal::charger_isr ( void * arg)
static

GPIO interrupt handler for the charger IRQ pin.

Parameters
argUnused ISR argument.
Returns
void

Definition at line 78 of file BQ25895Power.cpp.

References charger_irq_pending.

Referenced by cdc::hal::BQ25895Power::init().

◆ curveByte()

uint8_t cdc::hal::curveByte ( EccCurve c)
inline

Maps an EccCurve to the module-level curve byte.

Parameters
cCurve identifier.
Returns
0 for Ed25519, 1 for P-256.

Definition at line 22 of file ISecureElement.h.

References ED25519.

◆ curveFromByte()

EccCurve cdc::hal::curveFromByte ( uint8_t b)
inline

Maps a curve byte to its EccCurve enum.

Parameters
bCurve byte (0 Ed25519, otherwise P-256).
Returns
Corresponding EccCurve value.

Definition at line 31 of file ISecureElement.h.

References ED25519, and P256.

◆ getBluetoothControllerInstance()

◆ getDisplayInstance()

◆ getEspHardwareInstance()

IEspHardware * cdc::hal::getEspHardwareInstance ( )

Definition at line 92 of file EspHardware.cpp.

References g_espHardware.

Referenced by cdc::ui::buildHardwareInfoText().

◆ getI2cBus0()

II2cBus * cdc::hal::getI2cBus0 ( )

Returns singleton instance of I2C bus 0.

Returns
Pointer to II2cBus instance.

Definition at line 275 of file I2cBus.cpp.

References g_i2c0.

Referenced by cdc::ui::buildHardwareInfoText(), cdc::hal::BQ25895Power::init(), cdc::hal::TCA9535Keypad::init(), and initI2cBus().

◆ getI2cBus1()

II2cBus * cdc::hal::getI2cBus1 ( )

Returns singleton instance of I2C bus 1.

Returns
Pointer to II2cBus instance.

Definition at line 280 of file I2cBus.cpp.

References g_i2c1.

Referenced by sao_init().

◆ getKeypadInstance()

◆ getPowerManagerInstance()

IPowerManager * cdc::hal::getPowerManagerInstance ( )

Returns the singleton power manager instance.

Returns
Pointer to the global IPowerManager implementation.

Definition at line 636 of file BQ25895Power.cpp.

References g_powerManager.

Referenced by cdc::ui::buildHardwareInfoText(), cdc::serial::cmdShipMode(), initPowerManager(), and cdc::ui::onShipModeConfirm().

◆ getRtcInstance()

IRtc * cdc::hal::getRtcInstance ( )

◆ getSecureElementInstance()

◆ getSharedSpiHost()

spi_host_device_t cdc::hal::getSharedSpiHost ( )

Returns shared SPI host identifier.

Shared SPI host for Display + Secure Element The SPI bus is initialized once and shared between devices

Returns
SPI host used by shared bus.

Definition at line 25 of file SpiBus.cpp.

References SPI_BUS_HOST.

Referenced by lt_port_init().

◆ getSleepControllerInstance()

ISleepController * cdc::hal::getSleepControllerInstance ( )

Returns the singleton sleep controller service instance.

Returns
Pointer to the global ISleepController implementation.

Definition at line 426 of file SleepController.cpp.

References g_sleepController.

Referenced by cdc::os_ui::SystemSettingsBackup::exportSystemSettings(), cdc::os_ui::SystemSettingsBackup::importSystemSettings(), and initSleepController().

◆ getWifiControllerInstance()

◆ initSharedSpiBus()

esp_err_t cdc::hal::initSharedSpiBus ( )

Initializes shared SPI bus once for all SPI peripherals.

Returns
ESP-IDF error code.

Definition at line 33 of file SpiBus.cpp.

References g_spiInitialized, LOG_E, LOG_I, SPI_BUS_HOST, SPI_DMA_CHAN, SPI_MISO_PIN, SPI_MOSI_PIN, SPI_SCLK_PIN, and TAG.

Referenced by lt_port_init().

◆ ipEventHandler()

void cdc::hal::ipEventHandler ( void * arg,
esp_event_base_t eventBase,
int32_t eventId,
void * eventData )
static

IP event callback bridge.

ESP-IDF IP event bridge to controller instance.

Parameters
argOptional callback context (unused).
eventBaseEvent base (unused).
eventIdIP event id.
eventDataEvent payload.

Definition at line 131 of file WifiController.cpp.

References cdc::hal::WifiController::instance_.

Referenced by cdc::hal::WifiController::enable().

◆ keyToMask()

uint16_t cdc::hal::keyToMask ( Key key)
static

Converts a Key enum value to its expected raw 12-bit mask.

Parameters
keyKey to convert.
Returns
Raw keypad mask for the selected key.

Definition at line 110 of file TCA9535Keypad.cpp.

References KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_BIT_0, KEY_BIT_1, KEY_BIT_2, KEY_BIT_3, KEY_BIT_4, KEY_BIT_5, KEY_BIT_6, KEY_BIT_7, KEY_BIT_8, KEY_BIT_9, KEY_BIT_NO, KEY_BIT_YES, KEY_NO, KEY_STATE_INVALID, KEY_YES, and maskForBit().

Referenced by cdc::hal::TCA9535Keypad::isKeyPressed().

◆ loadBacklight()

void cdc::hal::loadBacklight ( )
static

Loads persisted backlight level from NVS.

Definition at line 116 of file EpaperDisplay.cpp.

References BACKLIGHT_DEFAULT, BACKLIGHT_MAX, NVS_KEY_BACKLIGHT, NVS_NAMESPACE, and s_backlightLevel.

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

◆ maskForBit()

constexpr uint16_t cdc::hal::maskForBit ( uint8_t bit)
staticconstexpr

Builds the active-low raw state for a single pressed key.

Parameters
bitBit index of the pressed key (0..11).
Returns
12-bit mask with the selected bit cleared, all others set.

Definition at line 78 of file TCA9535Keypad.cpp.

References KEY_MASK_ALL.

Referenced by keyToMask(), and rawToKey().

◆ persistBacklight()

void cdc::hal::persistBacklight ( uint16_t level)
static

Persists backlight level to NVS.

Parameters
levelBacklight level to store.

Definition at line 131 of file EpaperDisplay.cpp.

References LOG_D, NVS_KEY_BACKLIGHT, NVS_NAMESPACE, and TAG.

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

◆ rawToKey()

Key cdc::hal::rawToKey ( uint16_t raw)
static

Converts raw 16-bit keypad state to a Key enum value.

Parameters
rawRaw keypad state bitmask (active-low, bits 0-11).
Returns
Mapped Key value, or KEY_NONE when no key is active.

Definition at line 87 of file TCA9535Keypad.cpp.

References KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_BIT_0, KEY_BIT_1, KEY_BIT_2, KEY_BIT_3, KEY_BIT_4, KEY_BIT_5, KEY_BIT_6, KEY_BIT_7, KEY_BIT_8, KEY_BIT_9, KEY_BIT_NO, KEY_BIT_YES, KEY_MASK_ALL, KEY_NO, KEY_NONE, KEY_YES, and maskForBit().

◆ refreshStrength()

int cdc::hal::refreshStrength ( RefreshMode mode)
static

Definition at line 95 of file EpaperDisplay.cpp.

References FULL, PARTIAL, and PARTIAL_LIGHT.

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

◆ renderTask()

void cdc::hal::renderTask ( void * arg)
static

Render worker task processing async flush requests.

Parameters
argTask parameter (unused).

Definition at line 145 of file EpaperDisplay.cpp.

References HEIGHT, resolveFullRefresh(), s_epd_display, s_panelMutex, s_renderMode, s_renderMutex, s_renderPending, and WIDTH.

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

◆ resolveFullRefresh()

bool cdc::hal::resolveFullRefresh ( RefreshMode mode)
static

◆ wifiEventHandler()

void cdc::hal::wifiEventHandler ( void * arg,
esp_event_base_t eventBase,
int32_t eventId,
void * eventData )
static

Wi-Fi event callback bridge.

ESP-IDF Wi-Fi event bridge to controller instance.

Parameters
argOptional callback context (unused).
eventBaseEvent base (unused).
eventIdWi-Fi event id.
eventDataEvent payload.

Definition at line 115 of file WifiController.cpp.

References cdc::hal::WifiController::instance_.

Referenced by cdc::hal::WifiController::enable().

◆ winkBacklight()

void cdc::hal::winkBacklight ( uint8_t count = 2,
uint16_t period_ms = 150 )

Blink the backlight as a visual "look at me" signal.

Toggles the e-paper frontlight off/on count times with period_ms milliseconds in each half-cycle. Restores the original backlight state on return. Safe to call from any FreeRTOS task: the underlying LEDC PWM API is thread-safe and no framebuffer rendering happens.

Used for FIDO2/CTAPHID WINK identification, USB pairing prompts, and any other "draw the user's attention" notification.

Parameters
countNumber of off/on cycles (clamped to 1..10, default 2).
period_msDuration of each half-cycle in ms (clamped to 50..1000, default 150). Total wall time is 2 * count * period_ms.

Definition at line 573 of file EpaperDisplay.cpp.

References getDisplayInstance().

Referenced by handle_wink(), and host_ui_wink().

Variable Documentation

◆ BACKLIGHT_DEFAULT

uint16_t cdc::hal::BACKLIGHT_DEFAULT = 512
staticconstexpr

Definition at line 47 of file EpaperDisplay.cpp.

Referenced by loadBacklight().

◆ BACKLIGHT_MAX

uint16_t cdc::hal::BACKLIGHT_MAX = 1023
staticconstexpr

Definition at line 48 of file EpaperDisplay.cpp.

Referenced by loadBacklight(), and cdc::hal::EpaperDisplay::setBacklight().

◆ BATTERY_EMPTY_MV

uint16_t cdc::hal::BATTERY_EMPTY_MV = 3200
staticconstexpr

Definition at line 57 of file BQ25895Power.cpp.

Referenced by cdc::hal::BQ25895Power::getBatteryPercent().

◆ BATTERY_FULL_MV

uint16_t cdc::hal::BATTERY_FULL_MV = 4200
staticconstexpr

Definition at line 58 of file BQ25895Power.cpp.

Referenced by cdc::hal::BQ25895Power::getBatteryPercent().

◆ BATTERY_MAX_MV

uint16_t cdc::hal::BATTERY_MAX_MV = 4250
staticconstexpr

Definition at line 59 of file BQ25895Power.cpp.

◆ BATTERY_MIN_MV

uint16_t cdc::hal::BATTERY_MIN_MV = 2800
staticconstexpr

Battery voltage thresholds for state estimation. LiPo battery characteristics (3.7V nominal, 4.2V max).

Definition at line 56 of file BQ25895Power.cpp.

◆ BATTERY_USB_PASSTHRU_MAX_MV

uint16_t cdc::hal::BATTERY_USB_PASSTHRU_MAX_MV = BATTERY_MAX_MV
staticconstexpr

Definition at line 61 of file BQ25895Power.cpp.

◆ BATTERY_USB_PASSTHRU_MIN_MV

uint16_t cdc::hal::BATTERY_USB_PASSTHRU_MIN_MV = 4000
staticconstexpr

Definition at line 60 of file BQ25895Power.cpp.

◆ BQ_ICHG_STEP_MA

uint8_t cdc::hal::BQ_ICHG_STEP_MA = 64
staticconstexpr

Charge current and safety threshold constants.

Definition at line 45 of file BQ25895Power.cpp.

◆ BQ_REG_ADC_CTRL

uint8_t cdc::hal::BQ_REG_ADC_CTRL = 0x02
staticconstexpr

◆ BQ_REG_BATV

uint8_t cdc::hal::BQ_REG_BATV = 0x0E
staticconstexpr

Definition at line 34 of file BQ25895Power.cpp.

Referenced by cdc::hal::BQ25895Power::getBatteryVoltage().

◆ BQ_REG_CHG_CTRL

uint8_t cdc::hal::BQ_REG_CHG_CTRL = 0x03
staticconstexpr

Definition at line 28 of file BQ25895Power.cpp.

Referenced by cdc::hal::BQ25895Power::init().

◆ BQ_REG_FAST_CHG

uint8_t cdc::hal::BQ_REG_FAST_CHG = 0x04
staticconstexpr

Definition at line 29 of file BQ25895Power.cpp.

◆ BQ_REG_FAULT

uint8_t cdc::hal::BQ_REG_FAULT = 0x0C
staticconstexpr

Definition at line 33 of file BQ25895Power.cpp.

◆ BQ_REG_ICHG

uint8_t cdc::hal::BQ_REG_ICHG = 0x12
staticconstexpr

Definition at line 38 of file BQ25895Power.cpp.

◆ BQ_REG_INPUT_CTRL

uint8_t cdc::hal::BQ_REG_INPUT_CTRL = 0x00
staticconstexpr

BQ25895 register map constants.

Definition at line 26 of file BQ25895Power.cpp.

Referenced by cdc::hal::BQ25895Power::init().

◆ BQ_REG_MISC

uint8_t cdc::hal::BQ_REG_MISC = 0x09
staticconstexpr

Definition at line 31 of file BQ25895Power.cpp.

Referenced by cdc::hal::BQ25895Power::enterShipMode().

◆ BQ_REG_SYS_STATUS

uint8_t cdc::hal::BQ_REG_SYS_STATUS = 0x0B
staticconstexpr

Definition at line 32 of file BQ25895Power.cpp.

◆ BQ_REG_SYSV

uint8_t cdc::hal::BQ_REG_SYSV = 0x0F
staticconstexpr

Definition at line 35 of file BQ25895Power.cpp.

◆ BQ_REG_TIMER

uint8_t cdc::hal::BQ_REG_TIMER = 0x07
staticconstexpr

Definition at line 30 of file BQ25895Power.cpp.

◆ BQ_REG_TS

uint8_t cdc::hal::BQ_REG_TS = 0x10
staticconstexpr

Definition at line 36 of file BQ25895Power.cpp.

◆ BQ_REG_VBUS

uint8_t cdc::hal::BQ_REG_VBUS = 0x11
staticconstexpr

Definition at line 37 of file BQ25895Power.cpp.

◆ BQ_REG_VENDOR

uint8_t cdc::hal::BQ_REG_VENDOR = 0x14
staticconstexpr

Definition at line 40 of file BQ25895Power.cpp.

Referenced by cdc::hal::BQ25895Power::init().

◆ BQ_REG_VINDPM

uint8_t cdc::hal::BQ_REG_VINDPM = 0x13
staticconstexpr

Definition at line 39 of file BQ25895Power.cpp.

◆ BQ_SYS_MIN_MV

uint16_t cdc::hal::BQ_SYS_MIN_MV = 3300
staticconstexpr

Definition at line 46 of file BQ25895Power.cpp.

Referenced by cdc::hal::BQ25895Power::init().

◆ CHARGE_CURRENT_FAST

uint16_t cdc::hal::CHARGE_CURRENT_FAST = 1000
staticconstexpr

Definition at line 48 of file BQ25895Power.cpp.

Referenced by cdc::hal::BQ25895Power::setChargingEnabled().

◆ CHARGE_CURRENT_MAX

uint16_t cdc::hal::CHARGE_CURRENT_MAX = 1024
staticconstexpr

Definition at line 50 of file BQ25895Power.cpp.

◆ CHARGE_CURRENT_MIN

uint16_t cdc::hal::CHARGE_CURRENT_MIN = 64
staticconstexpr

Definition at line 49 of file BQ25895Power.cpp.

Referenced by cdc::hal::BQ25895Power::setChargingEnabled().

◆ CHARGE_CURRENT_SLOW

uint16_t cdc::hal::CHARGE_CURRENT_SLOW = 512
staticconstexpr

◆ charger_irq_pending

volatile bool cdc::hal::charger_irq_pending = false
static

Charger IRQ flag set by ISR and consumed in update().

Definition at line 71 of file BQ25895Power.cpp.

Referenced by charger_isr(), and cdc::hal::BQ25895Power::update().

◆ DEBOUNCE_MS

uint32_t cdc::hal::DEBOUNCE_MS = 10
staticconstexpr

Definition at line 37 of file TCA9535Keypad.cpp.

◆ DEFAULT_LIGHT_SLEEP_INTERVAL_S

uint32_t cdc::hal::DEFAULT_LIGHT_SLEEP_INTERVAL_S = 60
staticconstexpr

Default light-sleep timer interval in seconds.

Definition at line 32 of file SleepController.cpp.

◆ g_bluetoothController

BluetoothControllerStub cdc::hal::g_bluetoothController
static

Definition at line 2436 of file BluetoothController.cpp.

Referenced by getBluetoothControllerInstance().

◆ g_diag_boot_count

RTC_DATA_ATTR uint32_t cdc::hal::g_diag_boot_count = 0
static

Definition at line 47 of file SleepController.cpp.

Referenced by cdc::hal::Esp32SleepController::init().

◆ g_diag_deep_sleep_count

RTC_DATA_ATTR uint32_t cdc::hal::g_diag_deep_sleep_count = 0
static

◆ g_espHardware

EspHardware cdc::hal::g_espHardware
static

Definition at line 90 of file EspHardware.cpp.

Referenced by getEspHardwareInstance().

◆ g_i2c0

I2cBusImpl cdc::hal::g_i2c0(I2C_NUM_0, I2C0_SDA_PIN, I2C0_SCL_PIN, "i2c0") ( I2C_NUM_0 ,
I2C0_SDA_PIN ,
I2C0_SCL_PIN ,
"i2c0"  )
static

Singleton instances for both hardware I2C ports.

Referenced by getI2cBus0().

◆ g_i2c1

I2cBusImpl cdc::hal::g_i2c1(I2C_NUM_1, I2C1_SDA_PIN, I2C1_SCL_PIN, "i2c1") ( I2C_NUM_1 ,
I2C1_SDA_PIN ,
I2C1_SCL_PIN ,
"i2c1"  )
static

Referenced by getI2cBus1().

◆ g_keypad

TCA9535Keypad cdc::hal::g_keypad
static

Singleton keypad instance.

Definition at line 601 of file TCA9535Keypad.cpp.

Referenced by getKeypadInstance().

◆ g_powerManager

BQ25895Power cdc::hal::g_powerManager
static

Singleton power manager instance.

Definition at line 630 of file BQ25895Power.cpp.

Referenced by getPowerManagerInstance().

◆ g_rtc

Esp32Rtc cdc::hal::g_rtc
static

Singleton RTC implementation instance.

Definition at line 298 of file Rtc.cpp.

Referenced by getRtcInstance().

◆ g_secureElement

Tropic01Element cdc::hal::g_secureElement
static

Global singleton instance of TROPIC secure-element implementation.

Definition at line 1055 of file Tropic01Element.cpp.

◆ g_secureElementStub

SecureElementStub cdc::hal::g_secureElementStub
static

Definition at line 85 of file SecureElementStub.cpp.

Referenced by getSecureElementInstance().

◆ g_sleepController

Esp32SleepController cdc::hal::g_sleepController
static

Singleton sleep-controller instance.

Definition at line 420 of file SleepController.cpp.

Referenced by getSleepControllerInstance().

◆ g_spiInitialized

std::atomic<bool> cdc::hal::g_spiInitialized {false}
static

Definition at line 19 of file SpiBus.cpp.

Referenced by initSharedSpiBus().

◆ g_was_in_deep_sleep

RTC_DATA_ATTR bool cdc::hal::g_was_in_deep_sleep = false
static

◆ g_wifiController

WifiController cdc::hal::g_wifiController
static

Singleton Wi-Fi controller instance.

Definition at line 729 of file WifiController.cpp.

Referenced by getWifiControllerInstance().

◆ HEIGHT

uint16_t cdc::hal::HEIGHT = 128
staticconstexpr

◆ I2C_FREQ_HZ

uint32_t cdc::hal::I2C_FREQ_HZ = 100000
staticconstexpr

I2C bus timing configuration constants.

Definition at line 18 of file I2cBus.cpp.

Referenced by cdc::hal::I2cBusImpl::init().

◆ I2C_TIMEOUT_MS

◆ INVALID_LISTENER

ListenerToken cdc::hal::INVALID_LISTENER = IBluetoothController::INVALID_LISTENER
inlineconstexpr

Definition at line 710 of file IBluetoothController.h.

◆ KEY_BIT_0

uint8_t cdc::hal::KEY_BIT_0 = 0
staticconstexpr

Bit positions of each physical key on the TCA9535 P0/P1 ports. Active-low: a pressed key drives its corresponding bit to 0.

Definition at line 48 of file TCA9535Keypad.cpp.

Referenced by keyToMask(), and rawToKey().

◆ KEY_BIT_1

uint8_t cdc::hal::KEY_BIT_1 = 1
staticconstexpr

Definition at line 49 of file TCA9535Keypad.cpp.

Referenced by keyToMask(), and rawToKey().

◆ KEY_BIT_2

uint8_t cdc::hal::KEY_BIT_2 = 2
staticconstexpr

Definition at line 50 of file TCA9535Keypad.cpp.

Referenced by keyToMask(), and rawToKey().

◆ KEY_BIT_3

uint8_t cdc::hal::KEY_BIT_3 = 3
staticconstexpr

Definition at line 51 of file TCA9535Keypad.cpp.

Referenced by keyToMask(), and rawToKey().

◆ KEY_BIT_4

uint8_t cdc::hal::KEY_BIT_4 = 4
staticconstexpr

Definition at line 52 of file TCA9535Keypad.cpp.

Referenced by keyToMask(), and rawToKey().

◆ KEY_BIT_5

uint8_t cdc::hal::KEY_BIT_5 = 5
staticconstexpr

Definition at line 53 of file TCA9535Keypad.cpp.

Referenced by keyToMask(), and rawToKey().

◆ KEY_BIT_6

uint8_t cdc::hal::KEY_BIT_6 = 6
staticconstexpr

Definition at line 54 of file TCA9535Keypad.cpp.

Referenced by keyToMask(), and rawToKey().

◆ KEY_BIT_7

uint8_t cdc::hal::KEY_BIT_7 = 7
staticconstexpr

Definition at line 55 of file TCA9535Keypad.cpp.

Referenced by keyToMask(), and rawToKey().

◆ KEY_BIT_8

uint8_t cdc::hal::KEY_BIT_8 = 8
staticconstexpr

Definition at line 56 of file TCA9535Keypad.cpp.

Referenced by keyToMask(), and rawToKey().

◆ KEY_BIT_9

uint8_t cdc::hal::KEY_BIT_9 = 9
staticconstexpr

Definition at line 57 of file TCA9535Keypad.cpp.

Referenced by keyToMask(), and rawToKey().

◆ KEY_BIT_NO

uint8_t cdc::hal::KEY_BIT_NO = 11
staticconstexpr

Definition at line 58 of file TCA9535Keypad.cpp.

Referenced by keyToMask(), and rawToKey().

◆ KEY_BIT_YES

uint8_t cdc::hal::KEY_BIT_YES = 10
staticconstexpr

Definition at line 59 of file TCA9535Keypad.cpp.

Referenced by keyToMask(), and rawToKey().

◆ KEY_BUFFER_SIZE

size_t cdc::hal::KEY_BUFFER_SIZE = 16
staticconstexpr

Ring-buffer configuration for queued key events.

Definition at line 44 of file TCA9535Keypad.cpp.

◆ KEY_MASK_ALL

uint16_t cdc::hal::KEY_MASK_ALL = 0x0FFF
staticconstexpr

Mask of all 12 keypad bits (P0.0..P1.3).

Definition at line 62 of file TCA9535Keypad.cpp.

Referenced by cdc::hal::TCA9535Keypad::anyKeyDown(), cdc::hal::TCA9535Keypad::isKeyPressed(), maskForBit(), and rawToKey().

◆ KEY_STATE_IDLE

uint16_t cdc::hal::KEY_STATE_IDLE = KEY_MASK_ALL
staticconstexpr

Idle state: every key released, all 12 bits high.

Definition at line 65 of file TCA9535Keypad.cpp.

Referenced by cdc::hal::TCA9535Keypad::anyKeyDown().

◆ KEY_STATE_INVALID

uint16_t cdc::hal::KEY_STATE_INVALID = 0xFFFF
staticconstexpr

Sentinel value returned when an I2C read fails or no key is mapped.

Definition at line 68 of file TCA9535Keypad.cpp.

Referenced by cdc::hal::TCA9535Keypad::isKeyPressed(), and keyToMask().

◆ kMaxPartialsBeforeFull

uint16_t cdc::hal::kMaxPartialsBeforeFull = 60
staticconstexpr

Definition at line 75 of file EpaperDisplay.cpp.

Referenced by resolveFullRefresh().

◆ kPowerButtonLongPressMs

uint32_t cdc::hal::kPowerButtonLongPressMs = 3000
staticconstexpr

Hold duration on the power/flash button that triggers ship mode.

Definition at line 66 of file BQ25895Power.cpp.

Referenced by cdc::hal::BQ25895Power::update().

◆ LEDC_CHANNEL

ledc_channel_t cdc::hal::LEDC_CHANNEL = LEDC_CHANNEL_0
staticconstexpr

Definition at line 36 of file EpaperDisplay.cpp.

Referenced by applyBacklight(), and cdc::hal::EpaperDisplay::init().

◆ LEDC_DUTY_RES

ledc_timer_bit_t cdc::hal::LEDC_DUTY_RES = LEDC_TIMER_10_BIT
staticconstexpr

Definition at line 37 of file EpaperDisplay.cpp.

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

◆ LEDC_FREQUENCY

uint32_t cdc::hal::LEDC_FREQUENCY = 10000
staticconstexpr

Definition at line 38 of file EpaperDisplay.cpp.

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

◆ LEDC_MODE

ledc_mode_t cdc::hal::LEDC_MODE = LEDC_LOW_SPEED_MODE
staticconstexpr

Definition at line 35 of file EpaperDisplay.cpp.

Referenced by applyBacklight(), and cdc::hal::EpaperDisplay::init().

◆ LEDC_TIMER

ledc_timer_t cdc::hal::LEDC_TIMER = LEDC_TIMER_0
staticconstexpr

LEDC backlight PWM configuration constants.

Definition at line 34 of file EpaperDisplay.cpp.

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

◆ LONG_PRESS_THRESHOLD_MS

uint32_t cdc::hal::LONG_PRESS_THRESHOLD_MS = 800
staticconstexpr

Default long-press detection threshold in milliseconds. Long enough to avoid accidental triggers, short enough to feel responsive.

Definition at line 41 of file TCA9535Keypad.cpp.

◆ MAX_CALLBACKS

size_t cdc::hal::MAX_CALLBACKS = 8
staticconstexpr

Maximum number of registered callbacks per callback list.

Definition at line 39 of file SleepController.cpp.

◆ NVS_KEY_BACKLIGHT

const char* cdc::hal::NVS_KEY_BACKLIGHT = "backlight"
staticconstexpr

Definition at line 42 of file EpaperDisplay.cpp.

Referenced by loadBacklight(), and persistBacklight().

◆ NVS_KEY_INTERVAL

const char* cdc::hal::NVS_KEY_INTERVAL = "interval"
staticconstexpr

Definition at line 36 of file SleepController.cpp.

◆ NVS_KEY_TS

const char* cdc::hal::NVS_KEY_TS = "last_ts"
staticconstexpr

Definition at line 30 of file Rtc.cpp.

◆ NVS_KEY_TZ

const char* cdc::hal::NVS_KEY_TZ = "tz_offset"
staticconstexpr

Definition at line 29 of file Rtc.cpp.

Referenced by cdc::hal::Esp32Rtc::setTimezoneOffset().

◆ NVS_NAMESPACE [1/3]

const char* cdc::hal::NVS_NAMESPACE = "display"
staticconstexpr

NVS namespace and keys for display settings.

Definition at line 41 of file EpaperDisplay.cpp.

Referenced by loadBacklight(), persistBacklight(), and cdc::hal::Esp32Rtc::setTimezoneOffset().

◆ NVS_NAMESPACE [2/3]

const char* cdc::hal::NVS_NAMESPACE = "rtc"
staticconstexpr

NVS namespace used to persist RTC state across resets.

Definition at line 28 of file Rtc.cpp.

◆ NVS_NAMESPACE [3/3]

const char* cdc::hal::NVS_NAMESPACE = "sleep"
staticconstexpr

NVS namespace/key for persisted sleep interval.

Definition at line 35 of file SleepController.cpp.

◆ PANIC_CHORD_BITS

uint16_t cdc::hal::PANIC_CHORD_BITS = (1u << KEY_BIT_NO) | (1u << KEY_BIT_YES)
staticconstexpr

Reserved rescue chord: N and Y held together (anti-block instant lock).

Definition at line 71 of file TCA9535Keypad.cpp.

◆ POLL_TIMEOUT_MS

uint32_t cdc::hal::POLL_TIMEOUT_MS = 50
staticconstexpr

Definition at line 36 of file TCA9535Keypad.cpp.

◆ REG_CONFIG_0

uint8_t cdc::hal::REG_CONFIG_0 = 0x06
staticconstexpr

Definition at line 30 of file TCA9535Keypad.cpp.

Referenced by cdc::hal::TCA9535Keypad::init().

◆ REG_CONFIG_1

uint8_t cdc::hal::REG_CONFIG_1 = 0x07
staticconstexpr

Definition at line 31 of file TCA9535Keypad.cpp.

Referenced by cdc::hal::TCA9535Keypad::init().

◆ REG_INPUT_0

uint8_t cdc::hal::REG_INPUT_0 = 0x00
staticconstexpr

TCA9535 register-address constants.

Definition at line 24 of file TCA9535Keypad.cpp.

◆ REG_INPUT_1

uint8_t cdc::hal::REG_INPUT_1 = 0x01
staticconstexpr

Definition at line 25 of file TCA9535Keypad.cpp.

◆ REG_OUTPUT_0

uint8_t cdc::hal::REG_OUTPUT_0 = 0x02
staticconstexpr

Definition at line 26 of file TCA9535Keypad.cpp.

Referenced by cdc::hal::TCA9535Keypad::init().

◆ REG_OUTPUT_1

uint8_t cdc::hal::REG_OUTPUT_1 = 0x03
staticconstexpr

Definition at line 27 of file TCA9535Keypad.cpp.

Referenced by cdc::hal::TCA9535Keypad::init().

◆ REG_POLARITY_0

uint8_t cdc::hal::REG_POLARITY_0 = 0x04
staticconstexpr

Definition at line 28 of file TCA9535Keypad.cpp.

Referenced by cdc::hal::TCA9535Keypad::init().

◆ REG_POLARITY_1

uint8_t cdc::hal::REG_POLARITY_1 = 0x05
staticconstexpr

Definition at line 29 of file TCA9535Keypad.cpp.

Referenced by cdc::hal::TCA9535Keypad::init().

◆ s_backlightLevel

◆ s_backlightOn

◆ s_display

EpaperDisplay* cdc::hal::s_display = nullptr
static

Lazily created singleton display instance.

Definition at line 560 of file EpaperDisplay.cpp.

Referenced by getDisplayInstance().

◆ s_epd_display

◆ s_epd_spi

EpdSpi* cdc::hal::s_epd_spi = nullptr
static

Lazily initialized display objects to avoid global constructors.

Definition at line 51 of file EpaperDisplay.cpp.

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

◆ s_initialized

bool cdc::hal::s_initialized = false
static

Mutable display state cache.

Definition at line 55 of file EpaperDisplay.cpp.

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

◆ s_panelMutex

SemaphoreHandle_t cdc::hal::s_panelMutex = nullptr
static

◆ s_partialsSinceFull

uint16_t cdc::hal::s_partialsSinceFull = 0
static

Definition at line 74 of file EpaperDisplay.cpp.

Referenced by resolveFullRefresh().

◆ s_renderMode

volatile RefreshMode cdc::hal::s_renderMode = RefreshMode::PARTIAL
static

Definition at line 63 of file EpaperDisplay.cpp.

Referenced by cdc::hal::EpaperDisplay::flush(), and renderTask().

◆ s_renderMutex

SemaphoreHandle_t cdc::hal::s_renderMutex = nullptr
static

Render-task runtime state.

Definition at line 60 of file EpaperDisplay.cpp.

Referenced by cdc::hal::EpaperDisplay::flush(), cdc::hal::EpaperDisplay::init(), and renderTask().

◆ s_renderPending

volatile bool cdc::hal::s_renderPending = false
static

◆ s_renderTask

TaskHandle_t cdc::hal::s_renderTask = nullptr
static

◆ SPI_BUS_HOST

spi_host_device_t cdc::hal::SPI_BUS_HOST = SPI2_HOST
staticconstexpr

Shared SPI host selection for ESP32-S3 user peripherals.

Definition at line 16 of file SpiBus.cpp.

Referenced by getSharedSpiHost(), and initSharedSpiBus().

◆ SPI_DMA_CHAN

uint32_t cdc::hal::SPI_DMA_CHAN = SPI_DMA_CH_AUTO
staticconstexpr

Definition at line 17 of file SpiBus.cpp.

Referenced by initSharedSpiBus().

◆ TASK_PRIORITY

UBaseType_t cdc::hal::TASK_PRIORITY = 5
staticconstexpr

Definition at line 35 of file TCA9535Keypad.cpp.

Referenced by cdc::hal::TCA9535Keypad::init().

◆ TASK_STACK_SIZE

uint32_t cdc::hal::TASK_STACK_SIZE = 6144
staticconstexpr

Keypad task scheduling configuration.

Definition at line 34 of file TCA9535Keypad.cpp.

Referenced by cdc::hal::TCA9535Keypad::init().

◆ WIDTH

uint16_t cdc::hal::WIDTH = 296
staticconstexpr

Display timing and geometry constants.

Definition at line 45 of file EpaperDisplay.cpp.

Referenced by cdc::hal::EpaperDisplay::flushSync(), cdc::hal::EpaperDisplay::getWidth(), cdc::hal::EpaperDisplay::init(), and renderTask().