Monado OpenXR Runtime
Loading...
Searching...
No Matches
esp770u.c File Reference

Implementation of esp770u sensor initialization. More...

#include "util/u_logging.h"
#include "uvc/uvc_interface.h"
#include "esp770u.h"
#include <errno.h>
#include <string.h>
Include dependency graph for esp770u.c:

Macros

#define ESP770U_EXTENSION_UNIT   4
 
#define ESP770U_SELECTOR_I2C   2
 
#define ESP770U_SELECTOR_REG   3
 
#define ESP770U_SELECTOR_COUNTER   10
 
#define ESP770U_SELECTOR_CONTROL   11
 
#define ESP770U_SELECTOR_DATA   12
 
#define XU_ENTITY   ESP770U_EXTENSION_UNIT
 
#define REG_SEL   ESP770U_SELECTOR_REG
 
#define CONTROL_SEL   ESP770U_SELECTOR_CONTROL
 
#define DATA_SEL   ESP770U_SELECTOR_DATA
 
#define ESP_DEBUG   0
 
#define esp770u_read_reg(d, r, v)   rift_sensor_esp770u_read_reg((d), 0xf0, (r), (v))
 
#define esp770u_read_reg_f1(d, r, v)   rift_sensor_esp770u_read_reg((d), 0xf1, (r), (v))
 
#define esp770u_write_reg(d, r, v)   rift_sensor_esp770u_write_reg((d), 0xf0, (r), (v))
 
#define esp770u_write_reg_f1(d, r, v)   rift_sensor_esp770u_write_reg((d), 0xf1, (r), (v))
 

Functions

static int set_get_verify_a0 (libusb_device_handle *dev, uint8_t val, uint8_t retval)
 
static int esp770u_get_counter (libusb_device_handle *devh, uint8_t *count)
 
static int esp770u_set_counter (libusb_device_handle *devh, uint8_t count)
 
static int esp770u_spi_set_control (libusb_device_handle *devh, uint8_t a, size_t len)
 
static int esp770u_spi_set_data (libusb_device_handle *devh, uint8_t *data, size_t len)
 
static int esp770u_spi_get_data (libusb_device_handle *devh, uint8_t *data, size_t len)
 
static int radio_write (libusb_device_handle *devhandle, const uint8_t *buf, size_t len)
 
static int rift_sensor_esp770u_read_reg (libusb_device_handle *dev, uint8_t reg_block, uint8_t reg, uint8_t *val)
 
static int rift_sensor_esp770u_write_reg (libusb_device_handle *dev, uint8_t reg_block, uint8_t reg, uint8_t val)
 
int rift_sensor_esp770u_flash_read (libusb_device_handle *devh, uint32_t addr, uint8_t *data, uint16_t len)
 Reads a buffer from the flash storage.
 
int rift_sensor_esp770u_setup_radio (libusb_device_handle *devhandle, const uint8_t radio_id[5])
 Sets up the radio with the given ID.
 
int rift_sensor_esp770u_init_regs (libusb_device_handle *devhandle)
 Initial register setup, only after camera plugin.
 
int rift_sensor_esp770u_init_jpeg (libusb_device_handle *devhandle)
 Extra initialisation sent after UVC config when in USB2 / MJPEG mode.
 

Detailed Description

Function Documentation

◆ rift_sensor_esp770u_flash_read()

int rift_sensor_esp770u_flash_read ( libusb_device_handle *  devh,
uint32_t  addr,
uint8_t *  data,
uint16_t  len 
)

Reads a buffer from the flash storage.

Parameters
[in]devhlibusb device handle
[in]addrAddress to read from
[out]dataBuffer to read into
[in]lenNumber of bytes to read
Returns
0 on success, negative error code on failure

◆ rift_sensor_esp770u_init_jpeg()

int rift_sensor_esp770u_init_jpeg ( libusb_device_handle *  devhandle)

Extra initialisation sent after UVC config when in USB2 / MJPEG mode.

Parameters
[in]devhandlelibusb device handle
Returns
0 on success, negative error code on failure

◆ rift_sensor_esp770u_init_regs()

int rift_sensor_esp770u_init_regs ( libusb_device_handle *  devhandle)

Initial register setup, only after camera plugin.

Parameters
[in]devhandlelibusb device handle
Returns
0 on success, negative error code on failure

References U_LOG_W.

◆ rift_sensor_esp770u_setup_radio()

int rift_sensor_esp770u_setup_radio ( libusb_device_handle *  devhandle,
const uint8_t  radio_id[5] 
)

Sets up the radio with the given ID.

Parameters
[in]devhandlelibusb device handle
[in]radio_id5-byte radio ID
Returns
0 on success, negative error code on failure