//extern void TFT_SetGPIO(void);
//extern void TFT_Delay(unsigned int nCount);
extern void Delay_us(unsigned char Times);
extern void Delay_ms(unsigned char Times);
extern void Delay_s(unsigned char Times);
extern unsigned short TFT_CheckContronller(void);
extern void TFT_BackLight(unsigned char status);
extern void TFT_Reset(void);
extern void TFT_WriteRegister(unsigned short index,unsigned short dat);
extern unsigned short TFT_ReadRegister(unsigned short index);
extern unsigned short TFT_ReadData(void);
extern void TFT_WriteData(unsigned short dat);
extern void TFT_Init(void);
extern void TFT_SetCursor(unsigned short x,unsigned short y);
extern void TFT_SetWindows(unsigned short startX,unsigned short startY,unsigned short endX,unsigned short endY);
extern void TFT_Clear(unsigned short dat);
extern unsigned short TFT_GetPoint(unsigned short x,unsigned short y);
extern void TFT_SetPoint(unsigned short x,unsigned short y,unsigned short point);
extern void TFT_DrawPicture(unsigned short startX,unsigned short startY,unsigned short endX,unsigned short endY,unsigned char const *pic);
extern void TFT_PutChar(unsigned short x,unsigned short y,unsigned char asciiCode,unsigned short charColor,unsigned short bkColor);
extern void TFT_Test(void);
extern unsigned short TFT_BGR2RGB(unsigned short c);
extern void TFT_WriteIndex(unsigned short idx);
extern void TFT_PutStr(unsigned short endX,unsigned short endY,unsigned char *ptr,unsigned short charColor,unsigned short bkColor);
#endif
/******************************************************
End Of File
******************************************************/
* ³ÌÐòÃû³Æ: TFT²ÊÆÁÍ·Îļþ
* ³ÌÐò¹¦ÄÜ: TFT²ÊÆÁ²ÎÊýÉèÖÃ
* Ä¿±êÓ²¼þ:
* ÎļþÃû³Æ£ºILI9320.h
* ´´½¨ÈÕÆÚ:
* Ô­´´×÷Õß:
******************************************************/
#ifndef __ILI9320_H
#define __ILI9320_H
#include "mytype.h"
#include "c8051f020.h"
/***************** ¹Ü½Å¶¨Òå ************************/
//#define TFT_CS 1 << 16 // P1.16 Ƭѡ
//#define TFT_RS 1 << 17 // P1.17 Ö¸Áî/Êý¾ÝÑ¡Ôñ 0 - Ö¸Á1 - Êý¾Ý
//#define TFT_WR 1 << 18 // P1.18
//#define TFT_RD 1 << 19 // P1.19
//#define TFT_RST 1 << 20 // P1.20 ¸´Î»
//#define TFT_BLK 1 << 21 // P1.21 ±³¹â¿ØÖÆ
//
//#define TFT_DAT 0xFFFF // P0.0~P0.15
sbit A0 = P2^1; //Êý¾Ý/ÃüÁîÇл»
sbit RES = P2^4; //¸´Î»
sbit WRB = P2^2; //д¿ØÖÆ
sbit RDB = P2^3; //¶Á¿ØÖÆ
sbit CS = P2^0; //Ƭѡ
sbit BLK = P2^5; //ÔÝʱûÓõ½
//****************** ºê¶¨Òå ***************************
#define SET_TFT_CS() (CS = 1)
#define CLR_TFT_CS() (CS = 0)
#define SET_TFT_RS() (A0 = 1)
#define CLR_TFT_RS() (A0 = 0)
#define SET_TFT_WR() (WRB = 1)
#define CLR_TFT_WR() (WRB = 0)
#define SET_TFT_RD() (RDB = 1)
#define CLR_TFT_RD() (RDB = 0)
#define SET_TFT_RST() (RES = 1)
#define CLR_TFT_RST() (RES = 0)
#define ON_TFT_BLK() (BLK = 1)
#define OFF_TFT_BLK() (BLK = 0)
// ****************** ¶ÁÊý¾Ý ************************
//#define READDATA() (P0)
//************** ÑÕÉ«¶¨Òå ***************************
#define RED 0xF800 // ºìÉ«
#define GREEN 0x03E0 // ÂÌÉ«
#define BLUE 0x001F // À¶É«
#define WRITE 0xFFFF // °×É«
#define BLACK 0x0000 // ºÚÉ«
#define ORANGE 0xF860 // ³ÈÉ«
#define YELLOW 0xFFE0 // »ÆÉ«
#define CYAN 0x07FF // ÇàÉ«
#define PROPLE 0xF81F // ×ÏÉ«
#define NOCOLOR 0x0001 // ÎÞÉ«
//************** ¶¨ÒåÆÁ¿í ***************************
#define WIDTH 240 // ÆÁ¿í
#define HEIGTH 320 // ÆÁ¸ß
/***************** º¯ÊýÉêÃ÷ ************************/
//extern void TFT_SetGPIO(void);
//extern void TFT_Delay(unsigned int nCount);
extern void Delay_us(unsigned char Times);
extern void Delay_ms(unsigned char Times);
extern void Delay_s(unsigned char Times);
extern unsigned short TFT_CheckContronller(void);
extern void TFT_BackLight(unsigned char status);
extern void TFT_Reset(void);
extern void TFT_WriteRegister(unsigned short index,unsigned short dat);
extern unsigned short TFT_ReadRegister(unsigned short index);
extern unsigned short TFT_ReadData(void);
extern void TFT_WriteData(unsigned short dat);
extern void TFT_Init(void);
extern void TFT_SetCursor(unsigned short x,unsigned short y);
extern void TFT_SetWindows(unsigned short startX,unsigned short startY,unsigned short endX,unsigned short endY);
extern void TFT_Clear(unsigned short dat);
extern unsigned short TFT_GetPoint(unsigned short x,unsigned short y);
extern void TFT_SetPoint(unsigned short x,unsigned short y,unsigned short point);
extern void TFT_DrawPicture(unsigned short startX,unsigned short startY,unsigned short endX,unsigned short endY,unsigned char const *pic);
extern void TFT_PutChar(unsigned short x,unsigned short y,unsigned char asciiCode,unsigned short charColor,unsigned short bkColor);
extern void TFT_Test(void);
extern unsigned short TFT_BGR2RGB(unsigned short c);
extern void TFT_WriteIndex(unsigned short idx);
extern void TFT_PutStr(unsigned short endX,unsigned short endY,unsigned char *ptr,unsigned short charColor,unsigned short bkColor);
#endif
/******************************************************
End Of File
******************************************************/
一周热门 更多>