Fork to see if I can get working

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

Fork of xDotBridge_update_test20180823 by Matt Briggs

Committer:
mbriggs_vortex
Date:
Wed Nov 29 13:54:36 2017 -0700
Revision:
100:0882cf295f8e
Parent:
69:eb391644b346
Adding relaese bin to repo

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Matt Briggs 62:9751a8504c82 1 /*
Matt Briggs 62:9751a8504c82 2 * UserInterface.h
Matt Briggs 62:9751a8504c82 3 *
Matt Briggs 62:9751a8504c82 4 * Created on: Feb 28, 2017
Matt Briggs 62:9751a8504c82 5 * Author: mbriggs
Matt Briggs 62:9751a8504c82 6 */
Matt Briggs 62:9751a8504c82 7
Matt Briggs 62:9751a8504c82 8 #ifndef XDOTBRIDGE_INC_USERINTERFACE_H_
Matt Briggs 62:9751a8504c82 9 #define XDOTBRIDGE_INC_USERINTERFACE_H_
Matt Briggs 62:9751a8504c82 10
Matt Briggs 62:9751a8504c82 11 #include <stdint.h>
Matt Briggs 62:9751a8504c82 12 #include "BaseboardIO.h"
Matt Briggs 62:9751a8504c82 13
Matt Briggs 62:9751a8504c82 14 const float RX_PAIR_WAIT_TIME = 30.0;
Matt Briggs 62:9751a8504c82 15 const float TX_ACCEPT_WAIT_TIME = 10.0;
Matt Briggs 62:9751a8504c82 16
Matt Briggs 62:9751a8504c82 17 enum PairBtnState {
Matt Briggs 69:eb391644b346 18 pairBtnNoPress=0,
Matt Briggs 69:eb391644b346 19 pairBtnShortPress=1,
Matt Briggs 69:eb391644b346 20 pairBtnMediumPress=2,
Matt Briggs 69:eb391644b346 21 pairBtnLongPress=3
Matt Briggs 62:9751a8504c82 22 };
Matt Briggs 62:9751a8504c82 23
Matt Briggs 62:9751a8504c82 24 class PairBtnInterp {
Matt Briggs 62:9751a8504c82 25 public:
Matt Briggs 62:9751a8504c82 26 // Start time < press time < stop time (all time in ms)
Matt Briggs 62:9751a8504c82 27 static const uint16_t ShortPressStartTime = 0;
Matt Briggs 62:9751a8504c82 28 static const uint16_t ShortPressStopTime = 4000;
Matt Briggs 62:9751a8504c82 29 static const uint16_t MediumPressStartTime = 4000;
Matt Briggs 62:9751a8504c82 30 static const uint16_t MediumPressStopTime = 9000;
Matt Briggs 62:9751a8504c82 31 // Anything longer is a LongPress
Matt Briggs 62:9751a8504c82 32
Matt Briggs 62:9751a8504c82 33 static PairBtnState read(BaseboardIO *bbio);
Matt Briggs 62:9751a8504c82 34 };
Matt Briggs 62:9751a8504c82 35
Matt Briggs 62:9751a8504c82 36 class HoldTimeSetting {
Matt Briggs 62:9751a8504c82 37 public:
Matt Briggs 62:9751a8504c82 38 static uint32_t rotVal2Msec(uint8_t in);
Matt Briggs 62:9751a8504c82 39 static float rotVal2Sec(uint8_t in) {return rotVal2Msec(in)/1000.0;}
Matt Briggs 62:9751a8504c82 40 };
Matt Briggs 62:9751a8504c82 41
Matt Briggs 64:46c8819c07cc 42 class LedPatterns {
Matt Briggs 64:46c8819c07cc 43 public:
Matt Briggs 64:46c8819c07cc 44 LedPatterns(BaseboardIO *bbio);
Matt Briggs 64:46c8819c07cc 45 void turnOn();
Matt Briggs 64:46c8819c07cc 46 void turnOff();
Matt Briggs 64:46c8819c07cc 47 void singleBlink();
Matt Briggs 64:46c8819c07cc 48 void tripleBlink();
Matt Briggs 64:46c8819c07cc 49 void tenBlinks();
Matt Briggs 64:46c8819c07cc 50 private:
Matt Briggs 64:46c8819c07cc 51 BaseboardIO *mBbio;
Matt Briggs 64:46c8819c07cc 52 };
Matt Briggs 62:9751a8504c82 53 #endif /* XDOTBRIDGE_INC_USERINTERFACE_H_ */