Monado OpenXR Runtime
Files | Functions
PS Move driver

Driver for the Sony PlayStation Move Controller. More...

Collaboration diagram for PS Move driver:

Files

file  psmv_driver.c
 PlayStation Move motion controller prober and driver code.
 
file  psmv_interface.h
 Interface to PS Move driver.
 

Functions

int psmv_found (struct xrt_prober *xp, struct xrt_prober_device **devices, size_t num_devices, size_t index, cJSON *attached_data, struct xrt_device **out_xdevs)
 Probing function for the PS Move devices. More...
 
#define PSMV_SPEW(p, ...)
 
#define PSMV_DEBUG(p, ...)
 
#define PSMV_ERROR(p, ...)
 
#define SET_INPUT(NAME)   (psmv->base.inputs[PSMV_INDEX_##NAME].name = XRT_INPUT_PSMV_##NAME)
 
enum  psmv_input_index {
  PSMV_INDEX_PS_CLICK, PSMV_INDEX_MOVE_CLICK, PSMV_INDEX_START_CLICK, PSMV_INDEX_SELECT_CLICK,
  PSMV_INDEX_SQUARE_CLICK, PSMV_INDEX_CROSS_CLICK, PSMV_INDEX_CIRCLE_CLICK, PSMV_INDEX_TRIANGLE_CLICK,
  PSMV_INDEX_TRIGGER_VALUE, PSMV_INDEX_BODY_CENTER_POSE, PSMV_INDEX_BALL_CENTER_POSE, PSMV_INDEX_BALL_TIP_POSE
}
 Indices where each input is in the input list. More...
 
enum  psmv_button_bit {
  PSMV_BUTTON_BIT_MOVE_F2 = (1 << 6), PSMV_BUTTON_BIT_TRIGGER_F2 = (1 << 7), PSMV_BUTTON_BIT_PS = (1 << 8), PSMV_BUTTON_BIT_MOVE_F1 = (1 << 11),
  PSMV_BUTTON_BIT_TRIGGER_F1 = (1 << 12), PSMV_BUTTON_BIT_TRIANGLE = (1 << 20), PSMV_BUTTON_BIT_CIRCLE = (1 << 21), PSMV_BUTTON_BIT_CROSS = (1 << 22),
  PSMV_BUTTON_BIT_SQUARE = (1 << 23), PSMV_BUTTON_BIT_START = (1 << 27), PSMV_BUTTON_BIT_SELECT = (1 << 24), PSMV_BUTTON_BIT_MOVE_ANY,
  PSMV_BUTTON_BIT_TRIGGER_ANY
}
 Mask for the button in the button uint32_t. More...
 

Detailed Description

Driver for the Sony PlayStation Move Controller.

Macro Definition Documentation

◆ PSMV_DEBUG

#define PSMV_DEBUG (   p,
  ... 
)

#include <drivers/psmv/psmv_driver.c>

Value:
do { \
if (p->print_debug) { \
fprintf(stderr, "%s - ", __func__); \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, "\n"); \
} \
} while (false)

◆ PSMV_ERROR

#define PSMV_ERROR (   p,
  ... 
)

#include <drivers/psmv/psmv_driver.c>

Value:
do { \
fprintf(stderr, "%s - ", __func__); \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, "\n"); \
} while (false)

◆ PSMV_SPEW

#define PSMV_SPEW (   p,
  ... 
)

#include <drivers/psmv/psmv_driver.c>

Value:
do { \
if (p->print_spew) { \
fprintf(stderr, "%s - ", __func__); \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, "\n"); \
} \
} while (false)

◆ SET_INPUT

#define SET_INPUT (   NAME)    (psmv->base.inputs[PSMV_INDEX_##NAME].name = XRT_INPUT_PSMV_##NAME)

Enumeration Type Documentation

◆ psmv_button_bit

#include <drivers/psmv/psmv_driver.c>

Mask for the button in the button uint32_t.

Enumerator
PSMV_BUTTON_BIT_MOVE_F2 
PSMV_BUTTON_BIT_TRIGGER_F2 
PSMV_BUTTON_BIT_PS 
PSMV_BUTTON_BIT_MOVE_F1 
PSMV_BUTTON_BIT_TRIGGER_F1 
PSMV_BUTTON_BIT_TRIANGLE 
PSMV_BUTTON_BIT_CIRCLE 
PSMV_BUTTON_BIT_CROSS 
PSMV_BUTTON_BIT_SQUARE 
PSMV_BUTTON_BIT_START 
PSMV_BUTTON_BIT_SELECT 
PSMV_BUTTON_BIT_MOVE_ANY 
PSMV_BUTTON_BIT_TRIGGER_ANY 

◆ psmv_input_index

#include <drivers/psmv/psmv_driver.c>

Indices where each input is in the input list.

Enumerator
PSMV_INDEX_PS_CLICK 
PSMV_INDEX_MOVE_CLICK 
PSMV_INDEX_START_CLICK 
PSMV_INDEX_SELECT_CLICK 
PSMV_INDEX_SQUARE_CLICK 
PSMV_INDEX_CROSS_CLICK 
PSMV_INDEX_CIRCLE_CLICK 
PSMV_INDEX_TRIANGLE_CLICK 
PSMV_INDEX_TRIGGER_VALUE 
PSMV_INDEX_BODY_CENTER_POSE 
PSMV_INDEX_BALL_CENTER_POSE 
PSMV_INDEX_BALL_TIP_POSE 

Function Documentation

◆ psmv_found()

int psmv_found ( struct xrt_prober xp,
struct xrt_prober_device **  devices,
size_t  num_devices,
size_t  index,
cJSON attached_data,
struct xrt_device **  out_xdevs 
)

#include <drivers/psmv/psmv_interface.h>

Probing function for the PS Move devices.

Todo:
measure!
Todo:
cleanup to not leak

References PSMV_PID_ZCM1, PSMV_PID_ZCM2, and XRT_BUS_TYPE_BLUETOOTH.