USB_Host_Shield_2.0
Main Page
Related Pages
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
GitHub
USB_Host_Shield_2.0
examples
HID
USBHIDJoystick
hidjoystickrptparser.h
Go to the documentation of this file.
1
#if !defined(__HIDJOYSTICKRPTPARSER_H__)
2
#define __HIDJOYSTICKRPTPARSER_H__
3
4
#include <inttypes.h>
5
#include <avr/pgmspace.h>
6
#include "
avrpins.h
"
7
#include "
max3421e.h
"
8
#include "
usbhost.h
"
9
#include "
usb_ch9.h
"
10
#include "
Usb.h
"
11
12
#if defined(ARDUINO) && ARDUINO >=100
13
#include "Arduino.h"
14
#else
15
#include <WProgram.h>
16
#endif
17
18
#include "
printhex.h
"
19
#include "
hexdump.h
"
20
#include "
message.h
"
21
#include "
confdescparser.h
"
22
#include "
hid.h
"
23
24
struct
GamePadEventData
25
{
26
uint8_t
X
,
Y
,
Z1
,
Z2
,
Rz
;
27
};
28
29
class
JoystickEvents
30
{
31
public
:
32
virtual
void
OnGamePadChanged
(
const
GamePadEventData
*evt);
33
virtual
void
OnHatSwitch
(uint8_t hat);
34
virtual
void
OnButtonUp
(uint8_t but_id);
35
virtual
void
OnButtonDn
(uint8_t but_id);
36
};
37
38
#define RPT_GEMEPAD_LEN 5
39
40
class
JoystickReportParser
:
public
HIDReportParser
41
{
42
JoystickEvents
*joyEvents;
43
44
uint8_t oldPad[
RPT_GEMEPAD_LEN
];
45
uint8_t oldHat;
46
uint16_t oldButtons;
47
48
public
:
49
JoystickReportParser
(
JoystickEvents
*evt);
50
51
virtual
void
Parse
(
HID
*hid,
bool
is_rpt_id, uint8_t len, uint8_t *buf);
52
};
53
54
#endif // __HIDJOYSTICKRPTPARSER_H__
Generated on Wed Jan 30 2013 21:23:56 for USB_Host_Shield_2.0 by
1.8.3.1