|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
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) |
Functions | |
| IBluetoothController * | getBluetoothControllerInstance () |
| Returns singleton Bluetooth stub when NimBLE is unavailable. | |
| IDisplay * | getDisplayInstance () |
| 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. | |
| IEspHardware * | getEspHardwareInstance () |
| II2cBus * | getI2cBus0 () |
| Returns singleton instance of I2C bus 0. | |
| II2cBus * | getI2cBus1 () |
| Returns singleton instance of I2C bus 1. | |
| IKeypad * | getKeypadInstance () |
| Returns the singleton keypad service instance. | |
| IPowerManager * | getPowerManagerInstance () |
| Returns the singleton power manager instance. | |
| IRtc * | getRtcInstance () |
| 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. | |
| ISecureElement * | getSecureElementInstance () |
| Returns singleton secure-element stub instance. | |
| ISleepController * | getSleepControllerInstance () |
| 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. | |
| IWifiController * | getWifiControllerInstance () |
| 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 EpaperDisplay * | s_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. | |
GATT read callback for characteristic reads
Definition at line 96 of file IBluetoothController.h.
GATT write callback for characteristic writes
Definition at line 90 of file IBluetoothController.h.
| using cdc::hal::I2cDeviceHandle = void* |
| using cdc::hal::KeyCallback = void(*)(Key key, bool pressed) |
Definition at line 709 of file IBluetoothController.h.
| using cdc::hal::SleepCallback = void (*)(void* context) |
Callback types for sleep/wakeup events
Definition at line 32 of file ISleepController.h.
|
strong |
Charging status
| Enumerator | |
|---|---|
| NOT_CHARGING | |
| PRE_CHARGE | |
| FAST_CHARGE | |
| CHARGE_DONE | |
| FAULT | |
Definition at line 11 of file IPowerManager.h.
|
strong |
|
strong |
GATT descriptor type identifiers used by GattDescriptor.kind
| Enumerator | |
|---|---|
| NONE | |
| REPORT_REFERENCE | |
Definition at line 102 of file IBluetoothController.h.
|
strong |
|
strong |
|
strong |
Display refresh modes
| Enumerator | |
|---|---|
| FULL | |
| PARTIAL | |
| PARTIAL_LIGHT | |
Definition at line 11 of file IDisplay.h.
|
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.
|
strong |
Sleep mode types
| Enumerator | |
|---|---|
| NONE | |
| LIGHT_SLEEP | |
| DEEP_SLEEP | |
Definition at line 11 of file ISleepController.h.
|
strong |
Wakeup source
| Enumerator | |
|---|---|
| UNKNOWN | |
| TIMER | |
| GPIO | |
| TOUCHPAD | |
| EXT0 | |
| EXT1 | |
Definition at line 20 of file ISleepController.h.
|
strong |
|
strong |
WiFi security types
| Enumerator | |
|---|---|
| OPEN | |
| WEP | |
| WPA_PSK | |
| WPA2_PSK | |
| WPA3_PSK | |
| WPA2_ENTERPRISE | |
Definition at line 22 of file IWifiController.h.
|
strong |
WiFi connection state
| Enumerator | |
|---|---|
| DISCONNECTED | |
| CONNECTING | |
| CONNECTED | |
| CONNECTION_FAILED | |
| GOT_IP | |
Definition at line 34 of file IWifiController.h.
|
static |
Applies backlight PWM duty level.
| level | Duty 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().
|
static |
GPIO interrupt handler for the charger IRQ pin.
| arg | Unused ISR argument. |
Definition at line 78 of file BQ25895Power.cpp.
References charger_irq_pending.
Referenced by cdc::hal::BQ25895Power::init().
|
inline |
Maps an EccCurve to the module-level curve byte.
| c | Curve identifier. |
Definition at line 22 of file ISecureElement.h.
References ED25519.
|
inline |
| IBluetoothController * cdc::hal::getBluetoothControllerInstance | ( | ) |
Returns singleton Bluetooth stub when NimBLE is unavailable.
Definition at line 2442 of file BluetoothController.cpp.
References g_bluetoothController.
Referenced by cdc::mod_gpg::ble_gpg_xsig_init(), cdc::mod_gpg::ble_gpg_xsig_send(), cdc::ui::bleResolveBeginNext(), cdc::ui::bleResolveCleanupToSettle(), cdc::ui::bleResolveStart(), cdc::ui::bleResolveStop(), cdc::ui::bleResolveTick(), cdc::ui::buildHardwareInfoText(), cdc::mod_ble_serial::BleUartService::deinit(), cdc::mod_2fa::getBle(), cdc::mod_ble_serial::BleUartService::init(), initBluetoothController(), cdc::mod_ble_serial::BleUartService::isConnected(), cdc::ui::onBleNumericComparison(), cdc::ui::onBlePairingRequestEvent(), cdc::ui::onBluetoothMenuSelect(), cdc::ui::BlePairingView::onEnter(), cdc::ui::onForgetConfirm(), cdc::ui::BlePairingView::onTick(), cdc::ui::rebuildBluetoothMenu(), cdc::ui::rebuildPairedList(), cdc::ui::BlePairingView::render(), cdc::mod_ble_serial::BleUartService::send(), cdc::ui::showBluetoothStatus(), cdc::ui::showMsgBeaconScan(), cdc::ui::showPairedDevices(), cdc::mod_ble_serial::BleSerialModule::start(), cdc::ui::startBluetoothScan(), cdc::mod_ble_serial::BleSerialModule::toggle(), cdc::ui::toggleBluetoothEnable(), cdc::ui::toolsBluetoothIcon(), cdc::ui::ui_init(), and cdc::ui::updatePowerStatusIcons().
| IDisplay * cdc::hal::getDisplayInstance | ( | ) |
Returns lazily created singleton display instance.
Definition at line 566 of file EpaperDisplay.cpp.
References s_display.
Referenced by cdc::ui::buildHardwareInfoText(), cdc::os_ui::SystemSettingsBackup::exportSystemSettings(), cdc::mod_fido2::fido2_ui_user_presence_callback(), cdc::ui::CanvasView::getBodySize(), host_text_pick_font_that_fits(), cdc::os_ui::SystemSettingsBackup::importSystemSettings(), initDisplay(), cdc::ui::LockScreenView::onEnter(), cdc::ui::LockScreenView::onResume(), cdc::mod_fido2::promptComplete(), cdc::mod_2fa::OathCodeView::render(), cdc::ui::BlePairingPromptView::render(), cdc::ui::BlePairingView::render(), cdc::ui::CanvasView::render(), cdc::ui::ColorPickerView::render(), cdc::ui::ConfirmView::render(), cdc::ui::ContextMenuView::render(), cdc::ui::DateInputView::render(), cdc::ui::InfoView::render(), cdc::ui::ListView::render(), cdc::ui::LockScreenView::render(), cdc::ui::MessageBox::render(), cdc::ui::PasswordT9View::render(), cdc::ui::PinChangeView::render(), cdc::ui::PinEntryView::render(), cdc::ui::QRCodeView::render(), cdc::ui::SliderView::render(), cdc::ui::T9InputView::render(), cdc::ui::TimeInputView::render(), cdc::ui::ToastView::render(), cdc::ui::ViewStack::render(), cdc::ui::LockScreenView::toggleBacklight(), and winkBacklight().
| IEspHardware * cdc::hal::getEspHardwareInstance | ( | ) |
Definition at line 92 of file EspHardware.cpp.
References g_espHardware.
Referenced by cdc::ui::buildHardwareInfoText().
| II2cBus * cdc::hal::getI2cBus0 | ( | ) |
Returns singleton instance of I2C bus 0.
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().
| II2cBus * cdc::hal::getI2cBus1 | ( | ) |
Returns singleton instance of I2C bus 1.
Definition at line 280 of file I2cBus.cpp.
References g_i2c1.
Referenced by sao_init().
| IKeypad * cdc::hal::getKeypadInstance | ( | ) |
Returns the singleton keypad service instance.
Definition at line 607 of file TCA9535Keypad.cpp.
References g_keypad.
Referenced by cdc::ui::buildHardwareInfoText(), host_key_consume_next(), host_key_pressed(), initKeypad(), cdc::ui::CanvasView::onExit(), cdc::ui::ColorPickerView::onTick(), cdc::ui::SliderView::onTick(), cdc::hal::Esp32SleepController::prepareGpioForSleep(), and cdc::hal::Esp32SleepController::stabilizeGpioAfterWakeup().
| IPowerManager * cdc::hal::getPowerManagerInstance | ( | ) |
Returns the singleton power manager instance.
Definition at line 636 of file BQ25895Power.cpp.
References g_powerManager.
Referenced by cdc::ui::buildHardwareInfoText(), cdc::serial::cmdShipMode(), initPowerManager(), and cdc::ui::onShipModeConfirm().
| IRtc * cdc::hal::getRtcInstance | ( | ) |
Returns the singleton RTC service instance.
Definition at line 304 of file Rtc.cpp.
References g_rtc.
Referenced by cdc::ui::WifiHandlers::ensureConnected(), cdc::os_ui::SystemSettingsBackup::exportSystemSettings(), cdc::os_ui::SystemSettingsBackup::importSystemSettings(), initRtc(), cdc::ui::settings::onTimezoneSave(), cdc::ui::WifiHandlers::syncNtp(), and cdc::ui::ui_init().
| ISecureElement * cdc::hal::getSecureElementInstance | ( | ) |
Returns singleton secure-element stub instance.
Returns the singleton secure element service instance.
Definition at line 91 of file SecureElementStub.cpp.
References g_secureElementStub.
Referenced by cdc::mod_password::PasswordStore::addEntry(), cdc::ui::buildHardwareInfoText(), cdc::mod_2fa::OathStore::deleteAccount(), cdc::mod_password::PasswordStore::deleteEntry(), erase_slot_data(), fido2_storage_create_credential(), fido2_storage_get_pubkey(), fido2_storage_init(), fido2_storage_sign(), fido2_storage_sign_der(), fido2_storage_sign_raw(), cdc::mod_password::generateRandomPassword(), get_se(), get_se(), cdc::serial::getSecureElementWithCheck(), gpg_export_pubkey_pem(), gpg_generate_key(), cdc::mod_gpg::gpgCrossSign(), host_random_strict(), initSecureElement(), cdc::core::PinManager::isStorageAvailable(), key_fingerprint_generate(), read_rmem_credential(), cdc::mod_2fa::OathStore::readAccount(), cdc::mod_password::PasswordStore::readEntry(), secure_random_fill(), u2f_attest_sign(), u2f_init_attestation(), u2f_register(), cdc::mod_password::PasswordStore::updateEntry(), wipeTropicForFactoryReset(), write_rmem_credential(), and cdc::mod_2fa::writePayload().
| 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
Definition at line 25 of file SpiBus.cpp.
References SPI_BUS_HOST.
Referenced by lt_port_init().
| ISleepController * cdc::hal::getSleepControllerInstance | ( | ) |
Returns the singleton sleep controller service instance.
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().
| IWifiController * cdc::hal::getWifiControllerInstance | ( | ) |
Returns the singleton Wi-Fi controller service instance.
Definition at line 735 of file WifiController.cpp.
References g_wifiController.
Referenced by cdc::ui::buildHardwareInfoText(), cdc::serial::cmdWifiConnect(), cdc::serial::cmdWifiOff(), cdc::serial::cmdWifiOn(), cdc::serial::cmdWifiScan(), cdc::serial::cmdWifiStatus(), cdc::ui::WifiHandlers::connect(), cdc::ui::WifiHandlers::disconnect(), cdc::ui::WifiHandlers::ensureConnected(), initWifiController(), cdc::ui::WifiHandlers::isConnected(), cdc::ui::onWifiMainSelect(), cdc::ui::rebuildWifiMainMenu(), cdc::ui::WifiHandlers::syncNtp(), cdc::ui::updatePowerStatusIcons(), cdc::ui::wifiConnect(), cdc::ui::wifiShowDetails(), and cdc::ui::wifiStartScan().
| esp_err_t cdc::hal::initSharedSpiBus | ( | ) |
Initializes shared SPI bus once for all SPI peripherals.
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().
|
static |
IP event callback bridge.
ESP-IDF IP event bridge to controller instance.
| arg | Optional callback context (unused). |
| eventBase | Event base (unused). |
| eventId | IP event id. |
| eventData | Event payload. |
Definition at line 131 of file WifiController.cpp.
References cdc::hal::WifiController::instance_.
Referenced by cdc::hal::WifiController::enable().
|
static |
Converts a Key enum value to its expected raw 12-bit mask.
| key | Key to convert. |
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().
|
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().
|
staticconstexpr |
Builds the active-low raw state for a single pressed key.
| bit | Bit index of the pressed key (0..11). |
Definition at line 78 of file TCA9535Keypad.cpp.
References KEY_MASK_ALL.
Referenced by keyToMask(), and rawToKey().
|
static |
Persists backlight level to NVS.
| level | Backlight 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().
|
static |
Converts raw 16-bit keypad state to a Key enum value.
| raw | Raw keypad state bitmask (active-low, bits 0-11). |
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().
|
static |
Definition at line 95 of file EpaperDisplay.cpp.
References FULL, PARTIAL, and PARTIAL_LIGHT.
Referenced by cdc::hal::EpaperDisplay::flush().
|
static |
Render worker task processing async flush requests.
| arg | Task 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().
|
static |
Definition at line 79 of file EpaperDisplay.cpp.
References FULL, kMaxPartialsBeforeFull, PARTIAL_LIGHT, and s_partialsSinceFull.
Referenced by cdc::hal::EpaperDisplay::flushSync(), and renderTask().
|
static |
Wi-Fi event callback bridge.
ESP-IDF Wi-Fi event bridge to controller instance.
| arg | Optional callback context (unused). |
| eventBase | Event base (unused). |
| eventId | Wi-Fi event id. |
| eventData | Event payload. |
Definition at line 115 of file WifiController.cpp.
References cdc::hal::WifiController::instance_.
Referenced by cdc::hal::WifiController::enable().
| 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.
| count | Number of off/on cycles (clamped to 1..10, default 2). |
| period_ms | Duration 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().
|
staticconstexpr |
Definition at line 47 of file EpaperDisplay.cpp.
Referenced by loadBacklight().
|
staticconstexpr |
Definition at line 48 of file EpaperDisplay.cpp.
Referenced by loadBacklight(), and cdc::hal::EpaperDisplay::setBacklight().
|
staticconstexpr |
Definition at line 57 of file BQ25895Power.cpp.
Referenced by cdc::hal::BQ25895Power::getBatteryPercent().
|
staticconstexpr |
Definition at line 58 of file BQ25895Power.cpp.
Referenced by cdc::hal::BQ25895Power::getBatteryPercent().
|
staticconstexpr |
Definition at line 59 of file BQ25895Power.cpp.
|
staticconstexpr |
Battery voltage thresholds for state estimation. LiPo battery characteristics (3.7V nominal, 4.2V max).
Definition at line 56 of file BQ25895Power.cpp.
|
staticconstexpr |
Definition at line 61 of file BQ25895Power.cpp.
|
staticconstexpr |
Definition at line 60 of file BQ25895Power.cpp.
|
staticconstexpr |
Charge current and safety threshold constants.
Definition at line 45 of file BQ25895Power.cpp.
|
staticconstexpr |
Definition at line 27 of file BQ25895Power.cpp.
Referenced by cdc::hal::BQ25895Power::getBatteryVoltage(), and cdc::hal::BQ25895Power::init().
|
staticconstexpr |
Definition at line 34 of file BQ25895Power.cpp.
Referenced by cdc::hal::BQ25895Power::getBatteryVoltage().
|
staticconstexpr |
Definition at line 28 of file BQ25895Power.cpp.
Referenced by cdc::hal::BQ25895Power::init().
|
staticconstexpr |
Definition at line 29 of file BQ25895Power.cpp.
|
staticconstexpr |
Definition at line 33 of file BQ25895Power.cpp.
|
staticconstexpr |
Definition at line 38 of file BQ25895Power.cpp.
|
staticconstexpr |
BQ25895 register map constants.
Definition at line 26 of file BQ25895Power.cpp.
Referenced by cdc::hal::BQ25895Power::init().
|
staticconstexpr |
Definition at line 31 of file BQ25895Power.cpp.
Referenced by cdc::hal::BQ25895Power::enterShipMode().
|
staticconstexpr |
Definition at line 32 of file BQ25895Power.cpp.
|
staticconstexpr |
Definition at line 35 of file BQ25895Power.cpp.
|
staticconstexpr |
Definition at line 30 of file BQ25895Power.cpp.
|
staticconstexpr |
Definition at line 36 of file BQ25895Power.cpp.
|
staticconstexpr |
Definition at line 37 of file BQ25895Power.cpp.
|
staticconstexpr |
Definition at line 40 of file BQ25895Power.cpp.
Referenced by cdc::hal::BQ25895Power::init().
|
staticconstexpr |
Definition at line 39 of file BQ25895Power.cpp.
|
staticconstexpr |
Definition at line 46 of file BQ25895Power.cpp.
Referenced by cdc::hal::BQ25895Power::init().
|
staticconstexpr |
Definition at line 48 of file BQ25895Power.cpp.
Referenced by cdc::hal::BQ25895Power::setChargingEnabled().
|
staticconstexpr |
Definition at line 50 of file BQ25895Power.cpp.
|
staticconstexpr |
Definition at line 49 of file BQ25895Power.cpp.
Referenced by cdc::hal::BQ25895Power::setChargingEnabled().
|
staticconstexpr |
Definition at line 47 of file BQ25895Power.cpp.
Referenced by cdc::hal::BQ25895Power::init(), and cdc::hal::BQ25895Power::setChargingEnabled().
|
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().
|
staticconstexpr |
Definition at line 37 of file TCA9535Keypad.cpp.
|
staticconstexpr |
Default light-sleep timer interval in seconds.
Definition at line 32 of file SleepController.cpp.
|
static |
Definition at line 2436 of file BluetoothController.cpp.
Referenced by getBluetoothControllerInstance().
|
static |
Definition at line 47 of file SleepController.cpp.
Referenced by cdc::hal::Esp32SleepController::init().
|
static |
Definition at line 48 of file SleepController.cpp.
Referenced by cdc::hal::Esp32SleepController::enterDeepSleep(), and cdc::hal::Esp32SleepController::init().
|
static |
Definition at line 90 of file EspHardware.cpp.
Referenced by getEspHardwareInstance().
|
static |
Singleton instances for both hardware I2C ports.
Referenced by getI2cBus0().
|
static |
Referenced by getI2cBus1().
|
static |
Singleton keypad instance.
Definition at line 601 of file TCA9535Keypad.cpp.
Referenced by getKeypadInstance().
|
static |
Singleton power manager instance.
Definition at line 630 of file BQ25895Power.cpp.
Referenced by getPowerManagerInstance().
|
static |
Singleton RTC implementation instance.
Definition at line 298 of file Rtc.cpp.
Referenced by getRtcInstance().
|
static |
Global singleton instance of TROPIC secure-element implementation.
Definition at line 1055 of file Tropic01Element.cpp.
|
static |
Definition at line 85 of file SecureElementStub.cpp.
Referenced by getSecureElementInstance().
|
static |
Singleton sleep-controller instance.
Definition at line 420 of file SleepController.cpp.
Referenced by getSleepControllerInstance().
|
static |
Definition at line 19 of file SpiBus.cpp.
Referenced by initSharedSpiBus().
|
static |
RTC-retained flag indicating previous deep-sleep state.
Definition at line 42 of file SleepController.cpp.
Referenced by cdc::hal::Esp32SleepController::clearDeepSleepFlag(), cdc::hal::Esp32SleepController::enterDeepSleep(), cdc::hal::Esp32SleepController::init(), and cdc::hal::Esp32SleepController::wasInDeepSleep().
|
static |
Singleton Wi-Fi controller instance.
Definition at line 729 of file WifiController.cpp.
Referenced by getWifiControllerInstance().
|
staticconstexpr |
Definition at line 46 of file EpaperDisplay.cpp.
Referenced by cdc::hal::EpaperDisplay::flushSync(), cdc::hal::EpaperDisplay::getHeight(), cdc::hal::EpaperDisplay::init(), and renderTask().
|
staticconstexpr |
I2C bus timing configuration constants.
Definition at line 18 of file I2cBus.cpp.
Referenced by cdc::hal::I2cBusImpl::init().
|
staticconstexpr |
Definition at line 19 of file I2cBus.cpp.
Referenced by cdc::hal::I2cBusImpl::readRaw(), cdc::hal::I2cBusImpl::readReg(), cdc::hal::I2cBusImpl::writeRaw(), cdc::hal::I2cBusImpl::writeReadRaw(), and cdc::hal::I2cBusImpl::writeReg().
|
inlineconstexpr |
Definition at line 710 of file IBluetoothController.h.
|
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().
|
staticconstexpr |
Definition at line 49 of file TCA9535Keypad.cpp.
Referenced by keyToMask(), and rawToKey().
|
staticconstexpr |
Definition at line 50 of file TCA9535Keypad.cpp.
Referenced by keyToMask(), and rawToKey().
|
staticconstexpr |
Definition at line 51 of file TCA9535Keypad.cpp.
Referenced by keyToMask(), and rawToKey().
|
staticconstexpr |
Definition at line 52 of file TCA9535Keypad.cpp.
Referenced by keyToMask(), and rawToKey().
|
staticconstexpr |
Definition at line 53 of file TCA9535Keypad.cpp.
Referenced by keyToMask(), and rawToKey().
|
staticconstexpr |
Definition at line 54 of file TCA9535Keypad.cpp.
Referenced by keyToMask(), and rawToKey().
|
staticconstexpr |
Definition at line 55 of file TCA9535Keypad.cpp.
Referenced by keyToMask(), and rawToKey().
|
staticconstexpr |
Definition at line 56 of file TCA9535Keypad.cpp.
Referenced by keyToMask(), and rawToKey().
|
staticconstexpr |
Definition at line 57 of file TCA9535Keypad.cpp.
Referenced by keyToMask(), and rawToKey().
|
staticconstexpr |
Definition at line 58 of file TCA9535Keypad.cpp.
Referenced by keyToMask(), and rawToKey().
|
staticconstexpr |
Definition at line 59 of file TCA9535Keypad.cpp.
Referenced by keyToMask(), and rawToKey().
|
staticconstexpr |
Ring-buffer configuration for queued key events.
Definition at line 44 of file TCA9535Keypad.cpp.
|
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().
|
staticconstexpr |
Idle state: every key released, all 12 bits high.
Definition at line 65 of file TCA9535Keypad.cpp.
Referenced by cdc::hal::TCA9535Keypad::anyKeyDown().
|
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().
|
staticconstexpr |
Definition at line 75 of file EpaperDisplay.cpp.
Referenced by resolveFullRefresh().
|
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().
|
staticconstexpr |
Definition at line 36 of file EpaperDisplay.cpp.
Referenced by applyBacklight(), and cdc::hal::EpaperDisplay::init().
|
staticconstexpr |
Definition at line 37 of file EpaperDisplay.cpp.
Referenced by cdc::hal::EpaperDisplay::init().
|
staticconstexpr |
Definition at line 38 of file EpaperDisplay.cpp.
Referenced by cdc::hal::EpaperDisplay::init().
|
staticconstexpr |
Definition at line 35 of file EpaperDisplay.cpp.
Referenced by applyBacklight(), and cdc::hal::EpaperDisplay::init().
|
staticconstexpr |
LEDC backlight PWM configuration constants.
Definition at line 34 of file EpaperDisplay.cpp.
Referenced by cdc::hal::EpaperDisplay::init().
|
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.
|
staticconstexpr |
Maximum number of registered callbacks per callback list.
Definition at line 39 of file SleepController.cpp.
|
staticconstexpr |
Definition at line 42 of file EpaperDisplay.cpp.
Referenced by loadBacklight(), and persistBacklight().
|
staticconstexpr |
Definition at line 36 of file SleepController.cpp.
|
staticconstexpr |
Definition at line 29 of file Rtc.cpp.
Referenced by cdc::hal::Esp32Rtc::setTimezoneOffset().
|
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().
|
staticconstexpr |
|
staticconstexpr |
NVS namespace/key for persisted sleep interval.
Definition at line 35 of file SleepController.cpp.
|
staticconstexpr |
Reserved rescue chord: N and Y held together (anti-block instant lock).
Definition at line 71 of file TCA9535Keypad.cpp.
|
staticconstexpr |
Definition at line 36 of file TCA9535Keypad.cpp.
|
staticconstexpr |
Definition at line 30 of file TCA9535Keypad.cpp.
Referenced by cdc::hal::TCA9535Keypad::init().
|
staticconstexpr |
Definition at line 31 of file TCA9535Keypad.cpp.
Referenced by cdc::hal::TCA9535Keypad::init().
|
staticconstexpr |
TCA9535 register-address constants.
Definition at line 24 of file TCA9535Keypad.cpp.
|
staticconstexpr |
Definition at line 25 of file TCA9535Keypad.cpp.
|
staticconstexpr |
Definition at line 26 of file TCA9535Keypad.cpp.
Referenced by cdc::hal::TCA9535Keypad::init().
|
staticconstexpr |
Definition at line 27 of file TCA9535Keypad.cpp.
Referenced by cdc::hal::TCA9535Keypad::init().
|
staticconstexpr |
Definition at line 28 of file TCA9535Keypad.cpp.
Referenced by cdc::hal::TCA9535Keypad::init().
|
staticconstexpr |
Definition at line 29 of file TCA9535Keypad.cpp.
Referenced by cdc::hal::TCA9535Keypad::init().
|
static |
Definition at line 56 of file EpaperDisplay.cpp.
Referenced by cdc::hal::EpaperDisplay::backlightOn(), cdc::hal::EpaperDisplay::getBacklight(), cdc::hal::EpaperDisplay::init(), cdc::hal::EpaperDisplay::isBacklightOn(), loadBacklight(), cdc::hal::EpaperDisplay::saveBacklight(), cdc::hal::EpaperDisplay::setBacklight(), and cdc::hal::EpaperDisplay::start().
|
static |
|
static |
Lazily created singleton display instance.
Definition at line 560 of file EpaperDisplay.cpp.
Referenced by getDisplayInstance().
|
static |
Definition at line 52 of file EpaperDisplay.cpp.
Referenced by cdc::hal::EpaperDisplay::clear(), cdc::hal::EpaperDisplay::drawLine(), cdc::hal::EpaperDisplay::drawPixel(), cdc::hal::EpaperDisplay::drawRect(), cdc::hal::EpaperDisplay::fillRect(), cdc::hal::EpaperDisplay::flushSync(), cdc::hal::EpaperDisplay::getNativeHandle(), cdc::hal::EpaperDisplay::init(), cdc::hal::EpaperDisplay::print(), cdc::hal::EpaperDisplay::printf(), renderTask(), cdc::hal::EpaperDisplay::setCursor(), cdc::hal::EpaperDisplay::setFont(), cdc::hal::EpaperDisplay::setTextColor(), cdc::hal::EpaperDisplay::setTextSize(), and cdc::hal::EpaperDisplay::showSplash().
|
static |
Lazily initialized display objects to avoid global constructors.
Definition at line 51 of file EpaperDisplay.cpp.
Referenced by cdc::hal::EpaperDisplay::init().
|
static |
Mutable display state cache.
Definition at line 55 of file EpaperDisplay.cpp.
Referenced by cdc::hal::EpaperDisplay::init().
|
static |
Definition at line 68 of file EpaperDisplay.cpp.
Referenced by cdc::hal::EpaperDisplay::flushSync(), cdc::hal::EpaperDisplay::init(), and renderTask().
|
static |
Definition at line 74 of file EpaperDisplay.cpp.
Referenced by resolveFullRefresh().
|
static |
Definition at line 63 of file EpaperDisplay.cpp.
Referenced by cdc::hal::EpaperDisplay::flush(), and renderTask().
|
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().
|
static |
Definition at line 62 of file EpaperDisplay.cpp.
Referenced by cdc::hal::EpaperDisplay::flush(), cdc::hal::EpaperDisplay::isBusy(), and renderTask().
|
static |
Definition at line 61 of file EpaperDisplay.cpp.
Referenced by cdc::hal::EpaperDisplay::flush(), and cdc::hal::EpaperDisplay::init().
|
staticconstexpr |
Shared SPI host selection for ESP32-S3 user peripherals.
Definition at line 16 of file SpiBus.cpp.
Referenced by getSharedSpiHost(), and initSharedSpiBus().
|
staticconstexpr |
Definition at line 17 of file SpiBus.cpp.
Referenced by initSharedSpiBus().
|
staticconstexpr |
Definition at line 35 of file TCA9535Keypad.cpp.
Referenced by cdc::hal::TCA9535Keypad::init().
|
staticconstexpr |
Keypad task scheduling configuration.
Definition at line 34 of file TCA9535Keypad.cpp.
Referenced by cdc::hal::TCA9535Keypad::init().
|
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().