Overview
The main goal of the Steering Interface is to detect steering events such as when the horn is pressed or the turn signal is moved. Once it detects this, it will raise an event and send a CAN message.
For digital input, this is accomplished by:
Initializing all the pins with an interrupt in steering_digital_input
Triggering the interrupt if a certain button is pressed (eg horn) which raises an event
Processing the event and sending the respective CAN message in steering_can
For analog input, this is accomplished by:
Using adc_periodic_reader which uses soft_timer and interrupts to periodically check the voltage
Checking the voltages and raising the correct event using steering_control_stalk
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 | ||
---|---|---|
| ||
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) |
...