阅读:3923回复:26
2410LCD显示问题
2410 从4.2升级到5.0后系统起来后屏幕显示上下两截,且两截一样,各占半屏幕```
请问是否是时序的问题```在哪改```请高手指点一下!! |
|
沙发#
发布于:2007-11-14 22:48
这半个屏幕是什么样的?是完整的WinCE界面还是一半的WinCE界面
|
|
板凳#
发布于:2007-11-15 09:05
谢谢chjw_ch````是完整的Wince界面
|
|
地板#
发布于:2007-11-15 09:40
你的LCD设置的分辨率是多少?你的5.0的LCD驱动是从4.2移植过来的还是5.0的bsp包中的?
|
|
地下室#
发布于:2007-11-15 09:41
能否贴一个照片上来看看?
|
|
5楼#
发布于:2007-11-15 10:18
是从4.2移植过来的```原来是320*240, 现在要改用800*600
没相机````相片没办法贴上来````屏幕是上下两半```上面原色正常````下面不正常`` 谢谢 |
|
6楼#
发布于:2007-11-15 10:56
InitDisplay函数里的设置贴出来看看
|
|
7楼#
发布于:2007-11-15 10:57
检查一下你的显存是否足够,因为你改大了分辨率
|
|
8楼#
发布于:2007-11-15 11:14
谢谢各位了
DisplayInit(LPCTSTR pszInstance, DWORD dwNumMonitors) { DWORD dwStatus; HKEY hkDisplay; BOOL fOk = FALSE; RETAILMSG(0, (_T("SALCD2: display instance '%s', num monitors %d\r\n"), pszInstance != NULL ? pszInstance : _T("<NULL>"), dwNumMonitors)); if(pszInstance != NULL) { _tcsncpy(gszBaseInstance, pszInstance, dim(gszBaseInstance)); } // sanity check the path by making sure it exists dwStatus = RegOpenKeyEx(HKEY_LOCAL_MACHINE, gszBaseInstance, 0, 0, &hkDisplay); if(dwStatus == ERROR_SUCCESS) { RegCloseKey(hkDisplay); fOk = TRUE; } else { RETAILMSG(0, (_T("SALCD2: DisplayInit: can't open '%s'\r\n"), gszBaseInstance)); } return fOk; } |
|
9楼#
发布于:2007-11-15 11:16
现在还没有改大```在原来的LCD上就是显示两半的
void S3C2410DISP::InitializeHardware (void) { WORD *ptr; DWORD index; HKEY hkDisplay = NULL; DWORD dwLCDPhysicalFrameBase; DWORD dwStatus, dwType, dwSize; RETAILMSG(0, (_T("++S3C2410DISP::InitializeHardware\r\n"))); // open the registry key and read our configuration dwStatus = RegOpenKeyEx(HKEY_LOCAL_MACHINE, gszBaseInstance, 0, 0, &hkDisplay); dwType = REG_DWORD; if(dwStatus == ERROR_SUCCESS && dwType == REG_DWORD) { dwSize = sizeof(DWORD); dwStatus = RegQueryValueEx(hkDisplay, _T("LCDVirtualFrameBase"), NULL, &dwType, (LPBYTE) &gdwLCDVirtualFrameBase, &dwSize); } if(dwStatus == ERROR_SUCCESS && dwType == REG_DWORD) { dwSize = sizeof(DWORD); dwStatus = RegQueryValueEx(hkDisplay, _T("LCDPhysicalFrameBase"), NULL, &dwType, (LPBYTE) &dwLCDPhysicalFrameBase, &dwSize); } // close the registry key if(hkDisplay != NULL) { RegCloseKey(hkDisplay); } // did we get everything? if(dwStatus != ERROR_SUCCESS) { RETAILMSG(0, (_T("SALCD2: InitializeHardware: couldn't get registry configuration\r\n"))); return; } // map frame buffer into process space memory m_VirtualFrameBuffer = (DWORD)VirtualAlloc(0, (0x40000), MEM_RESERVE, PAGE_NOACCESS); if (m_VirtualFrameBuffer == NULL) { RETAILMSG(0,(TEXT("m_VirtualFrameBuffer is not allocated\n\r"))); return; } else if (!VirtualCopy((PVOID)m_VirtualFrameBuffer, (PVOID)gdwLCDVirtualFrameBase, (0x40000), PAGE_READWRITE | PAGE_NOCACHE)) { RETAILMSG(0, (TEXT("m_VirtualFrameBuffer is not mapped\n\r"))); VirtualFree((PVOID)m_VirtualFrameBuffer, 0, MEM_RELEASE); return; } RETAILMSG(0, (TEXT("m_VirtualFrameBuffer is mapped at %x(PHY : %x)\n\r"), m_VirtualFrameBuffer, gdwLCDVirtualFrameBase)); RETAILMSG(0, (TEXT("Clearing frame buffer !!!\n\r"))); ptr = (WORD *)m_VirtualFrameBuffer; // clear rest of frame buffer out for (index = 0; index < 320*240; index++) { if(index < 3200) { ptr[index] = 0xf800; } else if(index < 6400) { ptr[index] = 0x07e0; } else if(index < 9600) { ptr[index] = 0x001f; } else { ptr[index] = 0xffff; } } RETAILMSG(1, (_T("--S3C2410DISP::InitializeHardware\r\n"))); } |
|
10楼#
发布于:2007-11-16 12:49
不是这部分代码,是里面有对s3c2410的LCD相关寄存器设置的那部分代码,我记得函数名应该是InitDisplay
|
|
11楼#
发布于:2007-11-17 12:17
不好意思``谢谢chjw_ch
static void InitDisplay(void) { volatile S3C2410X_IOPORT_REG *s2410IOP = (S3C2410X_IOPORT_REG *)OALPAtoVA(S3C2410X_BASE_REG_PA_IOPORT, FALSE); volatile S3C2410X_LCD_REG *s2410LCD = (S3C2410X_LCD_REG *)OALPAtoVA(S3C2410X_BASE_REG_PA_LCD, FALSE); // Set up the LCD controller registers to display a power-on bitmap image. // s2410IOP->GPCUP = 0xFFFFFFFF; s2410IOP->GPCCON = 0xAAAAAAAA; s2410IOP->GPDUP = 0xFFFFFFFF; s2410IOP->GPDCON = 0xAAAAAAAA; s2410LCD->LCDCON1 = (6 << 8) | /* VCLK = HCLK / ((CLKVAL + 1) * 2) -> About 7 Mhz */ (LCD_MVAL << 7) | /* 0 : Each Frame */ (3 << 5) | /* TFT LCD Pannel */ (12 << 1) | /* 16bpp Mode */ (0 << 0) ; /* Disable LCD Output */ s2410LCD->LCDCON2 = (LCD_VBPD << 24) | /* VBPD : 1 */ (LCD_LINEVAL_TFT << 14) | /* Vertical Size : 320 - 1 */ (LCD_VFPD << 6) | /* VFPD : 2 */ (LCD_VSPW << 0) ; /* VSPW : 1 */ s2410LCD->LCDCON3 = (LCD_HBPD << 19) | /* HBPD : 6 */ (LCD_HOZVAL_TFT << 8) | /* HOZVAL_TFT : 240 - 1 */ (LCD_HFPD << 0) ; /* HFPD : 2 */ s2410LCD->LCDCON4 = (LCD_MVAL << 8) | /* MVAL : 13 */ (LCD_HSPW << 0) ; /* HSPW : 4 */ s2410LCD->LCDCON5 = (0 << 12) | /* BPP24BL : LSB valid */ (1 << 11) | /* FRM565 MODE : 5:6:5 Format */ (0 << 10) | /* INVVCLK : VCLK Falling Edge */ (1 << 9) | /* INVVLINE : Inverted Polarity */ (1 << 8) | /* INVVFRAME : Inverted Polarity */ (0 << 7) | /* INVVD : Normal */ (0 << 6) | /* INVVDEN : Normal */ (0 << 5) | /* INVPWREN : Normal */ (0 << 4) | /* INVENDLINE : Normal */ (0 << 3) | /* PWREN : Disable PWREN */ (0 << 2) | /* ENLEND : Disable LEND signal */ (0 << 1) | /* BSWP : Swap Disable */ (1 << 0) ; /* HWSWP : Swap Enable */ s2410LCD->LCDSADDR1 = ((IMAGE_FRAMEBUFFER_DMA_BASE >> 22) << 21) | ((M5D(IMAGE_FRAMEBUFFER_DMA_BASE >> 1)) << 0); s2410LCD->LCDSADDR2 = M5D((IMAGE_FRAMEBUFFER_DMA_BASE + (LCD_XSIZE_TFT * LCD_YSIZE_TFT * 2)) >> 1); s2410LCD->LCDSADDR3 = (((LCD_XSIZE_TFT - LCD_XSIZE_TFT) / 1) << 11) | (LCD_XSIZE_TFT / 1); s2410LCD->LPCSEL |= 0x3; s2410LCD->TPAL = 0x0; s2410LCD->LCDCON1 |= 1; // Display a bitmap image on the LCD... // memcpy((void *)IMAGE_FRAMEBUFFER_UA_BASE, ScreenBitmap, LCD_ARRAY_SIZE_TFT_16BIT); } |
|
12楼#
发布于:2007-11-18 07:54
OALPAtoVA 能在驱动里用?要连接那个库啊?
|
|
13楼#
发布于:2007-11-19 09:24
请各位帮我指点一下````谢谢
还有请问论坛里怎么传图片上来? |
|
14楼#
发布于:2007-11-19 09:25
你看一下这个文件中前面的LCD_XSIZE_TFT ,LCD_YSIZE_TFT 定义的值,还有s3c2410.h中定义的这2个值是多少?
|
|
15楼#
发布于:2007-11-19 09:44
需要修改的文件有:
1. s3c2410.h (或者s2410.h) 中的LCD_XSIZE_TFT, LCD_YSIZE_TFT需要修改为你期望的分辨率。 2. 确保cfw.c中没有重新定义以上的2个宏 3. 修改s3c2410disp.cpp的构造函数S3C2410DISP中的m_nScreenWidth, m_nScreenHeight,必须和你上面设置的数值有关。 4. 修改config.bib中的DISPLAY所在行,例如640x480x16bpp的定义为: DISPLAY 8c100000 00100000 RESERVED 其中8c100000是显存的地址, 00100000是显存的大小,640x480x 16(bit) = 640x480x2(byte) = 0x96000 byte ,注意这个显存的大小必须足够容纳你的分辨率需要的空间。而且要保证显存的地址+显存的大小 不能够大于前面的NK的基地址(默认为8C200000),显存的基地址也不能覆盖前面的节。 5. 调整分辨率以后,有时候还需要调整s3c2410.h (s2410.h)中的LCD的一些时序的定义常量,这个要看你的屏的具体的datasheet,可以暂时不修改。 |
|
16楼#
发布于:2007-11-19 09:47
谢谢chjw_ch```两个的定义如下
#define LCD_XSIZE_TFT (320) #define LCD_YSIZE_TFT (240) |
|
17楼#
发布于:2007-11-19 09:57
以上是wince4.2关于lcd的修改内容。wince5.0的bsp中的文件路径和名称有一些变化,基本的对应关系是:
s3c2410.h 中LCD相关的部分s3c2410x_lcd.h s3c2410disp.cpp -> s3c2410x_lcd.cpp 其他的都应该差不多 |
|
18楼#
发布于:2007-11-19 09:58
LCD_XSIZE_TFT ,LCD_YSIZE_TFT 应该修改为你所需要的分辨率,其他的内容也需要按照我上面的帖子的几个步骤来修改
|
|
19楼#
发布于:2007-11-19 10:10
非常感谢!!
请问chjw_ch可否告知 QQ或Skype, 以便有问题可以向你请教? |
|
上一页
下一页