mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
sensors/gc2145: Add functions to disable AWB/AEC.
* Note these functions currently have no support for setting exposure_us or gain.
This commit is contained in:
parent
4921275987
commit
dbb6f9eafe
@ -883,6 +883,26 @@ static int set_vflip(sensor_t *sensor, int enable)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int set_auto_exposure(sensor_t *sensor, int enable, int exposure_us)
|
||||||
|
{
|
||||||
|
int ret = 0;
|
||||||
|
uint8_t reg;
|
||||||
|
ret |= cambus_writeb(&sensor->bus, sensor->slv_addr, 0xFE, 0x00);
|
||||||
|
ret |= cambus_readb(&sensor->bus, sensor->slv_addr, 0xb6, ®);
|
||||||
|
ret |= cambus_writeb(&sensor->bus, sensor->slv_addr, 0xb6, (reg & 0xFE) | (enable & 0x01)) ;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int set_auto_whitebal(sensor_t *sensor, int enable, float r_gain_db, float g_gain_db, float b_gain_db)
|
||||||
|
{
|
||||||
|
int ret = 0;
|
||||||
|
uint8_t reg;
|
||||||
|
ret |= cambus_writeb(&sensor->bus, sensor->slv_addr, 0xFE, 0x00);
|
||||||
|
ret |= cambus_readb(&sensor->bus, sensor->slv_addr, 0x82, ®);
|
||||||
|
ret |= cambus_writeb(&sensor->bus, sensor->slv_addr, 0x82, (reg & 0xFD) | ((enable & 0x01) << 1));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
int gc2145_init(sensor_t *sensor)
|
int gc2145_init(sensor_t *sensor)
|
||||||
{
|
{
|
||||||
// Initialize sensor structure.
|
// Initialize sensor structure.
|
||||||
@ -894,6 +914,8 @@ int gc2145_init(sensor_t *sensor)
|
|||||||
sensor->set_framesize = set_framesize;
|
sensor->set_framesize = set_framesize;
|
||||||
sensor->set_hmirror = set_hmirror;
|
sensor->set_hmirror = set_hmirror;
|
||||||
sensor->set_vflip = set_vflip;
|
sensor->set_vflip = set_vflip;
|
||||||
|
sensor->set_auto_exposure = set_auto_exposure;
|
||||||
|
sensor->set_auto_whitebal = set_auto_whitebal;
|
||||||
|
|
||||||
// Set sensor flags
|
// Set sensor flags
|
||||||
sensor->hw_flags.vsync = 0;
|
sensor->hw_flags.vsync = 0;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user