Modules
precharge_control
receives can message
begins precharge (sets gpio pin)
acks the precharge message (checks the gpio state after setting it, if it’s the same, ack status OK)
discharges ()
acks
sends precharge complete message when precharge is complete (interrupt)
precharge_status_fsm
not really needed… precharge’s simple enough
mci_data_broadcast
listens on the CAN network for mci data. (interrupt driven)
sends it on the car’s internal CAN network. (can happen when the interrupt goes off)
relay_rx
sets gpio state
reads from it
acks message
will be a library
drive_rx
will be a library
receive messages and keep a global state, also raise events
powertrain_rx
will be a library
simply just acks powertrain messages
drive_output
receives pedal messages (throttle and brake), and makes a decision on
target speed
throttle value
Incoming CAN Messages
Message ID | Parameters | |
---|---|---|
CAR_DRIVE_STATE | u_8 drive_staet | |
BEGIN_PRECHARGE | ||
THROTTLE_OUTPUT | ||
SET_RELAY_STATES | ||
BRAKE_PRESSED | ||
CRUISE_CONTROL_COMMAND | ||
POWERTRAIN_HEARTBEAT |
Outgoing CAN Messages
Message ID | Parameters | DESCRIPTION |
---|---|---|
PRECHARGE_COMPLETED | no data | |
CRUISE_CONTROL_CANCELLED | no data | |
MOTOR_CONTROLLER_STATUS | u64 | |
MOTOR_CONTROLLER_DATA | u32 type, u32 data | |