2013-12-15 18:30:16 -05:00
|
|
|
/*----------------------------------------------------------------------------*/
|
2016-01-02 03:02:34 -08:00
|
|
|
/* Copyright (c) FIRST 2008-2016. All Rights Reserved. */
|
2013-12-15 18:30:16 -05:00
|
|
|
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
2016-01-02 03:02:34 -08:00
|
|
|
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
|
|
|
|
/* the project. */
|
2013-12-15 18:30:16 -05:00
|
|
|
/*----------------------------------------------------------------------------*/
|
2016-01-02 03:02:34 -08:00
|
|
|
|
2014-05-02 17:54:01 -04:00
|
|
|
#pragma once
|
2013-12-15 18:30:16 -05:00
|
|
|
|
2014-08-08 17:05:49 -04:00
|
|
|
#include <stdint.h>
|
2013-12-15 18:30:16 -05:00
|
|
|
|
|
|
|
|
/** GenericHID Interface
|
|
|
|
|
*/
|
2015-06-25 15:07:55 -04:00
|
|
|
class GenericHID {
|
|
|
|
|
public:
|
|
|
|
|
enum JoystickHand { kLeftHand = 0, kRightHand = 1 };
|
2013-12-15 18:30:16 -05:00
|
|
|
|
2015-06-24 01:06:29 -07:00
|
|
|
virtual ~GenericHID() = default;
|
2013-12-15 18:30:16 -05:00
|
|
|
|
2015-06-25 15:07:55 -04:00
|
|
|
virtual float GetX(JoystickHand hand = kRightHand) const = 0;
|
|
|
|
|
virtual float GetY(JoystickHand hand = kRightHand) const = 0;
|
|
|
|
|
virtual float GetZ() const = 0;
|
|
|
|
|
virtual float GetTwist() const = 0;
|
|
|
|
|
virtual float GetThrottle() const = 0;
|
|
|
|
|
virtual float GetRawAxis(uint32_t axis) const = 0;
|
2013-12-15 18:30:16 -05:00
|
|
|
|
2015-06-25 15:07:55 -04:00
|
|
|
virtual bool GetTrigger(JoystickHand hand = kRightHand) const = 0;
|
|
|
|
|
virtual bool GetTop(JoystickHand hand = kRightHand) const = 0;
|
|
|
|
|
virtual bool GetBumper(JoystickHand hand = kRightHand) const = 0;
|
|
|
|
|
virtual bool GetRawButton(uint32_t button) const = 0;
|
2014-10-17 14:46:25 -04:00
|
|
|
|
2015-06-25 15:07:55 -04:00
|
|
|
virtual int GetPOV(uint32_t pov = 0) const = 0;
|
2013-12-15 18:30:16 -05:00
|
|
|
};
|