Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Quick Links:

Architecture:

It would make sense to keep the firmware of this board pretty simple, the board does not need to know about the car's power states. It can simply receive CAN messages and act upon them.

Modules:

  • front_power_distribution_can
    • Receives can messages and raises events.
  • front_power_distribution_gpio
    • Receives GPIO events and sets the corresponding GPIO pin states.
  • front_power_distribution_current_measurement
    • Periodically Reads current values from all the load switches in some period of time
  • front_power_distribution_publish_data
    • Periodically broadcasts the gathered data from front_power_distribution_current_measurement
  • main
    • initializes the modules, processes the event queue and passes it into the other modules.

Libraries

  • signal_lights_fsm
    • Uses blinkers to repeatedly raise events
    • Has a state machine implementing the.
    • inputs:
      • event names: signal_left_fsm_input, signal_right_fsm_input, hazard_fsm_input, sync
    • outputs:
      • signal_left_fsm_output
      • signal_right_fsm_output
      • signal_both_output, or you can raise a left_output and right_output...
  • blinker
    • uses soft_timers to repeatedly raise an event with a data field
    • inputs:
      • event_id
    • outputs:
      • raising that event_id with alternating data fields.

Incoming CAN Messages:

Message IDData FieldsExported Enums
SYSTEM_CAN_MESSAGE_FRONT_POWERuint16_t output_bitset, uint16_t state_bitsetEEFrontPowerDistributionOutput, EEFrontPowerDistributionOutputState
SYSTEM_CAN_MESSAGE_LIGHTSuint16_t light_type_bitset, uint16_t state_bitsetEELightType, EELightState
SYSTEM_CAN_MESSAGE_LIGHTS_SYNCempty
SYSTEM_CAN_MESSAGE_HORNuint8_t horn_stateEEHornState
  • front_power_distribution
  • lights_states
  • lights_sync

Outgoing CAN Messages:

Message IDData FieldsExported Enums
SYSTEM_CAN_MESSAGE_FRONT_POWER_CURRENT_DATA

uint16_t output_bitset,

uint16_t current_data_0, 

uint16_t current_data_1, 

uint16_t current_data_2

EEFrontPowerDistributionOutput

GPIO Outputs:

#OutputPortPin
1Driver Display

2Steering

3Centre Console

4Pedal

5Headlight Left (may be more)

6Headlight Right

7Signal Left

8Signal Right

9Strobe Light

10Horn

11Driver Fan Left

12Driver Fan Right

13


14


15


16


  • No labels