Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
steering_can_init()
steering_can_process_event()

...

button_

...

press

Code Block
languagec
steeringbutton_digital_inputpress_init() // sets up interrupts for buttons and processesgenerates events

Operation

processes events and sends steering CAN messages.

signal_stalk

Code Block
signal_stalk_init() // sets up analog_readers

Operation

Uses an analog reader to read voltages, and converts them to signal events

cruise_control_stalk

Operation

Uses an analog reader to read voltages, and converts them to cruise control events.

analog_reader

accepts a callback, repeatedly calls that callback with new data as it gets new data.

Events

Event

Source

Destination

Data

Description

BUTTON_PRESS_EVENT_HORN

button_press

steering_can

1: pressed

0: released

BUTTON_PRESS_EVENT_HIGH_BEAM_FORWARD

button_press

steering_can

1: ON

0: OFF

z````

BUTTON_PRESS_EVENT_HIGH_BEAM_REAR

button_press

steering_can

1: ON

0: OFF

BUTTON_PRESS_EVENT_REGEN_BRAKE_TOGGLE

button_press

steering_can

1: ON

0: OFF

STEERING_SIGNAL_STALK_EVENT_LEFT

signal_stalk

steering_can

none

STEERING_SIGNAL_STALK_EVENT_RIGHT

signal_stalk

steering_can

none

STEERING_SIGNAL_STALK_EVENT_OFF

signal_stalk

steering_can

none

STEERING_CRUISE_CONTROL_EVENT_INCREASE_SPEED

cruise_control_stalk

steering_can

STEERING_CRUISE_CONTROL_EVENT_DECREASE_SPEED

cruise_control_stalk

steering_can

GPIO Inputs

Input

GPIO Address

Description

STEERING_DIGITAL_INPUT_HORN

PB1

STEERING_DIGITAL_INPUT_RADIOLANE_PPTASSIST

PA6

STEERING_DIGITAL_INPUT_HIGH_BEAM_FORWARD

PA7

STEERING_DIGITAL_INPUT_HIGH_BEAM_REAR

PB0

STEERING_DIGITAL_INPUT_REGEN_BRAKE_TOGGLE

PA4

STEERING_DIGITAL_INPUT_CC_ON_OFF

PA5

STEERING_DIGITAL_DIGITAL_INPUT_CC_INCREASE_SPEED

PA2

STEERING_DIGITAL_DIGITAL_INPUT_CC_DECREASE_SPEED

PA1

STEERING_DIGITAL_DIGITAL_INPUT_TURN_SIGNAL_STALK

PA3

This is an ADC

CAN Messages

CAN Message

CAN_TRANSMIT_LIGHTS_STATES

CAN_TRANSMIT_HORN_STATE

CAN_TRANSMIT_

...