ATmega16L驅(qū)動(dòng)ILI9325/9328
PA0--- 復(fù)位信號(hào)RESET
本文引用地址:http://butianyuan.cn/article/201611/318937.htmPA1---片選CS
PA2----寄存器選擇信號(hào)RS
PA3---寫信號(hào)WR
PA4---讀信號(hào)RD
文件名:Type.h,主要定義一些數(shù)據(jù)變量的別名
- /****************************************Copyright(c)**************************************************
- **SoutheastUniversity
- **--------------FileInfo-------------------------------------------------------------------------------
- **FileName:Type.h
- **LastmodifiedDate:2012-03-23
- **LastVersion:1.0
- **Description:定義數(shù)據(jù)類型別名
- **------------------------------------------------------------------------------------------------------
- **CreatedBy:JianGe
- **Createddate:2012-03-23
- **Version:1.0
- **------------------------------------------------------------------------------------------------------*/
- #ifndef__TYPE_H__
- #define__TYPE_H__
- /********************************************************************************************************
- *Datetypes(Compilerspecific)數(shù)據(jù)類型(和編譯器相關(guān))*
- ********************************************************************************************************/
- typedefunsignedcharuint8;//Unsigned8bitquantity無符號(hào)8位整型變量
- typedefunsignedcharuchar;//Unsigned8bitquantity無符號(hào)8位整型變量
- typedefsignedcharint8;//Signed8bitquantity有符號(hào)8位整型變量
- typedefunsignedshortuint16;//Unsigned16bitquantity無符號(hào)16位整型變量
- typedefsignedshortint16;//Signed16bitquantity有符號(hào)16位整型變量
- typedefunsignedintuint32;//Unsigned32bitquantity無符號(hào)32位整型變量
- typedefunsignedintuint;//Unsigned32bitquantity無符號(hào)32位整型變量
- typedefsignedintint32;//Signed32bitquantity有符號(hào)32位整型變量
- typedeffloatfp32;//Singleprecisionfloatingpoint單精度浮點(diǎn)數(shù)(32位長(zhǎng)度)
- typedefdoublefp64;//Doubleprecisionfloatingpoint雙精度浮點(diǎn)數(shù)(64位長(zhǎng)度)
- #ifndefTRUE
- #defineTRUE1
- #endif
- #ifndefFALSE
- #defineFALSE0
- #endif
- #ifndefNULL
- #defineNULL0
- #endif
- #endif
- /*********************************************************************************************************
- *EndOfFile*
- *********************************************************************************************************/
文件名:USART.h,串口操作函數(shù)的聲明
- /****************************************Copyright(c)**************************************************
- **SoutheastUniversity
- **--------------FileInfo-------------------------------------------------------------------------------
- **FileName:USART.h
- **LastmodifiedDate:2012-03-23
- **LastVersion:1.0
- **Description:串口函數(shù)聲明
- **------------------------------------------------------------------------------------------------------
- **CreatedBy:JianGe
- **Createddate:2012-03-23
- **Version:1.0
- **------------------------------------------------------------------------------------------------------*/
- #ifndef_USART_H
- #define_USART_H
- #include"Type.h"
- #defineBAUD9600//波特率設(shè)置
- #defineCRYSTAL4000000//11059200//晶振頻率
- #defineBAUD_SET(uint16)((uint32)CRYSTAL/(16*(uint32)BAUD)-1)
- #defineBAUD_H(uint8)(BAUD_SET>>8)
- #defineBAUD_L(uint8)(BAUD_SET)
- #defineFE_EERBIT(FE)//幀接收錯(cuò)誤
- #definePE_EERBIT(PE)//校驗(yàn)錯(cuò)誤
- #defineDATA_OVERBIT(DOR)//接收溢出錯(cuò)誤
- #defineUDR_EMPTYBIT(UDRE)//數(shù)據(jù)寄存器空
- #defineUSAT_TX_ENUCSRB|=BIT(TXEN)//使能USART發(fā)送
- #defineUSAT_TX_NO_ENUCSRB&=~BIT(TXEN)
- #defineUSAT_RX_ENUCSRB|=BIT(RXEN)//使能USART接收
- #defineUSAT_RX_NO_ENUCSRB&=~BIT(RXEN)
- externvoidUSART_Init(void);
- externvoidUart_Transmit(unsignedchari);
- externunsignedcharUart_Receive(void);
- #endif
- /*********************************************************************************************************
- *EndOfFile*
- *********************************************************************************************************/
文件名:Delay.h,延時(shí)函數(shù)的聲明
- /****************************************Copyright(c)**************************************************
- **SoutheastUniversity
- **--------------FileInfo-------------------------------------------------------------------------------
- **FileName:Delay.h
- **LastmodifiedDate:2012-03-23
- **LastVersion:1.0
- **Description:延時(shí)函數(shù)聲明
- **------------------------------------------------------------------------------------------------------
- **CreatedBy:JianGe
- **Createddate:2012-03-23
- **Version:1.0
- **------------------------------------------------------------------------------------------------------*/
- #ifndefDELAY_H_H_
- #defineDELAY_H_H_
- #defineDELAY_USasm("nop");asm("nop");asm("nop");asm("nop");
- asm("nop");asm("nop");asm("nop");asm("nop");
- externvoidDelay_nUS(unsignedintn);
- externvoidDelay_MS(void);
- externvoidDelay_nMS(unsignedintn);
- #endif
- /*********************************************************************************************************
- *EndOfFile*
- *********************************************************************************************************/
文件名:LCDDriver.h,LCD驅(qū)動(dòng)函數(shù)和應(yīng)用函數(shù)的聲明
- /****************************************Copyright(c)**************************************************
- **SoutheastUniversity
- **--------------FileInfo-------------------------------------------------------------------------------
- **FileName:LCD_Driver.h
- **LastmodifiedDate:2012-03-24
- **LastVersion:1.0
- **Description:LCD驅(qū)動(dòng)函數(shù)聲明
- **------------------------------------------------------------------------------------------------------
- **CreatedBy:JianGe
- **Createddate:2012-03-24
- **Version:1.0
- **------------------------------------------------------------------------------------------------------*/
- #ifndefLCD_DRIVER_H_H_
- #defineLCD_DRIVER_H_H_
- #include"Type.h"
- #include
- externvoidLCD_Port_Init(void);
- externvoidLCD_WriteCmd(uint32regID);
- externvoidLCD_WriteData(uint32data);
- externvoidLCD_WriteReg(uint32regID,uint32regData);
- externunsignedintLCD_ReadReg(uint32regID);
- externvoidLCD_ILI9325_Init(void);
- externvoidLCD_SetWindow(unsignedintx0,unsignedintx1,unsignedinty0,unsignedinty1);
- externvoidLCD_ClearScreen(unsignedintcolor);
- externvoidLCD_Fill_Rectangle(unsignedintx0,unsignedinty0,unsignedintx1,unsignedinty1,unsignedintcolor);
- externunsignedcharGet_CharOffset(unsignedcharchar_data);
- externvoidSet_CharWindow(unsignedintlineNum,unsignedintrowNum);
- externvoidLCD_WriteChar(unsignedintlineNum,
- unsignedintrowNum,
- unsignedintcharColor,
- unsignedintbkColor,
- unsignedcharchChar)
- externvoidLCD_WriteString(unsignedcharlineNum,unsignedcharrowNum,
- unsignedintcharColor,
- unsignedintbkColor,
- unsignedchar*p_str)
- #endif
- /*********************************************************************************************************
- *EndOfFile*
- *********************************************************************************************************/
文件名:LCD_Font.h LCD字體庫的聲明
- /****************************************Copyright(c)**************************************************
- **SoutheastUniversity
- **--------------FileInfo-------------------------------------------------------------------------------
- **FileName:LCD_Font.h
- **LastmodifiedDate:2012-03-27
- **LastVersion:1.0
- **Description:LCD顯示字符的字節(jié)表
- **------------------------------------------------------------------------------------------------------
- **CreatedBy:JianGe
- **Createddate:2012-03-27
- **Version:1.0
- **------------------------------------------------------------------------------------------------------*/
- #ifndefLCD_FONT_H_H_
- #defineLCD_FONT_H_H_
- //常用ASCII字符碼表
- constunsignedcharLetter[][16]=
- {
- //第一欄從到?
- {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"",0*/
- {0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x18,0x18,0x00,0x00},/*"!",1*/
- {0x00,0x12,0x36,0x24,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*""",2*/
- {0x00,0x00,0x00,0x24,0x24,0x24,0xFE,0x48,0x48,0x48,0xFE,0x48,0x48,0x48,0x00,0x00},/*"#",3*/
- {0x00,0x00,0x10,0x38,0x54,0x54,0x50,0x30,0x18,0x14,0x14,0x54,0x54,0x38,0x10,0x10},/*"$",4*/
- {0x00,0x00,0x00,0x44,0xA4,0xA8,0xA8,0xA8,0x54,0x1A,0x2A,0x2A,0x2A,0x44,0x00,0x00},/*"%",5*/
- {0x00,0x00,0x00,0x30,0x48,0x48,0x48,0x50,0x6E,0xA4,0x94,0x88,0x89,0x76,0x00,0x00},/*"&",6*/
- {0x00,0x60,0x60,0x20,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"",7*/
- {0x00,0x02,0x04,0x08,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x08,0x08,0x04,0x02,0x00},/*"(",8*/
- {0x00,0x40,0x20,0x10,0x10,0x08,0x08,0x08,0x08,0x08,0x08,0x10,0x10,0x20,0x40,0x00},/*")",9*/
- {0x00,0x00,0x00,0x00,0x10,0x10,0xD6,0x38,0x38,0xD6,0x10,0x10,0x00,0x00,0x00,0x00},/*"*",10*/
- {0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0xFE,0x10,0x10,0x10,0x10,0x00,0x00,0x00},/*"+",11*/
- {0x00,0x60,0x60,0x20,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"",12*/
- {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"-",13*/
- {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x00},/*".",14*/
- {0x00,0x00,0x01,0x02,0x02,0x04,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x40,0x40,0x00},/*"/",15*/
- {0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x24,0x18,0x00,0x00},/*"0",16*/
- {0x00,0x00,0x00,0x10,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00},/*"1",17*/
- {0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x04,0x04,0x08,0x10,0x20,0x42,0x7E,0x00,0x00},/*"2",18*/
- {0x00,0x00,0x00,0x3C,0x42,0x42,0x04,0x18,0x04,0x02,0x02,0x42,0x44,0x38,0x00,0x00},/*"3",19*/
- {0x00,0x00,0x00,0x04,0x0C,0x14,0x24,0x24,0x44,0x44,0x7E,0x04,0x04,0x1E,0x00,0x00},/*"4",20*/
- {0x00,0x00,0x00,0x7E,0x40,0x40,0x40,0x58,0x64,0x02,0x02,0x42,0x44,0x38,0x00,0x00},/*"5",21*/
- {0x00,0x00,0x00,0x1C,0x24,0x40,0x40,0x58,0x64,0x42,0x42,0x42,0x24,0x18,0x00,0x00},/*"6",22*/
- {0x00,0x00,0x00,0x7E,0x44,0x44,0x08,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00},/*"7",23*/
- {0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x24,0x18,0x24,0x42,0x42,0x42,0x3C,0x00,0x00},/*"8",24*/
- {0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x26,0x1A,0x02,0x02,0x24,0x38,0x00,0x00},/*"9",25*/
- {0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00},/*":",26*/
- {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x20},/*";",27*/
- {0x00,0x00,0x00,0x02,0x04,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x04,0x02,0x00,0x00},/*"<",28*/
- {0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00},/*"=",29*/
- {0x00,0x00,0x00,0x40,0x20,0x10,0x08,0x04,0x02,0x04,0x08,0x10,0x20,0x40,0x00,0x00},/*">",30*/
- {0x00,0x00,0x00,0x3C,0x42,0x42,0x62,0x02,0x04,0x08,0x08,0x00,0x18,0x18,0x00,0x00},/*"?",31*/
- //第二欄從@開始
- {0x00,0x00,0x00,0x38,0x44,0x5A,0xAA,0xAA,0xAA,0xAA,0xB4,0x42,0x44,0x38,0x00,0x00},/*"@",32*/
- {0x00,0x00,0x00,0x10,0x10,0x18,0x28,0x28,0x24,0x3C,0x44,0x42,0x42,0xE7,0x00,0x00},/*"A",33*/
- {0x00,0x00,0x00,0xF8,0x44,0x44,0x44,0x78,0x44,0x42,0x42,0x42,0x44,0xF8,0x00,0x00},/*"B",34*/
- {0x00,0x00,0x00,0x3E,0x42,0x42,0x80,0x80,0x80,0x80,0x80,0x42,0x44,0x38,0x00,0x00},/*"C",35*/
- {0x00,0x00,0x00,0xF8,0x44,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x44,0xF8,0x00,0x00},/*"D",36*/
- {0x00,0x00,0x00,0xFC,0x42,0x48,0x48,0x78,0x48,0x48,0x40,0x42,0x42,0xFC,0x00,0x00},/*"E",37*/
- {0x00,0x00,0x00,0xFC,0x42,0x48,0x48,0x78,0x48,0x48,0x40,0x40,0x40,0xE0,0x00,0x00},/*"F",38*/
- {0x00,0x00,0x00,0x3C,0x44,0x44,0x80,0x80,0x80,0x8E,0x84,0x44,0x44,0x38,0x00,0x00},/*"G",39*/
- {0x00,0x00,0x00,0xE7,0x42,0x42,0x42,0x42,0x7E,0x42,0x42,0x42,0x42,0xE7,0x00,0x00},/*"H",40*/
- {0x00,0x00,0x00,0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00},/*"I",41*/
- {0x00,0x00,0x00,0x3E,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x88,0xF0},/*"J",42*/
- {0x00,0x00,0x00,0xEE,0x44,0x48,0x50,0x70,0x50,0x48,0x48,0x44,0x44,0xEE,0x00,0x00},/*"K",43*/
- {0x00,0x00,0x00,0xE0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x42,0xFE,0x00,0x00},/*"L",44*/
- {0x00,0x00,0x00,0xEE,0x6C,0x6C,0x6C,0x6C,0x54,0x54,0x54,0x54,0x54,0xD6,0x00,0x00},/*"M",45*/
- {0x00,0x00,0x00,0xC7,0x62,0x62,0x52,0x52,0x4A,0x4A,0x4A,0x46,0x46,0xE2,0x00,0x00},/*"N",46*/
- {0x00,0x00,0x00,0x38,0x44,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x44,0x38,0x00,0x00},/*"O",47*/
- {0x00,0x00,0x00,0xFC,0x42,0x42,0x42,0x42,0x7C,0x40,0x40,0x40,0x40,0xE0,0x00,0x00},/*"P",48*/
- {0x00,0x00,0x00,0x38,0x44,0x82,0x82,0x82,0x82,0x82,0xB2,0xCA,0x4C,0x38,0x06,0x00},/*"Q",49*/
- {0x00,0x00,0x00,0xFC,0x42,0x42,0x42,0x7C,0x48,0x48,0x44,0x44,0x42,0xE3,0x00,0x00},/*"R",50*/
- {0x00,0x00,0x00,0x3E,0x42,0x42,0x40,0x20,0x18,0x04,0x02,0x42,0x42,0x7C,0x00,0x00},/*"S",51*/
- {0x00,0x00,0x00,0xFE,0x92,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00},/*"T",52*/
- {0x00,0x00,0x00,0xE7,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00},/*"U",53*/
- {0x00,0x00,0x00,0xE7,0x42,0x42,0x44,0x24,0x24,0x28,0x28,0x18,0x10,0x10,0x00,0x00},/*"V",54*/
- {0x00,0x00,0x00,0xD6,0x92,0x92,0x92,0x92,0xAA,0xAA,0x6C,0x44,0x44,0x44,0x00,0x00},/*"W",55*/
- {0x00,0x00,0x00,0xE7,0x42,0x24,0x24,0x18,0x18,0x18,0x24,0x24,0x42,0xE7,0x00,0x00},/*"X",56*/
- {0x00,0x00,0x00,0xEE,0x44,0x44,0x28,0x28,0x10,0x10,0x10,0x10,0x10,0x38,0x00,0x00},/*"Y",57*/
- {0x00,0x00,0x00,0x7E,0x84,0x04,0x08,0x08,0x10,0x20,0x20,0x42,0x42,0xFC,0x00,0x00},/*"Z",58*/
- {0x00,0x1E,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1E,0x00},/*"[",59*/
- {0x00,0x00,0x40,0x40,0x20,0x20,0x10,0x10,0x10,0x08,0x08,0x04,0x04,0x04,0x02,0x02},/*"",60*/
- {0x00,0x78,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x78,0x00},/*"]",61*/
- {0x00,0x1C,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"^",62*/
- {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"-",63*/
- //第三欄從開始
- {0x00,0x60,0x60,0x20,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"",64*/
- {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x1E,0x22,0x42,0x42,0x3F,0x00,0x00},/*"a",65*/
- {0x00,0x00,0x00,0xC0,0x40,0x40,0x40,0x58,0x64,0x42,0x42,0x42,0x64,0x58,0x00,0x00},/*"b",66*/
- {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x22,0x40,0x40,0x40,0x22,0x1C,0x00,0x00},/*"c",67*/
- {0x00,0x00,0x00,0x06,0x02,0x02,0x02,0x1E,0x22,0x42,0x42,0x42,0x26,0x1B,0x00,0x00},/*"d",68*/
- {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x7E,0x40,0x40,0x42,0x3C,0x00,0x00},/*"e",69*/
- {0x00,0x00,0x00,0x0F,0x11,0x10,0x10,0x7E,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00},/*"f",70*/
- {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x44,0x44,0x38,0x40,0x3C,0x42,0x42,0x3C},/*"g",71*/
- {0x00,0x00,0x00,0xC0,0x40,0x40,0x40,0x5C,0x62,0x42,0x42,0x42,0x42,0xE7,0x00,0x00},/*"h",72*/
- {0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x70,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00},/*"i",73*/
- {0x00,0x00,0x00,0x0C,0x0C,0x00,0x00,0x1C,0x04,0x04,0x04,0x04,0x04,0x04,0x44,0x78},/*"j",74*/
- {0x00,0x00,0x00,0xC0,0x40,0x40,0x40,0x4E,0x48,0x50,0x68,0x48,0x44,0xEE,0x00,0x00},/*"k",75*/
- {0x00,0x00,0x00,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00},/*"l",76*/
- {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x49,0x49,0x49,0x49,0x49,0xED,0x00,0x00},/*"m",77*/
- {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0x62,0x42,0x42,0x42,0x42,0xE7,0x00,0x00},/*"n",78*/
- {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00},/*"o",79*/
- {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0x64,0x42,0x42,0x42,0x44,0x78,0x40,0xE0},/*"p",80*/
- {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x22,0x42,0x42,0x42,0x22,0x1E,0x02,0x07},/*"q",81*/
- {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEE,0x32,0x20,0x20,0x20,0x20,0xF8,0x00,0x00},/*"r",82*/
- {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x42,0x40,0x3C,0x02,0x42,0x7C,0x00,0x00},/*"s",83*/
- {0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x7C,0x10,0x10,0x10,0x10,0x10,0x0C,0x00,0x00},/*"t",84*/
- {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0x42,0x42,0x42,0x42,0x46,0x3B,0x00,0x00},/*"u",85*/
- {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE7,0x42,0x24,0x24,0x28,0x10,0x10,0x00,0x00},/*"v",86*/
- {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD7,0x92,0x92,0xAA,0xAA,0x44,0x44,0x00,0x00},/*"w",87*/
- {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6E,0x24,0x18,0x18,0x18,0x24,0x76,0x00,0x00},/*"x",88*/
- {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE7,0x42,0x24,0x24,0x28,0x18,0x10,0x10,0xE0},/*"y",89*/
- {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x44,0x08,0x10,0x10,0x22,0x7E,0x00,0x00},/*"z",90*/
- {0x00,0x03,0x04,0x04,0x04,0x04,0x04,0x08,0x04,0x04,0x04,0x04,0x04,0x04,0x03,0x00},/*"{",91*/
- {0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00},/*":",92*/
- {0x00,0x60,0x10,0x10,0x10,0x10,0x10,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x60,0x00},/*"}",93*/
- {0x30,0x4C,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"~",94*/
- {0x00,0x1C,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"^",95*/
- };
- #endif
- /*********************************************************************************************************
- *EndOfFile*
- *********************************************************************************************************/
文件名: Delay.c,延時(shí)函數(shù)的實(shí)現(xiàn)
- /****************************************Copyright(c)**************************************************
- **SoutheastUniversity
- **--------------FileInfo-------------------------------------------------------------------------------
- **FileName:Delay.c
- **LastmodifiedDate:2012-03-23
- **LastVersion:1.0
- **Description:延時(shí)函數(shù)實(shí)現(xiàn)
- **------------------------------------------------------------------------------------------------------
- **CreatedBy:JianGe
- **Createddate:2012-03-23
- **Version:1.0
- **------------------------------------------------------------------------------------------------------*/
- #include"Delay.h"
- #include"Type.h"
- /*********************************************************************************************************
- **Functionname:Delay_nUS
- **Descriptions:延時(shí)n微秒
- **inputparameters:無
- **outputparameters:無
- **Returnedvalue:無
- *********************************************************************************************************/
- voidDelay_nUS(uint32n)
- {
- uint32i=0;
- for(i=0;i
- {
- DELAY_US;
- }
- }
- /*********************************************************************************************************
- **Functionname:Delay_MS
- **Descriptions:延時(shí)1毫秒
- **inputparameters:無
- **outputparameters:無
- **Returnedvalue:無
- *********************************************************************************************************/
- voidDelay_MS(void)
- {
- uint32i=0;
- for(i=0;i<1000;i++)
- {
- DELAY_US;
- }
- }
- /*********************************************************************************************************
- **Functionname:Delay_nMS
- **Descriptions:延時(shí)n毫秒
- **inputparameters:無
- **outputparameters:無
- **Returnedvalue:無
- *********************************************************************************************************/
- voidDelay_nMS(uint32n)
- {
- uint32i=0;
- for(i=0;i
- {
- Delay_MS();
- }
- }
- /*********************************************************************************************************
- *EndOfFile*
- *********************************************************************************************************/
文件名:USART.c 串口調(diào)試函數(shù)的實(shí)現(xiàn)
- /****************************************Copyright(c)**************************************************
- **SoutheastUniversity
- **--------------FileInfo-------------------------------------------------------------------------------
- **FileName:USART.c
- **LastmodifiedDate:2012-03-23
- **LastVersion:1.0
- **Description:串口函數(shù)實(shí)現(xiàn)
- **------------------------------------------------------------------------------------------------------
- **CreatedBy:JianGe
- **Createddate:2012-03-23
- **Version:1.0
- **------------------------------------------------------------------------------------------------------*/
- #include
- #include"USART.h"
- /*串口初始化函數(shù)*/
- voidUSART_Init(void)
- {
- UCSRA=0x02;/*倍速*/
- UCSRB=0x18;/*允許接收和發(fā)送*/
- UCSRC=0x06;/*8位數(shù)據(jù)*/
- UBRRH=0x00;
- //UBRRL=12;/*9600*/
- //UBRRL=103;//11.0592M下9600
- UBRRL=207;//16MHz下9600
- }/*數(shù)據(jù)發(fā)送,查詢方式*/
- voidUart_Transmit(unsignedchari)
- {
- while(!(UCSRA&(1<
- UDR=i;/*發(fā)送數(shù)據(jù)*/
- }
- /*數(shù)據(jù)接收,查詢方式*/
- unsignedcharUart_Receive(void)
- {while(!(UCSRA&(1<
- returnUDR;/*獲取并返回?cái)?shù)據(jù)*/
- }
- /*********************************************************************************************************
- *EndOfFile*
- *********************************************************************************************************/
文件名:LCDDriver.c LCD驅(qū)動(dòng)函數(shù)以及上層函數(shù)的實(shí)現(xiàn)
- /****************************************Copyright(c)**************************************************
- **SoutheastUniversity
- **--------------FileInfo-------------------------------------------------------------------------------
- **FileName:LCDDriver.c
- **LastmodifiedDate:2012-04-12
- **LastVersion:1.0
- **Description:LCD驅(qū)動(dòng)函數(shù)的實(shí)現(xiàn)
- **------------------------------------------------------------------------------------------------------
- **CreatedBy:JianGe
- **Createddate:2012-03-24
- **Version:1.0
- **------------------------------------------------------------------------------------------------------*/
- #include"Delay.h"
- #include
- #include
- #include"USART.h"
- #include"LCD_Font.h"
- #include"Type.h"
- ///////////屏顯示參數(shù)設(shè)置///////////////
- //設(shè)置屏顯示像素大小
- #defineX_SIZE240
- #defineY_SIZE320
- //x和y的最大坐標(biāo)值,坐標(biāo)原點(diǎn)為(0,0)
- #defineX_END(X_SIZE-1)
- #defineY_END(Y_SIZE-1)
- //一個(gè)字符x*y的分別大小
- #defineCHAR_X_SIZE8
- #defineCHAR_Y_SIZE16
- //橫坐標(biāo)能顯示的字符數(shù)X_SIZE/CHAR_X_SIZE
- #defineCHAR_X_NUM30
- //縱坐標(biāo)能顯示的字符數(shù)Y_SIZE/CHAR_Y_SIZE
- #defineCHAR_Y_NUM20
- ////////////////////////////////////////
- //LCD控制端口動(dòng)作宏定義
- #defineLCD_CS_BITPA1
- #defineLCD_RS_BITPA2
- #defineLCD_WR_BITPA3
- #defineLCD_RD_BITPA4
- #defineLCD_REST_BITPA0
- #defineLCD_CLT_PORTPORTA
- #defineLCD_CLT_PINPINA
- #defineLCD_CLT_DDRDDRA
- #defineLCD_CS_LLCD_CLT_PORT&=~BIT(LCD_CS_BIT)
- #defineLCD_CS_HLCD_CLT_PORT|=BIT(LCD_CS_BIT)
- #defineLCD_RS_LLCD_CLT_PORT&=~BIT(LCD_RS_BIT)
- #defineLCD_RS_HLCD_CLT_PORT|=BIT(LCD_RS_BIT)
- #defineLCD_WR_LLCD_CLT_PORT&=~BIT(LCD_WR_BIT)
- #defineLCD_WR_HLCD_CLT_PORT|=BIT(LCD_WR_BIT)
- #defineLCD_RD_LLCD_CLT_PORT&=~BIT(LCD_RD_BIT)
- #defineLCD_RD_HLCD_CLT_PORT|=BIT(LCD_RD_BIT)
- #defineLCD_REST_LLCD_CLT_PORT&=~BIT(LCD_REST_BIT)
- #defineLCD_REST_HLCD_CLT_PORT|=BIT(LCD_REST_BIT)
- //8位數(shù)據(jù)口
- #defineDATA_HPB0
- #defineLCD_DATA_PORTPORTB
- #defineLCD_DATA_DDRDDRB
- #defineLCD_DATA_PINPINB
- #defineLCD_DATA_INDDRB=0x00
- #defineLCD_DATA_OUTDDRB=0xFF
- //讀GRAM時(shí)需要一個(gè)虛晃的讀(DummyRead)
- #defineDUMMY_READ()LCD_RD_L;LCD_RD_H;LCD_RD_L;LCD_RD_H;
- //片選,開始9328的某種操作前調(diào)用
- #defineLCD_SELECT()LCD_CS_L
- //片選,結(jié)束9328的某項(xiàng)操作后調(diào)用
- #defineLCD_DIS_SELECT()LCD_CS_H
- /*********************************************************************************************************
- **Functionname:LCD_Port_Init
- **Descriptions:LCD的控制端口和數(shù)據(jù)端口的初始化
- **inputparameters:寄存器地址regID
- **outputparameters:無
- **Returnedvalue:無
- *********************************************************************************************************/
- voidLCD_Port_Init(void)
- {
- LCD_DATA_OUT;
- LCD_DATA_PORT=0xFF;
- LCD_CLT_DDR=0xFF;
- LCD_CS_H;
- LCD_RS_H;
- LCD_WR_H;
- LCD_RD_H;
- LCD_REST_H;
- }
- /*********************************************************************************************************
- **Functionname:LCD_WriteCmd
- **Descriptions:寫寄存器命令,選擇一個(gè)寄存器
- **inputparameters:寄存器地址regID
- **outputparameters:無
- **Returnedvalue:無
- *********************************************************************************************************/
- ///////////////////////////////////////////////////////////////////////////////////////////////////////
- //nCS----__________________________________________/---------------------------//
- //RS------______________________________/------------------------------------//
- //nRD----------------------------------------------------------------------------//
- //nWR--------______/----------_____/-------------------------------------------//
- //DB[10:17]----[寄存器高8位]-----[寄存器低8位]-------------------------------------------//
- ////////////////////////////////////////////////////////////////////////////////////////////////////////
- voidLCD_WriteCmd(uint32regID)
- {
- LCD_RS_L;
- LCD_DATA_PORT=regID>>8;
- LCD_WR_L;
- LCD_WR_H;
- LCD_DATA_PORT=regID;
- LCD_WR_L;
- LCD_WR_H;
- LCD_RS_H;
- }
- /*********************************************************************************************************
- **Functionname:LCD_WriteData
- **Descriptions:向LCD寫數(shù)據(jù)
- **inputparameters:待寫入的數(shù)據(jù)data
- **outputparameters:無
- **Returnedvalue:無
- *********************************************************************************************************/
- ////////////////////////////////////////////////////////////////////////////////////////////////////
- //nCS----__________________________________________/-----------------------------//
- //RS-----------------------------------------------------------------------------//
- //nRD-------------------------------------------------------------------------//
- //nWR--------______/--------_____/-----------------------------------------//
- //DB[10:17]-----[數(shù)據(jù)高8位]-----[數(shù)據(jù)低8位]-------------------------------------------//
- /////////////////////////////////////////////////////////////////////////////////////////////////////
- voidLCD_WriteData(uint32data)
- {
- LCD_DATA_PORT=data>>8;
- LCD_WR_L;
- LCD_WR_H;
- LCD_DATA_PORT=data;
- LCD_WR_L;
- LCD_WR_H;
- }
- /*********************************************************************************************************
- **Functionname:LCD_WriteReg
- **Descriptions:向一個(gè)寄存器寫入數(shù)據(jù)
- **inputparameters:寄存器地址:regID待寫入的數(shù)據(jù)regData
- **outputparameters:無
- **Returnedvalue:無
- *********************************************************************************************************/
- ////////////////////////////////////////////////////////////////////////////////////////////////////
- //nCS----_____________________________________________________________/--------//
- //RS----____________________________/-----------------------------------------//
- //nRD-------------------------------------------------------------------------//
- //nWR------______/--------_____/--------______/-----______/----------------//
- //DB[10:17]---[寄存器高8位]---[寄存器低8位]---[數(shù)據(jù)高8位]----[數(shù)據(jù)低8位]---------------//
- /////////////////////////////////////////////////////////////////////////////////////////////////////
- voidLCD_WriteReg(uint32regID,uint32regData)
- {
- LCD_RS_L;
- LCD_DATA_PORT=regID>>8;
- LCD_WR_L;
- LCD_WR_H;
- LCD_DATA_PORT=regID;
- LCD_WR_L;
- LCD_WR_H;
- LCD_RS_H;
- LCD_DATA_PORT=regData>>8;
- LCD_WR_L;
- LCD_WR_H;
- LCD_DATA_PORT=regData;
- LCD_WR_L;
- LCD_WR_H;
- }
- /*********************************************************************************************************
- **Functionname:LCD_ReadReg
- **Descriptions:讀取指定寄存器的數(shù)據(jù)
- **inputparameters:寄存器地址:regID
- **outputparameters:無
- **Returnedvalue:讀出數(shù)據(jù)(16位)
- *********************************************************************************************************/
- ////////////////////////////////////////////////////////////////////////////////////////////////////
- //nCS----_____________________________________________________________/--------//
- //RS----____________________________/-----------------------------------------//
- //nRD-----------------------------------_____/------_____/------------------//
- //nWR------______/--------_____/----------------------------------------------//
- //DB[10:17]---[寄存器高8位]--[寄存器低8位]--[數(shù)據(jù)高8位]--[數(shù)據(jù)低8位]---------------//
- /////////////////////////////////////////////////////////////////////////////////////////////////////
- unsignedintLCD_ReadReg(uint32regID)
- {
- uint32regData;
- LCD_WriteCmd(regID);
- LCD_DATA_IN;
- LCD_RS_H;
- LCD_RD_L;
- LCD_RD_H;
- regData=LCD_DATA_PIN;
- regData=regData<<8;
- LCD_RD_L;
- LCD_RD_H;
- regData|=LCD_DATA_PIN;
- LCD_WR_L;
- LCD_WR_H;
- LCD_DATA_OUT;
- returnregData;
- }
- /*********************************************************************************************************
- **Functionname:LCD_ILI9325_Init
- **Descriptions:9325/28內(nèi)部寄存器的初始化
- **inputparameters:無
- **outputparameters:無
- **Returnedvalue:無
- *********************************************************************************************************/
- voidLCD_ILI9325_Init(void)
- {
- uint32ID=0x0000;
- LCD_Port_Init();
- LCD_REST_L;//復(fù)位
- Delay_nMS(50);
- LCD_REST_H;
- Delay_nMS(50);
- LCD_SELECT();
- ID=LCD_ReadReg(0x0000);//讀LCD的ID,這里是9328
- Uart_Transmit(ID>>8);//串口觀察
- Uart_Transmit(ID);
- LCD_WriteReg(0x0001,0x0100);
- LCD_WriteReg(0x0002,0x0700);
- LCD_WriteReg(0x0003,0x1030);//轉(zhuǎn)換RGB至GBR,水平掃描
- LCD_WriteReg(0x0004,0x0000);
- LCD_WriteReg(0x0008,0x0207);
- LCD_WriteReg(0x0009,0x0000);
- LCD_WriteReg(0x000A,0x0000);
- LCD_WriteReg(0x000C,0x0000);
- LCD_WriteReg(0x000D,0x0000);
- LCD_WriteReg(0x000F,0x0000);
- //poweronsequenceVGHVGL
- LCD_WriteReg(0x0010,0x0000);
- LCD_WriteReg(0x0011,0x0007);
- LCD_WriteReg(0x0012,0x0000);
- LCD_WriteReg(0x0013,0x0000);
- //vgh
- LCD_WriteReg(0x0010,0x1290);
- LCD_WriteReg(0x0011,0x0227);
- //vregiout
- LCD_WriteReg(0x0012,0x001d);//0x001b
- //vomamplitude
- LCD_WriteReg(0x0013,0x1500);
- //vomH
- LCD_WriteReg(0x0029,0x0018);
- LCD_WriteReg(0x002B,0x000D);
- //gamma
- LCD_WriteReg(0x0030,0x0004);
- LCD_WriteReg(0x0031,0x0307);
- LCD_WriteReg(0x0032,0x0002);//0006
- LCD_WriteReg(0x0035,0x0206);
- LCD_WriteReg(0x0036,0x0408);
- LCD_WriteReg(0x0037,0x0507);
- LCD_WriteReg(0x0038,0x0204);//0200
- LCD_WriteReg(0x0039,0x0707);
- LCD_WriteReg(0x003C,0x0405);//0504
- LCD_WriteReg(0x003D,0x0F02);
- //ram
- LCD_WriteReg(0x0050,0x0000);
- LCD_WriteReg(0x0051,0x00EF);
- LCD_WriteReg(0x0052,0x0000);
- LCD_WriteReg(0x0053,0x013F);
- LCD_WriteReg(0x0060,0xA700);
- LCD_WriteReg(0x0061,0x0001);
- LCD_WriteReg(0x006A,0x0000);
- //
- LCD_WriteReg(0x0080,0x0000);
- LCD_WriteReg(0x0081,0x0000);
- LCD_WriteReg(0x0082,0x0000);
- LCD_WriteReg(0x0083,0x0000);
- LCD_WriteReg(0x0084,0x0000);
- LCD_WriteReg(0x0085,0x0000);
- //
- LCD_WriteReg(0x0090,0x0010);
- LCD_WriteReg(0x0092,0x0600);
- LCD_WriteReg(0x0093,0x0003);
- LCD_WriteReg(0x0095,0x0110);
- LCD_WriteReg(0x0097,0x0000);
- LCD_WriteReg(0x0098,0x0000);
- LCD_WriteReg(0x0007,0x0133);
- LCD_DIS_SELECT();
- }
- /*********************************************************************************************************
- **Functionname:LCD_SetWindow
- **Descriptions:定義刷屏窗口
- **inputparameters:起始坐標(biāo)(x0,y0),終止坐標(biāo)(x1,y1)
- **outputparameters:無
- **Returnedvalue:無
- *********************************************************************************************************/
- staticvoidLCD_SetWindow(unsignedintx0,unsignedintx1,unsignedinty0,unsignedinty1)
- {
- LCD_WriteReg(0x0050,x0);
- LCD_WriteReg(0x0051,x1);
- LCD_WriteReg(0x0052,y0);
- LCD_WriteReg(0x0053,y1);
- LCD_WriteReg(0x0020,x0);
- LCD_WriteReg(0x0021,y0);
- LCD_WriteCmd(0x0022);//GRAM寄存器,之后可以寫GRAM緩沖區(qū)
- }
- /*******************************************************************************************************************/
- /*******************************************************************************************************************/
- /**************************************************以下為L(zhǎng)CD的應(yīng)用函數(shù)**********************************************/
- /*******************************************************************************************************************/
- /*******************************************************************************************************************/
- /*********************************************************************************************************
- **Functionname:LCD_ClearScreen
- **Descriptions:刷整屏為一種顏色
- **inputparameters:顏色的RGB值color
- **outputparameters:無
- **Returnedvalue:無
- *********************************************************************************************************/
- voidLCD_ClearScreen(unsignedintcolor)
- {
- unsignedinti,j;
- LCD_SELECT();//選擇9328
- LCD_SetWindow(0,240,0,320);//320x240的屏
- for(i=0;i<320;i++)
- {
- for(j=0;j<240;j++)
- {
- LCD_WriteData(color);//向GRAM寫入RGB數(shù)據(jù)
- }
- }
- LCD_DIS_SELECT();//操作完畢
- }
- /*********************************************************************************************************
- **Functionname:LCD_Fill
- **Descriptions:填充一個(gè)矩形區(qū)域
- **inputparameters:矩形起始坐標(biāo)----(x0,y0),矩形終點(diǎn)坐標(biāo)--(x1,y1)
- **outputparameters:無
- **Returnedvalue:無
- *********************************************************************************************************/
- //
- voidLCD_Fill_Rectangle(unsignedintx0,unsignedinty0,unsignedintx1,unsignedinty1,unsignedintcolor)
- {
- unsignedlongi;
- LCD_SELECT();//選擇9328
- LCD_SetWindow(x0,x1,y0,y1);
- for(i=0;i<(x1-x0+1)*(y1-y0+1);i++)
- {
- LCD_WriteData(color);//填充顏色
- }
- LCD_DIS_SELECT();//操作完畢
- }
- /*********************************************************************************************************
- **Functionname:Get_CharOffset
- **Descriptions:獲取字節(jié)的偏移量
- **inputparameters:輸入字節(jié)
- **outputparameters:無
- **Returnedvalue:偏移量
- *********************************************************************************************************/
- unsignedcharGet_CharOffset(unsignedcharchar_data)
- {
- if(char_data>=&&char_data<=})
- {
- char_data-=;//字符偏移從空格開始
- }
- else
- {
- char_data=;//如無匹配字符以空格代替
- }
- returnchar_data;//返回字符所在字符表的位置
- }
- /*********************************************************************************************************
- **Functionname:Set_CharWindow
- **Descriptions:設(shè)置字節(jié)窗口
- **inputparameters:每個(gè)字符8X16像素,共30行20列,lineNum----字符所在行號(hào),rowLine----字符所在列號(hào)
- **outputparameters:無
- **Returnedvalue:無
- *********************************************************************************************************/
- //例如顯示2這個(gè)字節(jié)窗口,為一個(gè)8X16的像素矩形
- //________,
- //________,
- //________,
- //__XXX___,
- //_X___X__,//lineNum
- //_____X__,
- //_____X__,
- //____X___,
- //___X____,
- //__X_____,
- //_X______,
- //_XXXXX__,
- //________,
- //________,
- //________,
- //________,
- voidSet_CharWindow(unsignedintlineNum,unsignedintrowNum)
- {
- unsignedintx0=0;
- unsignedinty0=0;
- x0=rowNum<<3;//起始X像素坐標(biāo)
- y0=lineNum<<4;//其實(shí)Y像素坐標(biāo)
- LCD_SetWindow(x0,x0+7,y0,y0+15);
- }
- /*********************************************************************************************************
- **Functionname:LCD_WriteChar
- **Descriptions:向屏幕寫一個(gè)字節(jié)
- **inputparameters:lineNum表示字符開始的行數(shù),rowNum表字符開始的列數(shù),共30X20個(gè)字符,背景色bkColor,寫入的字節(jié)chChar
- 字符顏色----charColor
- 待顯示的字符ch_char
- **outputparameters:無
- **Returnedvalue:無
- *********************************************************************************************************/
- voidLCD_WriteChar(unsignedintlineNum,
- unsignedintrowNum,
- unsignedintcharColor,
- unsignedintbkColor,
- unsignedcharchChar)
- {
- unsignedcharshow_cnt=0;
- unsignedcharbit_cnt=0;
- unsignedintcharPos=0;//字符在字符表中所在的位置
- LCD_SELECT();
- charPos=Get_CharOffset(chChar);//獲取字模顯示的偏移量
- Set_CharWindow(lineNum,rowNum);//設(shè)置起始坐標(biāo),xy是8*16的方格坐標(biāo)
- for(show_cnt=0;show_cnt<16;show_cnt++)
- {
- for(bit_cnt=0;bit_cnt<8;bit_cnt++)
- {
- if(Letter[charPos][show_cnt]&BIT(7-bit_cnt))
- {
- LCD_WriteData(charColor);//字符顏色
- }
- else
- {
- LCD_WriteData(bkColor);//背景色
- }
- }
- }
- LCD_DIS_SELECT();
- }
- /*******************************************************************************************************************
- **Functionname:LCD_WriteString
- **Descriptions:向屏幕寫字符串
- **inputparameters:字符起始行列(lineNum,rowLine),背景色---bkColor,字節(jié)顏色---charColor,字符串指針p_str
- **outputparameters:無
- **Returnedvalue:無
- ********************************************************************************************************************/
- voidLCD_WriteString(unsignedcharlineNum,unsignedcharrowNum,
- unsignedintcharColor,
- unsignedintbkColor,
- unsignedchar*p_str)
- {
- while(*p_str)
- {
- //計(jì)算坐標(biāo)
- if(*p_str==n)//換行
- {
- rowNum=0;
- lineNum++;
- p_str++;//調(diào)過換行符,不用顯示
- continue;//查詢下一個(gè)字符
- }
- else//未遇到換行符則按正常顯示坐標(biāo)自加
- {
- LCD_WriteChar(lineNum,rowNum,charColor,bkColor,*p_str);
- rowNum++;
- if(rowNum==CHAR_X_NUM)
- {
- rowNum=0;
- lineNum++;
- if(lineNum==CHAR_Y_NUM)
- {
- lineNum=0;
- }
- }
- }
- p_str++;//字符串指針++
- }
- }
- /*********************************************************************************************************
- *EndOfFile*
- *********************************************************************************************************/
文件名:main.c 主函數(shù)測(cè)試
- /****************************************Copyright(c)**************************************************
- **SoutheastUniversity
- **--------------FileInfo-------------------------------------------------------------------------------
- **FileName:main.c
- **LastmodifiedDate:2012-04-11
- **LastVersion:1.0
- **Description:測(cè)試函數(shù)
- **------------------------------------------------------------------------------------------------------
- **CreatedBy:JianGe
- **Createddate:2012-03-23
- **Version:1.0
- **------------------------------------------------------------------------------------------------------*/
- #include
- #include
- #include"Type.h"
- #include"Delay.h"
- #include"USART.h"
- voidmain(void)
- {
- unsignedchar*ptr="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- USART_Init();
- LCD_ILI9325_Init();
- LCD_ClearScreen(0xF800);
- LCD_Fill_Rectangle(0,0,200,200,0xF800);
- LCD_WriteChar(1,1,0xF800,0xFFFF,1);//顯示字符
- LCD_WriteString(0,0,0xF800,0xFFFF,ptr);//顯示字符串
- }
評(píng)論