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

📄 sensor.cpp

📁 windows ce 6.0 camera driver
💻 CPP
字号:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//
//
// (C) Copyright 2006 Marvell International Ltd.
// All Rights Reserved
//
/****************************************************
    (C) Copyright 2006 Marvell International Ltd.
    All Rights Reserved
*****************************************************/

#include <windows.h>
#include <ceddk.h>

#include "Cs.h"
#include "Csmedia.h"

#include "CameraPDDProps.h"
#include "dstruct.h"
#include "dbgsettings.h"
#include <Camera.h>
#include "CameraDriver.h"
#include "PinDriver.h"
#include "sensor.h"
#include "Camera_SOC.h"
#include "PMIC_DRV.h"

void Sensor::init_camera_cfg(camera_cfg_t* cfg, BOOL is_still)
{
    format_t *qci_format = &cfg->qci_format;

    qci_format->is_still = is_still;
    cfg->ippi_rpp_spec = 0;

    if (qci_format->format == PXA_CAMERA_IMAGE_FORMAT_RAW10)
    {
        float default_coe[9] = { 1, 0, 0,
                                 0, 1, 0,
                                 0, 0, 1 };

        float *coe = default_coe;
        if (cfg->color_cfg)
        {            
            DEBUGMSG( ZONE_IOCTL, ( _T("CAM: using sensor specific coe\r\n")) );
            coe = cfg->color_cfg->color_correct_coe;
        }            
    }
}

BOOL Sensor::pic_read_reg(UCHAR addr, UCHAR* value)
{


    PXA_STATUS_T ulStatus = PXA_STATUS_SUCCESS;

    ulStatus = PMIC_Read((UINT8)addr, (UINT8*)value);

    if (PXA_STATUS_SUCCESS != ulStatus)
    {
        ERRORMSG(1, (TEXT("[Camera]: pic_read_reg Failed in PMIC_Read (ulStatus = %d).\r\n"),ulStatus));   
        return FALSE;
    }    

    return TRUE;    
}

BOOL Sensor::pic_write_reg(UCHAR addr, UCHAR value)
{

    PXA_STATUS_T ulStatus = PXA_STATUS_SUCCESS;

    ulStatus = PMIC_Write((UINT8)addr, (UINT8)value);

    if (PXA_STATUS_SUCCESS != ulStatus)
    {
        ERRORMSG(1, (TEXT("[Camera]: pic_write_reg Failed in PMIC_Write (ulStatus = %d).\r\n"),ulStatus));   
        return FALSE;
    }    

    return TRUE;    
}

⌨️ 快捷键说明

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