0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #ifndef _UAPI_LINUX_JOYSTICK_H
0023 #define _UAPI_LINUX_JOYSTICK_H
0024
0025
0026
0027 #include <linux/types.h>
0028 #include <linux/input.h>
0029
0030
0031
0032
0033
0034 #define JS_VERSION 0x020100
0035
0036
0037
0038
0039
0040 #define JS_EVENT_BUTTON 0x01
0041 #define JS_EVENT_AXIS 0x02
0042 #define JS_EVENT_INIT 0x80
0043
0044 struct js_event {
0045 __u32 time;
0046 __s16 value;
0047 __u8 type;
0048 __u8 number;
0049 };
0050
0051
0052
0053
0054
0055 #define JSIOCGVERSION _IOR('j', 0x01, __u32)
0056
0057 #define JSIOCGAXES _IOR('j', 0x11, __u8)
0058 #define JSIOCGBUTTONS _IOR('j', 0x12, __u8)
0059 #define JSIOCGNAME(len) _IOC(_IOC_READ, 'j', 0x13, len)
0060
0061 #define JSIOCSCORR _IOW('j', 0x21, struct js_corr)
0062 #define JSIOCGCORR _IOR('j', 0x22, struct js_corr)
0063
0064 #define JSIOCSAXMAP _IOW('j', 0x31, __u8[ABS_CNT])
0065 #define JSIOCGAXMAP _IOR('j', 0x32, __u8[ABS_CNT])
0066 #define JSIOCSBTNMAP _IOW('j', 0x33, __u16[KEY_MAX - BTN_MISC + 1])
0067 #define JSIOCGBTNMAP _IOR('j', 0x34, __u16[KEY_MAX - BTN_MISC + 1])
0068
0069
0070
0071
0072
0073 #define JS_CORR_NONE 0x00
0074 #define JS_CORR_BROKEN 0x01
0075
0076 struct js_corr {
0077 __s32 coef[8];
0078 __s16 prec;
0079 __u16 type;
0080 };
0081
0082
0083
0084
0085
0086 #define JS_RETURN sizeof(struct JS_DATA_TYPE)
0087 #define JS_TRUE 1
0088 #define JS_FALSE 0
0089 #define JS_X_0 0x01
0090 #define JS_Y_0 0x02
0091 #define JS_X_1 0x04
0092 #define JS_Y_1 0x08
0093 #define JS_MAX 2
0094
0095 #define JS_DEF_TIMEOUT 0x1300
0096 #define JS_DEF_CORR 0
0097 #define JS_DEF_TIMELIMIT 10L
0098
0099 #define JS_SET_CAL 1
0100 #define JS_GET_CAL 2
0101 #define JS_SET_TIMEOUT 3
0102 #define JS_GET_TIMEOUT 4
0103 #define JS_SET_TIMELIMIT 5
0104 #define JS_GET_TIMELIMIT 6
0105 #define JS_GET_ALL 7
0106 #define JS_SET_ALL 8
0107
0108 struct JS_DATA_TYPE {
0109 __s32 buttons;
0110 __s32 x;
0111 __s32 y;
0112 };
0113
0114 struct JS_DATA_SAVE_TYPE_32 {
0115 __s32 JS_TIMEOUT;
0116 __s32 BUSY;
0117 __s32 JS_EXPIRETIME;
0118 __s32 JS_TIMELIMIT;
0119 struct JS_DATA_TYPE JS_SAVE;
0120 struct JS_DATA_TYPE JS_CORR;
0121 };
0122
0123 struct JS_DATA_SAVE_TYPE_64 {
0124 __s32 JS_TIMEOUT;
0125 __s32 BUSY;
0126 __s64 JS_EXPIRETIME;
0127 __s64 JS_TIMELIMIT;
0128 struct JS_DATA_TYPE JS_SAVE;
0129 struct JS_DATA_TYPE JS_CORR;
0130 };
0131
0132
0133 #endif