13#include <asm/byteorder.h>
17#define VIVE_CONTROLLER_BUTTON_REPORT_ID 0x01
19#define VIVE_CONTROLLER_USB_BUTTON_TRIGGER (1 << 0)
20#define VIVE_CONTROLLER_USB_BUTTON_GRIP (1 << 2)
21#define VIVE_CONTROLLER_USB_BUTTON_MENU (1 << 12)
22#define VIVE_CONTROLLER_USB_BUTTON_SYSTEM (1 << 13)
23#define VIVE_CONTROLLER_USB_BUTTON_THUMB (1 << 18)
24#define VIVE_CONTROLLER_USB_BUTTON_TOUCH (1 << 20)
35 uint16_t battery_voltage;
42 uint16_t trigger_hires;
46 uint8_t maybe_bitfield;
48} __attribute__((packed));
53} __attribute__((packed));
58} __attribute__((packed));
63} __attribute__((packed));
68} __attribute__((packed));
70#define VIVE_IMU_RANGE_MODES_REPORT_ID 0x01
78} __attribute__((packed));
80#define VIVE_MAINBOARD_STATUS_REPORT_ID 0x03
87 uint16_t lens_separation;
92 uint8_t proximity_change;
96 uint8_t reserved4[46];
97} __attribute__((packed));
99#define VIVE_HEADSET_POWER_REPORT_ID 0x04
101#define VIVE_HEADSET_POWER_REPORT_TYPE 0x2978
109 uint8_t reserved1[32];
111 uint8_t reserved2[18];
112} __attribute__((packed));
114#define VIVE_HEADSET_MAINBOARD_DEVICE_INFO_REPORT_ID 0x04
116#define VIVE_HEADSET_MAINBOARD_DEVICE_INFO_REPORT_TYPE 0x2987
126 uint32_t display_firmware_version;
127 uint8_t unknown2[48];
128} __attribute__((packed));
130#define VIVE_FIRMWARE_VERSION_REPORT_ID 0x05
135 uint32_t firmware_version;
139 uint8_t hardware_version_micro;
140 uint8_t hardware_version_minor;
141 uint8_t hardware_version_major;
142 uint8_t hardware_revision;
144 uint8_t fpga_version_minor;
145 uint8_t fpga_version_major;
146 uint8_t reserved[13];
147} __attribute__((packed));
149#define VIVE_CONFIG_START_REPORT_ID 0x10
155} __attribute__((packed));
157#define VIVE_CONFIG_READ_REPORT_ID 0x11
164} __attribute__((packed));
166#define VIVE_IMU_REPORT_ID 0x20
174} __attribute__((packed));
180} __attribute__((packed));
191 uint8_t timestamp_hi;
194} __attribute__((packed));
197#define TYPE_FLAG_TOUCH_FORCE 161
205 uint8_t middle_finger_handle;
206 uint8_t ring_finger_handle;
207 uint8_t pinky_finger_handle;
208 uint8_t index_finger_trigger;
210 uint8_t squeeze_force;
211 uint8_t trackpad_force;
212} __attribute__((packed));
214#define VIVE_CONTROLLER_LIGHTHOUSE_PULSE_REPORT_ID 0x21
221} __attribute__((packed));
228} __attribute__((packed));
230#define VIVE_CONTROLLER_REPORT1_ID 0x23
232#define VIVE_CONTROLLER_BATTERY_CHARGING 0x80
233#define VIVE_CONTROLLER_BATTERY_CHARGE_MASK 0x7f
235#define VIVE_CONTROLLER_BUTTON_TRIGGER 0x01
236#define VIVE_CONTROLLER_BUTTON_TOUCH 0x02
237#define VIVE_CONTROLLER_BUTTON_THUMB 0x04
238#define VIVE_CONTROLLER_BUTTON_SYSTEM 0x08
239#define VIVE_CONTROLLER_BUTTON_GRIP 0x10
240#define VIVE_CONTROLLER_BUTTON_MENU 0x20
244 uint8_t timestamp_hi;
246 uint8_t timestamp_lo;
248} __attribute__((packed));
254} __attribute__((packed));
256#define VIVE_CONTROLLER_REPORT2_ID 0x24
262} __attribute__((packed));
264#define VIVE_HEADSET_LIGHTHOUSE_PULSE_REPORT_ID 0x25
272} __attribute__((packed));
274#define VIVE_HEADSET_LIGHTHOUSE_V2_PULSE_REPORT_ID 0x27
288} __attribute__((packed));
290#define VIVE_HEADSET_LIGHTHOUSE_V2_PULSE_RAW_REPORT_ID 0x28
295} __attribute__((packed));
302} __attribute__((packed));
308} __attribute__((packed));
310#define VIVE_CONTROLLER_DISCONNECT_REPORT_ID 0x26
312#define VIVE_CONTROLLER_COMMAND_REPORT_ID 0xff
314#define VIVE_CONTROLLER_HAPTIC_PULSE_COMMAND 0x8f
324 uint16_t repeat_count;
325} __attribute__((packed));
327#define VIVE_CONTROLLER_POWEROFF_COMMAND 0x9f
335} __attribute__((packed));
344vive_get_imu_range_report(
struct os_hid_device *hid_dev,
double *gyro_range,
double *acc_range);
348 uint32_t *firmware_version,
349 uint8_t *hardware_revision,
350 uint8_t *hardware_version_micro,
351 uint8_t *hardware_version_minor,
352 uint8_t *hardware_version_major);
Wrapper around OS native hid functions.
Representing a single hid interface on a device.
Definition: os_hid.h:29
Definition: vive_protocol.h:160
Definition: vive_protocol.h:152
Definition: vive_protocol.h:66
Definition: vive_protocol.h:317
Definition: vive_protocol.h:224
Definition: vive_protocol.h:217
Definition: vive_protocol.h:243
Definition: vive_protocol.h:330
Definition: vive_protocol.h:251
Definition: vive_protocol.h:259
Definition: vive_protocol.h:51
Definition: vive_protocol.h:56
Definition: vive_protocol.h:133
Definition: vive_protocol.h:305
Definition: vive_protocol.h:298
Definition: vive_protocol.h:293
Definition: vive_protocol.h:277
Definition: vive_protocol.h:267
Definition: vive_protocol.h:119
Definition: vive_protocol.h:104
Definition: vive_protocol.h:73
Definition: vive_protocol.h:177
Definition: vive_protocol.h:169
Definition: vive_protocol.h:83
Definition: vive_protocol.h:183
Definition: vive_protocol.h:199