Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Add GPIO output ports/pins

...

  • front_power_distribution_can_rx
    • 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.

...

  • 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...
  • blink_event_generator
    • uses soft_timers to repeatedly raise an event with a data field
    • inputs:
      • event_id
    • outputs:
      • raising that event_id with alternating data fields.

Events: 

















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

...

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 (Output)B2
2SteeringA10
3Centre ConsoleA8
4PedalA9
5Headlight Left (may be more)

6Headlight Right

7Signal LeftB13
8Signal RightB12
9Strobe Light

10HornB14
11Driver Fan LeftB15
12Driver
Fan Right13
Display (Current sensing)A1
13Horn (Current sensing)A4
14


15
16