In development. It changes without notice.
Topic
Board Description
The record of a board's hardware, where it is registered, and how often a chip that has to be polled is read.
- BoardDef holds a pointer to each part of a board, or none where the board lacks it.
- The registration gives the rest of the firmware the one record of the board it was built for.
- hal::
PollPeriod says when a value that the loop polls is due.
The board's constants are in Build Configuration, and the I2C bus inside it in I2C Bus.
Files | |
| file | src/ |
| Aggregate of pointers to every hardware-subsystem interface. | |
| file | src/ |
| Global registration point for the active variant's BoardDef. | |
| file | src/ |
| How often a chip is read for a value the main loop polls. | |
Namespaces | |
| namespace | kleidos::hal |
| The board hardware abstraction the application calls instead of a chip driver. | |
Classes | |
| struct | kleidos:: |
| Variant hardware description: identity plus subsystem interface pointers. More about kleidos:: | |
| class | kleidos:: |
| Says when a polled read is due: the first time, then once per period. More about kleidos:: | |
| struct | kleidos:: |
| One reading of a pointer, judged as a screen sees it. More about kleidos:: | |
Macros | |
| #define | REGISTER_ |
Register a static BoardDef with the board registry at file scope. | |
Typedefs | |
| using | kleidos:: |
The IMU interface, by name only: a caller that dereferences BoardDef::imu includes imu_manager.h. | |
Functions | |
| template<auto Slot> | |
| constexpr ButtonInput * | kleidos:: |
| Compile-time-checked third-button slot for a BoardDef initializer. | |
| void | kleidos:: |
| Record the active board definition. | |
| const BoardDef & | kleidos:: |
| Get the active board descriptor. | |
Variables | |
| constexpr uint32_t | kleidos:: |
| constexpr uint32_t | kleidos:: |
| constexpr uint32_t | kleidos:: |
| Period between two reads of a touch panel that reported no contact, ms. | |
| constexpr uint32_t | kleidos:: |
Macro Definition Documentation
REGISTER_ BOARD #
Register a static BoardDef with the board registry at file scope.
Expands to an anonymous-namespace helper with a static instance whose constructor calls board::. Place at file scope in the variant's board_<name>.cpp (typically the last statement).
- Parameters
-
Name Meaning def Identifier (or address) of a BoardDefwith static storage duration in the current translation unit.
Function Documentation
get() #
Get the active board descriptor.
- Returns
- Reference to the registered board; halts via an infinite loop if no board was registered (the firmware cannot continue without one).
registerBoard() #
Record the active board definition.
Called from the file-scope static initialiser installed by REGISTER_def; the second registration replaces the first (so linking two board factories for the same DEVICE_ID is a build error caught at link time, not a runtime surprise).
- Parameters
-
Name Direction Meaning def in Pointer to the board descriptor to register (must outlive the program — typically a static const BoardDef in board_<name>.cpp).
thirdButtonSlot() #
Compile-time-checked third-button slot for a BoardDef initializer.
BoardDef:: is a runtime pointer, so nothing structurally stops a board factory from wiring a third button the variant never declared — or omitting one it did, which would leave a VAULT_ board with a tab grammar (A-hold / C-hold) it cannot produce. Routing the slot through this helper makes the wiring and HAS_ the same fact: they are compared in the very translation unit that owns the wiring, so they cannot drift.
- Template Parameters
-
Name Meaning Slot Address of this board's third-button input, or nullptr.
- Returns
Slotas aButtonInput*.
Variable Documentation
kFrameTouchPollMs #
Least time between two reads of a touch panel from inside a frame the loop task paints, its blit included, ms (display::): a usual tap (50-100 ms on the glass) spans five or more of them.
kLatchedPowerKeyPollMs #
Period between two reads of a power key the PMIC latches, ms: a click locks at most this long after it was made.
kLevelPowerKeyPollMs #
Period between two reads of a power key read as a level, ms: short enough that the briefest deliberate click spans two reads.