testlcd.c

来自「该程序是在linux arm下实现的基于framebuffer的LCD驱动」· C语言 代码 · 共 68 行

C
68
字号
/*   testlcd.c : Test LCD & TouchScreen Devices driver for Linux          Copyright (C) 2002 Lao Tie & Olival  Ran   A lot of inspiration came from Jun Qiu...   ellipse extensions by:  	FengHua Zhu    This program is free software; you can redistribute it and/or modify   it under the terms of the GNU General Public License as published by   the Free Software Foundation; either version 2, or (at your option)   any later version.      You should have received a copy of the GNU General Public License   (for example /usr/src/linux/COPYING); if not, write to the Free   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */#include <unistd.h>#include <stdlib.h>#include <stdio.h>#include <fcntl.h>#include <sys/stat.h>#include <fcntl.h>#include <unistd.h>#include <sys/mman.h>#include <string.h>#include <linux/fb.h>#include <linux/kd.h>#include <sys/mman.h>#include <sys/types.h>#include <sys/stat.h>#include <termios.h>#include <sys/time.h>#include <sys/ioctl.h>#include "lcd.h"int  main(){    int i , j ;    fb_init();        //    lcd_vline(30,0,100,0,0);	//    for(i=0;i<50;i++)//        lcd_putpixel(i,i,0,0);//    lcd_fillrect(0, 0, 159, 9, 0);//    lcd_hline(0, 10, 120, 0, 0);//    lcd_putpixel(0, 100, 1, 0);	for(i = 0; i < 120; i++)	{		lcd_ellipse(160,120,i+1,i+1,i*2,0);    	lcd_textout(126, 16,"普天慧讯",255-i*2);		sleep(1);	}//    lcd_textout(0, 32,"嵌入式ARM系统");//    show_palette();    fb_release();}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?