Fork to see if I can get working

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

Fork of xDotBridge_update_test20180823 by Matt Briggs

xDotBridge/inc/UserInterface.h

Committer:
Matt Briggs
Date:
2017-03-14
Revision:
62:9751a8504c82
Child:
64:46c8819c07cc

File content as of revision 62:9751a8504c82:

/*
 * UserInterface.h
 *
 *  Created on: Feb 28, 2017
 *      Author: mbriggs
 */

#ifndef XDOTBRIDGE_INC_USERINTERFACE_H_
#define XDOTBRIDGE_INC_USERINTERFACE_H_

#include <stdint.h>
#include "BaseboardIO.h"

const float RX_PAIR_WAIT_TIME = 30.0;
const float TX_ACCEPT_WAIT_TIME = 10.0;

enum PairBtnState {
    pairBtnShortPress,
    pairBtnMediumPress,
    pairBtnLongPress
};

class PairBtnInterp {
public:
    // Start time < press time < stop time (all time in ms)
    static const uint16_t ShortPressStartTime = 0;
    static const uint16_t ShortPressStopTime = 4000;
    static const uint16_t MediumPressStartTime = 4000;
    static const uint16_t MediumPressStopTime  = 9000;
    // Anything longer is a LongPress

    static PairBtnState read(BaseboardIO *bbio);
};

class HoldTimeSetting {
public:
    static uint32_t rotVal2Msec(uint8_t in);
    static float rotVal2Sec(uint8_t in) {return rotVal2Msec(in)/1000.0;}
};

#endif /* XDOTBRIDGE_INC_USERINTERFACE_H_ */