⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 image_sensor.c

📁 mtk 6225平台
💻 C
📖 第 1 页 / 共 5 页
字号:
    case CAM_WB_MANUAL:
    default:
        return KAL_FALSE;
    }

    return KAL_TRUE;
}   /* MC501CB_Set_Para_WB */

/*************************************************************************
* FUNCTION
*   MC501CB_Set_Para_EV
*
* DESCRIPTION
*   MC501CB exposure setting.
*
* PARAMETERS
*   None
*
* RETURNS
*   None
*
* GLOBALS AFFECTED
*
*************************************************************************/
kal_uint32 MC501CB_Set_Para_EV(kal_uint32 iPara)
{
    CHANGE_TO_PAGE(3);

    switch (iPara) {
    case CAM_EV_NEG_4_3:    // -4 EV
        write_cmos_sensor(0x1C, 0x16);
        break;

    case CAM_EV_NEG_3_3:    // -3 EV
        write_cmos_sensor(0x1C, 0x29);
        break;

    case CAM_EV_NEG_2_3:    // -2 EV
        write_cmos_sensor(0x1C, 0x31);
        break;

    case CAM_EV_NEG_1_3:    // -1 EV
        write_cmos_sensor(0x1C, 0x3C);
        break;

    case CAM_EV_ZERO:   // +0 EV
        write_cmos_sensor(0x1C, 0x45);
        break;

    case CAM_EV_POS_1_3:    // +1 EV
        write_cmos_sensor(0x1C, 0x57);
        break;

    case CAM_EV_POS_2_3:    // +2 EV
        write_cmos_sensor(0x1C, 0x67);
        break;

    case CAM_EV_POS_3_3:    // +3 EV
        write_cmos_sensor(0x1C, 0x76);
        break;

    case CAM_EV_POS_4_3:    // +4 EV
        write_cmos_sensor(0x1C, 0x85);
        break;

    default:
        return KAL_FALSE;    
    }

    return KAL_TRUE;	
}   /* MC501CB_Set_Para_EV */

/*************************************************************************
* FUNCTION
*   MC501CB_Set_Para_Banding
*
* DESCRIPTION
*   MC501CB banding setting.
*
* PARAMETERS
*   None
*
* RETURNS
*   None
*
* GLOBALS AFFECTED
*
*************************************************************************/
kal_uint32 MC501CB_Set_Para_Banding(kal_uint32 iPara)
{
    switch (iPara) {
    case CAM_BANDING_50HZ:
        ConfigBanding(CAM_BANDING_50HZ);
        if (g_bVideoMode == KAL_TRUE) {
            // the setting is generated from Magnachip tool
            CHANGE_TO_PAGE(3);
            write_cmos_sensor(0x10, 0x1C);
            write_cmos_sensor(0x33, 0x00);
            write_cmos_sensor(0x34, 0xBE);
            write_cmos_sensor(0x35, 0x6E);
            write_cmos_sensor(0x10, 0x9C);
        }
        break;

    case CAM_BANDING_60HZ:
        ConfigBanding(CAM_BANDING_60HZ);
        if (g_bVideoMode == KAL_TRUE) {
            // the setting is generated from Magnachip tool
            CHANGE_TO_PAGE(3);
            write_cmos_sensor(0x10, 0x0C);
            write_cmos_sensor(0x33, 0x00);
            write_cmos_sensor(0x34, 0xD3);
            write_cmos_sensor(0x35, 0x94);
            write_cmos_sensor(0x10, 0x8C);
        }
        break;

    default:
        return KAL_FALSE;
    }

    return KAL_TRUE;
}   /* MC501CB_Set_Para_Banding */

/*************************************************************************
* FUNCTION
*   MC501CB_Set_Para_Saturation
*
* DESCRIPTION
*   MC501CB saturation setting.
*
* PARAMETERS
*   None
*
* RETURNS
*   None
*
* GLOBALS AFFECTED
*
*************************************************************************/
kal_uint32 MC501CB_Set_Para_Saturation(kal_uint32 iPara)
{
    // MC501CB not support saturation adjustment

    return KAL_FALSE;
}   /* MC501CB_Set_Para_Saturation */

/*************************************************************************
* FUNCTION
*   MC501CB_NightMode
*
* DESCRIPTION
*   This function switch on/off night mode of MC501CB.
*
* PARAMETERS
*   None
*
* RETURNS
*   None
*
* GLOBALS AFFECTED
*
*************************************************************************/
void MC501CB_NightMode(kal_bool bEnable)
{
    kal_uint8 iTemp;

    if (bEnable == KAL_TRUE) {
        if (g_bVideoMode == KAL_TRUE) {  // video night mode
            if(g_bMJPEGMode == KAL_TRUE)
                ConfigFixFrameRate(FPS_MJPEG_NIGHT);
            else
                ConfigFixFrameRate(FPS_VIDEO_NIGHT);
        }else { // camera night mode
            ConfigMinFrameRate(MIN_FPS_CAMERA_NIGHT);
        }
        CHANGE_TO_PAGE(1);
        write_cmos_sensor(0x1A, 0x30);
        iTemp = read_cmos_sensor(0x12);
        write_cmos_sensor(0x12, iTemp | 0x20);
    }else {
        if (g_bVideoMode == KAL_TRUE) {  // video normal mode
            if(g_bMJPEGMode == KAL_TRUE)
                ConfigFixFrameRate(FPS_MJPEG_NORMAL);
            else
                ConfigFixFrameRate(FPS_VIDEO_NORMAL);
        }else { // camera normal mode
            ConfigMinFrameRate(MIN_FPS_CAMERA_NORMAL);
        }
        CHANGE_TO_PAGE(1);
        write_cmos_sensor(0x1A, 0x20);  // this should be the same as default in initial setting
        iTemp = read_cmos_sensor(0x12);
        write_cmos_sensor(0x12, iTemp & 0xDF);
    }
}

/*************************************************************************
* FUNCTION
*   MC501CB_Set_Para_NightMode
*
* DESCRIPTION
*   MC501CB night mode setting.
*
* PARAMETERS
*   None
*
* RETURNS
*   None
*
* GLOBALS AFFECTED
*
*************************************************************************/
kal_uint32 MC501CB_Set_Para_NightMode(kal_uint32 iPara)
{
    MC501CB_NightMode((iPara != 0) ? KAL_TRUE : KAL_FALSE);

    return KAL_TRUE;
}   /* MC501CB_Set_Para_NightMode */

/*************************************************************************
* FUNCTION
*   MC501CB_Set_Para_AE_Meter
*
* DESCRIPTION
*   MC501CB AE metering mode
*
* PARAMETERS
*   None
*
* RETURNS
*   None
*
* GLOBALS AFFECTED
*
*************************************************************************/
kal_uint32 MC501CB_Set_Para_AE_Meter(kal_uint32 iPara)
{
    // MC501CB not support AE meter selection

    if (g_bCaptureMode == KAL_TRUE) {
        return KAL_TRUE;
    }

    switch (iPara) {
    case CAM_AE_METER_AUTO: // NORMAL mode AE metering
    case CAM_AE_METER_SPOT: // SPOT mode AE metering
    case CAM_AE_METER_CENTRAL:
    case CAM_AE_METER_AVERAGE:
    default:
        return KAL_FALSE;
	}

    return KAL_FALSE;
}   /* MC501CB_Set_Para_AE_Meter */

/*************************************************************************
* FUNCTION
*   MC501CB_Get_Para_AF_Status
*
* DESCRIPTION
*   MC501CB AF status
*   Possible status: AF_SEARCH_SUCCESS, AF_SEARCH_FAIL, AF_BUSY
*
* PARAMETERS
*   None
*
* RETURNS
*   None
*
* GLOBALS AFFECTED
*
*************************************************************************/
kal_uint32 MC501CB_Get_Para_AF_Status(kal_uint32 iPara)
{
    // MC501CB not support AF

	return AF_SEARCH_FAIL;
}   /* MC501CB_Get_Para_AF_Status */

/*************************************************************************
* FUNCTION
*   MC501CB_Set_Para_Shutter_Priority
*
* DESCRIPTION
*   MC501CB
*
* PARAMETERS
*   None
*
* RETURNS
*   None
*
* GLOBALS AFFECTED
*
*************************************************************************/
kal_uint32 MC501CB_Set_Para_Shutter_Priority(kal_uint32 iPara)
{
    // MC501CB not support shutter priority

    return KAL_FALSE;
}   /* MC501CB_Set_Para_Shutter_Priority */

/*************************************************************************
* FUNCTION
*   MC501CB_Set_Para_Aperture_Priority
*
* DESCRIPTION
*   MC501CB
*
* PARAMETERS
*   None
*
* RETURNS
*   None
*
* GLOBALS AFFECTED
*
*************************************************************************/
kal_uint32 MC501CB_Set_Para_Aperture_Priority(kal_uint32 iPara)
{
    // MC501CB not support Aperture priority

    return KAL_FALSE;
}   /* MC501CB_Set_Para_Aperture_Priority */

/*************************************************************************
* FUNCTION
*   MC501CB_Set_Para_ISO
*
* DESCRIPTION
*   MC501CB
*
* PARAMETERS
*   None
*
* RETURNS
*   None
*
* GLOBALS AFFECTED
*
*************************************************************************/
kal_uint32 MC501CB_Set_Para_ISO(kal_uint32 iPara)
{
    // MC501CB not support ISO selection

    switch (iPara) {
    case CAM_ISO_AUTO:
    case CAM_ISO_100:
    case CAM_ISO_200:
    case CAM_ISO_400:
    default:
        return KAL_FALSE;
    }

    return KAL_FALSE;
}   /* MC501CB_Set_Para_ISO */

/*************************************************************************
* FUNCTION
*   MC501CB_Set_Para_DSC_Mode
*
* DESCRIPTION
*   MC501CB
*
* PARAMETERS
*   None
*
* RETURNS
*   None
*
* GLOBALS AFFECTED
*
*************************************************************************/
kal_uint32 MC501CB_Set_Para_DSC_Mode(kal_uint32 iPara)
{
    // MC501CB not support DSC mode selection

    switch(iPara) {
    case CAM_AUTO_DSC:
    case CAM_PORTRAIT:
    case CAM_LA

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -