|
Monado OpenXR Runtime
|
Implementation of esp570 sensor initialization. More...
#include "util/u_logging.h"#include "uvc/uvc_interface.h"#include "esp570.h"#include <string.h>#include <errno.h>
Macros | |
| #define | ESP570_EXTENSION_UNIT 4 |
| #define | ESP570_SELECTOR_I2C 2 |
| #define | ESP570_SELECTOR_UNKNOWN_3 3 |
| #define | ESP570_SELECTOR_EEPROM 5 |
Functions | |
| static int | uvc_xu_set_get_cur (libusb_device_handle *devh, int selector, uint8_t *buf, uint8_t len) |
| Calls SET_CUR and then GET_CUR on a given selector of the eSP570 UVC extension unit. | |
| int | esp570_eeprom_read (libusb_device_handle *devh, uint16_t addr, uint8_t *data, uint8_t len) |
| Reads a buffer from the Microchip 24AA128 EEPROM. | |
| int | esp570_i2c_read (libusb_device_handle *devh, uint8_t addr, uint8_t reg, uint16_t *val) |
| Performs a 16-bit read operation on the I2C bus. | |
| int | esp570_i2c_write (libusb_device_handle *devh, uint8_t addr, uint8_t reg, uint16_t val) |
| Performs a 16-bit write operation on the I2C bus. | |
| int | esp570_setup_unknown_3 (libusb_device_handle *devh) |
| Calls SET_CUR and GET_CUR on the extension unit's selector 3 with values captured from the Oculus Windows drivers to setup the device. | |
Implementation of esp570 sensor initialization.
| int esp570_eeprom_read | ( | libusb_device_handle * | devh, |
| uint16_t | addr, | ||
| uint8_t * | buf, | ||
| uint8_t | len | ||
| ) |
Reads a buffer from the Microchip 24AA128 EEPROM.
| [in] | devh | libusb device handle |
| [in] | addr | Address to read from |
| [out] | buf | Buffer to read into |
| [in] | len | Number of bytes to read (max 32) |
References U_LOG_E, and uvc_xu_set_get_cur().
| int esp570_i2c_read | ( | libusb_device_handle * | devh, |
| uint8_t | addr, | ||
| uint8_t | reg, | ||
| uint16_t * | val | ||
| ) |
Performs a 16-bit read operation on the I2C bus.
| [in] | devh | libusb device handle |
| [in] | addr | I2C address |
| [in] | reg | Register to read from |
| [out] | val | Value read |
References U_LOG_W, and uvc_xu_set_get_cur().
| int esp570_i2c_write | ( | libusb_device_handle * | devh, |
| uint8_t | addr, | ||
| uint8_t | reg, | ||
| uint16_t | val | ||
| ) |
Performs a 16-bit write operation on the I2C bus.
| [in] | devh | libusb device handle |
| [in] | addr | I2C address |
| [in] | reg | Register to write to |
| [in] | val | Value to write |
References U_LOG_W, and uvc_xu_set_get_cur().
| int esp570_setup_unknown_3 | ( | libusb_device_handle * | devh | ) |
Calls SET_CUR and GET_CUR on the extension unit's selector 3 with values captured from the Oculus Windows drivers to setup the device.
I have no idea what these mean.
| [in] | devh | libusb device handle |
References U_LOG_W, and uvc_xu_set_get_cur().
|
static |
Calls SET_CUR and then GET_CUR on a given selector of the eSP570 UVC extension unit.
| [in] | devh | libusb device handle |
| [in] | selector | Selector to call on |
| [in] | buf | Buffer to send with SET_CUR, and receive with GET_CUR |
| [in] | len | Length of the buffer |
References U_LOG_E.
Referenced by esp570_eeprom_read(), esp570_i2c_read(), esp570_i2c_write(), and esp570_setup_unknown_3().