📄 lcd1602_4.h
字号:
//
// File: lcd1602_4.h
// Description: header file for lcd1602_4.c
// Author: Nicholas Tian
// Version:0.1.0 by Nicholas @ 2012-07-15
//
#ifndef __LCD1602_H__
#define __LCD1602_H__
// Define IO.
#define lcdControl P1OUT
#define lcdDataIn P2IN
#define lcdDataOut P2OUT
// Define IO direction.
#define lcdDataSelIO P2SEL &= 0x0f // high 4 bits effective.
#define lcdDataSel2IO P2SEL2 &= 0x0f // high 4 bits effective.
#define lcdCtrlDirIn P1DIR |= 0x38 // P1.3 -> P1.5 RS, RW, EN.
#define lcdDataDirIn P2DIR &= 0x0f // high 4 bits effective.
#define lcdDataDirOut P2DIR |= 0xf0 // high 4 bits effective.
// Define control ports operations.
#define setLcdRS lcdControl |= BIT3 // RS -> P1.3
#define clrLcdRS lcdControl &= ~BIT3
#define setLcdRW lcdControl |= BIT4 // RW -> P1.4
#define clrLcdRW lcdControl &= ~BIT4
#define setLcdEN lcdControl |= BIT5 // EN -> P1.5
#define clrLcdEN lcdControl &= ~BIT5
// Declare functions.
extern void initLCD(void);
extern void onLcd(unsigned char y, unsigned char x, char * string);
extern void clearLcd(void);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -