Mobile Security System - Revision 1.0
Dependencies: FXOS8700Q N5110 SDFileSystem SRF02 mbed
Diff: main.h
- Revision:
- 7:8ac5aee0c13e
- Parent:
- 6:dc1229224d8e
- Child:
- 8:8a3d1c07bdec
--- a/main.h Mon May 02 13:47:17 2016 +0000 +++ b/main.h Mon May 02 14:28:32 2016 +0000 @@ -156,6 +156,8 @@ int length; /*!< Stores the length of strings that are comprised of variables that are going to be displayed on the LCD */ +// Initialisation Functions + void error(); /*!< Hangs flashing on_board LED */ void init_serial(); /*!< Set-up the serial port */ @@ -166,6 +168,8 @@ void init_variables(); /*!< Initialises all variables to zero */ +// Interrupt Service Routines (ISRs) + void setting_distance_isr(); /*!< Interrupt Service Routine that triggers when setting_distance ticker fires */ void intruder_distance_isr(); /*!< Interrupt Service Routine that triggers when intruder_distance ticker fires */ @@ -182,13 +186,15 @@ void setting_screen_isr(); /*!< Interrupt Service Routine that triggers when setting_screen ticker fires */ +// Button Functions + void button_0_protocol(); /*!< Protocol when button_0 is pressed */ void button_1_protocol(); /*!< Protocol when button_1 is pressed */ void button_c_protocol(); /*!< Protocol when button_c is pressed */ -void timeout_protocol(); /*!< Prints timeout counter when the alarm is triggered */ +// State Functions void state_0_screen(); /*!< Sets the screen and the necessary tickers and timeouts for state 0 */ @@ -208,13 +214,19 @@ void state_8_screen(); /*!< Sets the screen and the necessary tickers and timeouts for state 8 */ +void lcd_border(); /*!< Prints a border to the Nokia 5110 LCD */ + +void pin_text_box(); /*!< Prints a box to the Nokia 5110 LCD for the states where a pin is required */ + void screen_selection(); /*!< Calls the relevant state_X_screen() depending on the value of g_next_state */ +// Screen Animation Functions + void setting_animation(); /*!< Prints the animation on the setting screen to the Nokia 5110 LCD */ -void lcd_border(); /*!< Prints a border to the Nokia 5110 LCD */ +void timeout_protocol(); /*!< Prints timeout counter when the alarm is triggered */ -void pin_text_box(); /*!< Prints a box to the Nokia 5110 LCD for the states where a pin is required */ +// Read Distance Functions void get_setting_distance(); /*!< Gets the distance from the SRF02 and then increments the setting_distance_counter */ @@ -224,12 +236,16 @@ void calculate_intruder_distance(); /*!< Averages the past 10 distance readings and compares this value to the initial_setting_distance to detect a potential intruder */ +// Timeout Functions + void screen_5_transition(); /*!< Called five seconds after the setting screen is called */ void screen_progression(); /*!< Calls check pin to see if the entered pin is correct and from there either proceed or go back */ void alarm_setting_buzz(); /*!< Turns off buzzer one second after entering state 5 */ +// Pin Functions + void pin_confirm(); /*!< Clears the screen when a pin is entered to tell the user to press button 'C' to confirm the entered pin */ void enter_pin(); /*!< Prints '*' to the Nokia 5110 LCD when a pin is being entered */