2021-11-13 16:01:24 +00:00
|
|
|
// Copyright 2021 Jan Schmidt <jan@centricular.com>
|
|
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
|
|
/*!
|
|
|
|
* @file
|
|
|
|
* @brief Interface to read WMR cameras
|
|
|
|
* @author Jan Schmidt <jan@centricular.com>
|
|
|
|
* @ingroup drv_wmr
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "xrt/xrt_config_have.h"
|
|
|
|
#include "util/u_logging.h"
|
|
|
|
#include "xrt/xrt_prober.h"
|
|
|
|
|
|
|
|
#include "wmr_config.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct wmr_camera;
|
|
|
|
|
|
|
|
#ifdef XRT_HAVE_LIBUSB
|
|
|
|
struct wmr_camera *
|
2021-11-20 14:50:47 +00:00
|
|
|
wmr_camera_open(struct xrt_prober_device *dev_holo, enum u_logging_level log_level);
|
2021-11-13 16:01:24 +00:00
|
|
|
void
|
|
|
|
wmr_camera_free(struct wmr_camera *cam);
|
|
|
|
|
2021-11-20 13:50:54 +00:00
|
|
|
/*!
|
|
|
|
* Starts the cameras.
|
|
|
|
*
|
|
|
|
* The data pointed to by @p configs must be kept alive for as long as the camera is kept alive.
|
|
|
|
*/
|
2021-11-13 16:01:24 +00:00
|
|
|
bool
|
2021-11-20 13:50:54 +00:00
|
|
|
wmr_camera_start(struct wmr_camera *cam, const struct wmr_camera_config *configs, int config_count);
|
2021-11-13 16:01:24 +00:00
|
|
|
bool
|
|
|
|
wmr_camera_stop(struct wmr_camera *cam);
|
2021-11-14 12:06:19 +00:00
|
|
|
int
|
|
|
|
wmr_camera_set_gain(struct wmr_camera *cam, uint8_t camera_id, uint8_t exposure);
|
|
|
|
|
2021-11-13 16:01:24 +00:00
|
|
|
#else
|
|
|
|
|
|
|
|
/* Stubs to disable camera functions without libusb */
|
|
|
|
#define wmr_camera_open(dev_holo, ll) NULL
|
|
|
|
#define wmr_camera_free(cam)
|
|
|
|
#define wmr_camera_start(cam, cam_configs, n_configs) false
|
|
|
|
#define wmr_camera_stop(cam) false
|
2021-11-14 12:06:19 +00:00
|
|
|
#define wmr_camera_set_gain(cam, camera_id, exposure) -1
|
2021-11-13 16:01:24 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|