sync(system): update front board system configuration.

This commit is contained in:
kangjun
2024-05-14 11:30:40 +08:00
parent 643879bc1e
commit 47b4c1d7b2
57 changed files with 19610 additions and 3891 deletions

View File

@@ -40,7 +40,7 @@
#define SENSOR_NAME_2 "ov02b1b_mipi"
#define SENSOR_1600x1200_30FPS 1
#define SENSOR_1280x720_30FPS 1
#define SENSOR_1280x720_30FPS 0
#define SENSOR_1280x720_15FPS 0
#define SENSOR_800x600_15FPS 0
#define SENSOR_640x480_15FPS 0
@@ -193,6 +193,7 @@ static struct regval_list sensor_1600x1200_30fps_regs[] = {
{0xfd, 0x01},
{0x0e, 0x02},
{0x0f, 0x1a},
{0x12, 0x01}, //mirror and flip
{0x18, 0x00},
{0x22, 0xff},
{0x23, 0x02},
@@ -711,10 +712,9 @@ static int sensor_s_exp_gain(int id, struct sensor_exp_gain *exp_gain)
/*
* Stuff that knows about the sensor.
*/
static int pwdn_flag = 0;
static int sensor_power(int id, int on)
{
sensor_dbg("sensor_power \n");
if (on && (sensor_power_count[id])++ > 0)
return 0;
else if (!on && (sensor_power_count[id] == 0 || --(sensor_power_count[id]) > 0))
@@ -723,23 +723,19 @@ static int sensor_power(int id, int on)
switch (on) {
case PWR_ON:
sensor_dbg("PWR_ON!\n");
#if 1
//if((id==0 && sensor_power_count[1]==0) || (id==1 && sensor_power_count[0]==0)) {
hal_gpio_set_direction(GPIOD(2), GPIO_DIRECTION_OUTPUT);
hal_gpio_set_data(GPIOD(2), GPIO_DATA_HIGH);
hal_gpio_set_direction(GPIOF(3), GPIO_DIRECTION_OUTPUT);
hal_gpio_set_data(GPIOF(3), GPIO_DATA_HIGH);
hal_gpio_set_direction(GPIOF(4), GPIO_DIRECTION_OUTPUT);
hal_gpio_set_data(GPIOF(4), GPIO_DATA_HIGH);
// hal_gpio_set_direction(GPIOH(0), GPIO_DIRECTION_OUTPUT);
// hal_gpio_set_data(GPIOH(0), GPIO_DATA_LOW);
//}
#endif
if (pwdn_flag == 0)
{
pwdn_flag = 1;
vin_gpio_set_status(id, PWDN, 1);
}
vin_gpio_set_status(id, PWDN, 1);
// vin_gpio_set_status(id, PWDN, 1);
vin_gpio_set_status(id, RESET, 1);
vin_gpio_write(id, PWDN, CSI_GPIO_LOW);
vin_gpio_set_status(id, IR_LED, 1);
// vin_gpio_write(id, PWDN, CSI_GPIO_LOW);
vin_gpio_write(id, RESET, CSI_GPIO_LOW);
vin_gpio_write(id, IR_LED, CSI_GPIO_HIGH);
hal_usleep(5000);
vin_set_mclk_freq(id, MCLK);
@@ -757,13 +753,7 @@ static int sensor_power(int id, int on)
vin_gpio_write(id, RESET, CSI_GPIO_LOW);
vin_set_mclk(id, 0);
vin_gpio_write(id, PWDN, CSI_GPIO_LOW);
//if(sensor_power_count[0]==0 && sensor_power_count[1]==0) {
// hal_gpio_set_data(GPIOD(2), GPIO_DATA_LOW);
// hal_gpio_set_data(GPIOF(3), GPIO_DATA_LOW);
// hal_gpio_set_data(GPIOF(4), GPIO_DATA_LOW);
//}
// vin_gpio_write(id, PWDN, CSI_GPIO_LOW);
break;
default:
@@ -774,6 +764,7 @@ static int sensor_power(int id, int on)
static int sensor_set_ir(int id, int status)
{
#if 0
vin_gpio_set_status(id, IR_LED, 1);
switch (status) {
case IR_DAY:
@@ -785,6 +776,7 @@ static int sensor_set_ir(int id, int status)
default:
return -1;
}
#endif
return 0;
}
@@ -829,7 +821,8 @@ static struct sensor_format_struct sensor_formats[] = {
#if SENSOR_1600x1200_30FPS
/* 1600x1200 30fps */
{
.mbus_code = MEDIA_BUS_FMT_SRGGB10_1X10,//MEDIA_BUS_FMT_SBGGR10_1X10,
//.mbus_code = MEDIA_BUS_FMT_SRGGB10_1X10,//MEDIA_BUS_FMT_SBGGR10_1X10,
.mbus_code = MEDIA_BUS_FMT_SGRBG10_1X10,//MEDIA_BUS_FMT_SBGGR10_1X10,//MEDIA_BUS_FMT_SBGGR10_1X10,
.width = 1600,
.height = 1200,
.hoffset = 0,
@@ -936,7 +929,6 @@ static struct sensor_format_struct *sensor_get_format(int id, int isp_id)
int fps = isp_get_cfg[ispid].sensor_get_fps;
int i;
sensor_print("%s(), %d, id:%d, ispid:%d\n", __func__, __LINE__, id, ispid);
if (current_win[id])
return current_win[id];
@@ -949,11 +941,10 @@ static struct sensor_format_struct *sensor_get_format(int id, int isp_id)
}
}
}
sensor_print("%s(), %d, id:%d, ispid:%d\n", __func__, __LINE__, id, ispid);
if (sensor_format == NULL) {
for (i = 0; i < ARRAY_SIZE(sensor_formats); i++) {
sensor_print("%s(), %d, ispid:%d, width:%d\n", __func__, __LINE__, ispid, sensor_formats[i].width);
if (sensor_formats[i].wdr_mode == wdr_on && ((ispid == 0 && sensor_formats[i].width == 1280) || (ispid == 1 && sensor_formats[i].width == 1600))) {
if (sensor_formats[i].wdr_mode == wdr_on) {
sensor_format = &sensor_formats[i];
isp_get_cfg[ispid].sensor_get_fps = sensor_format->fps_fixed;
sensor_print("fine wdr is %d, use fps is %d\n", wdr_on, sensor_format->fps_fixed);
@@ -961,14 +952,14 @@ static struct sensor_format_struct *sensor_get_format(int id, int isp_id)
}
}
}
sensor_print("%s(), %d, id:%d, ispid:%d\n", __func__, __LINE__, id, ispid);
if (sensor_format == NULL) {
sensor_format = &sensor_formats[0];
isp_get_cfg[ispid].sensor_wdr_on = sensor_format->wdr_mode;
isp_get_cfg[ispid].sensor_get_fps = sensor_format->fps_fixed;
sensor_print("use wdr is %d, use fps is %d\n", sensor_format->wdr_mode, sensor_format->fps_fixed);
}
sensor_print("%s(), %d, id:%d, ispid:%d\n", __func__, __LINE__, id, ispid);
done:
current_win[id] = sensor_format;
return sensor_format;
@@ -1050,7 +1041,6 @@ static struct sensor_format_struct *sensor_get_switch_format(int id, int isp_id)
}
done:
sensor_wdr_mode[id] = sensor_format->wdr_mode;
current_switch_win[id] = sensor_format;
return sensor_format;
#else

View File

@@ -60,6 +60,7 @@ struct sensor_cfg_array sensor_array[] = {
#endif
#ifdef CONFIG_SENSOR_OV02B10_MIPI
{"ov02b10_mipi", &ov02b10_core},
{"ov02b1b_mipi", &ov02b10_core},
#endif
};