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 Current »

The power distribution boards for front and rear power distribution are almost identical, differing only in the boards/lights controlled by each of them. Thus, firmware for front and rear is combined.

Power distribution consists of the following modules (each of which is prefixed with “power_distribution”, but that’ll go away soon):

  • can_rx_event_mapper receives CAN messages and maps them to events defined in events. The CAN messages → event mapping is configurable for front and rear; these configurations are defined in can_rx_event_mapper_config.

  • gpio receives GPIO events (defined in events and raised by can_rx_event_mapper) and turns on or off GPIO pins. The event → pin mapping is configurable and is defined in gpio_config.

  • current_measurement reads currents from each BTS7200/BTS7040 chip and stores them in its internal storage. The names of the currents it reads are defined in currents and are configurable for front and rear; the configurations are defined in current_measurement_config.

  • publish_data takes current data from current_measurement and transmits it over CAN. The CAN message to use is configurable in publish_data_config.

  • rear_power_distribution_blink_strobe is only active on rear power distribution. It takes strobe events (from events) and blinks the strobe light.

Also, pin_defs provides aliases for pin addresses on front and rear power distribution.

As well, the library lights_signal_fsm is closely associated with power distribution (and really should be moved into the project). It takes left, right, and hazard signal events, raised by can_rx_event_mapper when the driver turns on the turn signal or hits the hazard button, and raises events indicating whether the lights should blink in left, right, or hazard modes. (This handles peculiarities like the left turn signal and hazard light simultaneously being on.)

  • No labels