How tudsat-rocket/io_board_firmware works
This repository is firmware for configurable CAN-connected I/O nodes, with valve, heating, sensor, and safety behavior. The principal workflow is a CAN master changing or commanding node state; firmware stores that intent, samples sensors and rail values, computes safe output targets, drives hardware, and reports state over CAN. The graph includes the documented configuration, protocol, sensing, and control domains. Evidence is limited to the supplied excerpts and SOURCE INDEX; links without direct relationship evidence are omitted.
Main entry points: control.rs Control task · store.rs Shared state · sensors/mod.rs Sensor sampling · can/mod.rs CAN transport
Components 23
CAN protocol
- CAN transport
src/can/mod.rs - SDO server
src/can/sdo.rs - TPDO publisher
src/can/tpdo.rs - Object dictionary
iocan-proto/src/od.rs - Valve wire format
iocan-proto/src/valve.rs
Configuration state
- Shared state
src/store.rs - Runtime config
src/config/mod.rs - Config persistence
src/config/persist.rs - Node defaults
src/zenith_mapping/mod.rs
Sensing
- Sensor sampling
src/sensors/mod.rs - External ADC
src/sensors/ext_adc.rs - Rail sensing
src/rail_sense.rs
Control
- Control task
src/control.rs - Valve control
src/valves.rs - Heating control
src/heating.rs - Pressure relief
src/relief.rs - Safety logic
src/safety.rs - CPU monitoring
src/cpu.rs - Error counters
src/errors.rs
Board hardware
- High-current outputs
src/hco.rs - Output drivers
src/outputs.rs - Board support
src/board/mod.rs
Other components
- CAN master
Connections 25
- CAN master → CAN transport: sends frames
src/can/mod.rs - CAN transport → SDO server: fans out
src/can/mod.rs - CAN transport → TPDO publisher: transports frames
src/can/mod.rs - SDO server → Shared state: parks requests
src/store.rs - TPDO publisher → Shared state: reads state
src/can/tpdo.rs - SDO server → Object dictionary: serves objects
iocan-proto/src/od.rs - Object dictionary → Valve wire format: defines encoding
iocan-proto/src/od.rs - Control task → Shared state: reads intent
src/control.rs - Control task → Shared state: writes observations
src/control.rs - Control task → Pressure relief: applies relief
src/relief.rs - Control task → Rail sensing: reads rails
src/control.rs - Sensor sampling → Runtime config: uses calibration
src/sensors/mod.rs - Sensor sampling → Shared state: publishes readings
src/sensors/mod.rs - Sensor sampling → External ADC: samples devices
src/sensors/mod.rs - Runtime config → Config persistence: loads and saves
src/config/mod.rs - Runtime config → Node defaults: falls back to
src/zenith_mapping/mod.rs - Control task → High-current outputs: drives outputs
src/hco.rs - High-current outputs → Output drivers: uses drivers
src/hco.rs - Board support → High-current outputs: initializes
src/board/mod.rs - Board support → Sensor sampling: provides I2C
src/board/mod.rs - Control task → Heating control: coordinates heating
src/control.rs - Control task → Valve control: coordinates valves
src/control.rs - Control task → Safety logic: checks safety
src/control.rs - Control task → Error counters: records faults
src/control.rs - Control task → CPU monitoring: publishes utilization
src/control.rs