Monado OpenXR Runtime
Loading...
Searching...
No Matches
Pimax P2 HMD driver

Driver for the HID device of Pimax P2 HMDs. More...

Collaboration diagram for Pimax P2 HMD driver:

Files

file  pimax_p2.c
 Pimax P2 driver implementation.
 
file  pimax_p2.h
 Pimax P2 driver header - inherits xrt_device.
 

Functions

bool pimax_p2_init (struct pimax_p2_device **pdev)
 Initializes the Pimax HID device, enables the displays, and allocates and populates pdev with data.
 
bool pimax_p2_setup_hmd (struct pimax_p2_device *pdev, struct xrt_hmd_parts *hmd)
 Fills the xrt_hmd_parts with data.
 
xrt_result_t pimax_p2_get_view_poses (struct pimax_p2_device *dev, const struct xrt_vec3 *default_eye_relation, struct xrt_hmd_parts *hmd, uint32_t view_count, struct xrt_fov *out_fovs, struct xrt_pose *out_poses)
 Like xrt_device->get_view_poses, but does not fill in the head relation.
 
xrt_result_t pimax_p2_compute_distortion_from_mesh (struct pimax_p2_device *dev, uint32_t view, float u, float v, struct xrt_uv_triplet *out_result)
 Compute distortion, using the mesh loaded by init.
 
xrt_result_t pimax_p2_get_brightness (struct pimax_p2_device *dev, float *out_brightness)
 Get backlight brightness from 0 to 1.
 
xrt_result_t pimax_p2_set_brightness (struct pimax_p2_device *dev, float brightness, bool relative)
 Set backlight brightness from 0 to 1.
 
void pimax_p2_destroy (struct pimax_p2_device *dev)
 Clean up a pimax_p2_device.
 

Detailed Description

Driver for the HID device of Pimax P2 HMDs.

Function Documentation

◆ pimax_p2_compute_distortion_from_mesh()

xrt_result_t pimax_p2_compute_distortion_from_mesh ( struct pimax_p2_device *  dev,
uint32_t  view,
float  u,
float  v,
struct xrt_uv_triplet *  out_result 
)

#include <drivers/pimax_p2/pimax_p2.h>

Compute distortion, using the mesh loaded by init.

References XRT_SUCCESS.

◆ pimax_p2_destroy()

void pimax_p2_destroy ( struct pimax_p2_device *  dev)

#include <drivers/pimax_p2/pimax_p2.h>

Clean up a pimax_p2_device.

References U_LOG_D.

◆ pimax_p2_get_brightness()

xrt_result_t pimax_p2_get_brightness ( struct pimax_p2_device *  dev,
float *  out_brightness 
)

#include <drivers/pimax_p2/pimax_p2.h>

Get backlight brightness from 0 to 1.

References XRT_SUCCESS.

◆ pimax_p2_get_view_poses()

xrt_result_t pimax_p2_get_view_poses ( struct pimax_p2_device *  dev,
const struct xrt_vec3 *  default_eye_relation,
struct xrt_hmd_parts *  hmd,
uint32_t  view_count,
struct xrt_fov *  out_fovs,
struct xrt_pose *  out_poses 
)

#include <drivers/pimax_p2/pimax_p2.h>

Like xrt_device->get_view_poses, but does not fill in the head relation.

Tracking must be handled separately.

References ARRAY_SIZE, xrt_hmd_parts::distortion, xrt_hmd_parts::fov, xrt_hmd_parts::views, xrt_pose::XRT_POSE_IDENTITY, and XRT_SUCCESS.

◆ pimax_p2_init()

bool pimax_p2_init ( struct pimax_p2_device **  pdev)

#include <drivers/pimax_p2/pimax_p2.h>

Initializes the Pimax HID device, enables the displays, and allocates and populates pdev with data.

Should be called before lighthouse init. If no Pimax P2 HID is found or an error occurs, returns false.

References os_nanosleep(), and u_var_add_root().

Referenced by steamvr_lh_create_devices().

◆ pimax_p2_set_brightness()

xrt_result_t pimax_p2_set_brightness ( struct pimax_p2_device *  dev,
float  brightness,
bool  relative 
)

#include <drivers/pimax_p2/pimax_p2.h>

Set backlight brightness from 0 to 1.

References CLAMP, XRT_ERROR_USB_COMMAND_FAILED, and XRT_SUCCESS.

◆ pimax_p2_setup_hmd()

bool pimax_p2_setup_hmd ( struct pimax_p2_device *  pdev,
struct xrt_hmd_parts *  hmd 
)

#include <drivers/pimax_p2/pimax_p2.h>

Fills the xrt_hmd_parts with data.