Software - Lobbyist
Master State Machine
The Master State Machine controls the Lobbyist in accordance with the communications protocol. The state machine, developed by our class' communications committee, is shown below.
|
|
The following modules and services are simple one-state state machines, that allowed us to organize our code in a way that helped us to incrementally build and debug our project.
UART Service
The UART Service handles the initialization of the Universal Asynchronous Receiver/Transmistter module of the TIVA, as well as notifying the Master SM when an individual byte is successfully sent or received from the data register.
|
|
Receive Service
The Receive Service is used to collect the bytes of a single reception and parse through them to ultimately send the proper notifications to the Master. The Lobbyist receives pairing requests, 32-number encryption keys, and encrypted control packets from the PAC.
|
|
Transmit Service
The Transmit Service is only responsible for forming and sending the status packets - the only packet the Lobbyist needs to send to the PAC. The status packet contains information about the Lobbyist's pairing status, the status of a possible encryption failure, and the last packet of data it successfully received.
|
|
Outputs Service
The Outputs Service handles all calls to control the Lobbyist, including lift, thrust, braking and turning, and communication with the DMC, which controls displays.
|
|
Helpers and Definitions
The helper functions and definitions header made our code for the entire project much more readable and intuitive to implement. The helper functions allowed us to call a single function to change a duty cycle or initialize a module, and the definitions header allowed us to refer to a pin by its name or function. This ability allowed us to more easily refer to specific pins, and made our code more flexible, which helped when the need to rearrange hardware arose.
|
|
|
Main and ES_Configure modules
The main and ES_configure modules don't show much code specific to our Lobbyist, however they do give a good sense for the general skeleton of our code, as well as the timers used to keep it running.
|
|