|
发表于 2008-7-29 00:30:31
|
显示全部楼层
下面是你提供的文件中的内容:
ecos-cvs/packages/hal/arm/s3c44b0x/current/include/lcd-support.h
...
#define LCD_WIDTH (320)
#define LCD_HEIGHT (240)
…
#define DISMODE 2
…
#define LINEBLANK 10
#define HOZVAL (LCD_WIDTH)
#define LINEVAL (LCD_HEIGHT)
#define dLCDCON2 ((LINEBLANK<<21)|(HOZVAL<<10)|LINEVAL)
…
#define MODESEL 3
…
#define BSWP 0
…
从中可看出你想设置的 LCD 具体参数是:
宽320、高240、8位色深(256索引空间) Single-Scan 模式
其中,关于 HOZVAL/LINEVAL 的计算公式有错。应为下面:
#define HOZVAL (((LCD_WIDTH)*3)/8-1)
#define LINEVAL ((LCD_HEIGHT)-1)
具体缘由我摘录手册内容如下,供你参考:
P12-4
The VFRAME and VLINE pulse generation is controlled by the configurations of the HOZVAL field and the LINEVAL
field in the LCDCON2 register. Each field is related to the LCD size and display mode. In other words, the HOZVAL
and LINEVAL can be determined by the size of the LCD panel and the display mode according to the following
equation:
HOZVAL = ( Horizontal display size / Number of the valid VD data line) -1
In color mode: Horizontal display size = 3 * Number of Horizontal Pixel
In case of 4-bit dual scan display the number of valid VD data line should be 4 and in case of 8-bit signal scan
display mode, the number of valid VD data lines should be 8.
LINEVAL = (Vertical display size) -1: In case of single scan display type
LINEVAL = (Vertical display size / 2) -1: In case of dual scan display type
| | | | | | These bits indicate the blank time in one horizontal line duration time. These bits adjust the rate of the VLINE finely. The unit of LINEBLANK is MCLK. Ex) If the value of LINEBLANK is 10, the blank time is inserted to VCLK during 10 system clocks. | | | | These bits determine the horizontal size of the LCD panel. HOZVAL has to be determined to meet the condition that total bytes of 1 line be 2n bytes. If the x size of LCD is 120 dots in mono mode, x=120 can not be supported because 1 line consists of 15 bytes. Instead, x=128 in mono mode can be supported because 1 line consists of 16 bytes(2n). The additional 8 dot will be discarded by LCD panel driver. | | | | These bits determine the vertical size of LCD panel. | |
| | | | | | 1 : Swap Enable 0 : Swap Disable LCD DMA fetches the frame memory data by 4 word burst access. In little endian mode and BSWP is 0, the frame memory data are displayed in the sequence, 4n+3th, 4n+2th ,4n+1th ,4nth data. If BSWP is 1, the sequence will be 4n-th, 4n+1th, If the CPU is little endian mode, the frame buffer may be accessed by only byte access mode, Because BSWP is 1, the byte accessed data will be shown correctly also in the little endian mode. In the other case, BSWP has to be 0. | |
[ 本帖最后由 AnthonyLee 于 2008-7-29 00:43 编辑 ] |
|