.power_setting_array =
{
.power_up_setting_a =
{
{
.seq_type = CAMERA_POW_SEQ_VREG,
.seq_val = CAMERA_VDIG,
.config_val = 0,
.delay = 0,
},
{
.seq_type = CAMERA_POW_SEQ_GPIO,
.seq_val = CAMERA_GPIO_RESET,
.config_val = GPIO_OUT_LOW,
.delay = 1,
},
{
.seq_type = CAMERA_POW_SEQ_GPIO,
.seq_val = CAMERA_GPIO_RESET,
.config_val = GPIO_OUT_HIGH,
.delay = 20,
},
},
.size_up = 3,
CameraResult SensorPlatformCommon::SensorExecutePowerSetting(
struct camera_power_setting *power_settings, unsigned short nSize, CameraPowerEventType mode)
{
uint8 index;
SENSOR_FUNCTIONENTRY("");
if (MAX_POWER_CONFIG < nSize)
{
SENSOR_ERROR("Invalid array size = %d", nSize);
return CAMERA_EFAILED;
}
for (index = 0; index < nSize; index++)
{
// Execute Power Config
switch(power_settings[index].seq_type)
{
case CAMERA_POW_SEQ_GPIO:
{
CameraSensorGPIO_SignalType GPIOSignal = (CameraSensorGPIO_SignalType)power_settings[index].seq_val;
CameraSensorGPIO_ValueType GPIOValue = (power_settings[index].config_val == GPIO_OUT_HIGH) ?
CAMERA_GPIO_CONFIG_HIGH : CAMERA_GPIO_CONFIG_LOW;
CameraSensorGPIO_Out(m_eCameraInterface, GPIOSignal, GPIOValue);
}
break;
case CAMERA_POW_SEQ_CLK:
case CAMERA_POW_SEQ_VREG:
case CAMERA_POW_SEQ_I2C_MUX:
case CAMERA_POW_SEQ_I2C:
default:
// do nothing for now
break;
}
if (power_settings[index].delay > 0)
{
CameraSleep(power_settings[index].delay);
}
}
SENSOR_FUNCTIONEXIT("");
return CAMERA_SUCCESS;
} /* SensorDriver_ExecutePowerConfig */