Versions Compared

Key

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

Overview

The main goal of these modules is to detect steering events such as when the horn is pressed or the turn signal is moved.

For digital input, this is accomplished by:

  1. Initializing all the pins with an interrupt in steering_digital_input

  2. Triggering the interrupt if a certain button is pressed (eg horn) which raises an event

  3. Processing the event and sending the respective CAN message in steering_can

For analog input, this is accomplished by:

  1. Using adc_periodic_reader which uses soft_timer and interrupts to periodically check the voltage

  2. Checking the voltages and raising the correct event using steering_control_stalk

  3. Processing the event and sending the respective CAN message in steering_can

Modules

Modules for this board:

steering_can

Methods:

Code Block
steering_can_process_event() //Sends CAN messages

steering_digital_input()

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

...

Code Block
adc_periodic_reader_init()

adc_periodic_reader_set_up_channel(reader_id,adc_settings)//sets up the channels
//so an interrupt will be triggered periodically and will call the callback function

adc_periodic_reader_start(reader_id) //starts the soft timer

adc_periodic_reader_stop(reader_id)

...