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 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 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"); \ uint32_t tick
Definition: psvr_device.h:84
bool psvr_parse_sensor_packet(struct psvr_parsed_sensor *sensor, const uint8_t *buffer, int size)
Definition: psvr_packet.c:102
Definition: psvr_device.h:48
A parsed single gyro, accel and tick sample.
Definition: psvr_device.h:80
uint8_t state
Definition: psvr_device.h:95
uint8_t seq
Definition: psvr_device.h:99
uint8_t buttons
Definition: psvr_device.h:94
Header defining a xrt HMD device.
psvr_status_bits
Definition: psvr_device.h:38
Definition: psvr_device.h:43
struct xrt_vec3_i32 gyro
Definition: psvr_device.h:83
Common interface to probe for devices.
A 3 element vector with 32 bit integers.
Definition: xrt_defines.h:145
Definition: psvr_device.h:46
The main prober that probes and manages found but not opened HMD devices that are connected to the sy...
Definition: xrt_prober.h:153
struct xrt_vec3_i32 accel
Definition: psvr_device.h:82
uint16_t button_raw
Definition: psvr_device.h:97
uint8_t status
Definition: psvr_device.h:111
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:992
uint8_t display_time
Definition: psvr_device.h:113
uint16_t volume
Definition: psvr_device.h:96
Definition: psvr_device.h:47
Over the wire sensor packet from the headset.
Definition: psvr_device.h:92
Definition: psvr_device.h:44
bool psvr_parse_status_packet(struct psvr_parsed_status *status, const uint8_t *buffer, int size)
Definition: psvr_packet.c:153
A single HMD or input device.
Definition: xrt_device.h:202
Definition: psvr_device.h:42
uint8_t volume
Definition: psvr_device.h:112
uint8_t vr_mode
Definition: psvr_device.h:114
Definition: psvr_device.h:41
uint16_t proximity
Definition: psvr_device.h:98
Definition: psvr_device.h:45