Versions Compared

Key

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

...

Driver Inputs

IO Initialization

IO initialization has been split into To simplify device setup, two separate modules have been created to take care of IO initialization for both digital and analog devices.

Input Handling

Once an event has been generated, it will be stored inside a global event queue until it is time to process the event. The system will use FSM arbitration to events will be stored inside a global event queue until inputs. A configuration file has also been set up to define the addresses used for each device.

In addition, since the type of ISR needed to handle an input event will depend on whether the input is digital or analog, the responsibility for handling the events for particular device will fall onto either the digital or analog module, depending on the device.

Input Handling 

Since input commands are to be made by the user, the events will be handled through the ISRs.

CAN Data Scheme

Until a sufficient protocol can be defined for sending driver input data over CAN, we will be using the following dummy scheme for the event data field:

Bits0123456789101112131415
ContentsDevice identifierDevice

















the 

Pin Assignments

Input DevicePinType
PowerPC0Digital
Gas PedalPA1Analog
Mechanical BrakePA2Analog
Direction Selector Forward
PC2
PB2Digital
Direction Selector ReversePB3
PC3
Digital
Cruise ControlPC4Digital
Cruise Control IncreasePC5Digital
Cruise Control DecreasePC6Digital
Turn Signal RightPC7Digital
Turn Signal LeftPC8Digital
Hazard Light SwitchPC9
Mechanical BrakePA10

Handling Inputs

The driver control inputs will be connected to onboard GPIOs. As we are only concerned with handling each input as they are triggered, most of the inputs will be set to be handled through the use of a common ISR. The ISR will then look at the debounced state of the triggering input device and raise the proper event in the event queue. The event queue will then be used to send the necessary messages over CAN and I2C.

...

Digital

Finite State Machine

The program will be controlled through the use of multiple Finite State Machines to ensure that inputs are only serviced at the appropriate periods. 

...