linux中lcd的用法,求助 armlinux中实现lcd显示

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

/* 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("123456\n");

if (fd == -1) {

printf("Failed to open fb device %s\n", "/dev/fb/0");

}

if (ioctl(fd, FBIOGET_VSCREENINFO, &varInfo) == -1) {

printf("Failed ioctl FBIOGET_VSCREENINFO on %s\n","/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 %s\n", "/dev/fb/0");

} if (varInfo.xres !=720 ||

varInfo.yres !=576 ||

varInfo.bits_per_pixel != 16) {

printf("Failed to get the requested screen size: at bpp\n");

}

size = fixInfo.line_length * varInfo.yres_virtual;

printf("size=%d\n",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 %s\n", "/dev/fb/0");

}

memset(displays,0,size);

//setOsdBuffer(fd, 0); } static int setOsdTransparency(unsigned char trans) //trans的值是0,设置OSD透明度参数

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值