xref: /aosp_15_r20/bionic/libc/kernel/uapi/linux/joystick.h (revision 8d67ca893c1523eb926b9080dbe4e2ffd2a27ba1)
1 /*
2  * This file is auto-generated. Modifications will be lost.
3  *
4  * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5  * for more information.
6  */
7 #ifndef _UAPI_LINUX_JOYSTICK_H
8 #define _UAPI_LINUX_JOYSTICK_H
9 #include <linux/types.h>
10 #include <linux/input.h>
11 #define JS_VERSION 0x020100
12 #define JS_EVENT_BUTTON 0x01
13 #define JS_EVENT_AXIS 0x02
14 #define JS_EVENT_INIT 0x80
15 struct js_event {
16   __u32 time;
17   __s16 value;
18   __u8 type;
19   __u8 number;
20 };
21 #define JSIOCGVERSION _IOR('j', 0x01, __u32)
22 #define JSIOCGAXES _IOR('j', 0x11, __u8)
23 #define JSIOCGBUTTONS _IOR('j', 0x12, __u8)
24 #define JSIOCGNAME(len) _IOC(_IOC_READ, 'j', 0x13, len)
25 #define JSIOCSCORR _IOW('j', 0x21, struct js_corr)
26 #define JSIOCGCORR _IOR('j', 0x22, struct js_corr)
27 #define JSIOCSAXMAP _IOW('j', 0x31, __u8[ABS_CNT])
28 #define JSIOCGAXMAP _IOR('j', 0x32, __u8[ABS_CNT])
29 #define JSIOCSBTNMAP _IOW('j', 0x33, __u16[KEY_MAX - BTN_MISC + 1])
30 #define JSIOCGBTNMAP _IOR('j', 0x34, __u16[KEY_MAX - BTN_MISC + 1])
31 #define JS_CORR_NONE 0x00
32 #define JS_CORR_BROKEN 0x01
33 struct js_corr {
34   __s32 coef[8];
35   __s16 prec;
36   __u16 type;
37 };
38 #define JS_RETURN sizeof(struct JS_DATA_TYPE)
39 #define JS_TRUE 1
40 #define JS_FALSE 0
41 #define JS_X_0 0x01
42 #define JS_Y_0 0x02
43 #define JS_X_1 0x04
44 #define JS_Y_1 0x08
45 #define JS_MAX 2
46 #define JS_DEF_TIMEOUT 0x1300
47 #define JS_DEF_CORR 0
48 #define JS_DEF_TIMELIMIT 10L
49 #define JS_SET_CAL 1
50 #define JS_GET_CAL 2
51 #define JS_SET_TIMEOUT 3
52 #define JS_GET_TIMEOUT 4
53 #define JS_SET_TIMELIMIT 5
54 #define JS_GET_TIMELIMIT 6
55 #define JS_GET_ALL 7
56 #define JS_SET_ALL 8
57 struct JS_DATA_TYPE {
58   __s32 buttons;
59   __s32 x;
60   __s32 y;
61 };
62 struct JS_DATA_SAVE_TYPE_32 {
63   __s32 JS_TIMEOUT;
64   __s32 BUSY;
65   __s32 JS_EXPIRETIME;
66   __s32 JS_TIMELIMIT;
67   struct JS_DATA_TYPE JS_SAVE;
68   struct JS_DATA_TYPE JS_CORR;
69 };
70 struct JS_DATA_SAVE_TYPE_64 {
71   __s32 JS_TIMEOUT;
72   __s32 BUSY;
73   __s64 JS_EXPIRETIME;
74   __s64 JS_TIMELIMIT;
75   struct JS_DATA_TYPE JS_SAVE;
76   struct JS_DATA_TYPE JS_CORR;
77 };
78 #endif
79