Nathaniel Honka / UI-Honka

Dependents:   Data-Management-Honka

Fork of UI by Michael Ling

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers UserInterface.h Source File

UserInterface.h

00001 #ifndef USERINTERFACE_H
00002 #define USERINTERFACE_H
00003 
00004 /**
00005 * Copyright (c) 2014
00006 * All rights reserved.
00007 *
00008  * This header file contains functions for reading received signals and checking that they are properly formed.
00009  * @author Bradley Perry
00010  * @date
00011 */
00012 
00013 #include "mbed.h"
00014 #include "initDatabed.h"
00015 
00016 /* UI button press types. Must match definitions in Controlbed UI header */
00017 enum UI_t {
00018     BUTTON_NONE = 0,
00019     BUTTON_A_PRESS = 1,
00020     BUTTON_B_PRESS = 2,
00021     BUTTON_A_HOLD = 3,
00022     BUTTON_B_HOLD = 4
00023 };
00024 
00025 extern UI_t UI;
00026 class UserInterface
00027 {
00028 public:
00029     UserInterface(void);
00030     void find_length(char *idx, int *count);
00031     bool checksum_check(char * idx, int length);
00032     void checkUI_XBee();
00033     void readBuffer();
00034     void initializeUI();
00035 
00036 private:
00037     int _buttonA;
00038     int _buttonA_prev;
00039     float _tHold;
00040     float _tIdle;
00041     int _SSconfirm;
00042     float _tRelease;
00043     Timer _time_StateChange;
00044     Timer _time_pressA;
00045     Timer _time_pressB;
00046     int _buttonB;
00047     int _buttonB_prev;
00048     char _xbeeBuffer[250];
00049     int _dataCnt;
00050     float _time_sinceA;
00051     float _time_sinceB;
00052 };
00053 #endif