====LCD部分====
分辨率修改
1、s2410.h (D:/WINCE500/PLATFORM/SMDK2410/INC/)
#define LCD_XSIZE_TFT (640)
#define LCD_YSIZE_TFT (480)
修改为
#define LCD_XSIZE_TFT (240)
#define LCD_YSIZE_TFT (320)
修改时序 (可选的范围很宽,很多时候可以不做修改)
1、cfw.c (D:/WINCE500/PLATFORM/SMDK2410/KERNEL/HAL/)
修改函数 InitDisplay()
LCD显示 竖屏改为横屏
(不需要修改s2410.h和cfw.c中的任何内容)
1、SMDK2440/DRIVERS/DISPLAY/S3C2440LCD 目录下的sources文件合适位置增加:
CLEARTYPE=0
2、s3c2440disp.h文件头上加一句
#define ROTATE
3、s3c2440disp.cpp中 S3C2440DISP::S3C2440DISP (void)加上
#ifdef ROTATE
m_iRotate = DMDO_90;
SetRotateParms();
#endif
4、注册表文件wince420/platform/smdk2410/files/platform.reg中添加如下键值:
[HKEY_LOCAL_MACHINE/System/GDI/ROTATION]
“Angle”=dword:5A
“LandscapeMode”=dword:1
5、修改函数DrvEscape()和DynRotate()
====触摸屏部分====
关于x或者y轴对称
tchpdd.cpp(D:/WINCE500/PLATFORM/SMDK2410/DRIVERS/TOUCHP/)
注:体现在函数Touch_CoordinateConversion()中
x 和y 的坐标的对调
tchpdd.cpp(D:/WINCE500/PLATFORM/SMDK2410/DRIVERS/TOUCHP/)
函数Touch_CoordinateConversion()中
#if 1 // x y坐标对调
temp = *px;
*px = *py;
*py = temp;
#endif
大小移植不一样(例如640*480的bsp要跑在320*240的LCD+触摸屏上)
修改
修改注册表 (特别重要,千万别忽视,否则触摸屏变化一点规律也没有,找问题还真难)
platform.reg(D:/WINCE500/PLATFORM/SMDK2410/FILES/)
修改
为
注:
1、 修改后的bsp下载
分辨率修改
1、s2410.h (D:/WINCE500/PLATFORM/SMDK2410/INC/)
#define LCD_XSIZE_TFT (640)
#define LCD_YSIZE_TFT (480)
修改为
#define LCD_XSIZE_TFT (240)
#define LCD_YSIZE_TFT (320)
修改时序 (可选的范围很宽,很多时候可以不做修改)
1、cfw.c (D:/WINCE500/PLATFORM/SMDK2410/KERNEL/HAL/)
修改函数 InitDisplay()
LCD显示 竖屏改为横屏
(不需要修改s2410.h和cfw.c中的任何内容)
1、SMDK2440/DRIVERS/DISPLAY/S3C2440LCD 目录下的sources文件合适位置增加:
CLEARTYPE=0
2、s3c2440disp.h文件头上加一句
#define ROTATE
3、s3c2440disp.cpp中 S3C2440DISP::S3C2440DISP (void)加上
#ifdef ROTATE
m_iRotate = DMDO_90;
SetRotateParms();
#endif
4、注册表文件wince420/platform/smdk2410/files/platform.reg中添加如下键值:
[HKEY_LOCAL_MACHINE/System/GDI/ROTATION]
“Angle”=dword:5A
“LandscapeMode”=dword:1
5、修改函数DrvEscape()和DynRotate()
ULONG S3C2410DISP::DrvEscape(
SURFOBJ *pso,
ULONG iEsc,
ULONG cjIn,
PVOID pvIn,
ULONG cjOut,
PVOID pvOut)
{
#ifdef ROTATE
if (iEsc == DRVESC_GETGAMMAVALUE)
{
return GetGammaValue((ULONG *)pvOut);
}
else if (iEsc == DRVESC_SETGAMMAVALUE)
{
return SetGammaValue(cjIn, *(BOOL *)pvIn);
}
if (iEsc == DRVESC_GETSCREENROTATION)
{
*(int *)pvOut = ((DMDO_0 | DMDO_90 | DMDO_180 | DMDO_270) << 8) | ((BYTE)m_iRotate);
// return DISP_CHANGE_SUCCESSFUL;
}
return DynRotate(DMDO_90);
#endif //ROTATE & ROTATE
return 0;
}
LONG S3C2410DISP::DynRotate(int angle)
{
GPESurfRotate *pSurf = (GPESurfRotate *)m_pPrimarySurface;
m_iRotate = angle;
switch(m_iRotate)
{
case DMDO_0:
case DMDO_180:
m_nScreenHeight = m_nScreenHeightSave;
m_nScreenWidth = m_nScreenWidthSave;
break;
case DMDO_90:
case DMDO_270:
m_nScreenHeight = m_nScreenWidthSave;
m_nScreenWidth = m_nScreenHeightSave;
break;
}
m_pMode->width = m_nScreenWidth;
m_pMode->height = m_nScreenHeight;
pSurf->SetRotation(m_nScreenWidth, m_nScreenHeight, angle);
return DISP_CHANGE_SUCCESSFUL;
}
SURFOBJ *pso,
ULONG iEsc,
ULONG cjIn,
PVOID pvIn,
ULONG cjOut,
PVOID pvOut)
{
#ifdef ROTATE
if (iEsc == DRVESC_GETGAMMAVALUE)
{
return GetGammaValue((ULONG *)pvOut);
}
else if (iEsc == DRVESC_SETGAMMAVALUE)
{
return SetGammaValue(cjIn, *(BOOL *)pvIn);
}
if (iEsc == DRVESC_GETSCREENROTATION)
{
*(int *)pvOut = ((DMDO_0 | DMDO_90 | DMDO_180 | DMDO_270) << 8) | ((BYTE)m_iRotate);
// return DISP_CHANGE_SUCCESSFUL;
}
return DynRotate(DMDO_90);
#endif //ROTATE & ROTATE
return 0;
}
LONG S3C2410DISP::DynRotate(int angle)
{
GPESurfRotate *pSurf = (GPESurfRotate *)m_pPrimarySurface;
m_iRotate = angle;
switch(m_iRotate)
{
case DMDO_0:
case DMDO_180:
m_nScreenHeight = m_nScreenHeightSave;
m_nScreenWidth = m_nScreenWidthSave;
break;
case DMDO_90:
case DMDO_270:
m_nScreenHeight = m_nScreenWidthSave;
m_nScreenWidth = m_nScreenHeightSave;
break;
}
m_pMode->width = m_nScreenWidth;
m_pMode->height = m_nScreenHeight;
pSurf->SetRotation(m_nScreenWidth, m_nScreenHeight, angle);
return DISP_CHANGE_SUCCESSFUL;
}
====触摸屏部分====
关于x或者y轴对称
tchpdd.cpp(D:/WINCE500/PLATFORM/SMDK2410/DRIVERS/TOUCHP/)
#define INVERSE_X
#define INVERSE_Y
#define INVERSE_Y
注:体现在函数Touch_CoordinateConversion()中
#ifdef INVERSE_X
*px = TOUCH_X*4 - 1 - *px;
#endif
#ifdef INVERSE_Y
*py = TOUCH_Y*4 - 1 - *py;
#endif
*px = TOUCH_X*4 - 1 - *px;
#endif
#ifdef INVERSE_Y
*py = TOUCH_Y*4 - 1 - *py;
#endif
x 和y 的坐标的对调
tchpdd.cpp(D:/WINCE500/PLATFORM/SMDK2410/DRIVERS/TOUCHP/)
函数Touch_CoordinateConversion()中
#if 1 // x y坐标对调
temp = *px;
*px = *py;
*py = temp;
#endif
修改
#define LCD_TYPE TFT240_320
体现在
#if ( LCD_TYPE == TFT640_480 )
#define TOUCH_MAX_X 1000
#define TOUCH_MIN_X 30
#define TOUCH_MAX_Y 980
#define TOUCH_MIN_Y 30
#define TOUCH_X 640
#define TOUCH_Y 480
#else
#define TOUCH_MAX_X 922//922//955 //950
#define TOUCH_MIN_X 75//75//100 //90
#define TOUCH_MAX_Y 940//940//925 //960
#define TOUCH_MIN_Y 40//40//70 //50
#define TOUCH_X 240
#define TOUCH_Y 320
#endif
#define TOUCH_MAX_X 1000
#define TOUCH_MIN_X 30
#define TOUCH_MAX_Y 980
#define TOUCH_MIN_Y 30
#define TOUCH_X 640
#define TOUCH_Y 480
#else
#define TOUCH_MAX_X 922//922//955 //950
#define TOUCH_MIN_X 75//75//100 //90
#define TOUCH_MAX_Y 940//940//925 //960
#define TOUCH_MIN_Y 40//40//70 //50
#define TOUCH_X 240
#define TOUCH_Y 320
#endif
修改注册表 (特别重要,千万别忽视,否则触摸屏变化一点规律也没有,找问题还真难)
platform.reg(D:/WINCE500/PLATFORM/SMDK2410/FILES/)
修改
[HKEY_LOCAL_MACHINE/HARDWARE/DEVICEMAP/TOUCH]
"MaxCalError"=dword:7
; portrait
"CalibrationData"="1267,927 239,1679 251,143 2311,143 2311,1691"
; @CESYSGEN ENDIF CE_MODULES_POINTER
; @CESYSGEN IF CE_MODULES_DISPLAY
"MaxCalError"=dword:7
; portrait
"CalibrationData"="1267,927 239,1679 251,143 2311,143 2311,1691"
; @CESYSGEN ENDIF CE_MODULES_POINTER
; @CESYSGEN IF CE_MODULES_DISPLAY
为
[HKEY_LOCAL_MACHINE/HARDWARE/DEVICEMAP/TOUCH]
"MaxCalError"=dword:7
; portrait
; "CalibrationData"="1267,927 239,1679 251,143 2311,143 2311,1691"
; @CESYSGEN ENDIF CE_MODULES_POINTER
; @CESYSGEN IF CE_MODULES_DISPLAY
"MaxCalError"=dword:7
; portrait
; "CalibrationData"="1267,927 239,1679 251,143 2311,143 2311,1691"
; @CESYSGEN ENDIF CE_MODULES_POINTER
; @CESYSGEN IF CE_MODULES_DISPLAY
注:
1、 修改后的bsp下载