linux LCD调试
开机LOGO在UI层 ; UI层在顶层;UI层使用图片自带的ALPHA;开机LOGO的ALPHA为不透明; 开机LOGO一直存在。基于以上原因,若未清framebuffer,其它图层的画面会被开机LOGO一直盖住,做类似sensor画面出图像DEMO时,可能会造成“图像不显示”的假象。不运行应用程序的情况下,可以执行下面这条命令清除framebuffer(置透明度为全透),以让自己需要的画面出现。
1.1. LCD时序参数说明
1.1.1. lcd_x
显示屏的水平像素点
1.1.2. lcd_y
显示屏的垂直像素点
1.1.3. lcd_ht
Horizontal Total time
指一行总的dclk的cycle个数
1.1.1. lcd_hbp
Horizontal Back Porch
指有效行间,行同步信号(hsync)开始,到有效数据开始之间的dclk的cycle个数, 包括同步信号区。见图1。
1.1.2. lcd_hspw
Horizontal Sync Pulse Width
指行同步信号的宽度。单位为1个dclk的时间(即是1个data cycle的时间)。见图1。
1.1.3. lcd_vt
Vertical Total time
指一场的总行数。见图2。
1.1.1. lcd_vbp
Vertical Back Porch
指场同步信号(vsync)开始,到有效数据行开始之间的行数,包括场同步信号区。见图2。
1.1.2. lcd_vspw
Vertical Sync Pulse Width
指场同步信号的宽度。单位为行。见图2。
1.1.3. lcd_dclk_freq
Data Clock Frequency
指PIN总线上数据的传送频率。单位为MHz ,即pixel_clock
屏幕刷新帧数 = (lcd_dclk_freq×1000×1000) / (ht×vt)
1.1.1. lcd_pwm_freq
Lcd backlight PWM Frequency
这个参数配置PWM信号的频率,单位为Hz。
1.1.2. lcd_pwm_pol
Lcd backlight PWM Polarity
这个参数配置PWM信号的占空比的极性。设置相应值对应含义为:
0:active high
1:active low
1.1.3. lcd_frm
Lcd Frame Rate Modulator
FRM是解决由于PIN减少导致的色深问题。
这个参数设置相应值对应含义为:
0:RGB888 → RGB888 direct
1:RGB888 → RGB666 dither
2:RGB888 → RGB565 dither
有些LCD屏的像素格式是18bit色深(RGB666)或16bit色深(RGB565),建议打开FRM功能,通过dither的方式弥补色深,使显示达到24bit色深(RGB888)的效果。如图2-4和图2-5,上图是色深为RGB66的LCD屏显示,下图是打开dither后的显示,打开dither后色彩渐变的地方过度平滑。
表1-2 LCD接口参数配置说明 | ||
Interface | Parameter | |
RGB接口 | Parallel RGB | lcd_hv_clk_phase |
Serial RGB | lcd_hv_clk_phase lcd_hv_srgb_seq | |
Dummy RGB | ||
RGB Dummy | ||
Serial YUV/CCIR656 | lcd_hv_syuv_seq | |
CPU/8080接口 | Parallel 18bit | lcd_cpu_te |
Parallel 16bit | ||
LVDS接口 | Single channal | lcd_lvds_bitwidth |
Dual channal | ||
DSI接口 | A20+SSD2828 | lcd_hv_clk_phase |
#include <stdio.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#if 0
#define FB_WIDTH 320
#define FB_HEIGHT 240
#else
#define FB_WIDTH 480
#define FB_HEIGHT 272
#endif
#define BIT_PER_PIX 32
#define PIX_LENGTH (BIT_PER_PIX / 8)
#define LINE_LENGTH (FB_WIDTH * PIX_LENGTH)
#define LENGTH (LINE_LENGTH * FB_HEIGHT)
unsigned long *buf;
int main(int argc, char *argv[])
{
int fd;
unsigned long color;
char *pos;
if (argc != 2)
{
fprintf(stderr, "demo color: 0x10ff0000\n");
usage();
return -1;
}
system("echo 0 >/sys/class/disp/disp/attr/lcd");
system("echo 1 >/sys/class/disp/disp/attr/lcd");
system("dd if=/dev/zero of=/dev/graphics/fb0");
if ((fd = open("/dev/graphics/fb0", O_RDWR)) < 0)
{
printf("open /dev/fb0 failed\n");
return -1;
}
buf = (unsigned long *)mmap(NULL, LENGTH, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
color = strtol(argv[1],&pos,16);
/ / color = 0x10ff0000;
fprintf(stderr, "color:0x%x\n", color);
unsigned long *ctt = mmap(NULL, LENGTH, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
/* set the display content */
int cnt = 0;
printf("%x\n", color);
while(cnt < LENGTH)
{
memcpy(ctt+(cnt/4), &color, 4);
cnt += 4;
}
munmap(ctt, LENGTH);
close(fd);
return 0;
}
int usage(void)
{
fprintf(stderr, "memset fb0 color\n");
fprintf(stderr, "usage: fb_color <color>\n");
return 1;
}
root@camdroid:/ #
root@camdroid:/ #
root@camdroid:/ # cd /sys/class/sunxi_dump
root@camdroid:/sys/class/sunxi_dump # echo 01c0c040 800001f4 > write
root@camdroid:/sys/class/sunxi_dump # echo 01c0c040 800001f5 > write
root@camdroid:/sys/class/sunxi_dump # echo 01c0c000,01c0c220 > dump;cat dump
[ 148.270551] __sunxi_dump_regs_ex, start 0x01c0c000, end 0x01c0c220, return 1995
0x01c0c000: 0x80000000 0x80000000 0x00000000 0x00000000
0x01c0c010: 0x80000000 0x00000001 0x00000003 0x00000005
0x01c0c020: 0x00000007 0x0000000b 0x0000000d 0x01010000
0x01c0c030: 0x15151111 0x57575555 0x7f7f7777 0x00000000
0x01c0c040: 0x800001f5 0xf000000a 0x01df0355 0x01f30009
0x01c0c050: 0x06b80003 0x00010001 0x00000000 0x00000000
0x01c0c060: 0x00000000 0x00000000 0x00000000 0x00000000
0x01c0c070: 0x00000000 0x00000000 0x00000000 0x00000000
0x01c0c080: 0x00000000 0x00000000 0x00000000 0xe0000000
0x01c0c090: 0x00000000 0x00000000 0x00000000 0x00000000
0x01c0c0a0: 0x00000000 0x00000000 0x00000000 0x00000000
0x01c0c0b0: 0x00010001 0x00000000 0x00000000 0x00000000
0x01c0c0c0: 0x00000000 0x00000000 0x00000000 0x00000000
0x01c0c0d0: 0x00000000 0x00000000 0x00000000 0x00000000
0x01c0c0e0: 0x00000000 0x00000000 0x00000000 0x00000000
0x01c0c0f0: 0x00000000 0xffffffff 0x40840000 0xa0e24000
0x01c0c100: 0x00000000 0x00000000 0x00000000 0x00000000
0x01c0c110: 0x00000000 0x00000000 0x00000000 0x00000000
0x01c0c120: 0x00000000 0x00000000 0x00000000 0x00000000
0x01c0c130: 0x00000000 0x00000000 0x00000000 0x00000000
0x01c0c140: 0x00000000 0x00000000 0x00000000 0x00000000
0x01c0c150: 0x00000000 0x00000000 0x00000000 0x00000000
0x01c0c160: 0x00000000 0x00000000 0x00200000 0x00000000
0x01c0c170: 0x00000000 0x00000000 0x00000000 0x00000000
0x01c0c180: 0x00000000 0x00000000 0x00000000 0x00000000
0x01c0c190: 0x00000000 0x00000000 0x00000000 0x00000000
0x01c0c1a0: 0x00000000 0x00000000 0x00000000 0x00000000
0x01c0c1b0: 0x00000000 0x00000000 0x00000000 0x00000000
0x01c0c1c0: 0x00000000 0x00000000 0x00000000 0x00000000
0x01c0c1d0: 0x00000000 0x00000000 0x00000000 0x00000000
0x01c0c1e0: 0x00000000 0x00000000 0x00000000 0x00000000
0x01c0c1f0: 0x01860003 0x00000000 0x00000000 0x00000000
0x01c0c200: 0x00000000 0x00000000 0x00000000 0x00000000
0x01c0c210: 0x00000000 0x00000000 0x00000000 0x00000000
0x01c0c220: 0x00000000
root@camdroid:/sys/class/sunxi_dump # echo 01c0c040 800001f5 > write
root@camdroid:/sys/class/sunxi_dump # echo 01c0c040 800001f4 > write
root@camdroid:/sys/class/sunxi_dump #
root@camdroid:/sys/class/sunxi_dump #
root@camdroid:/sys/class/sunxi_dump # echo 01c0c040 800001f0 > write
更多推荐
所有评论(0)