# Kleidos API reference > The reference of the code of Kleidos, a hardware password manager that types your logins over Bluetooth. In development. Kleidos is a hardware password manager that types your logins over Bluetooth. This is the reference of its code, made from the comments in the sources, for people who want to read how it works or change it. To use Kleidos, go to [kleidos.dev](https://kleidos.dev/). Every page here is also served as Markdown at its own address with `.md` appended (`index.md` for an address that ends in a slash): the same words, with the markup taken off. ## Kleidos firmware: front pages - [Overview](https://api.kleidos.dev/firmware/): Kleidos is firmware that turns an ESP32 board into a hardware password manager. ([Markdown](https://api.kleidos.dev/firmware/index.md)) - [Topics](https://api.kleidos.dev/firmware/topics): The parts of the firmware, from how it runs down to the facades it stands on. Each topic opens with what its part does. ([Markdown](https://api.kleidos.dev/firmware/topics.md)) - [The boards](https://api.kleidos.dev/firmware/boards_page): Nine boards run Kleidos, each an ESP32 or an ESP32-S3 with its own panel, keys and power hardware. ([Markdown](https://api.kleidos.dev/firmware/boards_page.md)) - [How it is tested](https://api.kleidos.dev/firmware/qa_and_bench): How the firmware this reference documents is tested: on a computer, on the boards themselves, and with a meter. ([Markdown](https://api.kleidos.dev/firmware/qa_and_bench.md)) ## Kleidos firmware: topics - [Entry Point & State Dispatch](https://api.kleidos.dev/firmware/group__app__entry): The start of the firmware: the boot, in order, and the loop that runs the active state. ([Markdown](https://api.kleidos.dev/firmware/group__app__entry.md)) - [Application States](https://api.kleidos.dev/firmware/group__states): The states of the application, what moves it from one to the next, and the handler that runs each. ([Markdown](https://api.kleidos.dev/firmware/group__states.md)) - [State Context & Shared Flows](https://api.kleidos.dev/firmware/group__states__fsm): What every state handler shares: the context and its sleep path, the handler's interface, and the flows that several states run. ([Markdown](https://api.kleidos.dev/firmware/group__states__fsm.md)) - [Home Screen](https://api.kleidos.dev/firmware/group__states__home): What the home screen shows and does besides settings: the lists, a record's detail, the one-time codes, the choice of a host, the SD card's flows and the edits. ([Markdown](https://api.kleidos.dev/firmware/group__states__home.md)) - [First-Time Setup](https://api.kleidos.dev/firmware/group__states__onboarding): The first use of a board: its keys, the language, a rehearsal of each control, the unlock secret, and the pairing of a first computer. ([Markdown](https://api.kleidos.dev/firmware/group__states__onboarding.md)) - [Settings Screen & Service](https://api.kleidos.dev/firmware/group__states__settings): The settings screen, its overlays and wizards, and the service that reads and applies an option. ([Markdown](https://api.kleidos.dev/firmware/group__states__settings.md)) - [Shared Screen Parts](https://api.kleidos.dev/firmware/group__states__chrome): The pieces several screens draw or steer by: the header, the lock screen's clock, the Bluetooth chip, the list's motion, and the navigation with two buttons or a dial. ([Markdown](https://api.kleidos.dev/firmware/group__states__chrome.md)) - [State Rules](https://api.kleidos.dev/firmware/group__states__logic): The decisions the handlers take, with no screen, no context and no device behind them, and the list of states itself. ([Markdown](https://api.kleidos.dev/firmware/group__states__logic.md)) - [Vault Storage](https://api.kleidos.dev/firmware/group__vault): The encrypted vault: how logins, one-time-code secrets and saved networks are stored, listed, changed, backed up and re-keyed. ([Markdown](https://api.kleidos.dev/firmware/group__vault.md)) - [Record Log & Envelopes](https://api.kleidos.dev/firmware/group__vault__records): The log the records are appended to, the binary form of a record, and the sealed envelope around it. ([Markdown](https://api.kleidos.dev/firmware/group__vault__records.md)) - [Keys, Metadata & Rotation](https://api.kleidos.dev/firmware/group__vault__keyset): The vault's keys, the authenticated metadata that holds them wrapped, what a typed secret becomes before it is derived, and the key rotation. ([Markdown](https://api.kleidos.dev/firmware/group__vault__keyset.md)) - [Record Repositories](https://api.kleidos.dev/firmware/group__vault__repos): The store of each kind of record: logins, one-time-code secrets and saved networks, with the names of the groups and the order of the lists. ([Markdown](https://api.kleidos.dev/firmware/group__vault__repos.md)) - [Backup, Import & Export](https://api.kleidos.dev/firmware/group__vault__transfer): The sealed backup the portal and the SD card share, the import of other managers' CSV files, and the SD card's flows. ([Markdown](https://api.kleidos.dev/firmware/group__vault__transfer.md)) - [Cryptography](https://api.kleidos.dev/firmware/group__crypto): From a PIN or passphrase to the keys that seal the vault, the secret bound to the chip, the seal of a backup and the password generator. ([Markdown](https://api.kleidos.dev/firmware/group__crypto.md)) - [Security](https://api.kleidos.dev/firmware/group__security): The lockout after wrong secrets, which lasts through a sleep or a cut in power, the log of security events, and the rule for a new secret. ([Markdown](https://api.kleidos.dev/firmware/group__security.md)) - [Change of Owner & Resets](https://api.kleidos.dev/firmware/group__change__of__owner): What a factory reset, a vault wipe and a settings reset erase, one sequence for every way of asking for each. ([Markdown](https://api.kleidos.dev/firmware/group__change__of__owner.md)) - [One-Time Codes](https://api.kleidos.dev/firmware/group__totp): Time-based one-time codes (RFC 6238): making one from the secret in the vault, and the gate that refuses when the clock cannot be trusted. ([Markdown](https://api.kleidos.dev/firmware/group__totp.md)) - [Clock & Time Zone](https://api.kleidos.dev/firmware/group__time): The wall clock and how far it is trusted, what set it last, and the time zones with their daylight-saving rules. ([Markdown](https://api.kleidos.dev/firmware/group__time.md)) - [BLE HID Keyboard](https://api.kleidos.dev/firmware/group__ble): The board as a Bluetooth keyboard: advertising, pairing, the bonded hosts, and typing. ([Markdown](https://api.kleidos.dev/firmware/group__ble.md)) - [BLE Facade & HID Manager](https://api.kleidos.dev/firmware/group__ble__core): The one entry point to Bluetooth for the screens and the portal, and the manager that runs the keyboard service behind it. ([Markdown](https://api.kleidos.dev/firmware/group__ble__core.md)) - [BLE Stack Integration](https://api.kleidos.dev/firmware/group__ble__stack): The owner of NimBLE on core 0: the stack's task, the queue of commands to it and the bus of events from it. ([Markdown](https://api.kleidos.dev/firmware/group__ble__stack.md)) - [Bond Storage](https://api.kleidos.dev/firmware/group__ble__bond): The bonded hosts: their identity, the name the owner gave each, their order, and the removal of one. ([Markdown](https://api.kleidos.dev/firmware/group__ble__bond.md)) - [BLE Connection Management](https://api.kleidos.dev/firmware/group__ble__connection): The state of the link as one coherent snapshot, and the parameters of a connection and of advertising. ([Markdown](https://api.kleidos.dev/firmware/group__ble__connection.md)) - [HID Profiles & Keyboard Tables](https://api.kleidos.dev/firmware/group__ble__profile): From text to key presses: the typer, the codes of the keys, and the accented letters each keyboard layout can type. ([Markdown](https://api.kleidos.dev/firmware/group__ble__profile.md)) - [Pairing & Numeric Comparison](https://api.kleidos.dev/firmware/group__ble__security): Who may pair, connect and receive keystrokes, and the prompt that compares six digits on both screens. ([Markdown](https://api.kleidos.dev/firmware/group__ble__security.md)) - [BLE Types](https://api.kleidos.dev/firmware/group__ble__types): The values every part of Bluetooth speaks: the keyboard layouts, the commands and events, the state of a session and of the stack, and the record of a host. ([Markdown](https://api.kleidos.dev/firmware/group__ble__types.md)) - [Wi-Fi Admin Portal](https://api.kleidos.dev/firmware/group__web): The web pages the board serves to one browser over its own Wi-Fi: to edit the vault, back it up, change settings and install an update. ([Markdown](https://api.kleidos.dev/firmware/group__web.md)) - [Admin Portal Rules](https://api.kleidos.dev/firmware/group__web__logic): The decisions the portal's routes take, with no server behind them. ([Markdown](https://api.kleidos.dev/firmware/group__web__logic.md)) - [Display Stream](https://api.kleidos.dev/firmware/group__web__debug): The video of the display that a debug build sends to the tests. ([Markdown](https://api.kleidos.dev/firmware/group__web__debug.md)) - [Network Services](https://api.kleidos.dev/firmware/group__net): The time from the network, the Wi-Fi session that fetches it, the portal's network name, and the request for the portal after a restart. ([Markdown](https://api.kleidos.dev/firmware/group__net.md)) - [Update Policy](https://api.kleidos.dev/firmware/group__ota): What a boot decides after an update: to keep the new firmware, to refuse it, or to say that the board went back to the previous one. ([Markdown](https://api.kleidos.dev/firmware/group__ota.md)) - [User Interface](https://api.kleidos.dev/firmware/group__ui): Everything the screen shows: drawing, components, the unlock entry (PIN or passphrase), popups and notices, brand logos and the on-screen keyboard. ([Markdown](https://api.kleidos.dev/firmware/group__ui.md)) - [Unlock Entry](https://api.kleidos.dev/firmware/group__ui__entry): How the owner enters the secret, by board: a dialed PIN, a touch keypad or a keyboard. ([Markdown](https://api.kleidos.dev/firmware/group__ui__entry.md)) - [Canvas, Theme & Layout](https://api.kleidos.dev/firmware/group__ui__core): What every screen draws with: the canvas, the design tokens, the theme, the roles of text and the rules of layout. ([Markdown](https://api.kleidos.dev/firmware/group__ui__core.md)) - [Buttons & Gestures](https://api.kleidos.dev/firmware/group__ui__input): The gestures every screen and both dial styles rely on, over the input sources. ([Markdown](https://api.kleidos.dev/firmware/group__ui__input.md)) - [Interface Components](https://api.kleidos.dev/firmware/group__ui__components): Buttons, lists, dialogs, steppers, keyboards and the rest, each drawn from the values it is given. ([Markdown](https://api.kleidos.dev/firmware/group__ui__components.md)) - [Reusable Widgets](https://api.kleidos.dev/firmware/group__ui__widgets): A scrolling menu that every board drives with its own inputs, and the header's chip that says the clock is not set. ([Markdown](https://api.kleidos.dev/firmware/group__ui__widgets.md)) - [Settings View Model](https://api.kleidos.dev/firmware/group__ui__settings): How a setting reads on the screen: its value in words, what handles it on a keyboard panel, and the tables of device information. ([Markdown](https://api.kleidos.dev/firmware/group__ui__settings.md)) - [Login Detail View Model](https://api.kleidos.dev/firmware/group__ui__credential): What the detail of a login shows and where each key leads, the sentences about a record, and what a refused one-time code offers. ([Markdown](https://api.kleidos.dev/firmware/group__ui__credential.md)) - [Popups & Modals](https://api.kleidos.dev/firmware/group__ui__popup): Toasts, spinners, confirmations and alerts, drawn over any screen. ([Markdown](https://api.kleidos.dev/firmware/group__ui__popup.md)) - [Notifications](https://api.kleidos.dev/firmware/group__ui__notify): Notices about the battery, the link, the portal, the lock and an update, shown once and not again until the state really changes. ([Markdown](https://api.kleidos.dev/firmware/group__ui__notify.md)) - [Brand Logos](https://api.kleidos.dev/firmware/group__ui__brands): The drawing of a service's logo, at the size a screen has for it. ([Markdown](https://api.kleidos.dev/firmware/group__ui__brands.md)) - [Render Canvas](https://api.kleidos.dev/firmware/group__ui__render): The canvas over the display, the smooth shapes it draws, and the choice of how an e-paper panel refreshes. ([Markdown](https://api.kleidos.dev/firmware/group__ui__render.md)) - [Settings Model](https://api.kleidos.dev/firmware/group__settings): The options a device has, once for every surface that shows them: their groups, their values and the words for each. ([Markdown](https://api.kleidos.dev/firmware/group__settings.md)) - [Internationalization](https://api.kleidos.dev/firmware/group__i18n): The interface's text by name, in English, Spanish, French, German and Italian. ([Markdown](https://api.kleidos.dev/firmware/group__i18n.md)) - [Brand Lookup & Logo Atlas](https://api.kleidos.dev/firmware/group__brands): From the address or the name in a login to the service's logo. ([Markdown](https://api.kleidos.dev/firmware/group__brands.md)) - [Build Configuration](https://api.kleidos.dev/firmware/group__config): What the board being built has, as constants. ([Markdown](https://api.kleidos.dev/firmware/group__config.md)) - [Hardware Abstraction Layer](https://api.kleidos.dev/firmware/group__hal): What the application calls instead of a chip: display, input, power and battery, motion, sound, SD card, clock and GPS. ([Markdown](https://api.kleidos.dev/firmware/group__hal.md)) - [Board Description](https://api.kleidos.dev/firmware/group__hal__common): The record of a board's hardware, where it is registered, and how often a chip that has to be polled is read. ([Markdown](https://api.kleidos.dev/firmware/group__hal__common.md)) - [Board Bring-up](https://api.kleidos.dev/firmware/group__hal__bootstrap): The start of a board's hardware and its update on each tick. ([Markdown](https://api.kleidos.dev/firmware/group__hal__bootstrap.md)) - [Input Sources & the Wake Rule](https://api.kleidos.dev/firmware/group__hal__input): Buttons, keyboards, trackball and touch behind four interfaces, and the rule that the first input on a dark panel only wakes it. ([Markdown](https://api.kleidos.dev/firmware/group__hal__input.md)) - [Power, Battery & Parking](https://api.kleidos.dev/firmware/group__hal__power): How each board sleeps, why it woke, what its battery says, and how hardware that nothing is using is switched off. ([Markdown](https://api.kleidos.dev/firmware/group__hal__power.md)) - [Motion & Shake-to-Lock](https://api.kleidos.dev/firmware/group__hal__motion): The shake that locks the device, and the motion sensor behind it. ([Markdown](https://api.kleidos.dev/firmware/group__hal__motion.md)) - [SD Card](https://api.kleidos.dev/firmware/group__hal__sd): The SD card: mounting it for as long as an action lasts, formatting it, and settling it at boot, on the boards that have a slot. ([Markdown](https://api.kleidos.dev/firmware/group__hal__sd.md)) - [Display](https://api.kleidos.dev/firmware/group__hal__display): The panel: its surface, its text, its frames and its light. ([Markdown](https://api.kleidos.dev/firmware/group__hal__display.md)) - [Sound: Catalog, Renderers & Speaker](https://api.kleidos.dev/firmware/group__hal__sound): The sounds as data, the two renderers that turn one into what a board plays, and the task that plays it. ([Markdown](https://api.kleidos.dev/firmware/group__hal__sound.md)) - [Clock Chip Back End](https://api.kleidos.dev/firmware/group__hal__rtc): The wall clock kept by a BM8563 chip, on the boards that have one. ([Markdown](https://api.kleidos.dev/firmware/group__hal__rtc.md)) - [GPS Time Sync](https://api.kleidos.dev/firmware/group__hal__gps): The time from a GPS receiver: one sync when the owner asks for it, and the receiver at rest otherwise. ([Markdown](https://api.kleidos.dev/firmware/group__hal__gps.md)) - [Board Configurations](https://api.kleidos.dev/firmware/group__boards): One source for each board, which creates its parts and registers the record of them. ([Markdown](https://api.kleidos.dev/firmware/group__boards.md)) - [Board-Specific Support](https://api.kleidos.dev/firmware/group__boards__support): The power managers that only one board uses: the CoreInk's, the LILYGO T-Deck's and the M5Cardputer ADV's. ([Markdown](https://api.kleidos.dev/firmware/group__boards__support.md)) - [Device Drivers](https://api.kleidos.dev/firmware/group__drivers): One driver for each chip: panels, power chips, motion sensors, clock, touch, keyboards, trackball, audio and GPS. ([Markdown](https://api.kleidos.dev/firmware/group__drivers.md)) - [Display Panel Drivers](https://api.kleidos.dev/firmware/group__drv__display): The controllers of the panels: ST7789 and ILI9342 for color, SSD1681 and JD79653A for e-paper. ([Markdown](https://api.kleidos.dev/firmware/group__drv__display.md)) - [Power Chip Drivers](https://api.kleidos.dev/firmware/group__drv__power): The power chips: battery, power key, the supply of the parts, and switching the board off. ([Markdown](https://api.kleidos.dev/firmware/group__drv__power.md)) - [Motion Sensor Drivers](https://api.kleidos.dev/firmware/group__drv__imu): The BMI270 and MPU6886 motion sensors, and a stand-in for the boards with none. ([Markdown](https://api.kleidos.dev/firmware/group__drv__imu.md)) - [Clock Chip Driver](https://api.kleidos.dev/firmware/group__drv__rtc): The BM8563 clock chip. ([Markdown](https://api.kleidos.dev/firmware/group__drv__rtc.md)) - [Touch Controller Drivers](https://api.kleidos.dev/firmware/group__drv__touch): The FT6x36 and GT911 touch controllers. ([Markdown](https://api.kleidos.dev/firmware/group__drv__touch.md)) - [Keyboard Drivers](https://api.kleidos.dev/firmware/group__drv__keyboard): The M5Cardputer ADV's key-matrix controller and the LILYGO T-Deck's keyboard. ([Markdown](https://api.kleidos.dev/firmware/group__drv__keyboard.md)) - [Trackball Driver](https://api.kleidos.dev/firmware/group__drv__trackball): The trackball: four direction lines and a click. ([Markdown](https://api.kleidos.dev/firmware/group__drv__trackball.md)) - [Audio Drivers](https://api.kleidos.dev/firmware/group__drv__audio): The ES8311 codec, the ES7210 microphone converter, the AW88298 amplifier, and amplifiers switched by a power chip or a pin. ([Markdown](https://api.kleidos.dev/firmware/group__drv__audio.md)) - [I2C Bus](https://api.kleidos.dev/firmware/group__drv__bus): The board's internal I2C bus, and reading and writing the registers of a chip on it. ([Markdown](https://api.kleidos.dev/firmware/group__drv__bus.md)) - [GPS Receiver Drivers](https://api.kleidos.dev/firmware/group__drv__gps): The GPS receivers the LILYGO T-Deck can carry, the probe that finds which one is fitted, and the park that keeps it asleep. ([Markdown](https://api.kleidos.dev/firmware/group__drv__gps.md)) - [Register Introspection](https://api.kleidos.dev/firmware/group__drv__introspection): The tables of a chip's registers that the serial console prints. ([Markdown](https://api.kleidos.dev/firmware/group__drv__introspection.md)) - [Platform Abstraction](https://api.kleidos.dev/firmware/group__platform): The facades over ESP-IDF and FreeRTOS that the firmware calls. ([Markdown](https://api.kleidos.dev/firmware/group__platform.md)) - [RTOS Facade](https://api.kleidos.dev/firmware/group__platform__rtos): Tasks and the core each runs on, queues, semaphores, critical sections, delays and the task watchdog. ([Markdown](https://api.kleidos.dev/firmware/group__platform__rtos.md)) - [Storage](https://api.kleidos.dev/firmware/group__platform__storage): LittleFS, NVS, the SD card's file system, the writer of updates, and what the security fuses say. ([Markdown](https://api.kleidos.dev/firmware/group__platform__storage.md)) - [Wi-Fi & HTTP Server](https://api.kleidos.dev/firmware/group__platform__net): Wi-Fi as an access point and as a station, the HTTP server, the time from the network, and addresses. ([Markdown](https://api.kleidos.dev/firmware/group__platform__net.md)) - [GPIO & Buses](https://api.kleidos.dev/firmware/group__platform__gpio__bus): GPIO, I2C, SPI, UART, PWM, I2S and ADC, the USB pads, the die's temperature, and the lock of the crypto hardware. ([Markdown](https://api.kleidos.dev/firmware/group__platform__gpio__bus.md)) - [Power, Sleep & System Control](https://api.kleidos.dev/firmware/group__platform__power): Deep and light sleep and what ends them, the CPU clock, the slow clock that counts through a sleep, and the record of a crash. ([Markdown](https://api.kleidos.dev/firmware/group__platform__power.md)) - [Monotonic Clock & Deadlines](https://api.kleidos.dev/firmware/group__platform__clock): The time since boot, and deadlines that stay right when it wraps. ([Markdown](https://api.kleidos.dev/firmware/group__platform__clock.md)) - [Random Numbers](https://api.kleidos.dev/firmware/group__platform__random): Random bytes from the chip's hardware generator. ([Markdown](https://api.kleidos.dev/firmware/group__platform__random.md)) - [Logging](https://api.kleidos.dev/firmware/group__platform__log): The log: one macro for each level, dropped when it is compiled below the level of the build. ([Markdown](https://api.kleidos.dev/firmware/group__platform__log.md)) - [Serial Transport](https://api.kleidos.dev/firmware/group__platform__serial): The serial line of a debug build, over a UART or the chip's USB. ([Markdown](https://api.kleidos.dev/firmware/group__platform__serial.md)) - [Platform Memory & Errors](https://api.kleidos.dev/firmware/group__platform__diag): Large blocks of memory, the record of an allocation that failed, names of errors, and where the compiler places a function or a variable. ([Markdown](https://api.kleidos.dev/firmware/group__platform__diag.md)) - [Main Loop & Hooks](https://api.kleidos.dev/firmware/group__platform__hooks): The task that runs the firmware, and the hooks through which code calls a module above it without knowing it. ([Markdown](https://api.kleidos.dev/firmware/group__platform__hooks.md)) - [Utilities](https://api.kleidos.dev/firmware/group__util): Text, lists and queues that never use the heap, a checksum, and a wipe the compiler cannot drop. ([Markdown](https://api.kleidos.dev/firmware/group__util.md)) - [Safe Strings](https://api.kleidos.dev/firmware/group__platform__string): Copies, comparisons and searches of C text that stay inside the space they are given. ([Markdown](https://api.kleidos.dev/firmware/group__platform__string.md)) - [Fixed-Capacity Containers](https://api.kleidos.dev/firmware/group__platform__containers): Text, lists, queues and functions that keep what they hold inside themselves and never allocate. ([Markdown](https://api.kleidos.dev/firmware/group__platform__containers.md)) - [JSON Reader, Writer and Binder](https://api.kleidos.dev/firmware/group__json): JSON read in pieces, written to a sink and bound to a record by a table, with no allocation. ([Markdown](https://api.kleidos.dev/firmware/group__json.md)) - [Diagnostics](https://api.kleidos.dev/firmware/group__diag): What a board reports of itself: the log's queue, memory and tasks, the time spent drawing, and an estimate of what it draws. ([Markdown](https://api.kleidos.dev/firmware/group__diag.md)) - [Serial Debug Console](https://api.kleidos.dev/firmware/group__debug): The serial console of a debug build, which drives a board from a cable. No other image holds it. ([Markdown](https://api.kleidos.dev/firmware/group__debug.md)) - [QA Host Firmware](https://api.kleidos.dev/firmware/group__host__tools): The firmware of a test host: a board that plays the computer, over Bluetooth or on the portal's Wi-Fi. ([Markdown](https://api.kleidos.dev/firmware/group__host__tools.md)) - [group_table.h](https://api.kleidos.dev/firmware/group__table_8h): Single encrypted group-name table (groups.bin). ([Markdown](https://api.kleidos.dev/firmware/group__table_8h.md)) ## Kleidos bench meter: front pages - [The bench meter's documentation](https://api.kleidos.dev/meter/): The bench meter measures what each Kleidos board draws: an ESP32-S3 reading a TI INA228 across a 0.1 Ω shunt in the board's battery lead, with a relay pair that takes the offset null without hands. ([Markdown](https://api.kleidos.dev/meter/index.md)) - [Using the meter](https://api.kleidos.dev/meter/usage_page): A measuring session with the bench meter, in the order its tasks come: install the host tool, find the port, check the line, verify the calibration, take the null, measure, capture, export, move the… ([Markdown](https://api.kleidos.dev/meter/usage_page.md)) - [The panel](https://api.kleidos.dev/meter/panel_page): kleidos-meter serve holds the meter's port and serves a panel on this computer: live charts, one button per measurement sequence, the relays, the pin map, the settings with each range's shunt and its… ([Markdown](https://api.kleidos.dev/meter/panel_page.md)) - [The meter's SCPI command set](https://api.kleidos.dev/meter/scpi_page): The instrument speaks SCPI-1999 over its CH343 serial line: 6,000,000 baud, 8N1, no flow control, one program message per line. ([Markdown](https://api.kleidos.dev/meter/scpi_page.md)) - [The bench rig's schematic](https://api.kleidos.dev/meter/hardware_page): rig.kicad_sch is the normative wiring of the INA228 bench rig: what is soldered to what, which terminal carries which signal, and why the sense point is where it is. ([Markdown](https://api.kleidos.dev/meter/hardware_page.md)) - [The firmware](https://api.kleidos.dev/meter/firmware_page): The firmware of the INA228 bench power meter: an ESP32-S3-N16R8 on a DSX063-1 carrier reading a TI INA228 across an R100 shunt, built with ESP-IDF only. ([Markdown](https://api.kleidos.dev/meter/firmware_page.md)) - [The Python API](https://api.kleidos.dev/meter/python_api_page): The host package, kleidos_meter: every public class, method and function a program that drives the meter may use. ([Markdown](https://api.kleidos.dev/meter/python_api_page.md)) ## Kleidos bench meter: topics - [Entry point](https://api.kleidos.dev/meter/group__app__entry): app_main(): the boot order, and the five objects of the instrument. ([Markdown](https://api.kleidos.dev/meter/group__app__entry.md)) - [INA228 driver](https://api.kleidos.dev/meter/group__ina228__driver): The TI INA228 on the I2C bus: its register map, field encodings and LSBs, the bring-up that proves what is on the bus, and register access. ([Markdown](https://api.kleidos.dev/meter/group__ina228__driver.md)) - [I2C master](https://api.kleidos.dev/meter/group__i2c__bus): I2C0 on its registers for the INA228's bus: the set-up, the clock set by rewriting the timing registers, each transaction polled to its end, and the recovery of a stuck bus, with nothing allocated… ([Markdown](https://api.kleidos.dev/meter/group__i2c__bus.md)) - [Sampling](https://api.kleidos.dev/meter/group__sampling): The four profiles, the pacing, the TRACE ring, the stream queue, the zero-offset null, and the integer arithmetic that turns counts into units. ([Markdown](https://api.kleidos.dev/meter/group__sampling.md)) - [SCPI parser](https://api.kleidos.dev/meter/group__scpi__parser): SCPI-1999 and IEEE 488.2: program-message parsing, header matching, parameter decoding, the error queue and the status bytes. ([Markdown](https://api.kleidos.dev/meter/group__scpi__parser.md)) - [Bit work](https://api.kleidos.dev/meter/group__bit__work): Flag tests and register fields on std::uint32_t, so that no narrow unsigned operand is promoted to int (MISRA C++:2023 7.0.5). ([Markdown](https://api.kleidos.dev/meter/group__bit__work.md)) - [Characters](https://api.kleidos.dev/meter/group__characters): Character classes, case folding, digits and the bytes a character stands for, from a compile-time table, with no character's numerical value used (MISRA C++:2023 7.0.3). ([Markdown](https://api.kleidos.dev/meter/group__characters.md)) - [Text output](https://api.kleidos.dev/meter/group__text__output): The bounded writer: typed appends on std::to_chars into a caller's buffer, with no format string, no variadic call and nothing allocated (MISRA C++:2023 21.10.1, 30.0.1). ([Markdown](https://api.kleidos.dev/meter/group__text__output.md)) - [Console](https://api.kleidos.dev/meter/group__console__dispatch): The UART0 command surface: the reader, the command table and every handler, the responses, the stream records and the status registers. ([Markdown](https://api.kleidos.dev/meter/group__console__dispatch.md)) - [Console line](https://api.kleidos.dev/meter/group__console__uart): UART0 on its registers for the console: the port, a static receive ring filled by an interrupt nothing allocated, the polled transmit and the overflow -363 reports, in place of ESP-IDF's UART driver. ([Markdown](https://api.kleidos.dev/meter/group__console__uart.md)) - [Calibration](https://api.kleidos.dev/meter/group__calibration__store): The working copy of the calibration (the null, the shunts, the tag and date) as a record of the flash log, the store's judgment of a record, the quality token, and the shunt calibration's arithmetic. ([Markdown](https://api.kleidos.dev/meter/group__calibration__store.md)) - [Record logs](https://api.kleidos.dev/meter/group__flash__log): Append-only logs of records, each over two sectors of raw flash: the newest valid record wins, a power cut at any point of a save leaves the last complete one, and nothing is allocated; the… ([Markdown](https://api.kleidos.dev/meter/group__flash__log.md)) - [Pin map](https://api.kleidos.dev/meter/group__pin__map): The board's pin table, generated from firmware/board/pins.toml, and the pin map: which GPIO each role takes, the default map (the rig as wired), the one definition of the rules a map must keep, and… ([Markdown](https://api.kleidos.dev/meter/group__pin__map.md)) - [Relays](https://api.kleidos.dev/meter/group__relay__bank): The relay module: the DUT's battery lead, the shunt bypass and the spares, the four circuits they make, make-before-break, the null-path checks and the hold. ([Markdown](https://api.kleidos.dev/meter/group__relay__bank.md)) - [Identity](https://api.kleidos.dev/meter/group__instrument__identity): Which instrument this is: the serial derived from the factory MAC (with its SHA-256), and the image it runs. ([Markdown](https://api.kleidos.dev/meter/group__instrument__identity.md)) - [Status LED](https://api.kleidos.dev/meter/group__status__led): The carrier's addressable RGB LED, blanked once at boot and never lit. ([Markdown](https://api.kleidos.dev/meter/group__status__led.md)) - [Heap monitor](https://api.kleidos.dev/meter/group__heap__monitor): The heap hooks that count every allocation and free, before app_main()'s first line and since, and the census build's ring of every event (DIAGnostic:HEAP?, docs/misra.md). ([Markdown](https://api.kleidos.dev/meter/group__heap__monitor.md)) - [Interrupt routing](https://api.kleidos.dev/meter/group__interrupt__routing): A peripheral's interrupt routed to a free level-1 CPU line by the CPU's own tables, with nothing allocated: the ALERT pin's and UART0's, in place of ESP-IDF's GPIO ISR service, its UART driver's… ([Markdown](https://api.kleidos.dev/meter/group__interrupt__routing.md)) - [Watchdog](https://api.kleidos.dev/meter/group__watchdog__timer): Timer Group 0's main watchdog timer, fed only once the console, the sampler and Core 0's idle task have all checked in, with nothing allocated: in place of ESP-IDF's task watchdog. ([Markdown](https://api.kleidos.dev/meter/group__watchdog__timer.md)) - [Startup memory](https://api.kleidos.dev/meter/group__startup__memory): Static storage in place of what ESP-IDF's startup would take from the heap before app_main(): the idle tasks' stacks and control blocks, and PSA's initialization, linked wrapped. ([Markdown](https://api.kleidos.dev/meter/group__startup__memory.md)) - [Brownout detector](https://api.kleidos.dev/meter/group__brownout__detector): The supply's brownout detector, armed to reset the chip in hardware with no interrupt and nothing allocated: in place of ESP-IDF's brownout handling. ([Markdown](https://api.kleidos.dev/meter/group__brownout__detector.md)) - [FreeRTOS ticks](https://api.kleidos.dev/meter/group__rtos__ticks): Milliseconds to ticks and the wait with no deadline, in place of FreeRTOS's casting macros pdMS_TO_TICKS() and portMAX_DELAY. ([Markdown](https://api.kleidos.dev/meter/group__rtos__ticks.md)) ## Optional - [Kleidos firmware, every page](https://api.kleidos.dev/firmware/llms.txt): Kleidos is firmware that turns an ESP32 board into a hardware password manager. - [Classes](https://api.kleidos.dev/firmware/annotated): The classes, records and interfaces, by the namespace they are in, with a line on each ([Markdown](https://api.kleidos.dev/firmware/annotated.md)) - [Names](https://api.kleidos.dev/firmware/functions): The members of every class and record, by name, each with the class it belongs to ([Markdown](https://api.kleidos.dev/firmware/functions.md)) - [Kleidos bench meter, every page](https://api.kleidos.dev/meter/llms.txt): The bench meter measures what each Kleidos board draws: an ESP32-S3 reading a TI INA228 across a 0.1 Ω shunt in the board's battery lead, with a relay pair that takes the offset null without hands. - [Classes](https://api.kleidos.dev/meter/annotated): The classes, records and interfaces, by the namespace they are in, with a line on each ([Markdown](https://api.kleidos.dev/meter/annotated.md)) - [File-level names](https://api.kleidos.dev/meter/globals): The macros and the functions outside every class and namespace, by name, each with the file that declares it ([Markdown](https://api.kleidos.dev/meter/globals.md))