Monado OpenXR Runtime
|
Razer Hydra prober and driver code. More...
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "xrt/xrt_prober.h"
#include "math/m_api.h"
#include "util/u_debug.h"
#include "util/u_device.h"
#include "util/u_misc.h"
#include "util/u_time.h"
#include "os/os_hid.h"
#include "hydra_interface.h"
Data Structures | |
struct | hydra_controller_state |
struct | hydra_state_machine |
The details of the Hydra state machine in a convenient package. More... | |
struct | hydra_system |
A Razer Hydra system containing two controllers. More... | |
struct | hydra_device |
A Razer Hydra device, representing just a single controller. More... | |
Macros | |
#define | HYDRA_SPEW(p, ...) |
#define | HYDRA_DEBUG(p, ...) |
#define | HYDRA_ERROR(p, ...) |
#define | SET_INPUT(NAME) |
Enumerations | |
enum | hydra_input_index { HYDRA_INDEX_1_CLICK, HYDRA_INDEX_2_CLICK, HYDRA_INDEX_3_CLICK, HYDRA_INDEX_4_CLICK, HYDRA_INDEX_MIDDLE_CLICK, HYDRA_INDEX_BUMPER_CLICK, HYDRA_INDEX_JOYSTICK_CLICK, HYDRA_INDEX_JOYSTICK_VALUE, HYDRA_INDEX_TRIGGER_VALUE, HYDRA_INDEX_POSE, HYDRA_MAX_CONTROLLER_INDEX } |
enum | hydra_button_bit { HYDRA_BUTTON_BIT_BUMPER = (1 << 0), HYDRA_BUTTON_BIT_3 = (1 << 1), HYDRA_BUTTON_BIT_1 = (1 << 2), HYDRA_BUTTON_BIT_2 = (1 << 3), HYDRA_BUTTON_BIT_4 = (1 << 4), HYDRA_BUTTON_BIT_MIDDLE = (1 << 5), HYDRA_BUTTON_BIT_JOYSTICK = (1 << 6) } |
enum | hydra_sm_state { HYDRA_SM_LISTENING_AFTER_CONNECT = 0, HYDRA_SM_LISTENING_AFTER_SET_FEATURE, HYDRA_SM_REPORTING } |
The states of the finite-state machine controlling the Hydra. More... | |
Functions | |
int | hydra_found (struct xrt_prober *xp, struct xrt_prober_device **devices, size_t num_devices, size_t index, struct xrt_device **out_xdevs) |
Probing function for Razer Hydra devices. More... | |
Razer Hydra prober and driver code.
Portions based on the VRPN Razer Hydra driver, originally written by Ryan Pavlik and available under the BSL-1.0.
#define HYDRA_DEBUG | ( | p, | |
... | |||
) |
#define HYDRA_ERROR | ( | p, | |
... | |||
) |
#define HYDRA_SPEW | ( | p, | |
... | |||
) |
#define SET_INPUT | ( | NAME | ) |
enum hydra_sm_state |
The states of the finite-state machine controlling the Hydra.