|
发表于 2018-4-11 17:32:31
14416 浏览 2 回复
求助UBOOT驱动4.3吋LCD
除了背光电路pwm我直接输出高电位,其它设置代码如下 (16 BPP (5:6:5) display types)
请问是哪里设错还是ˋ有没设定到的
- #define RGB565(r, g, b) (((r) << 11) | ((g) << 5) | (b) )
- void clean_screen(unsigned long *fb, int w, int h)
- {
- int i, j;
- for (i = 0; i < h; i ++) {
- for (j = 0; j < w; j ++) {
- fb[i * w + j] = RGB565(0, 255, 0);
- }
- }
- }
- static int do_lcd_on(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
- {
- unsigned long fb = 0x53000000;
- clean_screen(fb, 480, 272);
- GPC0CON = 0x00000100; //MD_RSTN
- GPL0CON = 0x00010000; //CHG_EN
- GPL1CON = 0x00000010; //CAM5M_RST
- GPL0DAT |= (0x1 << 4); //CHG_EN on
- GPL1DAT |= (0x0 << 1); //CAM5M_RST on
-
- GPF0CON = 0x22222222;
- GPF1CON = 0x22222222;
- GPF2CON = 0x22222222;
- GPF3CON = 0x00002222;
- GPF0DRV = 0x0000FFFF;
- GPF1DRV = 0x0000FFFF;
- GPF2DRV = 0x0000FFFF;
- GPF3DRV = 0x0000000F;
- //power
-
- //Blacklight
- GPD0CON &= ~(0xf << 4); //XPWMTOUT1
- GPD0CON |= (0x1 << 4);
- GPD0DAT &= ~(0x1 << 1); //XPWMTOUT1 on
- //system register
- LCDBLK_CFG = 2;
- LCDBLK_CFG2 = 1;
-
- //clock configure
- CLK_SRC_CAM0 |= 0x00001111;
- CLK_DIV_CAM0 |= 0x00002222;
- CLK_GATE_IP_CAM |= 0xF;
- CLK_SRC_LCD0 |= 1; //XusbXTIis Source Clk == 24MHz
- CLK_DIV_LCD |= 0; //SCLK_FIMD0 == SXusbXTI == 24MHz
- CLK_GATE_IP_LCD |= 1; //
- VIDCON0 = (2 << 6); //24/(2+1)=8MHz
- /* IVDEN =Normal
- IVSYNC =Inverted
- IHSYNC =Inverted
- IVCLK =falling edge */
- VIDCON1 |= (0 << 4) | (1 << 5) | ( 1 << 6) | (0 << 7) | (0 << 9);
- VIDCON2 = 0;
- VIDTCON0 = 9 | (1 << 8) | (1 << 16);
- VIDTCON1 = 40 | (1 << 8) | (1 << 16);
- VIDTCON2 = 479 | (271 << 11);
-
- //----------------------------
- WINCON0 = 1 | (0x5 << 2);
- SHADOWCON = 0x1;
-
- // WINCHMAP2
-
- VIDOSD0A = 0;
- VIDOSD0B = 135 | (479 << 11);
- VIDOSD0C = 136 * 240;
- //windows 0's buffer 0
- VIDW00ADD0B0 = fb;
- VIDW00ADD1B0 = fb + 480 * 272 * 4;
- VIDW00ADD2 = 480;
- //Video output enable
- VIDCON0 |= 1 | (1 << 1);
- GPC0DAT |= (1 << 2); //MD_RSTN on
- return 0;
- }
复制代码
|
|
|
|
|
|
|
|
楼主|
发表于 2018-4-13 19:56:54
原来就只差背光打开就行了
背光要用PWM不能只给高电位 |
|
|
|
|
|
|
登录或注册
扫一扫关注迅为公众号
|