chiark / gitweb /
hostside: hidrawconv: declarations for hatswitches; impl'n is still no-op
[trains.git] / hostside / hidrawconv.h
index cc2c4ec6f2096293174d42996982ac7c0792ed7f..4fb2465efe49f913b96642631f6a00b7ca0972c7 100644 (file)
@@ -52,4 +52,20 @@ void reportvals(const uint8_t msg[], const uint8_t last[],
                int len, const ValLoc vallocs[]);
 
 
+/*----- "hats", ie hatswitches -----*/
+
+typedef struct {
+  int x, y;
+} HatPosn;
+
+typedef struct {
+  const char *str; /* base; reporter will append "X" and "Y" to this */
+  int pos, rshift, max; /* mask is applied before rshift */
+  uint8_t mask;
+  const HatPosn *posns;
+} HatLoc;
+
+void reporthats(const uint8_t msg[], const uint8_t last[],
+               int len, const HatLoc hatlocs[]);
+
 #endif /*HIDRAWCONV_H*/