亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? lcd.c

?? 嵌入式下實驗的新的驅動設計源代碼
?? C
字號:
/* * lcd.c : Test LCD driver * * Copyright (C) 2003 ynding ( haoanian@263.net ) * * 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 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA * */#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <unistd.h>#include "lcd.h"static int dev_fd;void init_lcd(void){	static o_flag = 0;	if ( o_flag == 0 ) {		dev_fd = open("/dev/LCD",O_WRONLY);		++o_flag;	}	if(dev_fd<0)	{	         printf("cannot open /dev/LCD \n");	}         else	{	printf("LCD open\n"); 	}			return;}void close_lcd(void){	static c_flag = 0;	if ( c_flag == 0 ) {		close(dev_fd);		++c_flag;	}		return;}void clear_lcd(void){        printf("start clear\n");	ioctl(dev_fd, LCD_Clear, 0);	return;}/*  * draw a dot on the LCD * x,y : coordinates of the pixel to be displayed * color : the color of the dot */void draw_dot(int x, int y, COLOR color){	struct lcd_display	dot_display;	dot_display.x1 = x;	dot_display.y1 = y;	dot_display.color = color;	ioctl(dev_fd, LCD_Pixel_Set, &dot_display);	return;}/* draw a big dot 2*2 */void draw_big_dot(int x, int y, COLOR color){	struct lcd_display	big_dot_display;	big_dot_display.x1 = x;	big_dot_display.y1 = y;	big_dot_display.color = color;	ioctl(dev_fd, LCD_Big_Pixel_Set, &big_dot_display);	return;}/* draw a vertical line */void draw_vline(int x, int y1, int y2, COLOR color){	struct lcd_display      vline_display;	vline_display.x1 = x;	vline_display.y1 = y1;	vline_display.y2 = y2;	vline_display.color = color;	ioctl(dev_fd, LCD_Draw_VLine, &vline_display);	return;}/* draw a horizontal line */void draw_hline(int x1, int x2, int y, COLOR color){	struct lcd_display      hline_display;	hline_display.x1 = x1;	hline_display.x2 = x2;	hline_display.y1 = y;	hline_display.color = color;	ioctl(dev_fd, LCD_Draw_HLine, &hline_display);		return;}/* draw a vertical dashed */void draw_vdashed(int x, int y1, int y2, COLOR color){	struct lcd_display      vdashed_display;	vdashed_display.x1 = x;	vdashed_display.y1 = y1;	vdashed_display.y2 = y2;	vdashed_display.color = color;	ioctl(dev_fd, LCD_Draw_VDashed, &vdashed_display);								        	return;}/* draw a horizontal dashed */void draw_hdashed(int x1, int x2, int y, COLOR color){	struct lcd_display      hdashed_display;	hdashed_display.x1 = x1;	hdashed_display.x2 = x2;	hdashed_display.y1 = y;	hdashed_display.color = color;	ioctl(dev_fd, LCD_Draw_HDashed, &hdashed_display);	return;}/* * (start_x,start_y) : coordinate of the top-left-corner of the rectangle  * (end_x,end_y) : coordinate of the bottom-right-corner of the rectangle */void draw_rectangle(int start_x, int start_y, int end_x, int end_y, COLOR color){	struct lcd_display      rect_display;	rect_display.x1 = start_x;	rect_display.y1 = start_y;	rect_display.x2 = end_x;	rect_display.y2 = end_y;	rect_display.color = color;	ioctl(dev_fd, LCD_Draw_Rectangle, &rect_display);	return;}/* * (start_x,start_y) : coordinate of the top-left-corner of the rectangle  * (end_x,end_y) : coordinate of the bottom-right-corner of the rectangle * this rectangle is filled with pixels which color is the same as the frame */void draw_full_rectangle(int start_x, int start_y, int end_x, int end_y, COLOR color){	struct lcd_display      frect_display;	frect_display.x1 = start_x;	frect_display.y1 = start_y;	frect_display.x2 = end_x;	frect_display.y2 = end_y;	frect_display.color = color;	ioctl(dev_fd, LCD_Draw_Full_Rectangle, &frect_display);	return;  }/* (x,y) -- coordinate of the center of the circle */void draw_circle(int x, int y, int r, COLOR color){	int x1 = 0;	int y1 = r;	int p = 3 - 2 * r;	while(x1 <= y1 ) {		draw_dot(x + x1,y + y1,color);		draw_dot(x - x1,y + y1,color);		draw_dot(x + x1,y - y1,color);		draw_dot(x - x1,y - y1,color);		draw_dot(x + y1,y + x1,color);		draw_dot(x - y1,y + x1,color);		draw_dot(x + y1,y - x1,color);		draw_dot(x - y1,y - x1,color);		if(p < 0)			p+= 4 * x1++ +6;		else			p+= 4 * (x1++ - y1--) + 10;	}	return;}/* * display an ascii character * x,y   : coordinates of the start pixel * codes : the the bytes serial to be displayed  * the size of the ascii characters is 8*16 * color : the color of the character */void write_en(int x, int y, unsigned char* codes, COLOR color){	int i = 0;	struct lcd_display      en_display;	en_display.x1 = x;	en_display.y1 = y;	en_display.color = color;	for ( i=0;i<16;++i ) {		en_display.buf[i] = codes[i];	}	ioctl(dev_fd, LCD_Write_EN, &en_display);	return;  }/* * display a Chinese character * x,y   : coordinates of the start pixel * codes : the bytes serial to be displayed * the size of the Chinese characters is 16*16 * color : the color of the character */void write_cn(int x, int y, unsigned char* codes, COLOR color){	int i = 0;	struct lcd_display      cn_display;	cn_display.x1 = x;	cn_display.y1 = y;	cn_display.color = color;	for ( i=0;i<32;++i ) {		cn_display.buf[i] = codes[i];	}	ioctl(dev_fd, LCD_Write_CN, &cn_display);	return; }/* * display a string, can contain both ascii characters and Chinese characters * * x,y : the beginning coordinates of the string to be displayed * 0<=x<=39 : each line holds 40 bytes (each byte contain 8 pixels) horizontally * 0<=y<=14 : each line holds 16 pixels vertically * * so the whole LCD can display 40*15 ascii characters, * or 20*15 Chinese characters * * color : the color of the string  */void display_string(int x, int y, char* str, COLOR color){	unsigned int    ch;	unsigned int    cl;	unsigned int    offset;	unsigned char	buf[32];	int zk_cn_fd;	int zk_en_fd;	zk_cn_fd = open("/var/nfs/lcdtest/hzk16x16",O_RDONLY);	zk_en_fd = open("/var/nfs/lcdtest/ascii8x16",O_RDONLY);	while (*str){		ch = (unsigned int)str[0];		cl = (unsigned int)str[1];		if ( (ch>=0xa1)&&(ch<0xf8) && (cl>=0xa1)&&(cl<0xff) ) { /* Chinese characters */			/* if x reaches the end of a line,turn to the next line */			if ( x==39 || x==40 ){				x = 0;				y += 1;			}			/* calculate the offset of the character in the character storage */			offset = ( (ch-0xa1)*94+(cl-0xa1) )*32;			/* read the codes of the Chinese character */			lseek(zk_cn_fd,offset,SEEK_SET);			read(zk_cn_fd,buf,32);			/* display the character */			write_cn(x*8, y*16, buf, color);			/* x axis increase 2 */			x += 2;			/* move to the next character */			str += 2;       /* a Chinese character holds 2 bytes */		}else{ /* ascii character */			/* if x reaches the end of a line,turn to the next line */			if ( x == 40 ) {				x = 0;				y += 1;			}			/* calculate the offset of the character in the character storage */			offset = 16*ch;			/* read the codes of the ascii character */			lseek(zk_en_fd, offset, SEEK_SET);			read(zk_en_fd, buf, 16);			/* display the character */			write_en(x*8, y*16, buf, color);			/* x axis increase 1 */			x += 1;			/* move to the next character */			str++;  /* an ascii character holds 1 byte */		}	}	close(zk_en_fd);	close(zk_cn_fd);	return;}/* printf 4 colors' scales, and 7 characteristic colors */void display_color_scales(void){	static COLOR    red[] = {		red0, red1, red2, red3, red4, red5, red6, red7,		red8, red9, reda, redb, redc, redd, rede, redf	};	static COLOR    green[] = {		green0, green1, green2, green3, green4, green5, green6, green7,		green8, green9, greena, greenb, greenc, greend, greene, greenf	};	static COLOR    blue[] = {		blue0, blue1, blue2, blue3, blue4, blue5, blue6, blue7,		blue8, blue9, bluea, blueb, bluec, blued, bluee, bluef	};	static COLOR    gray[] = {		gray0, gray1, gray2, gray3, gray4, gray5, gray6, gray7,		gray8, gray9, graya, grayb, grayc, grayd, graye, grayf	};	int i = 0;	for ( i=0;i<16;++i ) {		/* red scale */		draw_full_rectangle(20*i,0,20*(i+1),20,red[i]);		/* green  scale */		draw_full_rectangle(20*i,20,20*(i+1),40,green[i]);		/* blue scale */		draw_full_rectangle(20*i,40,20*(i+1),60,blue[i]);		/* gray scale */		draw_full_rectangle(20*i,60,20*(i+1),80,gray[i]);	}	/* characteristic  colors:red,orange,yellow,green,cyan,blue,purple */	draw_full_rectangle(90,100,110,120,RED);	draw_full_rectangle(110,100,130,120,ORANGE);	draw_full_rectangle(130,100,150,120,YELLOW);	draw_full_rectangle(150,100,170,120,GREEN);	draw_full_rectangle(170,100,190,120,CYAN);	draw_full_rectangle(190,100,210,120,BLUE);	draw_full_rectangle(210,100,230,120,PURPLE);	return;}void display_circles(void){	draw_circle(50,120,20,RED);	draw_circle(50,120,30,GREEN);	draw_circle(270,120,20,BLUE);	draw_circle(270,120,30,BLACK);	return;}                                                                        

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线看国产一区| 国产精品网曝门| 精品国一区二区三区| 亚洲欧洲制服丝袜| 国产精品一级片| 欧美日韩大陆一区二区| 国产精品乱人伦一区二区| 欧美a一区二区| 欧美亚州韩日在线看免费版国语版 | 成av人片一区二区| 欧美一区二区三区小说| 亚洲欧美另类图片小说| 国产激情精品久久久第一区二区| 在线观看免费成人| 中文字幕一区二区三区精华液 | 亚洲日本韩国一区| 国产一区二区三区视频在线播放| 欧美无乱码久久久免费午夜一区 | 精品久久久久久综合日本欧美| 亚洲精品欧美二区三区中文字幕| 成人午夜免费电影| 久久久青草青青国产亚洲免观| 亚洲成av人在线观看| 99国产精品国产精品久久| 久久嫩草精品久久久久| 久久成人久久鬼色| 欧美一区二区三区婷婷月色| 午夜精品久久久久久久| 欧洲亚洲国产日韩| 亚洲综合av网| 欧美性猛交xxxx乱大交退制版 | 久久精品国产秦先生| 欧美美女bb生活片| 午夜精品aaa| 91精品欧美一区二区三区综合在 | 日韩理论片在线| 成人av片在线观看| 亚洲欧美综合在线精品| 99久久国产综合精品色伊| 国产精品美日韩| av高清不卡在线| 亚洲精品国产精华液| 欧美私模裸体表演在线观看| 亚洲成人在线观看视频| 91精品国产免费| 精品一区中文字幕| 欧美国产日韩精品免费观看| 高清视频一区二区| 亚洲欧美日韩成人高清在线一区| 在线亚洲人成电影网站色www| 亚洲欧美成人一区二区三区| 欧美亚洲自拍偷拍| 丝袜亚洲另类欧美综合| 亚洲精品一区二区精华| 国产成人午夜精品影院观看视频| 国产女人18水真多18精品一级做| www.亚洲色图.com| 丝袜诱惑亚洲看片| 国产拍揄自揄精品视频麻豆| 99精品国产视频| 丝袜美腿成人在线| 久久精品亚洲麻豆av一区二区 | 欧美日韩精品一区二区天天拍小说| 亚洲亚洲精品在线观看| 欧美大肚乱孕交hd孕妇| 国产盗摄视频一区二区三区| 亚洲一区二区三区爽爽爽爽爽| 欧美夫妻性生活| 国产91色综合久久免费分享| 一区二区三区中文字幕电影 | 中文字幕中文字幕一区| 7777精品伊人久久久大香线蕉| 精品一区二区免费看| 中文字幕一区二区5566日韩| 制服丝袜日韩国产| 丰满少妇久久久久久久| 亚洲va欧美va天堂v国产综合| 久久午夜羞羞影院免费观看| 色综合天天狠狠| 极品少妇一区二区三区精品视频| 国产精品网站一区| 日韩三级.com| 在线一区二区三区四区五区| 国产原创一区二区三区| 亚洲国产精品久久久男人的天堂| 69久久夜色精品国产69蝌蚪网 | 久久99国产精品免费| 亚洲精品国产品国语在线app| xnxx国产精品| 777午夜精品视频在线播放| 91香蕉国产在线观看软件| 久国产精品韩国三级视频| 一区2区3区在线看| 国产精品麻豆视频| 国产欧美日韩另类一区| 日韩一区二区三区观看| 欧美熟乱第一页| www.激情成人| 国产91露脸合集magnet| 激情欧美日韩一区二区| 日韩av一区二区在线影视| 亚洲制服丝袜av| 中文字幕日本乱码精品影院| 久久精品男人天堂av| 欧美不卡一区二区| 欧美一级搡bbbb搡bbbb| 91.麻豆视频| 欧美精品123区| 欧美日本一区二区在线观看| 一本色道久久综合亚洲91| jlzzjlzz欧美大全| av一区二区久久| voyeur盗摄精品| 99国产精品国产精品毛片| 91视频在线看| 色婷婷一区二区| 欧美午夜片在线观看| 欧美在线啊v一区| 欧美视频精品在线观看| 欧美无乱码久久久免费午夜一区| 欧美日韩在线播放一区| 欧美日韩一区三区四区| 欧美日韩一区二区三区在线看| 91久久国产最好的精华液| 欧美性猛片xxxx免费看久爱| 欧美人伦禁忌dvd放荡欲情| 在线播放欧美女士性生活| 51精品国自产在线| 精品欧美久久久| 国产欧美一区二区精品婷婷| 国产日韩精品久久久| 亚洲欧美乱综合| 天天综合网天天综合色| 捆绑调教美女网站视频一区| 极品销魂美女一区二区三区| 国产一区亚洲一区| 99久久精品情趣| 欧美主播一区二区三区| 91.xcao| 国产欧美精品一区二区色综合| 国产精品国产三级国产aⅴ原创| 国产精品伦理一区二区| 亚洲h动漫在线| 国产一区二区三区在线观看精品 | 国产精品自产自拍| 成人av网站在线观看免费| 色哟哟一区二区| 91精品国产免费| 国产精品伦理一区二区| 丝袜美腿高跟呻吟高潮一区| 国产精品123区| 欧美性xxxxx极品少妇| 久久久久国产精品人| 亚洲国产精品一区二区www| 久99久精品视频免费观看| 成人一区二区三区视频在线观看| 在线视频国产一区| 久久先锋影音av| 视频一区二区三区中文字幕| 国产乱子轮精品视频| 欧美午夜精品久久久| 久久精品夜夜夜夜久久| 午夜精品久久一牛影视| jizzjizzjizz欧美| 欧美一卡二卡三卡| 亚洲激情图片一区| 国产东北露脸精品视频| 3d成人动漫网站| 亚洲激情自拍偷拍| 国产成人综合网站| 日韩视频一区二区在线观看| 综合久久国产九一剧情麻豆| 久久电影国产免费久久电影| 色999日韩国产欧美一区二区| 精品久久久久久综合日本欧美| 亚洲大片在线观看| kk眼镜猥琐国模调教系列一区二区| 日韩欧美国产一区二区三区 | 自拍偷拍国产精品| 国产成人三级在线观看| 91精品蜜臀在线一区尤物| 亚洲精品国产成人久久av盗摄| 成人性视频网站| 国产亚洲成av人在线观看导航| 午夜精品久久久久久久久久久| 在线精品视频一区二区| 国产精品无人区| 成人影视亚洲图片在线| 国产夜色精品一区二区av| 黄色资源网久久资源365| 欧美一区二区日韩一区二区| 亚洲宅男天堂在线观看无病毒| 97精品国产露脸对白| 国产欧美精品日韩区二区麻豆天美| 久久黄色级2电影| 日韩亚洲欧美综合| 免费成人你懂的| 精品久久久三级丝袜| 狠狠久久亚洲欧美| 久久网站热最新地址|