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

📄 auto.h

📁 realtek LCD monitor, TV开发源代码
💻 H
字号:
//**********************************************************************************************************
//  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      : Auto.h No.0000
// Update Note  :
//----------------------------------------------------------------------------------------------------

//--------------------------------------------------
// Minumum Noise Margin
//--------------------------------------------------
#define _MIN_NOISE_MARGIN               0x40//0805 sephinroth


//--------------------------------------------------
// Set Adjusting Hsync Boundary Range (%) by the porch length
//--------------------------------------------------
#define _H_BOUND_RANGE_L                50
#define _H_BOUND_RANGE_R                50

/*
//--------------------------------------------------
// Set Adjusting H/V Position Range (0.1%) by the active region
//--------------------------------------------------
#define _H_POSITION_RANGE_L             40
#define _H_POSITION_RANGE_R             20
#define _V_POSITION_RANGE_L             40
#define _V_POSITION_RANGE_R             20
*/

//--------------------------------------------------
// Set H/V Position Adjusting Range (%) by the porch
//--------------------------------------------------
#define _H_POSITION_RANGE               50
#define _V_POSITION_RANGE               50


//--------------------------------------------------
// Set Clock Non-adjusting Range (%) by the active region
//--------------------------------------------------
#define _AUTO_CLOCK_RANGE               94


//--------------------------------------------------
// Set IHS Start Bias
//--------------------------------------------------
#define _IHS_START_BIAS                 50


//--------------------------------------------------
// Set IHS Delay Limit
//--------------------------------------------------
#define _IHS_DELAY_LIMIT                2


//--------------------------------------------------
// Set H Position Adjusting Limit
//--------------------------------------------------
#define _H_POSITION_ADJUST_LIMIT        2


//--------------------------------------------------
// Color Source Select for Detection
//--------------------------------------------------
#define _COLORS_BLUE                    0x00
#define _COLORS_GREEN                   0x01
#define _COLORS_RED                     0x02
#define _COLORS_ALL                     0x03

#define _COLOR_SELECT                   _COLORS_ALL

//--------------------------------------------------
// Definations of Measure Color
//--------------------------------------------------
#define _MEASURE_COLORS_MIN             0x00
#define _MEASURE_COLORS_MAX             0x01


//--------------------------------------------------
// White Balance Max/Min Level Settings
//--------------------------------------------------
#define _WHITEBALANCE_MAX_LEVEL         250
#define _WHITEBALANCE_MIN_LEVEL         2
#define _WHITEBALANCE_BR_MIN_LEVEL      128

//--------------------------------------------------
// Setting of Auto Black Level
//--------------------------------------------------
#define _OFF_LINE_ABL_MODE              0   //0:Off-line mode, 1:On-line mode
#define _ABL_REGION_IN_EACH_LINE        0   //(N+1)*16 pixels, N=0~3
#define _LINE_AVERAGED                  2   //N=0~3, 0△8, 1△16, 2△32, 3△64
#define _START_LINE_OF_ABL              4   //Start line of ABL after the leading edge of Vsync
#define _LOCK_MARGIN                    0   //N=0~3, 0△1, 1△2, 2△4, 3△6
#define _END_LINE_OF_ABL                512   //The last line of ABL which is counted by double-line
#define _START_POSITION_OF_ABL          4   //Start position of ABL in each line (0~63)
#define _LARGE_ERROR_MARGIN             3   //(N+1)*2, N=0~3
#define _MAX_FRAME_COUNT                0   //N=0~3, 0△4, 1△5, 2△6, 3△7
#define _LINE_DELAY                     0   //(N+1)*16 lines, N=0~7
#define _EQUAL_CONDITION                0   //0:To trigger status once, 1:To trigger status until measurement finished
#define _MEASURE_PIXELS_METHOD          0   //0: Average value, 1:Minimum value
#define _HSYNC_START_REF_SELECT         0   //0: HS leading edge, 1:HS trailing edge
#define _EQUAL_MARGIN                   3   //N=0~3

//--------------------------------------------------
// Hardware Auto Phase Step
//--------------------------------------------------
#define _HWAUTO_STEP_1                  0x00
#define _HWAUTO_STEP_2                  0x01
#define _HWAUTO_STEP_4                  0x02
#define _HWAUTO_STEP_8                  0x03
#define _HWAUTO_STEP_16                 0x04

#define _HWAUTO_STEP                    _HWAUTO_STEP_2


//--------------------------------------------------
// Auto Clock Precision (Unit in Clock Number)
//--------------------------------------------------
#define _AUTO_CLOCK_PRECISION_1         1
#define _AUTO_CLOCK_PRECISION_2         2

#define _AUTO_CLOCK_PRECISION           _AUTO_CLOCK_PRECISION_2


//--------------------------------------------------
// Definitions of Auto Function
//--------------------------------------------------
#define _ERROR_SUCCESS                  0x00
#define _ERROR_FINISH                   0x40
#define _ERROR_ABORT                    0x80
#define _ERROR_INPUT                    0xff
#define _ERROR_PHASE                    0xfe


//----------------------------------------------------------------------------------------------------

#ifdef __AUTO__

//--------------------------------------------------
// Global Variables
//--------------------------------------------------
/*
WORD xdata usHStartPos;
WORD xdata usHEndPos;
WORD xdata usVStartPos;
WORD xdata usVEndPos;
BYTE xdata ucAdcPGA; //yc 20080225
*/
WORD idata g_usHStartPos = 0;
WORD idata g_usHEndPos = 0;
WORD idata g_usVStartPos = 0;
WORD idata g_usVEndPos = 0;
BYTE idata g_ucAdcPGA = 0;

#if(_MODE_COMPARE_BY_SOD==_TRUE)
bit ucNoCheckFS = 0;
#endif

//--------------------------------------------------
// Function Prototypes
//--------------------------------------------------
void CAutoPositionFail(void);
BYTE CAutoDoAutoConfig(void);
bit CAutoCheckActiveRegion(void);
BYTE CAutoWaitFinish(void);
BYTE CAutoWaitForIVS(BYTE ucTimes);
BYTE CAutoMeasurePositionH(BYTE ucNoiseMarginH);
BYTE CAutoMeasurePositionV(BYTE ucNoiseMarginV);
DWORD CAutoPhaseSearch(BYTE ucSelColor, BYTE ucSelStep, BYTE ucSelStepNum, BYTE ucSelStepStart, BYTE *ucPhaseResult);
BYTE CAutoReadPhaseInfo(BYTE ucColor);
BYTE CAutoDoAutoClock(void);
BYTE CAutoDoAutoPhase(void);
BYTE CAutoDoAutoPosition(void);
BYTE CAutoDoWhiteBalance(void);
BYTE CAutoTuneBalance(void);
BYTE CAutoMeasureColor(BYTE ucColor, BYTE ucPar, BYTE *pMargin);
BYTE CAutoTuneAdcGain(BYTE ucColor, BYTE *pMargin);
BYTE CAutoTuneAdcOffset(BYTE ucColor, BYTE *pMargin);
BYTE CAutoChangeAdcGain(BYTE ucColor, BYTE ucDelta, BYTE ucInc);
BYTE CAutoChangeAdcOffset(BYTE ucColor, BYTE ucDelta, BYTE ucInc);


#else

//--------------------------------------------------
// Extern Global Variables
//--------------------------------------------------
/*
extern WORD xdata usHStartPos;
extern WORD xdata usHEndPos;
extern WORD xdata usVStartPos;
extern WORD xdata usVEndPos;
*/
extern WORD idata g_usHStartPos;
extern WORD idata g_usHEndPos;
extern WORD idata g_usVStartPos;
extern WORD idata g_usVEndPos;
extern BYTE idata g_ucAdcPGA;

#if(_MODE_COMPARE_BY_SOD==_TRUE)
extern bit ucNoCheckFS;
#endif

//--------------------------------------------------
// Extern Function Prototypes
//--------------------------------------------------
extern void CAutoPositionFail(void);
extern BYTE CAutoDoAutoConfig(void);
extern BYTE CAutoDoWhiteBalance(void);

#if(_MODE_COMPARE_BY_SOD==_TRUE)
extern BYTE CAutoMeasurePositionH(BYTE ucNoiseMarginH);
extern BYTE CAutoMeasurePositionV(BYTE ucNoiseMarginV);
extern DWORD CAutoPhaseSearch(BYTE ucSelColor, BYTE ucSelStep, BYTE ucSelStepNum, BYTE ucSelStepStart, BYTE *ucPhaseResult);
#endif

#endif // End of #ifdef __AUTO__



//----------------------------------------------------------------------------------------------------


#define HWAUTOSTEPNUM(x)                    (x)
#define HWAUTOSTEPSTART(x)                  (x)

⌨️ 快捷键说明

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