-
Notifications
You must be signed in to change notification settings - Fork 1
/
Xpad.h
54 lines (39 loc) · 1022 Bytes
/
Xpad.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef HID_SPI_REDIRECT_XPAD_H
#define HID_SPI_REDIRECT_XPAD_H
#include <stdint.h>
typedef struct {
uint8_t UNUSED_0;
uint8_t LENGTH; // always 0x14
uint8_t DPAD_UP :1;
uint8_t DPAD_DOWN :1;
uint8_t DPAD_LEFT :1;
uint8_t DPAD_RIGHT :1;
uint8_t BUTTON_START :1;
uint8_t BUTTON_BACK :1;
uint8_t BUTTON_L3 :1;
uint8_t BUTTON_R3 :1;
uint8_t UNUSED_1;
uint8_t BUTTON_A;
uint8_t BUTTON_B;
uint8_t BUTTON_X;
uint8_t BUTTON_Y;
uint8_t BUTTON_BLACK;
uint8_t BUTTON_WHITE;
uint8_t TRIGGER_LEFT;
uint8_t TRIGGER_RIGHT;
int16_t LEFT_STICK_X;
int16_t LEFT_STICK_Y;
int16_t RIGHT_STICK_X;
int16_t RIGHT_STICK_Y;
} XpadReport_Data_t;
typedef struct {
uint8_t unused_0;
uint8_t unused_len;
uint8_t unused_1;
uint8_t left;
uint8_t unused_separator;
uint8_t right;
uint8_t padding[14];
} XpadRumble_t;
void convertEventToReport(XpadReport_Data_t *dst, struct js_event *event);
#endif