📄 pdptimings.cpp
字号:
FALSE, // Not pixel doubled
FALSE, // Blanking signal is negative
111, // Horizontal front porch
3, // Horiztonal sync
4, // Horizontal back porch
0, // Horizontal left border
0, // Horizontal right border
13, // Vertical front porch
2, // Vertical sync
5, // Veritcal back porch
0, // Vertical top border
0, // Vertical bottom border
176, // HActive
220, // VActive
0, // Polarity of Hsync pulse, 1 = Positive;
0, // Polarity of VSync pulse, 1 = Positive;
PDP_FULL_REFRESH, // Specify we refresh the screen at full rate
0, // No time between refreshes (not used in PDP_FULL_REFRESH mode
TRUE, // Full rate Syncs
TRUE, // Full rate interrupts
10000, // Backlight control value of 10us which equates to a 100Khz Backlight frequency
}
};
// DVI Flat Panel Monitor 640x480 -> 1280x1024 PDP_SHARP_LLT1820H
PDP_TIMINGS asLLT1820HTimings[]=
{
// Just slap in some DMT timings for now
{
640, // XRes
480, // Yres
60, // Refresh rate in Hz.
31469, // Line rate in Hz (typically >30KHz, on vga timings
25175000, // Dot Clock in Hz (typically >27 MHz, on vga timings
FALSE, // Not Line doubled
FALSE, // Not pixel doubled
TRUE, // Blanking signal is negative
8, // Horizontal front porch
96, // Horiztonal sync
40, // Horizontal back porch
8, // Horizontal left border
8, // Horizontal right border
2, // Vertical front porch
2, // Vertical sync
25, // Veritcal back porch
8, // Vertical top border
8, // Vertical bottom border
640, // XRes
480, // Yres
0, // Polarity of Hsync pulse, True = Positive;
0, // Polarity of VSync pulse, True = Positive;
PDP_FULL_REFRESH, // Specify we refresh the screen at full rate
0, // No time between refreshes (not used in PDP_FULL_REFRESH mode
TRUE, // Full rate Syncs
TRUE, // Full rate interrupts
10000, // Backlight control value of 10us which equates to a 100Khz Backlight frequency
},
{
800, // XRes
600, // Yres
60, // Refresh rate in Hz.
37879, // Line rate in Hz (typically >30KHz, on vga timings
40000000, // Dot Clock in Hz (typically >27 MHz, on vga timings
FALSE, // Not Line doubled
FALSE, // Not pixel doubled
TRUE, // Blanking signal is negative
40, // Horizontal front porch
128, // Horiztonal sync
88, // Horizontal back porch
0, // Horizontal left border
0, // Horizontal right border
1, // Vertical front porch
4, // Vertical sync
23, // Veritcal back porch
0, // Vertical top border
0, // Vertical bottom border
800, // XRes
600, // Yres
1, // Polarity of Hsync pulse, True = Positive;
1, // Polarity of VSync pulse, True = Positive;
PDP_FULL_REFRESH, // Specify we refresh the screen at full rate
0, // No time between refreshes (not used in PDP_FULL_REFRESH mode
TRUE, // Full rate Syncs
TRUE, // Full rate interrupts
10000, // Backlight control value of 10us which equates to a 100Khz Backlight frequency
},
{
1024, // XRes
768, // Yres
60, // Refresh rate in Hz.
48363, // Line rate in Hz (typically b>30KHz, on vga timings
65000000, // Dot Clock in Hz (typically >27 MHz, on vga timings
FALSE, // Not Line doubled
FALSE, // Not pixel doubled
TRUE, // Blanking signal is negative
24, // Horizontal front porch
136, // Horiztonal sync
160, // Horizontal back porch
0, // Horizontal left border
0, // Horizontal right border
3, // Vertical front porch
6, // Vertical sync
29, // Veritcal back porch
0, // Vertical top border
0, // Vertical bottom border
1024, // XRes
768, // Yres
0, // Polarity of Hsync pulse, True = Positive;
0, // Polarity of VSync pulse, True = Positive;
PDP_FULL_REFRESH, // Specify we refresh the screen at full rate
0, // No time between refreshes (not used in PDP_FULL_REFRESH mode
TRUE, // Full rate Syncs
TRUE, // Full rate interrupts
10000, // Backlight control value of 10us which equates to a 100Khz Backlight frequency
},
{
1280, // XRes
1024, // Yres
60, // Refresh rate in Hz.
63981, // Line rate in Hz (typically b>30KHz, on vga timings
108000000, // Dot Clock in Hz (typically >27 MHz, on vga timings
FALSE, // Not Line doubled
FALSE, // Not pixel doubled
TRUE, // Blanking signal is positive
48, // Horizontal front porch
112, // Horiztonal sync
248, // Horizontal back porch
0, // Horizontal left border
0, // Horizontal right border
1, // Vertical front porch
3, // Vertical sync
38, // Veritcal back porch
0, // Vertical top border
0, // Vertical bottom border
1280, // XRes
1024, // Yres
1, // Polarity of Hsync pulse, True = Positive;
1, // Polarity of VSync pulse, True = Positive;
PDP_FULL_REFRESH, // Specify we refresh the screen at full rate
0, // No time between refreshes (not used in PDP_FULL_REFRESH mode
TRUE, // Full rate Syncs
TRUE, // Full rate interrupts
10000, // Backlight control value of 10us which equates to a 100Khz Backlight frequency
}
};
// Mobile Phone Style display 176x220 PDP_EPSON_LD22002TB301
// Need more info on this to do timings properly.
PDP_TIMINGS asLD22002TB301Timings[]=
{
{ // These are the timings for the Sharp LCD Display panel.
176, // XRes
220, // Yres
60, // Refresh rate in Hz.
13315, // Line rate in Hz (typically >30KHz, on vga timings
6530000, // Dot Clock in Hz (typically >27 MHz, on vga timings
FALSE, // Not Line doubled
FALSE, // Not pixel doubled
FALSE, // Blanking signal is negative
111, // Horizontal front porch
3, // Horiztonal sync
4, // Horizontal back porch
0, // Horizontal left border
0, // Horizontal right border
13, // Vertical front porch
2, // Vertical sync
5, // Veritcal back porch
0, // Vertical top border
0, // Vertical bottom border
176, // XRes
220, // Yres
0, // Polarity of Hsync pulse, 1 = Positive;
0, // Polarity of VSync pulse, 1 = Positive;
PDP_FULL_REFRESH, // Specify we refresh the screen at full rate
0, // No time between refreshes (not used in PDP_FULL_REFRESH mode
TRUE, // Full rate Syncs
TRUE, // Full rate interrupts
10000, // Backlight control value of 10us which equates to a 100Khz Backlight frequency
}
};
/*****************************************************************************
FUNCTION : TimingsToRelative
Description: Converts the absolute timings to timings relative to the start of h and vsync
PARAMETERS : PPDP_TIMINGS psTiming : Input absolute timings
PPDP_RELATIVETIMES psRelative : Output relative timings
RETURNS : PDP_ERROR_ok
*****************************************************************************/
PDP_ERROR TimingsToRelative(PPDP_TIMINGS psTiming ,PPDP_RELATIVETIMES psRelative)
{
WORD wHScale=1;
WORD wVScale=1;
if(psTiming->bLineDouble)
wVScale++;
if(psTiming->bPixelDouble)
wHScale++;
psRelative->HBPS = psTiming->wHSync;
psRelative->HLBS = psTiming->wHSync + psTiming->wHBP;
psRelative->HAS = psTiming->wHSync + psTiming->wHBP + psTiming->wHLB;
psRelative->HRBS = psTiming->wHSync + psTiming->wHBP + psTiming->wHLB + psTiming->wHActive*wHScale;
psRelative->HFPS = psTiming->wHSync + psTiming->wHBP + psTiming->wHLB + psTiming->wHActive*wHScale + psTiming->wHRB;
psRelative->HT = psTiming->wHSync + psTiming->wHBP + psTiming->wHLB + psTiming->wHActive*wHScale + psTiming->wHRB + psTiming->wHFP;
psRelative->VBPS = psTiming->wVSync;
psRelative->VTBS = psTiming->wVSync + psTiming->wVBP;
psRelative->VAS = psTiming->wVSync + psTiming->wVBP + psTiming->wVTB;
psRelative->VBBS = psTiming->wVSync + psTiming->wVBP + psTiming->wVTB + psTiming->wVActive*wVScale;
psRelative->VFPS = psTiming->wVSync + psTiming->wVBP + psTiming->wVTB + psTiming->wVActive*wVScale + psTiming->wVBB;
psRelative->VT = psTiming->wVSync + psTiming->wVBP + psTiming->wVTB + psTiming->wVActive*wVScale + psTiming->wVBB + psTiming->wVFP;
return PDP_ERROR_OK;
}
#ifdef SUPPORT_MARATHON_DEVICE
/*****************************************************************************
FUNCTION : GetLCDSwitchConfig
Description: Gets the LCD switch configuration for a panel
PARAMETERS : PDP_TIMINGSELECT eMethod
PDEV_LCD_CONFIG pLCDSwitchConfig
RETURNS : PDP_ERROR_OK
*****************************************************************************/
PDP_ERROR GetLCDSwitchConfig(PDP_TIMINGSELECT eMethod, PSYS_LCD_CONFIG pLCDSwitchConfig)
{
switch (eMethod)
{
case PDP_CVT: *pLCDSwitchConfig = sLCDConfigDefault; break;
case PDP_CVT_REDUCED: *pLCDSwitchConfig = sLCDConfigDefault; break;
case PDP_DMT: *pLCDSwitchConfig = sLCDConfigVGA; break;
case PDP_SHARP_LQ057Q3DC02: *pLCDSwitchConfig = sLCDConfigDefault; break;
case PDP_SHARP_LQ022B2DB02T: *pLCDSwitchConfig = sLCDConfigSharpLQ022; break;
case PDP_TOSHIBA_LTM04C380S: *pLCDSwitchConfig = sLCDConfigLTM04C380S; break;
case PDP_SHARP_LLT1820H: *pLCDSwitchConfig = sLCDConfigVGA; break;
case PDP_SHARP_LS047D: *pLCDSwitchConfig = sLCDConfigDefault; break;
case PDP_EPSON_LD22002TB301: *pLCDSwitchConfig = sLCDConfigDefault; break;
default:
return(PDP_ERROR_UNSUPPORTED);
}
return(PDP_ERROR_OK);
}
#endif
/*****************************************************************************
FUNCTION : GetModeTimings
Description: Gets the timings for the requested mode.
PARAMETERS : WORD wXRes : XResolution
WORD wYRes : YResolution
WORD wRefreshRate : RefreshRate
PDP_TIMINGSELECT eMethod : Method of generating timing
PPDP_TIMINGS sTiming : Pointer to output structure
RETURNS : PDP_ERROR_OK
*****************************************************************************/
PDP_ERROR GetModeTimings(WORD wXRes,WORD wYRes,WORD wRefreshRate,PDP_TIMINGSELECT eMethod,PPDP_TIMINGS psTiming)
{
switch (eMethod)
{
case PDP_CVT:
return GetCVT(wXRes,wYRes,wRefreshRate,0,psTiming); //CVT Calculated timings
break;
case PDP_CVT_REDUCED:
return GetCVT(wXRes,wYRes,wRefreshRate,1,psTiming); //CVT Reduced blanking timings
break;
case PDP_DMT: //Timings for the Vesa discrete monitor timings
return FindTiming(wXRes,wYRes,wRefreshRate,psTiming,asDMTTimings,sizeof(asDMTTimings)/sizeof(PDP_TIMINGS));
break;
case PDP_SHARP_LQ057Q3DC02: // Sharp custom timings
return FindTiming(wXRes,wYRes,wRefreshRate,psTiming,asLQ057Q3DC02Timings,sizeof(asLQ057Q3DC02Timings)/sizeof(PDP_TIMINGS));
break;
case PDP_SHARP_LQ022B2DB02T: // Sharp custom timings
return FindTiming(wXRes,wYRes,wRefreshRate,psTiming,asLQ022B2DB02TTimings,sizeof(asLQ022B2DB02TTimings)/sizeof(PDP_TIMINGS));
break;
case PDP_TOSHIBA_LTM04C380S: // Toshiba custom timings
return FindTiming(wXRes,wYRes,wRefreshRate,psTiming,asLTM04C380STimings,sizeof(asLTM04C380STimings)/sizeof(PDP_TIMINGS));
break;
case PDP_SHARP_LLT1820H: // Sharp custom timings
return FindTiming(wXRes,wYRes,wRefreshRate,psTiming,asLLT1820HTimings,sizeof(asLLT1820HTimings)/sizeof(PDP_TIMINGS));
break;
case PDP_SHARP_LS047D: // Sharp custom timings
return FindTiming(wXRes,wYRes,wRefreshRate,psTiming,asLS047DTimings,sizeof(asLS047DTimings)/sizeof(PDP_TIMINGS));
break;
case PDP_EPSON_LD22002TB301:
return FindTiming(wXRes,wYRes,wRefreshRate,psTiming,asLD22002TB301Timings,sizeof(asLD22002TB301Timings)/sizeof(PDP_TIMINGS));
break;
}
return PDP_ERROR_OK;
}
/*****************************************************************************
FUNCTION : FindTiming
Description: Searches for the timing requested in the table and fills in the structure.
PARAMETERS : WORD wXRes : XResolution
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -