In development. It changes without notice.
Topic
Board Bring-up
The start of a board's hardware and its update on each tick.
There is one implementation for the M5Stack boards and one for the LILYGO T-Deck. It finds the motion sensor, the keyboard's chip and the trackball, starts the display and the inputs, and puts to rest the chips no part of the firmware uses.
Files | |
| file | src/ |
| The bootstrap of hal_ | |
| file | src/ |
| The T-Deck's bootstrap of hal_ | |
| file | src/ |
| Serial-log scans of the internal I2C bus. | |
| file | src/ |
| Variant hardware bootstrap and per-frame hardware polling. | |
Functions | |
| void | kleidos:: |
| Scan the internal I2C bus on explicit pins and log results. | |
| void | kleidos:: |
| Scan the internal I2C bus on the variant pins and log results. | |
| void | kleidos:: |
| Start the serial console at the build's rate. | |
| void | kleidos:: |
| Initialize hardware (display, I2C, buttons, PMIC, peripherals). | |
| void | kleidos:: |
| Poll hardware state (buttons, touch, keyboard). | |
| void | kleidos:: |
| Sample the board's buttons without consuming their edges. | |
| void | kleidos:: |
| Initialize the UI framework (no-op: the in-house UI library needs none). | |
| void | kleidos:: |
| Tick the UI framework (no-op: the in-house UI library needs none). | |
| void | kleidos:: |
| Teardown the UI framework before deep sleep. | |
Function Documentation
begin() #
Initialize hardware (display, I2C, buttons, PMIC, peripherals).
Every board but the T-Deck: brings up the board power hold, I2C bus, display panel, backlight, button inputs, and any optional peripherals. The T-Deck: I2C, display, GPIO peripheral power, keyboard, trackball, touch.
Called once from app_main before the FSM starts.
beginConsole() #
Start the serial console at the build's rate.
Called from setup() before anything logs, ahead of begin. A line logged before it leaves the console UART at ESP-IDF's own 115200, which a host reading a debug build's faster console cannot read (the factory reset's FACTORY_
printRuntimeI2cScanForPins() #
Scan the internal I2C bus on explicit pins and log results.
- Parameters
-
Name Direction Meaning label in Label string printed as the scan header. sdaPin in SDA GPIO number to use for the scan. sclPin in SCL GPIO number to use for the scan.
sampleButtons() #
Sample the board's buttons without consuming their edges.
Run from the e-paper panel's BUSY waits, so a press made while a refresh holds the loop is still there on the next tick. Only the task that brought the HAL up (the loop task) samples; a call from any other task does nothing. A no-op on boards without polled buttons.
update() #
Poll hardware state (buttons, touch, keyboard).
Every board but the T-Deck: polls local board drivers and optional runtime services. The T-Deck: keyboard poll + backlight, touch poll.
Called once per loop() iteration from the UI task.