Fork to see if I can get working

Dependencies:   BufferedSerial OneWire WinbondSPIFlash libxDot-dev-mbed5-deprecated

Fork of xDotBridge_update_test20180823 by Matt Briggs

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers UserInterface.h Source File

UserInterface.h

00001 /*
00002  * UserInterface.h
00003  *
00004  *  Created on: Feb 28, 2017
00005  *      Author: mbriggs
00006  */
00007 
00008 #ifndef XDOTBRIDGE_INC_USERINTERFACE_H_
00009 #define XDOTBRIDGE_INC_USERINTERFACE_H_
00010 
00011 #include <stdint.h>
00012 #include "BaseboardIO.h"
00013 
00014 const float RX_PAIR_WAIT_TIME = 30.0;
00015 const float TX_ACCEPT_WAIT_TIME = 10.0;
00016 
00017 enum PairBtnState {
00018     pairBtnNoPress=0,
00019     pairBtnShortPress=1,
00020     pairBtnMediumPress=2,
00021     pairBtnLongPress=3
00022 };
00023 
00024 class PairBtnInterp {
00025 public:
00026     // Start time < press time < stop time (all time in ms)
00027     static const uint16_t ShortPressStartTime = 0;
00028     static const uint16_t ShortPressStopTime = 4000;
00029     static const uint16_t MediumPressStartTime = 4000;
00030     static const uint16_t MediumPressStopTime  = 9000;
00031     // Anything longer is a LongPress
00032 
00033     static PairBtnState read(BaseboardIO *bbio);
00034 };
00035 
00036 class HoldTimeSetting {
00037 public:
00038     static uint32_t rotVal2Msec(uint8_t in);
00039     static float rotVal2Sec(uint8_t in) {return rotVal2Msec(in)/1000.0;}
00040 };
00041 
00042 class LedPatterns {
00043 public:
00044     LedPatterns(BaseboardIO *bbio);
00045     void turnOn();
00046     void turnOff();
00047     void singleBlink();
00048     void tripleBlink();
00049     void tenBlinks();
00050 private:
00051     BaseboardIO *mBbio;
00052 };
00053 #endif /* XDOTBRIDGE_INC_USERINTERFACE_H_ */