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

📄 mode.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      : Mode.h No.0000
// Update Note  :
//----------------------------------------------------------------------------------------------------


#ifdef __MODE__

//--------------------------------------------------
// Global Variables
//--------------------------------------------------
BYTE idata ucCurrState = _PWOFF_STATE;
BYTE idata ucModeControl = 0;
BYTE idata ucEvent0 = 255;
BYTE idata ucEvent1 = 255;
BYTE idata ucModeFound;
BYTE idata ucHStartBias;
BYTE idata ucVStartBias;

//WORD xdata usVFreq;// for show Resolution yc_chen y080704
//WORD xdata usHFreq;

#if (_HDMI_OVERSCAN == _ON)
BYTE idata ucOverScanH  = 0;
BYTE idata ucOverScanV  = 0;
#endif

//--------------------------------------------------
// Function Prototypes
//--------------------------------------------------
void CModeHandler(void);
bit CModeMeasureReady(void);
bit CModeMeasureData(void);
bit CModeDetect(void);
bit CModeDetectCommon(void);
bit CModeIsChange(void);
BYTE CModeSearchDisplayMode(void);
BYTE CModeSearchModeVGA(void);
bit CModeComparePresetModeVGA(BYTE ucModeCnt);
BYTE CModeSearchAcceptiveModeVGA(void);
BYTE CModeSearchModeDVI(void);
bit CModeCompareModeDVI(BYTE ucModeCnt);
void CModeDisplayActiveMode(void);
void CModeSetupModeVGA(void);
void CModeSetupModeDVI(void);
void CModeSetupDisplay(void);
void CModeSetupColorProcess(void);
void CModeSetupEtcs(BYTE ucPar);
void CModeGetModeTableInfo(void);
void CModeStartUpVGA(void);
void CModeStartUpDVI(void);
BYTE CModeGetScaleSetting(void);
void CModeSetCaptureWindow(BYTE ucOption);
void CModeSetScaling(BYTE ucOption);
void CModeSetDisplay(BYTE ucOption);
void CModeModifyVTotal(void);
void CModeResetMode(void);
void CModeSetFreeRun(void);
bit CModeConnectIsChange(void);
void CModeAutoMeasureOn(void);
void CModeAutoMeasureOff(void);
void CModeSyncTimeoutCountDownEvent(void);
void CModeStableCountDownEvent(void);
void CModePowerSavingEvent(void);
void CModeNoSignalEvent(void);
void CModeNoCableEvent(void);
void CModeNoSupportEvent(void);
//Anderson 080130 for FRC Support Start
#if((_SCALER_TYPE == _RTD2545LR)||(_SCALER_TYPE == _RTD247xRD) || (_SCALER_TYPE == _RTD248xRD))//cyyeh 20080611
void CModeSetFIFOForFrameSync(void);
#endif
//Anderson 080130 for FRC Support End
void CModeHdmiStablePolling(void);
void CModeInterlaceCheck(void);
void CModeDeInterlaceSetting(void);

#if(_NON_LINEAR_SCALING_FUCTION == _ON)
void CScalerNonlinearScaleUp(void);
void CScalerDisableNonlinearScaleUp(void);
#endif

#if(_ASPECT_RATIO_SUPPORT==_ON)
bit CModeSetDHWidthToDisplay(void);
#endif

#else

//--------------------------------------------------
// Extern Global Variables
//--------------------------------------------------
extern BYTE idata ucCurrState;
extern BYTE idata ucModeControl;
extern BYTE idata ucHStartBias;
extern BYTE idata ucVStartBias;

#if (_HDMI_OVERSCAN == _ON)
extern BYTE idata ucOverScanH;
extern BYTE idata ucOverScanV;
#endif

//--------------------------------------------------
// Extern Function Prototypes
//--------------------------------------------------
extern void CModeHandler(void);
extern bit CModeMeasureReady(void);
extern bit CModeMeasureData(void);
extern bit CModeIsChange(void);
extern void CModeSetScaling(BYTE ucOption);
extern void CModeResetMode(void);
extern void CModeSetFreeRun(void);
extern void CModeSyncTimeoutCountDownEvent(void);
extern void CModeStableCountDownEvent(void);
extern void CModeSetupDisplay(void);
extern void CModeSetupColorProcess(void);
extern void CModeSetupEtcs(BYTE ucPar);
extern void CModeStartUpVGA(void);
extern void CModePowerSavingEvent(void);
extern void CModeNoSignalEvent(void);
extern void CModeNoCableEvent(void);
extern void CModeNoSupportEvent(void);
extern void CModeHdmiStablePolling(void);
extern void CModeInterlaceCheck(void);
extern void CModeSetCaptureWindow(BYTE ucOption);
extern void CModeSetDisplay(BYTE ucOption);
//Anderson 080130 for FRC Support Start
#if((_SCALER_TYPE == _RTD2545LR)||(_SCALER_TYPE == _RTD247xRD) || (_SCALER_TYPE == _RTD248xRD))//cyyeh 20080611
extern void CModeSetFIFOForFrameSync(void);
#endif
//Anderson 080130 for FRC Support End

extern void CModeDeInterlaceSetting(void);

#if(_NON_LINEAR_SCALING_FUCTION == _ON)
extern void CScalerNonlinearScaleUp(void);
extern void CScalerDisableNonlinearScaleUp(void);
#endif

#if(_ASPECT_RATIO_SUPPORT==_ON)
extern bit CModeSetDHWidthToDisplay(void);
#endif

extern void CModeSetOverScan(void);//0828 sephinroth

#endif // End of #ifdef __MODE__

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

//--------------------------------------------------
// Macro of Sync Processor Measure Ready Flag
//--------------------------------------------------
#define GET_VIDEOMODECHANGE()                   (bit)(ucModeControl & _BIT0)
#define SET_VIDEOMODECHANGE()                   (ucModeControl |= _BIT0)
#define CLR_VIDEOMODECHANGE()                   (ucModeControl &= ~_BIT0)

//--------------------------------------------------
// Macro of Start Display for OSD Flow
//--------------------------------------------------
#define GET_OSD_READYFORDISPLAY()               (bit)(ucModeControl & _BIT1)
#define SET_OSD_READYFORDISPLAY()               (ucModeControl |= _BIT1)
#define CLR_OSD_READYFORDISPLAY()               (ucModeControl &= ~_BIT1)

//--------------------------------------------------
// Macro of Mode Stable Flag
//--------------------------------------------------
#define GET_MODESTABLE()                        ((bit)(ucModeControl & _BIT2))
#define SET_MODESTABLE()                        (ucModeControl |= _BIT2)
#define CLR_MODESTABLE()                        (ucModeControl &= ~_BIT2)

//--------------------------------------------------
// Macro of Frame Sync Status
//--------------------------------------------------
#define GET_FRAMESYNCSTATUS()                   ((bit)(ucModeControl & _BIT3))
#define SET_FRAMESYNCSTATUS()                   (ucModeControl |= _BIT3)
#define CLR_FRAMESYNCSTATUS()                   (ucModeControl &= ~_BIT3)

//--------------------------------------------------
// Macro of Start Display
//--------------------------------------------------
#define GET_DEEPCOLORMODE()                     ((bit)(ucModeControl & _BIT4))
#define SET_DEEPCOLORMODE()                     (ucModeControl |= _BIT4)
#define CLR_DEEPCOLORMODE()                     (ucModeControl &= ~_BIT4)

//--------------------------------------------------
// Macro of Dp Hotplug
//--------------------------------------------------
#define GET_DPHOTPLUG()                   ((bit)(ucModeControl & _BIT6))
#define SET_DPHOTPLUG()                   (ucModeControl |= _BIT6)
#define CLR_DPHOTPLUG()                   (ucModeControl &= ~_BIT6)

//--------------------------------------------------
// Macro of Start Display
//--------------------------------------------------
#define GET_READYFORDISPLAY()                   ((bit)(ucModeControl & _BIT7))
#define SET_READYFORDISPLAY()                   (ucModeControl |= _BIT7)
#define CLR_READYFORDISPLAY()                   (ucModeControl &= ~_BIT7)



//--------------------------------------------------
// Macro of Power Status
//--------------------------------------------------
#define GET_POWERSTATUS()                       ((bit)(stSystemData.MonitorFlag & _BIT7))
#define SET_POWERSTATUS()                       (stSystemData.MonitorFlag |= _BIT7)         // Power Up
#define CLR_POWERSTATUS()                       (stSystemData.MonitorFlag &= ~_BIT7)        // Power Down
//--------------------------------------------------
// Macro of Input Source Type
//--------------------------------------------------
#define GET_INPUTSOURCE_TYPE()                  ((stSystemData.MonitorFlag & (_BIT0 | _BIT1 | _BIT2)))
#define SET_INPUTSOURCE_TYPE(x)                 (stSystemData.MonitorFlag = ((stSystemData.MonitorFlag & ~(_BIT0 | _BIT1 | _BIT2)) | (x)))

/*
#if(_NON_LINEAR_SCALING_FUCTION == _ON)
//--------------------------------------------------
// Macro of _NON_LINEAR_SCALING Function On/Off flag
//--------------------------------------------------
#define GET_NON_LINEAR_SCALING_STATUS()         ((bit)(stSystemData.SystemFlag & _BIT6))
#define SET_NON_LINEAR_SCALING_STATUS()         (stSystemData.SystemFlag |= _BIT6)
#define CLR_NON_LINEAR_SCALING_STATUS()         (stSystemData.SystemFlag &= ~_BIT6)
#endif

//--------------------------------------------------
// Macro of Aspect Ratio fuction
//--------------------------------------------------
#if(_ASPECT_RATIO_SUPPORT == _ON)

#define DISP_FULL_SCREEN                        0   // Full screen display
#define DISP_ORIGINAL_SIZE                      1   // Original size display
#define DISP_FIXED_AR_IN                        2   // Fixed-aspect-ratio display (all image inside screen)

#define GET_DISP_RATIO()                        ((stSystemData.MonitorFlag & (_BIT3 | _BIT4)) >> 3)
#define SET_DISP_RATIO(x)                       (stSystemData.MonitorFlag = ((stSystemData.MonitorFlag & ~(_BIT3 | _BIT4)) | (x << 3)))

#endif


#if(_OSD_ROTATE_FUCTION == _ON)
//--------------------------------------------------
// Macro of Rotate Function On/Off flag
//--------------------------------------------------
#define GET_ROTATE_STATUS()                     ((bit)(stSystemData.SystemFlag & _BIT3))
#define SET_ROTATE_STATUS()                     (stSystemData.SystemFlag |= _BIT3)
#define CLR_ROTATE_STATUS()                     (stSystemData.SystemFlag &= ~_BIT3)
#endif
*/
//----------------------------------------------------------------------------------------------------

⌨️ 快捷键说明

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