Kleidos API Search

In development. It changes without notice.

Topic

Board Configurations

One source for each board, which creates its parts and registers the record of them.

A build compiles one of them, the one its board's number names. It:

  1. creates the power manager, the sound, the buttons and the board's other inputs, and describes its power for the meter in Diagnostics;
  2. fills a BoardDef with pointers to them;
  3. registers it, so that the rest of the firmware reaches it.

The motion sensor, the keyboard's chip and the trackball's driver are not among them: the bring-up (Board Bring-up) probes for them and writes them into the record.

A board with two buttons and no more:

static PowerManagerM5PM1 s_power;
static AudioFeedback s_audio;
static GpioButtonInput s_btnA( device::kPinBtnA, true, false );
static GpioButtonInput s_btnB( device::kPinBtnB, true, false );
static const BoardDef kBoard = {
.deviceName = device::kName,
.shortName = device::kShortName,
.deviceId = device::kId,
.power = &s_power,
.powerProfile = &kPowerProfile,
.audio = &s_audio,
.btnA = &s_btnA,
.btnB = &s_btnB,
.keyboard = nullptr,
.trackball = nullptr,
.touch = nullptr,
};
REGISTER_BOARD( kBoard );

Before its source, a board needs its declaration of what it has (Build Configuration): the chip, the panel, the inputs, the sound, the clock, how it sleeps and what ends that sleep. The table of what each board has is The boards.

See also
Board Description, Board Bring-up, Build Configuration, Device Drivers

Topics

Board-Specific Support
The power managers that only one board uses: the CoreInk's, the LILYGO T-Deck's and the M5Cardputer ADV's.

Files

file src/boards/board_cardputer.cpp
Board registration for the M5Stack Cardputer ADV (DEVICE_ID 6).
file src/boards/board_core2_v13.cpp
Board registration for the M5Stack Core2 v1.3.
file src/boards/board_cores3_se.cpp
Board registration for the M5Stack CoreS3 SE.
file src/boards/board_m5core_ink.cpp
Board registration for the M5Stack CoreInk.
file src/boards/board_m5stickc_plus1.cpp
Board registration for the M5StickC Plus 1.1.
file src/boards/board_m5stickc_plus2.cpp
Board registration for the M5StickC Plus2 (DEVICE_ID 1).
file src/boards/board_m5stickc_plus_se.cpp
Board registration for the M5StickC Plus SE.
file src/boards/board_power_profile.h
Shared pieces of the per-board power profiles (board TUs only).
file src/boards/board_sticks3.cpp
Board registration for the M5StickS3.
file src/boards/board_tdeck.cpp
Board registration for the LilyGo T-Deck.

Classes

struct kleidos::boards::power::PanelSeed
Panel model seeds, not measurements: on at 0 % backlight, and at 100 % (µA). More about kleidos::boards::power::PanelSeed
struct kleidos::boards::power::SeedSpec
The board-specific part of a seed model. More about kleidos::boards::power::SeedSpec

Functions

constexpr pm::logic::ModelCoefficientskleidos::boards::power::seedModel (const SeedSpec &spec)
Seed model coefficients for a board.
constexpr pm::PowerProfilekleidos::boards::power::seedProfile (const SeedSpec &spec, uint16_t mvResolution, pm::SleepKind sleepKind)
Seed (uncalibrated) profile for the active variant.

Variables

constexpr pm::PowerBudgetskleidos::boards::power::kVariantBudgets
Expected values of the active variant, from its variant.h.
constexpr uint16_tkleidos::boards::power::kVariantCapacityMah
Rated capacity of the active variant's cell (BATTERY_CAPACITY_MAH).
constexpr pm::logic::OcvTablekleidos::boards::power::kGenericOcv
The generic LiPo rest-voltage table every seed profile uses.
constexpr std::array< uint32_t, pm::logic::kBleModeCount >kleidos::boards::power::kSeedBleUa
constexpr std::array< uint32_t, pm::logic::kWifiModeCount >kleidos::boards::power::kSeedWifiUa
constexpr PanelSeedkleidos::boards::power::kStickPanel
1.14" 135×240 ST7789.
constexpr PanelSeedkleidos::boards::power::kCardputerPanel
1.14" 240×135 ST7789V2.
constexpr PanelSeedkleidos::boards::power::kCorePanel
2.0" 320×240 ILI9342C.
constexpr PanelSeedkleidos::boards::power::kTdeckPanel
2.8" 320×240 ST7789.
constexpr PanelSeedkleidos::boards::power::kNoBacklight
E-paper: no standing draw.

Repeatable rest-voltage resolution by battery front end (mV)

constexpr uint16_tkleidos::boards::power::kPmicMvResolution
PMIC battery ADC (AXP / M5PM1).
constexpr uint16_tkleidos::boards::power::kHalfDividerMvResolution
ESP ADC behind a 2:1 divider.
constexpr uint16_tkleidos::boards::power::kCoreInkMvResolution
ESP ADC behind the ×4.92 divider.

CPU floor model seeds, not measurements (µA = base + perMhz × MHz)

constexpr uint32_tkleidos::boards::power::kClassicFloorBaseUa
ESP32: 21 mA at 80 MHz.
constexpr uint32_tkleidos::boards::power::kClassicFloorPerMhzUa
ESP32: 37 mA at 240 MHz.
constexpr uint32_tkleidos::boards::power::kS3FloorBaseUa
ESP32-S3: 15 mA at 80 MHz.
constexpr uint32_tkleidos::boards::power::kS3FloorPerMhzUa
ESP32-S3: 27 mA at 240 MHz.

Peripheral model seeds, not measurements (µA)

constexpr uint32_tkleidos::boards::power::kSeedBuzzerUa
Piezo buzzer tone.
constexpr uint32_tkleidos::boards::power::kSeedSpeakerUa
I2S amplifier + speaker tone.
constexpr uint32_tkleidos::boards::power::kSeedSdUa
Mounted SD card at idle.
constexpr uint32_tkleidos::boards::power::kSeedGpsUa
constexpr uint32_tkleidos::boards::power::kSeedCoreRailsUa
constexpr uint32_tkleidos::boards::power::kSeedKeyboardMcuUa
T-Deck keyboard controller (an ESP32-C3 on the peripheral rail).

Function Documentation

seedModel() #

pm::logic::ModelCoefficients kleidos::boards::power::seedModel(const SeedSpec & spec)
constexpr

Seed model coefficients for a board.

Parameters
NameDirectionMeaning
specinBoard-specific seed figures.
Returns
Coefficients; the sleep floor is the variant's reference figure.

seedProfile() #

pm::PowerProfile kleidos::boards::power::seedProfile(const SeedSpec & spec, uint16_t mvResolution, pm::SleepKind sleepKind)
constexpr

Seed (uncalibrated) profile for the active variant.

Parameters
NameDirectionMeaning
specinBoard-specific seed figures.
mvResolutioninRest-voltage resolution of the battery front end, mV.
sleepKindinWhat deep sleep does on the board.
Returns
Profile with the generic OCV table and the variant's expected values.

Variable Documentation

kSeedBleUa #

std::array<uint32_t, pm::logic::kBleModeCount> kleidos::boards::power::kSeedBleUa
inlineconstexpr

BLE model seeds by mode, not measurements: off, advertising, connected, typing (µA).

kSeedCoreRailsUa #

uint32_t kleidos::boards::power::kSeedCoreRailsUa
inlineconstexpr

Always-on PMIC rails, touch controller and peripheral 3V3 of the Core2 v1.3 and CoreS3 SE.

kSeedGpsUa #

uint32_t kleidos::boards::power::kSeedGpsUa
inlineconstexpr

GNSS receiver tracking.

kSeedWifiUa #

std::array<uint32_t, pm::logic::kWifiModeCount> kleidos::boards::power::kSeedWifiUa
inlineconstexpr

Wi-Fi model seeds by mode, not measurements: off, AP, AP with a client, station (µA).