Monado OpenXR Runtime
rift_internal.h File Reference

Interface to Oculus Rift driver code. More...

#include "util/u_device.h"
#include "util/u_logging.h"
#include "math/m_imu_3dof.h"
#include "math/m_api.h"
#include "math/m_mathinclude.h"
#include "os/os_hid.h"
#include "os/os_threading.h"
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "rift_interface.h"
Include dependency graph for rift_internal.h:

Go to the source code of this file.

Data Structures

struct  rift_config_report
 
struct  rift_display_info_report
 
struct  rift_catmull_rom_distortion_report_data
 
struct  rift_lens_distortion_report
 
struct  rift_dk2_keepalive_mux_report
 
struct  rift_display_report
 
struct  rift_dk2_sensor_sample
 
struct  rift_dk2_sample_pack
 
struct  rift_dk2_version_data
 
struct  rift_cv1_version_data
 
struct  dk2_in_report
 
struct  rift_enable_components_report
 
struct  rift_imu_calibration_report
 
struct  rift_catmull_rom_distortion_data
 
struct  rift_lens_distortion
 
struct  rift_scale_and_offset
 
struct  rift_viewport_fov_tan
 
struct  rift_extra_display_info
 
struct  rift_imu_calibration
 
struct  rift_hmd
 A rift HMD device. More...
 

Macros

#define HMD_TRACE(hmd, ...)   U_LOG_XDEV_IFL_T(&hmd->base, hmd->log_level, __VA_ARGS__)
 
#define HMD_DEBUG(hmd, ...)   U_LOG_XDEV_IFL_D(&hmd->base, hmd->log_level, __VA_ARGS__)
 
#define HMD_INFO(hmd, ...)   U_LOG_XDEV_IFL_I(&hmd->base, hmd->log_level, __VA_ARGS__)
 
#define HMD_WARN(hmd, ...)   U_LOG_XDEV_IFL_W(&hmd->base, hmd->log_level, __VA_ARGS__)
 
#define HMD_ERROR(hmd, ...)   U_LOG_XDEV_IFL_E(&hmd->base, hmd->log_level, __VA_ARGS__)
 
#define REPORT_MAX_SIZE   69
 
#define KEEPALIVE_INTERVAL_NS   10000000000
 
#define KEEPALIVE_SEND_RATE_NS   ((KEEPALIVE_INTERVAL_NS * 19) / 20)
 
#define IMU_SAMPLE_RATE   (1000)
 
#define NS_PER_SAMPLE   (1000 * 1000)
 
#define MICROMETERS_TO_METERS(microns)   ((float)microns / 1000000.0f)
 
#define DEFAULT_EXTRA_EYE_ROTATION   DEG_TO_RAD(30.0f)
 
#define IN_REPORT_DK2   11
 
#define SIZE_ASSERT(type, size)    static_assert(sizeof(type) == (size), "Size of " #type " is not " #size " bytes as was expected")
 
#define CATMULL_COEFFICIENTS   11
 
#define CHROMATIC_ABBERATION_COEFFEICENT_COUNT   4
 
#define DK2_MAX_SAMPLES   2
 

Enumerations

enum  rift_feature_reports {
  FEATURE_REPORT_CONFIG = 2 , FEATURE_REPORT_CALIBRATE = 3 , FEATURE_REPORT_RANGE = 4 , FEATURE_REPORT_REGISTER = 5 ,
  FEATURE_REPORT_DFU = 6 , FEATURE_REPORT_DK1_KEEP_ALIVE = 8 , FEATURE_REPORT_DISPLAY_INFO = 9 , FEATURE_REPORT_SERIAL = 10 ,
  FEATURE_REPORT_TRACKING = 12 , FEATURE_REPORT_DISPLAY = 13 , FEATURE_REPORT_MAG_CALIBRATION = 14 , FEATURE_REPORT_POS_CALIBRATION = 15 ,
  FEATURE_REPORT_CUSTOM_PATTERN = 16 , FEATURE_REPORT_KEEPALIVE_MUX = 17 , FEATURE_REPORT_MANUFACTURING = 18 , FEATURE_REPORT_UUID = 19 ,
  FEATURE_REPORT_TEMPERATURE = 20 , FEATURE_REPORT_GYROOFFSET = 21 , FEATURE_REPORT_LENS_DISTORTION = 22 , FEATURE_REPORT_RADIO_CONTROL = 26 ,
  FEATURE_REPORT_RADIO_READ_DATA_CMD = 27 , FEATURE_REPORT_ENABLE_COMPONENTS = 29
}
 
enum  rift_config_report_flags {
  RIFT_CONFIG_REPORT_USE_RAW = 1 , RIFT_CONFIG_REPORT_INTERNAL_CALIBRATION = 1 << 1 , RIFT_CONFIG_REPORT_USE_CALIBRATION = 1 << 2 , RIFT_CONFIG_REPORT_AUTO_CALIBRATION = 1 << 3 ,
  RIFT_CONFIG_REPORT_MOTION_KEEP_ALIVE = 1 << 4 , RIFT_CONFIG_REPORT_COMMAND_KEEP_ALIVE = 1 << 5 , RIFT_CONFIG_REPORT_USE_SENSOR_COORDINATES = 1 << 6 , RIFT_CONFIG_REPORT_OVERRIDE_POWER = 1 << 7
}
 
enum  rift_distortion_type { RIFT_DISTORTION_TYPE_DIMS = 1 , RIFT_DISTORTION_TYPE_K = 2 }
 
enum  rift_lens_type { RIFT_LENS_TYPE_A = 0 , RIFT_LENS_TYPE_B = 1 }
 
enum  rift_lens_distortion_version { RIFT_LENS_DISTORTION_NONE = 0 , RIFT_LENS_DISTORTION_LCSV_CATMULL_ROM_10_VERSION_1 = 1 }
 
enum  rift_component_flags { RIFT_COMPONENT_DISPLAY = 1 << 0 , RIFT_COMPONENT_AUDIO = 1 << 1 , RIFT_COMPONENT_LEDS = 1 << 2 }
 
enum  rift_display_mode { RIFT_DISPLAY_MODE_GLOBAL , RIFT_DISPLAY_MODE_ROLLING_TOP_BOTTOM , RIFT_DISPLAY_MODE_ROLLING_LEFT_RIGHT , RIFT_DISPLAY_MODE_ROLLING_RIGHT_LEFT }
 
enum  rift_display_limit { RIFT_DISPLAY_LIMIT_ACL_OFF = 0 , RIFT_DISPLAY_LIMIT_ACL_30 = 1 , RIFT_DISPLAY_LIMIT_ACL_25 = 2 , RIFT_DISPLAY_LIMIT_ACL_50 = 3 }
 
enum  rift_display_flags {
  RIFT_DISPLAY_USE_ROLLING = 1 << 6 , RIFT_DISPLAY_REVERSE_ROLLING = 1 << 7 , RIFT_DISPLAY_HIGH_BRIGHTNESS = 1 << 8 , RIFT_DISPLAY_SELF_REFRESH = 1 << 9 ,
  RIFT_DISPLAY_READ_PIXEL = 1 << 10 , RIFT_DISPLAY_DIRECT_PENTILE = 1 << 11
}
 

Functions

static struct rift_hmdrift_hmd (struct xrt_device *xdev)
 Casting helper function. More...
 

Detailed Description

Interface to Oculus Rift driver code.

Author
Beyley Cardellio ep1cm.nosp@m.1n10.nosp@m.n123@.nosp@m.gmai.nosp@m.l.com

Function Documentation

◆ rift_hmd()

static struct rift_hmd * rift_hmd ( struct xrt_device xdev)
inlinestatic

Casting helper function.