lcd.h
资源名称:RFID.rar [点击查看]
上传用户:njxy551199
上传日期:2022-04-06
资源大小:1990k
文件大小:2k
源码类别:
RFID编程
开发平台:
C/C++
- #ifndef _LCD_H_
- #define _LCD_H_
- //#include "REG52x2.h"
- #include "type.h"
- //#include "head.h"
- //#include "ka.h"
- //#include "logotu.h"
- #include "main.h"
- //#include "absacc.h"”
- //////////////////////////////////////////////////////////////////
- //LCD pin define
- #define LCD_DAT P0
- sbit LCD_nCS=P2^5;
- sbit LCD_nRD=P2^2;
- sbit LCD_nWR=P2^3;
- sbit LCD_RS=P2^4;
- sbit LCD_nRST=P2^6;
- sbit LCD_BLEN=P2^1;
- /*
- sbit Touch_nCS=P3^5;
- sbit Touch_DCLK=P2^7;
- sbit Touch_DIN=P2^6;
- sbit Touch_nINT=P3^4;
- sbit Touch_DOUT=P2^1;
- sbit Touch_nBUSY=P2^0;
- */
- sbit Beep=P1^6;
- //////////////////////////////////////////////////////////////////
- //Color define RGB=565
- #define RED 0xf800
- #define GREEN 0x07e0
- #define BLUE 0x001f
- #define WHITE 0xffff
- #define BLACK 0x0000
- #define YELLOW 0xFFE0
- #define TRANSP 1 //字体显示的时候不带背景颜色
- #define NORMAL 0 //字体显示的时候有背景颜色
- //////////////////////////////////////////////////////////////////
- #define LCD_W 240
- #define LCD_H 320
- #define LCD_Sx 0
- #define LCD_Sy 0
- #define LCD_Ex (LCD_W-1)
- #define LCD_Ey (LCD_H-1)
- #define XBYTE ((unsigned char volatile xdata *) 0)
- #define LCD_BLEN_0 LCD_BLEN=0
- #define LCD_BLEN_1 LCD_BLEN=1
- #define LCD_nCS_0 LCD_nCS=0
- #define LCD_nCS_1 LCD_nCS=1
- #define LCD_nRST_0 LCD_nRST=0
- #define LCD_nRST_1 LCD_nRST=1
- #define LCD_RS_0 LCD_RS=0
- #define LCD_RS_1 LCD_RS=1
- #define LCD_nRD_0 LCD_nRD=0
- #define LCD_nRD_1 LCD_nRD=1
- #define LCD_nWR_0 LCD_nWR=0
- #define LCD_nWR_1 LCD_nWR=1
- #define LCD_Dat_Rd P0
- //////////////////////////////////////////////////////////////////
- void DelayUs(U16 us);
- void DelayMs( U16 ms);
- void LCD_WrCmd(U16 cmd);
- void LCD_WrDat(U16 dat);
- void LCD_WrDat8(U8 dat);
- void LCD_WrCmdDat(U16 addr,U16 dat);
- U16 LCD_RdDat(void);
- void LCD_Init();
- void LCD_SetGramPoit(U16 x,U16 y);
- void LCD_SetWindows(U16 HSA, U16 VSA,U16 HEA, U16 VEA);
- void DispOneColor(U16 X,U16 Y,U16 W,U16 H,U16 Color);
- void LCD_Clear();
- void Display_full_screen_color(U16 color);
- void DrawSingleAscii(U16 x, U16 y, U8 *pHz, U16 LineColor,U16 FillColor, U8 Mod);
- void DrawSingleHz(U16 x, U16 y, U8 *pHz, U16 LineColor,U16 FillColor, U8 Mod);
- void DrawString(U16 x, U16 y, U8 *pStr, U16 LineColor,U16 FillColor, U8 Mod);
- void DispNum(U16 x, U16 y, U16 num,U16 LineColor,U16 FillColor, U8 Mod);
- void DispSmallPic(U16 x, U16 y, U16 w, U16 h, const U8 *str);
- #endif