d/psmv: Add device bindings

This commit is contained in:
Jakob Bornecrantz 2020-11-03 19:04:58 +00:00
parent 24a3886e85
commit 12df35232a

View file

@ -966,6 +966,34 @@ psmv_device_set_output(struct xrt_device *xdev,
}
/*
*
* Bindings
*
*/
static struct xrt_binding_input_pair simple_inputs[4] = {
{XRT_INPUT_SIMPLE_SELECT_CLICK, XRT_INPUT_PSMV_TRIGGER_VALUE},
{XRT_INPUT_SIMPLE_MENU_CLICK, XRT_INPUT_PSMV_MOVE_CLICK},
{XRT_INPUT_SIMPLE_GRIP_POSE, XRT_INPUT_PSMV_GRIP_POSE},
{XRT_INPUT_SIMPLE_AIM_POSE, XRT_INPUT_PSMV_AIM_POSE},
};
static struct xrt_binding_output_pair simple_outputs[1] = {
{XRT_OUTPUT_NAME_SIMPLE_VIBRATION, XRT_OUTPUT_NAME_PSMV_RUMBLE_VIBRATION},
};
static struct xrt_binding_profile binding_profiles[1] = {
{
.name = XRT_DEVICE_SIMPLE_CONTROLLER,
.inputs = simple_inputs,
.num_inputs = ARRAY_SIZE(simple_inputs),
.outputs = simple_outputs,
.num_outputs = ARRAY_SIZE(simple_outputs),
},
};
/*
*
* Prober functions.
@ -1011,6 +1039,8 @@ psmv_found(struct xrt_prober *xp,
psmv->base.get_tracked_pose = psmv_device_get_tracked_pose;
psmv->base.set_output = psmv_device_set_output;
psmv->base.name = XRT_DEVICE_PSMV;
psmv->base.binding_profiles = binding_profiles;
psmv->base.num_binding_profiles = ARRAY_SIZE(binding_profiles);
psmv->fusion.rot.w = 1.0f;
psmv->fusion.fusion = imu_fusion_create();
psmv->log_level = debug_get_log_option_psmv_log();