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

📄 dcr_type_1.c

📁 realtek LCD monitor, TV开发源代码
💻 C
字号:
//**********************************************************************************************************
//  The  Software  is  proprietary,  confidential,  and  valuable to Realtek Semiconductor
//  Corporation  ("Realtek").  All  rights, including but not limited  to  copyrights,
//  patents,  trademarks, trade secrets, mask work rights, and other similar rights and interests,
//  are reserved to Realtek. Without  prior  written  consent  from  Realtek,  copying, reproduction,
//  modification,  distribution,  or  otherwise  is strictly prohibited. The Software  shall  be
//  kept  strictly  in  confidence,  and  shall  not be  disclosed to or otherwise accessed by
//  any third party. @ <2003> - <2008>   The Software is provided "AS IS" without any warranty of any kind,
//  express, implied, statutory or otherwise.
//**********************************************************************************************************
//----------------------------------------------------------------------------------------------------
// ID Code      : DCR.c No.0000
// Update Note  :
//
//----------------------------------------------------------------------------------------------------

#define __DCR_TYPE_1__

#include "Common\Header\Include.h"

#if(_DCR_MODE == _DCR_TYPE_1)

//--------------------------------------------------
// Description  : DCR Set Boundary
// Input Value  : None
// Output Value : None
//--------------------------------------------------
void CDcrSetBoundary(void)//0902 sephinroth DCR
{
    WORD temp_s, temp_e;

    // get the horizontal boundary
    CScalerRead(_DISP_ACCESS_PORT_2A, 1, &pData[0], _NON_AUTOINC);
    CScalerSetByte(_DISP_ACCESS_PORT_2A, ((pData[0] & 0xC0) | 0x05));
    CScalerRead(_DISP_DATA_PORT_2B, 2, &pData, _NON_AUTOINC);
    temp_s = 0;
    temp_s = pData[0];
    temp_s = temp_s << 8;
    temp_s = temp_s | pData[1];
    CScalerRead(_DISP_ACCESS_PORT_2A, 1, &pData[0], _NON_AUTOINC);
    CScalerSetByte(_DISP_ACCESS_PORT_2A, ((pData[0] & 0xC0) | 0x07));
    CScalerRead(_DISP_DATA_PORT_2B, 2, &pData, _NON_AUTOINC);
    temp_e = 0;
    temp_e = pData[0];
    temp_e = temp_e << 8;
    temp_e = temp_e | pData[1];
    usHorBoundary = temp_e - temp_s;

    // get the vertical boundary
    CScalerRead(_DISP_ACCESS_PORT_2A, 1, &pData[0], _NON_AUTOINC);
    CScalerSetByte(_DISP_ACCESS_PORT_2A, ((pData[0] & 0xC0) | 0x10));
    CScalerRead(_DISP_DATA_PORT_2B, 2, &pData, _NON_AUTOINC);
    temp_s = 0;
    temp_s = pData[0];
    temp_s = temp_s << 8;
    temp_s = temp_s | pData[1];
    CScalerRead(_DISP_ACCESS_PORT_2A, 1, &pData[0], _NON_AUTOINC);
    CScalerSetByte(_DISP_ACCESS_PORT_2A, ((pData[0] & 0xC0) | 0x12));
    CScalerRead(_DISP_DATA_PORT_2B, 2, &pData, _NON_AUTOINC);
    temp_e = 0;
    temp_e = pData[0];
    temp_e = temp_e << 8;
    temp_e = temp_e | pData[1];
    usVerBoundary = temp_e - temp_s;
}
//--------------------------------------------------
// Description  : DCR Measurement by HW Control
// Input Value  : None
// Output Value : None
//--------------------------------------------------
void CDcrMeasureStartHD(void)
{
    DWORD temp_b;
/*
    WORD temp_s, temp_e;

    // get the horizontal boundary
    CScalerRead(_DISP_ACCESS_PORT_2A, 1, &pData[0], _NON_AUTOINC);
    CScalerSetByte(_DISP_ACCESS_PORT_2A, ((pData[0] & 0xC0) | 0x05));
    CScalerRead(_DISP_DATA_PORT_2B, 2, &pData, _NON_AUTOINC);
    temp_s = 0;
    temp_s = pData[0];
    temp_s = temp_s << 8;
    temp_s = temp_s | pData[1];
    CScalerRead(_DISP_ACCESS_PORT_2A, 1, &pData[0], _NON_AUTOINC);
    CScalerSetByte(_DISP_ACCESS_PORT_2A, ((pData[0] & 0xC0) | 0x07));
    CScalerRead(_DISP_DATA_PORT_2B, 2, &pData, _NON_AUTOINC);
    temp_e = 0;
    temp_e = pData[0];
    temp_e = temp_e << 8;
    temp_e = temp_e | pData[1];
    usHorBoundary = temp_e - temp_s;

    // get the vertical boundary
    CScalerRead(_DISP_ACCESS_PORT_2A, 1, &pData[0], _NON_AUTOINC);
    CScalerSetByte(_DISP_ACCESS_PORT_2A, ((pData[0] & 0xC0) | 0x10));
    CScalerRead(_DISP_DATA_PORT_2B, 2, &pData, _NON_AUTOINC);
    temp_s = 0;
    temp_s = pData[0];
    temp_s = temp_s << 8;
    temp_s = temp_s | pData[1];
    CScalerRead(_DISP_ACCESS_PORT_2A, 1, &pData[0], _NON_AUTOINC);
    CScalerSetByte(_DISP_ACCESS_PORT_2A, ((pData[0] & 0xC0) | 0x12));
    CScalerRead(_DISP_DATA_PORT_2B, 2, &pData, _NON_AUTOINC);
    temp_e = 0;
    temp_e = pData[0];
    temp_e = temp_e << 8;
    temp_e = temp_e | pData[1];
    usVerBoundary = temp_e - temp_s;
*/
    CScalerPageSelect(_PAGE7);
    CScalerSetByte(_P7_DCR_ACCESS_PORT_D8, 0x00);
    CScalerSetByte(_P7_DCR_DATA_PORT_D9, 0x04);            // Set the thershold 1 for DCR

    //CScalerSetBit(_P7_DCR_ACCESS_PORT_D8, ~_BIT1, _BIT1);  // Set RESULT_READ to read the result
    CScalerSetByte(_P7_DCR_ACCESS_PORT_D8, 0x17);
    CScalerRead(_P7_DCR_DATA_PORT_D9, 1, &pData[0], _NON_AUTOINC);
    CScalerSetByte(_P7_DCR_ACCESS_PORT_D8, 0x1B);
    CScalerRead(_P7_DCR_DATA_PORT_D9, 1, &pData[1], _NON_AUTOINC);
    CScalerSetByte(_P7_DCR_ACCESS_PORT_D8, 0x1F);
    CScalerRead(_P7_DCR_DATA_PORT_D9, 1, &pData[2], _NON_AUTOINC);
    CScalerSetByte(_P7_DCR_ACCESS_PORT_D8, 0x23);
    CScalerRead(_P7_DCR_DATA_PORT_D9, 1, &pData[3], _NON_AUTOINC);


    temp_b = pData[0];
    temp_b = temp_b << 8;
    temp_b = (temp_b & 0x0000ff00) | pData[1];
    temp_b = temp_b << 8;
    temp_b = (temp_b & 0x00ffff00) | pData[2];
    temp_b = temp_b << 8;
    temp_b = (temp_b & 0xffffff00) | pData[3];

    temp_b = temp_b / usVerBoundary;
    temp_b = temp_b / usHorBoundary;

	//usRGBInfo = temp_b; 
    if(abs(usRGBInfo - temp_b) <= 1)//yc_chen y080826 羬

⌨️ 快捷键说明

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