概述
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
/* for (bufIdx=0; bufIdx < NUM_DISPLAY_BUFS-1; bufIdx++) {
fbp[bufIdx+1] = fbp[bufIdx] + displaySize;
}*/
for(bufIdx=0;bufIdx
{
buf=(unsigned int *)fbp;
for (i=0; i < displaySize / sizeof(unsigned int); i++) {
buf[i] = UYVY_BLACK;
}
}
//pix=calloc(screensize,1);
yuv=fopen(FILE_YUV,"rb");
//displayIdx = (displayIdx + 1) % NUM_DISPLAY_BUFS;
fread(fbp,displaySize,1,yuv);
//fbp[displayIdx]=pix[displayIdx];
// for(j=0;j
//{fbp[j]=pix[j];}
//memset(fbp,yuv,screensize);
munmap(fbp, screensize);//ÉŸ³ýÌضšµØÖ·ÇøÓòµÄ¶ÔÏóÓ³Éä int munmap(void *start, size_t length); printf("The framebuffer device was munmapped to memory successfully.n");
close(fbfd);
printf("The framebuffer device was closed successfully.n");
return 0;
}
//static int osdInit(char *displays)
void osdInit(void)
{
struct fb_var_screeninfo varInfo;
struct fb_fix_screeninfo fixInfo;
int fd;
int size=0;
char * displays;
// Open the OSD device
fd = open("/dev/fb/0", O_RDWR);
printf("123456n");
if (fd == -1) {
printf("Failed to open fb device %sn", "/dev/fb/0");
}
if (ioctl(fd, FBIOGET_VSCREENINFO, &varInfo) == -1) {
printf("Failed ioctl FBIOGET_VSCREENINFO on %sn","/dev/fb/0" );
}
if (ioctl(fd, FBIOGET_FSCREENINFO, &fixInfo) == -1) {
printf("Failed FBIOGET_FSCREENINFO on n");
} // Try the requested size
varInfo.xres =720; ///WIDTH=720
varInfo.yres =576; ///HEIGHT=480 全屏显示
// varInfo.xres_virtual =720;
// varInfo.yres_virtual =1728;
varInfo.bits_per_pixel = 16; //=2,,,,,16位的显示屏SCREEN_BPP=16 if (ioctl(fd, FBIOPUT_VSCREENINFO, &varInfo) == -1) {
printf("Failed ioctl FBIOPUT_VSCREENINFO on %sn", "/dev/fb/0");
} if (varInfo.xres !=720 ||
varInfo.yres !=576 ||
varInfo.bits_per_pixel != 16) {
printf("Failed to get the requested screen size: at bppn");
}
size = fixInfo.line_length * varInfo.yres_virtual;
printf("size=%dn",size);
// Map the frame buffers to user space
displays= (char *) mmap(NULL, size ,
PROT_READ | PROT_WRITE,
MAP_SHARED, fd, 0); if (displays == MAP_FAILED) {
printf("Failed mmap on %sn", "/dev/fb/0");
}
memset(displays,0,size);
//setOsdBuffer(fd, 0); } static int setOsdTransparency(unsigned char trans) //trans的值是0,设置OSD透明度参数
最后
以上就是鲜艳高山为你收集整理的arm linux输出到lcd,求助 armlinux中实现lcd显示的全部内容,希望文章能够帮你解决arm linux输出到lcd,求助 armlinux中实现lcd显示所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复