123456789101112131415161718192021222324252627282930313233343536373839 |
- /*
- * Saitek X52 Arduino USB Host Shield Library.
- * Copyright 2016 by Thomas Buck <xythobuz@xythobuz.de>
- *
- * Based on the USB Host Library HID Joystick example
- * https://www.circuitsathome.com/mcu/hid-joystick-code-sample
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, version 2.
- */
-
- #ifndef __HID_PARSER_H__
- #define __HID_PARSER_H__
-
- #include <hid.h>
- #include "joystick_events.h"
-
- #define RPT_GEMEPAD_LEN 8
- #define BUFFER_SIZE 16
-
- class JoystickReportParser : public HIDReportParser {
- JoystickEvents* joyEvents;
-
- uint8_t buf[BUFFER_SIZE];
- uint8_t oldPad[RPT_GEMEPAD_LEN];
- uint8_t oldHat;
- uint64_t oldButtons;
- uint8_t oldMouse;
- GamePadEventData buffer;
-
- public:
- JoystickReportParser(JoystickEvents* evt);
-
- virtual void Parse(HID* hid, bool is_rpt_id, uint8_t len, uint8_t* bufPart);
- };
-
- #endif // __HID_PARSER_H__
|