Versions Compared

Key

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

...

Code Block
steering_can_init()
steering_can_process_event()

...

steering_digital_

...

input

Code Block
languagec
buttonsteering_digital_pressinput_init() // sets up interrupts for buttons and generates events

...

processes events and sends steering CAN messages.

steering_signal_stalk

Code Block
signal_stalk_init(configuration) // sets up analog_readers
  configuration = {
    
  
  }
signal_stalk

Operation

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

steering_cruise_control_stalk()

Operation

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

adc_periodic_reader()

Code Block
adc_periodic_reader(storage, settings) {}
  * period
adc_periodic_reader_set_up_channel(storage) {}
  adc_init(gpio_address, prv_) // initialize the adc
  * gpio_address
  * channel
analog_reader_register_callback(callback, channel) {}

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

...

Event

Source

Destination

Data

Description

BUTTON_PRESS_EVENT_HORN

buttonsteering_digital_pressinput

steering_can

1: pressed

0: released

BUTTON_PRESS_EVENT_HIGH_BEAM_FORWARD

buttonsteering_digital_pressinput

steering_can

1: ON

0: OFF

z````

BUTTON_PRESS_EVENT_HIGH_BEAM_REAR

buttonsteering_digital_pressinput

steering_can

1: ON

0: OFF

BUTTON_PRESS_EVENT_REGEN_BRAKE_TOGGLE

buttonsteering_digital_pressinput

steering_can

1: ON

0: OFFnone

BUTTON_PRESS_EVENT_CC_TOGGLE

steering_digital_input

steering_can

none

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

none

STEERING_CRUISE_CONTROL_EVENT_DECREASE_SPEED

cruise_control_stalk

steering_can

none

Old Car GPIO INPUTS

Input

GPIO Address

Description

STEERING_DIGITAL_INPUT_HORN

PB1

????

STEERING_DIGITAL_INPUT_LANE_ASSIST

PA6

GPIO top button

STEERING_DIGITAL_INPUT_HIGH_BEAM_FORWARD

PA7

GPIO pull above back

STEERING_DIGITAL_INPUT_HIGH_BEAM_REAR

PB0

GPIO push above forward

STEERING_DIGITAL_INPUT_REGEN_BRAKE_TOGGLE

PA4

GPIO bottom button

STEERING_DIGITAL_INPUT_CC_ON_OFF

PA5

GPIO pull bottom back

STEERING_DIGITAL_DIGITAL_INPUT_CC_INCREASE_SPEED

STEERING_DIGITAL_DIGITAL_INPUT_CC_DECREASE_SPEED

PA2

ADC: pull bottom up/down

nothing?

PA1

????

the distance thingy…

PA3

This is an ADC

sick

PA0

this is an ADC

...

CAN Message

CAN_TRANSMIT_LIGHTS_STATESSTATESm

CAN_TRANSMIT_HORN_STATE

CAN_TRANSMIT_

...