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

Implementation of mt9v034 sensor initialization. More...

#include "util/u_logging.h"
#include "esp570.h"
#include "mt9v034.h"
#include <errno.h>
#include <string.h>
Include dependency graph for mt9v034.c:

Macros

#define MT9V034_CHIP_VERSION   0x00
 
#define MT9V034_WINDOW_HEIGHT   0x03
 
#define MT9V034_WINDOW_WIDTH   0x04
 
#define MT9V034_HORIZONTAL_BLANKING   0x05
 
#define MT9V034_VERTICAL_BLANKING   0x06
 
#define MT9V034_CHIP_CONTROL   0x07
 
#define MT9V034_COARSE_SHUTTER_WIDTH_TOTAL   0x0b
 
#define MT9V034_READ_MODE   0x0d
 
#define MT9V034_LED_OUT_CONTROL   0x1b
 
#define MT9V034_ANALOG_GAIN   0x35
 
#define MT9V034_BLACK_LEVEL_CALIB_CTRL   0x47
 
#define MT9V034_BLACK_LEVEL_CALIB_VALUE   0x48
 
#define MT9V034_AEC_AGC_ENABLE   0xaf
 
#define MT9V034_MAX_TOTAL_SHUTTER_WIDTH   0xbd
 
#define MT9V034_FINE_SHUTTER_WIDTH_TOTAL   0xd5
 
#define MT9V034_ANALOG_GAIN_MIN   16
 
#define MT9V034_CHIP_CONTROL_MASTER_MODE   (1 << 3)
 
#define MT9V034_CHIP_CONTROL_SNAPSHOT_MODE   (3 << 3)
 
#define MT9V034_CHIP_CONTROL_DOUT_ENABLE   (1 << 7)
 
#define MT9V034_CHIP_CONTROL_SEQUENTIAL   (1 << 8)
 
#define MT9V032_READ_MODE_RESERVED   0x300
 
#define MT9V034_READ_MODE_ROW_FLIP   (1 << 4)
 
#define MT9V034_READ_MODE_COLUMN_FLIP   (1 << 5)
 
#define MT9V034_BLACK_LEVEL_CALIB_OVERRIDE   (1 << 0)
 
#define MT9V034_LED_OUT_DISABLE   (1 << 0)
 
#define MT9V034_LED_OUT_INVERT   (1 << 1)
 
#define MT9V034_I2C_ADDR   0x4c
 

Functions

static int mt9v034_read_reg (libusb_device_handle *devh, uint8_t reg, uint16_t *val)
 
static int mt9v034_write_reg (libusb_device_handle *devh, uint8_t reg, uint16_t val)
 
static int mt9v034_enable_sync (libusb_device_handle *devh)
 
static int mt9v034_disable_sync (libusb_device_handle *devh)
 
int mt9v034_setup (libusb_device_handle *devh)
 Sets up the MT9V034 sensor for synchronized exposure, with minimal gain and raised black level calibration.
 
int mt9v034_set_sync (libusb_device_handle *devh, bool enabled)
 Enables or disables the MT9V034's sync output.
 

Detailed Description

Function Documentation

◆ mt9v034_set_sync()

int mt9v034_set_sync ( libusb_device_handle *  devh,
bool  enabled 
)

Enables or disables the MT9V034's sync output.

Parameters
[in]devhlibusb device handle
[in]enabledWhether to enable or disable the sync output
Returns
0 on success, negative error code on failure

◆ mt9v034_setup()

int mt9v034_setup ( libusb_device_handle *  devh)

Sets up the MT9V034 sensor for synchronized exposure, with minimal gain and raised black level calibration.

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