You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
922 B

3 years ago
#ifndef __LCD_H_
#define __LCD_H_
/**********************************
<EFBFBD><EFBFBD>ʹ<EFBFBD>õ<EFBFBD><EFBFBD><EFBFBD>4λ<EFBFBD><EFBFBD><EFBFBD>ݴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ʹ<EFBFBD><EFBFBD>8λȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
**********************************/
//#define LCD1602_4PINS
/**********************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>ļ<EFBFBD>
**********************************/
#include<reg51.h>
//---<EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD><EFBFBD><EFBFBD>---//
#ifndef uchar
#define uchar unsigned char
#endif
#ifndef uint
#define uint unsigned int
#endif
/**********************************
PIN<EFBFBD>ڶ<EFBFBD><EFBFBD><EFBFBD>
**********************************/
#define LCD1602_DATAPINS P0
3 years ago
sbit LCD1602_E=P1^4;
sbit LCD1602_RW=P1^5;
sbit LCD1602_RS=P1^6;
/**********************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
**********************************/
/*<EFBFBD><EFBFBD>51<EFBFBD><EFBFBD>Ƭ<EFBFBD><EFBFBD>12MHZʱ<EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
void Lcd1602_Delay1ms(uint c); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0us
/*LCD1602д<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӻ<EFBFBD><EFBFBD><EFBFBD>*/
void LcdWriteCom(uchar com);
/*LCD1602д<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӻ<EFBFBD><EFBFBD><EFBFBD>*/
void LcdWriteData(uchar dat) ;
/*LCD1602<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD><EFBFBD><EFBFBD>*/
void LcdInit();
#endif