Added POV to joysticks.
Change-Id: Iad0ea8ed1526a6173502f3f0a9bc8918f0569adc
diff --git a/aos/common/input/driver_station_data.h b/aos/common/input/driver_station_data.h
index 7a946eb..41d54f5 100644
--- a/aos/common/input/driver_station_data.h
+++ b/aos/common/input/driver_station_data.h
@@ -44,6 +44,15 @@
static const int kButtons = 12;
};
+// Represents the direction of a POV on a joystick.
+// Use Data to actually get the value.
+// Safe for static initialization.
+class POVLocation : public JoystickFeature {
+ public:
+ POVLocation(int joystick, int number)
+ : JoystickFeature(joystick, number) {}
+};
+
// Represents various bits of control information that the DS sends.
// Use Data to actually get the value.
enum class ControlBit {
@@ -72,6 +81,10 @@
// Updates the current information with a new set of values.
void Update(const JoystickState &new_values);
+ bool IsPressed(POVLocation location) const;
+ bool PosEdge(POVLocation location) const;
+ bool NegEdge(POVLocation location) const;
+
bool IsPressed(ButtonLocation location) const;
bool PosEdge(ButtonLocation location) const;
bool NegEdge(ButtonLocation location) const;