📄 lcd.h
字号:
/***************************************************************
* LCD Library *
* Supported hardware: 2x16 LCD *
* Author : Vijay Manohar .D *
* Date : 13 July 2007 *
* File Details : LCD API and Other Constants*
***************************************************************/
#ifndef __LCD_H__
#define __LCD_H__
typedef unsigned char bit_8;
/*************************************
LCD Port Configuration
**************************************/
sbit LCD_PORT = 0x90; //Port of MC to which LCD is Connected
sbit RS = 0xA0;
sbit RW = 0xA1;
sbit En = 0xA2;
sbit Flag = 0x97; //Busy Flag
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LCD Command MACROS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
#define LCD_CLEAR 0x1
#define RETURN_HOME 0x2
#define DEC_CURSOR 0x4
#define INC_CURSOR 0x6
#define DISP_OFF_CUR_OFF 0x8
#define DISP_OFF_CUR_ON 0xA
#define DISP_ON_CUR_OFF 0xC
#define DISP_ON_CUR_BLINK 0xE
#define SHIFT_CUR_LEFT 0x10
#define SHIFT_CUR_RIGHT 0x14
#define SHIFT_DISP_LEFT 0x18
#define SHIFT_DISP_RIGHT 0x1C
#define FORCE_CURSOR_BEGIN_I_LINE 0x80
#define FORCE_CURSOR_BEGIN_II_LINE 0xC0
#define DISPLAY_MODE 0x38 //2 Lines and 5X7
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function Prototypes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
void LCD_Init (void); // Initialize LCD
void Busy (void); // To monitor the Busy Bit of LCD
void Wrt_Cmd (bit_8); // Sending Command
void Wrt_Data (bit_8); // Sending single character
void Wrt_String (bit_8*); // Sending String
void Wrt_Value (bit_8); // Sending 8-bit Decimal value
void GotoXY (bit_8, bit_8); // Bringing CuRSor to (X,Y) location X -> 1,2 and Y -> 1-16
void Delay ();
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -