Skip to main content

Crate hsm_firmware_logic

Crate hsm_firmware_logic 

Source
Expand description

Host-testable logic for the mini-HSM firmware.

This crate exists so the parts of the firmware that are pure logic (state machine, debouncer, LED/button abstractions) can be unit-tested on the host. The firmware binary depends on this crate and supplies the hardware-facing trait impls in hsm-firmware/src/hal_rp2040.rs.

Re-exports§

pub use io::Button;
pub use io::Debouncer;
pub use io::Led;
pub use io::DEBOUNCE_STABLE_SAMPLES;

Modules§

io
GPIO abstractions: LEDs and the touch button.
state_machine 🔒
Token operating state machine.

Enums§

Event
Events that drive transitions.
LedPattern
Visual LED pattern associated with each state.
TokenState
All the operating states the token can be in.

Constants§

ERROR_DISPLAY_MS
How long the token displays the error pattern before returning to idle.
TOUCH_TIMEOUT_MS
How long the user has to touch the button before the signing request is cancelled.