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

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

?? lcd.c

?? S3C2410上GPRS模塊的驅動源碼,ADS1.2編譯工程,已測試通過.附文檔.
?? C
字號:
/*************************************************************************/
/*                                                                       */
/*               Copyright Shenzhen Watertek S.&T. Co.,Ltd  2002         */
/*                         All Rights Reserved.                          */
/*                                                                       */
/* THIS WORK CONTAINS TRADE SECRET AND PROPRIETARY INFORMATION WHICH IS  */
/* THE PROPERTY OF MENTOR GRAPHICS CORPORATION OR ITS LICENSORS AND IS   */
/* SUBJECT TO LICENSE TERMS.                                             */
/*                                                                       */
/*************************************************************************/

/*************************************************************************/
/*                                                                       */
/* FILE NAME                                               VERSION       */
/*                                                                       */
/*      usbmain.c                                   S3c2410 USB device 1.0*/
/*                                                                       */
/*                                                                       */
/* DESCRIPTION                                                           */
/*                                                                       */
/*      This file contains macro and main routines 		 */
/*                                                                       */
/* AUTHOR                                                                */
/*    	Zhi-gang yang   shenzhen watertek                                */
/*                                                                       */
/*                                                                       */
/* DATA STRUCTURES                                                       */
/*                                                                       */
/*      Ep3Handler                   EP3 interrupt handler          	 */
/*      PrintEpoPkt                  print ep out packet for debug       */
/*      RdPktEp3_CheckSum            No	use 				 */
/*      IsrDma2              	     DMA interrupt handler,No use in this*/
/*					 case  				 */
/*      ClearEp3OutPktReady          clear endpoint 3 packet out tag     */
/*                                                                       */
/* FUNCTIONS                                                             */
/*                                                                       */
/*      None                                                             */
/*                                                                       */
/* DEPENDENCIES                                                          */
/*                                                                       */
/*      None	                          				 */
/*                                                                       */
/* HISTORY                                                               */
/*                                                                       */
/*         DATE                    REMARKS                               */
/*                                                                       */
/*      2004-12-27      Created initial version 1.0                      */
/*************************************************************************/
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include "2410addr.h"
#include "def.h"
#include "lcd.h"
#include "2410lib.h"
#include "RTC.h"

/*************************************************************************/
/*                                                                       */
/* FUNCTION                                                              */
/*                                                                       */
/*      C_Entry			                                         */
/*                                                                       */
/* DESCRIPTION                                                           */
/*                                                                       */
/*      C entry function				                 */
/*                                                                       */
/* AUTHOR                                                                */
/*                                                                       */
/*      Zhi-gang Yang          shenzhen watertek                         */
/*                                                                       */
/* INPUTS                                                                */
/*      None                                                             */
/*                                                                       */
/* OUTPUTS                                                               */
/*                                                                       */
/*      None      	                                                 */
/*                                                                       */
/* HISTORY                                                               */
/*                                                                       */
/*         DATE                    REMARKS                               */
/*                                                                       */
/*      2004-12-28      Created initial version 1.0                      */
/*************************************************************************/
void LCD_Entry(void)
{
//	int i;
	TIME time;
	int flag =0;
	char weekdaystr[20];
	char timestr[60];
	unsigned char *ptr;
	Led4_On_or_Off(TRUE);
	ptr =(unsigned char*) IMAGEBUFFER;
	showimage(ptr);	
	//add RTC
	readRTC (&time);
	
	if(time.weekday == 1)  strcpy(weekdaystr,"星期一");
	else if(time.weekday == 2)  strcpy(weekdaystr,"星期二");
	else if(time.weekday == 3)  strcpy(weekdaystr,"星期三");
	else if(time.weekday == 4)   strcpy(weekdaystr,"星期四");
	else if(time.weekday == 5)   strcpy(weekdaystr,"星期五");
	else if(time.weekday == 6)   strcpy(weekdaystr,"星期六");
	else if(time.weekday == 7)   strcpy(weekdaystr,"星期日");
	else 
		{
			strcpy(weekdaystr,"時間沒有設置正確");
			flag =1 ;
		}
	
	if(flag) 		drawtext(185,22,weekdaystr,1,0,rgb(255,0,0));
	else	drawtext(265,22,weekdaystr,1,0,rgb(255,0,0));
	
	sprintf(timestr,"%d%d:%d%d",time.hour/10,time.hour%10,time.min/10,time.min%10);
	
	drawascii168(270,40,timestr,rgb(255,0,0));
	
	
}

void INT_ADC_Enable(int flag)
{
	int temp;
	if(flag == FALSE)
	{
		temp = rINTSUBMSK;
		temp |=(1<<10);
		rINTSUBMSK = temp;
	
		temp = rINTMSK;
		temp |=0x80000000;
		rINTMSK = temp;
	}
	else 
	{
		temp = rINTSUBMSK;
		temp = 0x5ff;
		rINTSUBMSK = temp;
	
		temp = rINTMSK;
		temp &= ~(0x80000000) ;
		rINTMSK = temp;
	}
}


int LCD_Init(void)
{
   rLCDCON2=0x14FC081;
   rLCDCON3=0x188EF0F;
   rLCDCON4=0xD;
   rLCDCON5=0xB09;
   rLCDSADDR1=0x18000000;
   rLCDSADDR2=0x12c00;
   rLCDCON1=0x479;
   rLCDSADDR3=0x0;
   rREDLUT=0x0;
   rGREENLUT=0x0;
   rBLUELUT=0x0;
   rDITHMODE=0x0;
   rTPAL=0x0;
   rLCDINTPND=0x0;
   rLCDSRCPND=0x0;
   rLCDINTMSK=0x3;
   rLPCSEL=0x4;
   rADCTSC=0xd3;
   rADCDLY=0xc350;
   INT_ADC_Enable(TRUE);
   
   return 0;
}



unsigned short rgb(int red,int green,int blue)
{
	unsigned short pencolor;
	/*compose the color depend the red, blue and green*/
	pencolor=(((red&(~(~0<<RED_BITNUM)))<<RED_SHIFT)|((green&(~(~0<<GREEN_BITNUM)))<<GREEN_SHIFT)\
	                                                   |((blue&(~(~0<<BLUE_BITNUM)))<<BLUE_SHIFT));
	return pencolor;
}
		
int setpixel(int x,int y,unsigned short pencolor)
{
	int movetop;   /*THE PIXEL ADDRESS*/
	short *p;
	if (x<0||x>(int)x_limit) return ERROR;
	if (y<0||y>(int)y_limit) return ERROR;
	/*指向所要顯示的像素偏移地址*/
	movetop=(x*x_size+y)*2;//一個像素占兩個字節   
	p=(short *)(VideoAddrStart+movetop);
	*p=pencolor;
	return 1;
}

COLOR getpixel(int x,int y)
{
	int movetop;   /*THE PIXEL ADDRESS*/
	short *p;
	if (x<0||x>(int)x_limit) return ERROR;
	if (y<0||y>(int)y_limit) return ERROR;
	/*指向所要顯示的像素偏移地址*/
	movetop=(x*x_size+y)*2;//一個像素占兩個字節   
	p=(short *)(VideoAddrStart+movetop);
	return *p;
}


void clrsrc(COLOR mcolor)
{
short *p;
for(p=(short*)VideoAddrStart;p<(short*)VideoAddrEnd;p++) *p=mcolor;
return ;
}

void ascii_168(int x0,int y0,char *code,int pencolor)
{
	 /*define the code group for compare the code*/
	 char mask[]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};
	  char mat[16];
	  char *hzpos;
	  int i,k,m,offset;
	  offset=(*code)*16;
	  hzpos=(char *)(asciibufbase+offset);
	  /*transmit the lattice message to the group*/
	  for (m=0;m<16;m++)
  	  {
  	  	  mat[m]=*hzpos;
  		  hzpos++;
  	   }
  	  /*display the character depend on the messsage of the group*/
  	  for (i=0;i<16;i++)
	  		for (k=0;k<8;k++)
	  		{
	  		 	if (mask[k%8]&mat[i])
	  		 	{
	 			 setpixel(x0+k,y0-i,pencolor);

	 			 }
 	   		}
}

int drawascii168(int x0,int y0,char *c,int pencolor)             
{    
	int x,y,counter;
	x=x0;
	y=y0;
	counter=0;
	while(*c!='\0')    /*while don't reach to the end of the string*/
	{
		while(x<320 && (*c!='\0'))   /*while the X coordinate don't exceed the scope of X limit*/
		{
			ascii_168(x,y,c,pencolor);  /*display the character*/
			x+=8;
			c+=1;
			counter+=1;
		}
        	x=0;  /*exchange the next row*/                                              
        	y+=16;
    }
     return(counter);
}       

void ascii_1616(int x0,int y0,char *code,int pencolor)
{
	/*define the code group for compare the code*/
	 char mask[]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};
	  char mat[32];
	  char *hzpos;
	  int i,j,k,m,offset;
	  /*computer the excurison of the base address*/
	  offset=(*code)*32;
	  hzpos=(char *)(asciibufbase+offset);
	  /*get the character lattice message*/
	  for (m=0;m<32;m++)
  	  {
  	  	mat[m]=*hzpos;
  		  hzpos++;
  	   }
  	   /*display the character*/
  	  for (i=0;i<16;i++)
	  	for (j=0;j<2;j++)
	  		for (k=0;k<8;k++)
	  		{
	  		 	if (mask[k%8]&mat[2*i+j])
	 			 setpixel(x0+8*j+k,y0+i,pencolor);
 	   		}
}


int drawascii1616(int x0,int y0,char *c,int pencolor)             
{    
	int x,y,counter;
	x=x0;
	y=y0;
	counter=0;
	/*while don't reach to the end of the string*/
	while(*c!='\0')
	{
		while(x<320 && (*c!='\0'))  /*while the X coordinate don't exceed the scope of X limit*/ 
		{
			ascii_1616(x,y,c,pencolor);  /*display the character*/
			x+=16;
			c+=1;
			counter+=1;
		}
        	x=0;    /*exchange the next row*/                                              
        	y+=16;
      	}
     return(counter);
}       

void get_hz(int x0,int y0,char incode[],int zoom,int pencolor)                   
{	 
	  /*define the code group for compare the code*/
	  char mask[]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};
	  char mat[32];
	  char wh,qh;   /*the position code of the chinese characters*/
	  char *hzpos;
	  int i,j,k,m,offset;
	  /*get the position code from the ISN*/
	  qh=incode[0]-0xa0;
	  wh=incode[1]-0xa0;
	  /*get the excuriosn of chinese character and add it to the base address of chinese characters storeroom*/
	  offset=(94*(qh-1)+(wh-1))*32;
	  hzpos=(char *)(hzbufbase+offset);
	  /*get the chinese character lattice message*/
	  for (m=0;m<32;m++)
  	  {
  	  	  mat[m]=(*hzpos);
  		  hzpos++;
  	   }
  	   /*display the chinese character*/
  	  for (i=0;i<16;i++)
	  	for (j=0;j<2;j++)
	  		for (k=0;k<8;k++)
	  		{
	  		 	if (mask[k%8]&mat[2*i+j])
	  		 	{
	 			 setpixel(x0+zoom*(8*j+k),y0-zoom*i,pencolor);
	 			 }
 	   		}
}
 
 
 int drawtext(int x0,int y0,char *c,int zoom,int space,int pencolor)             
{    
	int x,y,counter;
	x=x0;
	y=y0;
	counter=0;
	while(*c!='\0')
	{
		/*if don't reach to the end of the string display the character in LCD*/
		while(x<320 && (*c!='\0'))
		{
			get_hz(x,y,c,zoom,pencolor);  /*display the Chines character*/
			x+=16*zoom+space;
			c+=2;
			counter+=1;
		}
        	x=0;                                                
        	y+=32;
      	}
     return(counter);
}       
 

void line(int x0,int y0,int x1,int y1,COLOR mcolor)
{
	int x;
	int y;
	if(x0==x1)
	{	if(y0>y1)
		{
		y=y0;y0=y1;y1=y;
	       }
	       for(y=y0;y<=y1;y++)
	       	setpixel(x0,y,mcolor);
	       return;
	 }
	 
	//swap
	if(x0>x1)
	{
		x=x0;x0=x1;x1=x;
		y=y0;y0=y1;y1=y;
	}
	for(x=x0;x<=x1;x++)
	{
		y=(int)(((float)(x-x0))*(y1-y0)/(x1-x0) + y0);
		setpixel(x,y,mcolor);
	}
	
}


void fillrectangle(int x0,int y0,int x1,int y1,COLOR mcolor)
{
	int x;
	int y;
	for(x=x0;x<=x1;x++)
	   for(y=y0;y<=y1;y++) setpixel(x,y,mcolor);
}

void showimage(unsigned char *p)
{
   
   int i,j;
   unsigned char red;
   unsigned char green;
   unsigned char blue;
   unsigned short color;
   p += 54;
   for(j=0;j<240;j++)
   for(i=0;i<320;i++)
  {

	blue = p[0];
	green = p[1];
	red = p[2];
	p +=3;
	
	color = rgb (red ,green ,blue);
    setpixel(i,j,color);
    }
    
}   

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久久久一区| 久久久www免费人成精品| 波波电影院一区二区三区| 久久99热这里只有精品| 欧美aaaaa成人免费观看视频| 亚洲欧美日韩中文字幕一区二区三区 | 欧美激情综合五月色丁香| 精品国内片67194| 久久嫩草精品久久久精品| 久久精品亚洲乱码伦伦中文| 国产欧美视频一区二区| 国产欧美精品一区二区色综合朱莉 | 激情六月婷婷综合| 国产成人高清在线| av综合在线播放| 色欧美片视频在线观看| 777午夜精品视频在线播放| 6080国产精品一区二区| 精品久久五月天| 中文字幕亚洲一区二区va在线| 亚洲综合在线免费观看| 亚洲高清免费视频| 九九**精品视频免费播放| 国产精品自拍av| 91浏览器入口在线观看| 欧美日韩国产在线观看| 欧美成va人片在线观看| 国产精品视频第一区| 亚洲女人的天堂| 久久爱www久久做| 一本大道久久a久久综合| 精品毛片乱码1区2区3区 | 91在线看国产| 欧美一区二区美女| 国产精品超碰97尤物18| 美女在线视频一区| 99久久亚洲一区二区三区青草| 欧美精品黑人性xxxx| 中文欧美字幕免费| 日韩精品一级二级| 成人动漫精品一区二区| 欧美一级理论片| 亚洲激情成人在线| 国产精品99久久久久久似苏梦涵 | 综合在线观看色| 麻豆91在线观看| 欧美视频一区二区三区在线观看| 久久久影院官网| 蜜臀久久久久久久| 欧美日韩一区高清| 亚洲精品欧美在线| 成人av一区二区三区| 7777精品伊人久久久大香线蕉超级流畅 | 国产肉丝袜一区二区| 香蕉加勒比综合久久| 97久久超碰国产精品| 久久久精品国产99久久精品芒果 | 久久久久99精品一区| 日韩在线a电影| 欧美这里有精品| 亚洲日本在线视频观看| 国产成人精品一区二区三区四区| 日韩午夜精品电影| 婷婷亚洲久悠悠色悠在线播放| 色妹子一区二区| 国产精品国产成人国产三级| 高清视频一区二区| 中文av一区特黄| 国产一区二区剧情av在线| 日韩视频一区二区在线观看| 亚洲一区影音先锋| 欧美亚洲动漫精品| 亚洲高清免费一级二级三级| 欧美无乱码久久久免费午夜一区| 亚洲国产精品二十页| 成人免费毛片片v| 中文一区一区三区高中清不卡| 成人午夜av影视| 国产欧美一区二区精品仙草咪| 国产在线精品免费| 国产人久久人人人人爽| 成人黄色片在线观看| 亚洲欧洲成人自拍| 欧美综合亚洲图片综合区| 一区二区三区国产| 欧美日韩高清不卡| 免费在线视频一区| 精品国产欧美一区二区| 国产成人在线看| 亚洲日韩欧美一区二区在线| 在线欧美日韩精品| 日韩电影免费一区| 精品国产免费视频| 成人avav影音| 亚洲伊人色欲综合网| 日韩一区二区高清| 国产福利精品导航| 1区2区3区欧美| 欧美影视一区在线| 男男视频亚洲欧美| 国产精品网站一区| 欧美性受极品xxxx喷水| 极品少妇xxxx精品少妇| 国产精品毛片高清在线完整版| 欧美熟乱第一页| 国产在线精品免费| 亚洲一区在线观看免费观看电影高清| 在线成人av网站| 国产a久久麻豆| 偷窥少妇高潮呻吟av久久免费| 久久久久久久久免费| 欧美日韩美少妇| 国内成+人亚洲+欧美+综合在线| 17c精品麻豆一区二区免费| 日韩一区二区视频在线观看| 成人av在线电影| 久久99最新地址| 亚洲一区二区三区中文字幕在线| 久久久精品天堂| 欧美日本乱大交xxxxx| av色综合久久天堂av综合| 爽好久久久欧美精品| 国产精品情趣视频| 欧美疯狂性受xxxxx喷水图片| 成人精品视频一区| 美女一区二区三区| 亚洲男人电影天堂| 精品国产伦一区二区三区观看方式 | 亚洲欧美日韩系列| 日韩免费看的电影| 91国模大尺度私拍在线视频| 久久精品国产成人一区二区三区| 一区二区三区国产精华| 国产精品国模大尺度视频| 精品国精品国产| 日韩一级欧美一级| 欧美人妇做爰xxxⅹ性高电影| 91视频国产资源| 93久久精品日日躁夜夜躁欧美| 国产91精品露脸国语对白| 蜜桃免费网站一区二区三区| 亚洲福利电影网| 亚洲香蕉伊在人在线观| 国产精品福利一区| 国产精品天干天干在线综合| 久久久亚洲精华液精华液精华液 | 中文字幕欧美激情一区| 久久中文字幕电影| 久久久99久久| 久久精品人人爽人人爽| 久久精品一区二区三区不卡牛牛| 日韩免费看网站| 精品国产乱码久久久久久牛牛| 日韩一区二区在线免费观看| 91精品国产综合久久久久久久久久| 欧美综合久久久| 欧美日韩一区在线观看| 欧美日韩免费在线视频| 欧美喷潮久久久xxxxx| 欧美精品亚洲二区| 日韩小视频在线观看专区| 精品少妇一区二区| 国产亚洲精品免费| 国产精品国产三级国产aⅴ入口 | 亚洲精品国产成人久久av盗摄 | 日韩一二三四区| 久久久久久久久99精品| 中文字幕国产精品一区二区| 亚洲精品综合在线| 亚洲一区二区欧美日韩| 热久久免费视频| 国产一区 二区| 欧美日韩精品欧美日韩精品一综合| 欧美日韩一区二区三区在线 | 久久九九全国免费| 亚洲欧美激情插| 日本中文字幕一区二区视频| 韩国女主播成人在线| 色综合天天狠狠| 日韩欧美一区二区三区在线| xnxx国产精品| 一卡二卡欧美日韩| 精品中文字幕一区二区| 99精品国产热久久91蜜凸| 欧美日韩精品一区二区在线播放| 欧美电影免费观看高清完整版在线 | 欧美日韩黄色影视| 久久久久久久久免费| 一区二区三区小说| 国产v综合v亚洲欧| 欧美美女直播网站| 国产精品美日韩| 麻豆精品视频在线| 色悠久久久久综合欧美99| 精品成人一区二区三区| 一区二区免费在线| 国产精品亚洲а∨天堂免在线| 欧美日韩黄色一区二区| 亚洲婷婷在线视频| 国产精品一卡二|