Monado OpenXR Runtime
|
Driver for an OSVR Hacker Dev Kit device. More...
#include "math/m_mathinclude.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <type_traits>
#include "xrt/xrt_device.h"
#include "os/os_hid.h"
#include "os/os_time.h"
#include "math/m_api.h"
#include "util/u_debug.h"
#include "util/u_misc.h"
#include "util/u_device.h"
#include "util/u_time.h"
#include "util/u_distortion_mesh.h"
#include "hdk_device.h"
Functions | |
template<size_t INT_BITS, size_t FRAC_BITS, typename IntegerType > | |
static float | fromFixedPoint (IntegerType v) |
A fixed-point to float conversion function. More... | |
static uint16_t | hdk_get_le_uint16 (uint8_t *&bufPtr) |
static int16_t | hdk_get_le_int16 (uint8_t *&bufPtr) |
static void | hdk_device_destroy (struct xrt_device *xdev) |
static int | hdk_device_update (struct hdk_device *hd) |
static xrt_result_t | hdk_device_get_tracked_pose (struct xrt_device *xdev, enum xrt_input_name name, int64_t requested_timestamp_ns, struct xrt_space_relation *out_relation) |
static void * | hdk_device_run_thread (void *ptr) |
struct hdk_device * | hdk_device_create (struct os_hid_device *dev, enum HDK_VARIANT variant) |
Variables | |
static constexpr uint8_t | BITS_PER_BYTE = 8 |
static constexpr uint8_t | MSG_LEN_LARGE = 32 |
static constexpr uint8_t | MSG_LEN_SMALL = 16 |
Driver for an OSVR Hacker Dev Kit device.
Based in part on the corresponding VRPN driver, available under BSL-1.0.
|
inlinestatic |
A fixed-point to float conversion function.
Values are signed, two's-complement, if the supplied integer is.
The conversion is effectively from the fixed-point arithmetic type known "unambiguously" as Q INT_BITS.FRAC_BITS - the number of integer bits is not inferred, though it is checked to ensure it adds up.
INT_BITS | The number of bits devoted to the integer part. |
FRAC_BITS | The number of bits devoted to the fractional part. |
IntegerType | The input integer type, typically deduced (do not need to specify explicitly) |
v | An input "integer" that is actually a fixed-point value. |
INT_BITS and FRAC_BITS must sum to 8 * sizeof(v), the bit width of the input integer, for unsigned values, or to one less than that (for the sign bit) for signed values.
Based in part on the VRPN header vrpn_FixedPoint.h, available under BSL-1.0.
|
static |