18 #include <hidapi/hidapi.h> 32 #define PSVR_VID 0x054c 33 #define PSVR_PID 0x09af 35 #define PSVR_HANDLE_IFACE 4 36 #define PSVR_CONTROL_IFACE 5 41 PSVR_STATUS_BIT_POWER = (1 << 0),
42 PSVR_STATUS_BIT_HMD_WORN = (1 << 1),
43 PSVR_STATUS_BIT_CINEMATIC_MODE = (1 << 2),
44 PSVR_STATUS_BIT_UNKNOWN_BIT_3 = (1 << 3),
45 PSVR_STATUS_BIT_HEADPHONES_CONNECTED = (1 << 4),
46 PSVR_STATUS_BIT_MUTE_ENABLED = (1 << 5),
47 PSVR_STATUS_BIT_UNKNOWN_BIT_6 = (1 << 6),
48 PSVR_STATUS_BIT_UNKNOWN_BIT_7 = (1 << 7),
52 #define PSVR_STATUS_VR_MODE_OFF 0 53 #define PSVR_STATUS_VR_MODE_ON 1 55 #define PSVR_TICKS_PER_SECOND (1000000.0) // 1 MHz ticks 56 #define PSVR_NS_PER_TICK (1000) // Each tick is a microsecond 58 #define PSVR_PKG_STATUS 0xF0 59 #define PSVR_PKG_DEVICE_NAME 0x80 60 #define PSVR_PKG_CALIBRATION 0x86 61 #define PSVR_PKG_0xA0 0xA0 62 #define PSVR_PKG_0x82 0x82 64 #define PSVR_GET_DATA_ID_DEVICE_NAME 0x80 65 #define PSVR_GET_DATA_ID_CALIBRATION 0x86 66 #define PSVR_GET_DATA_ID_0x82 0x82 113 uint8_t display_time;
126 struct hid_device_info *hmd_control_info,
133 const uint8_t *buffer,
138 const uint8_t *buffer,
148 #define PSVR_SPEW(p, ...) \ 150 if (p->print_spew) { \ 151 fprintf(stderr, "%s - ", __func__); \ 152 fprintf(stderr, __VA_ARGS__); \ 153 fprintf(stderr, "\n"); \ 156 #define PSVR_DEBUG(p, ...) \ 158 if (p->print_debug) { \ 159 fprintf(stderr, "%s - ", __func__); \ 160 fprintf(stderr, __VA_ARGS__); \ 161 fprintf(stderr, "\n"); \ 165 #define PSVR_ERROR(p, ...) \ 167 fprintf(stderr, "%s - ", __func__); \ 168 fprintf(stderr, __VA_ARGS__); \ 169 fprintf(stderr, "\n"); \ A parsed single gyro, accel and tick sample.
Definition: psvr_device.h:80
Header defining a xrt HMD device.
Common interface to probe for devices.
A 3 element vector with 32 bit integers.
Definition: xrt_defines.h:143
The main prober that probes and manages found but not opened HMD devices that are connected to the sy...
Definition: xrt_prober.h:147
A status packet from the headset in wire format.
Definition: psvr_device.h:109
struct xrt_device * psvr_device_create(struct hid_device_info *hmd_handle_info, struct hid_device_info *hmd_control_info, struct xrt_prober *xp, bool print_spew, bool print_debug)
Definition: psvr_device.c:1011
Over the wire sensor packet from the headset.
Definition: psvr_device.h:92
A single HMD or input device.
Definition: xrt_device.h:203