Skip to content

Limit Switch Board (LIM)

Reports the state of two limit switches on the CAN bus. Firmware lives in src/lim.

This is the simplest board in the tree. It exists for places that need limit switches without a motor controller attached to read them. The mast limit is the current user.

InterfacePeripheralNotes
Limit switches A and BGPIOpresence and polarity are configurable
CANFDCAN1
LoggingLPUART1 (DMA)
TimerRatePurpose
htim610 Hzpublish LIMState

There is no state machine and nothing to calibrate. The board reads both pins and publishes them on a fixed cadence. Configuration decides whether each switch is present at all, whether it is enabled, and whether it reads active high or active low.

MessageBase IDDLCSignals
LIMResetCmd0x803100001reset, clear_faults
ESWConfigCmd0x80F000006address, value, apply
ESWProbe0x80F100004data
MessageBase IDDLCSignals
LIMState0x803000001lim_a (1), lim_b (1)
ESWAck0x80F200004data

Definition: config/lim.yaml, 8 bytes, the smallest in the tree. Device values live under rover/cm/, for example rover/cm/mast_limit.yaml.

RegisterTypeMeaning
can_iduint8this board’s CAN node ID
host_can_iduint8where to address published state
sys_cfguint8lim_a_present (bit 0), lim_b_present (bit 1)
limit_cfguint8lim_a_en (0), lim_a_active_high (1), lim_b_en (2), lim_b_active_high (3)
publish_frequencyfloat32CAN publish rate, Hz

See Register Definitions and CAN Configuration Interface.

Terminal window
./scripts/build.sh --src src/lim --preset Debug
./scripts/build.sh --src src/lim --preset Debug --flash