Skip to content

Commit

Permalink
fix all cameras
Browse files Browse the repository at this point in the history
  • Loading branch information
Comma Device committed Mar 16, 2022
1 parent 7e59815 commit 6084b10
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
12 changes: 7 additions & 5 deletions selfdrive/camerad/cameras/camera_qcom2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,14 @@ void CameraState::sensors_init() {
switch (camera_num) {
case 0:
// port 0
i2c_info->slave_addr = 0x20;
//i2c_info->slave_addr = 0x20;
i2c_info->slave_addr = 0x34;
probe->camera_id = 0;
break;
case 1:
// port 1
i2c_info->slave_addr = 0x30;
//i2c_info->slave_addr = 0x30;
i2c_info->slave_addr = 0x36;
probe->camera_id = 1;
break;
case 2:
Expand Down Expand Up @@ -1024,9 +1026,9 @@ void CameraState::set_camera_exposure(float grey_frac) {
{0x3366, analog_gain_reg},
{0x3362, (uint16_t)(dc_gain_enabled ? 0x1 : 0x0)},
{0x3012, (uint16_t)exposure_time},
};
sensors_i2c(exp_reg_array, sizeof(exp_reg_array)/sizeof(struct i2c_random_wr_payload),
CAM_SENSOR_PACKET_OPCODE_SENSOR_CONFIG);*/
};*/
/*struct i2c_random_wr_payload exp_reg_array[] = {
sensors_i2c(exp_reg_array, sizeof(exp_reg_array)/sizeof(struct i2c_random_wr_payload), CAM_SENSOR_PACKET_OPCODE_SENSOR_CONFIG);*/
}

void camera_autoexposure(CameraState *s, float grey_frac) {
Expand Down
9 changes: 3 additions & 6 deletions selfdrive/camerad/cameras/sensor2_i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ struct i2c_random_wr_payload stop_reg_array[] = {{0x301A, 0x918}};*/
struct i2c_random_wr_payload start_reg_array[] = {{0x0, 0}};

struct i2c_random_wr_payload init_array_imx390[] = {
{0x2008, 0xdd}, {0x2009, 0x04}, {0x200a, 0x00}, // MODE_VMAX
{0x2008, 0xd0}, {0x2009, 0x07}, {0x200a, 0x00}, // MODE_VMAX = time between frames
{0x200C, 0xe4}, {0x200D, 0x0c}, // MODE_HMAX

// crop
Expand All @@ -17,8 +17,8 @@ struct i2c_random_wr_payload init_array_imx390[] = {
{0x3650, 0}, // CU_MODE

// exposure
{0x000c, 0x7f}, {0x000d, 0x02},
{0x0010, 0x7f}, {0x0011, 0x02},
{0x000c, 0x0f}, {0x000d, 0x00},
{0x0010, 0x0f}, {0x0011, 0x00},

// WUXGA mode
// not in datasheet, from https://github.com/bogsen/STLinux-Kernel/blob/master/drivers/media/platform/tegra/imx185.c
Expand All @@ -29,9 +29,6 @@ struct i2c_random_wr_payload init_array_imx390[] = {
{0x21ee, 0xc4}, {0x21ef, 0x04}, // image send amount (1220 is the end)
{0x21f0, 0xc4}, {0x21f1, 0x04}, // image processing amount

// analog gain
//{0x001a, 0x0c}, {0x001b, 0x00},

// disable a bunch of errors causing blanking
{0x0390, 0x00}, {0x0391, 0x00}, {0x0392, 0x00},

Expand Down

0 comments on commit 6084b10

Please sign in to comment.