Expand description
Minimal hardware abstraction for IoT hosts.
Host firmware implements these traits and registers matching FFI callbacks. The simulated implementation below is used for desktop demos and tests.
Structs§
- Simulated
Hal - Desktop/simulator HAL: 32 virtual GPIO pins + a tick counter for delay.
Traits§
Functions§
- builtin_
adc_ read adc_read(channel)→ int raw- builtin_
delay_ ms delay_ms(ms)— simulated; advances the HAL clock only.- builtin_
gpio_ read gpio_read(pin)→ bool- builtin_
gpio_ write gpio_write(pin, high)— pin: int, high: bool- sim_
drive_ pin - Test/demo helper: force an external pin level.
- sim_
elapsed_ ms - Test/demo helper: read simulated elapsed ms.
- sim_
set_ adc - Test/demo helper: inject a simulated ADC reading.