lcd_driver.h

来自「LCD1602驱动 在AVR单片机上实现 可方便地移植到51单片机」· C头文件 代码 · 共 43 行

H
43
字号
/*----------------------------------------------------------------------------------------------------------
									LCD1602头文件,实现对液晶的读写操作 
----------------------------------------------------------------------------------------------------------*/
#ifndef _LCD_DRIVER_H
#define _LCD_DRIVER_H

#include "avr_compiler.h"
#include "bin.h"

#define LCDEPORT PORTA
#define LCDRSPORT PORTA

#define LCD_DATA (PORTB.OUT)

#define LCD_E_bm PIN7_bm
#define LCD_RS_bm PIN6_bm

#define LCDMASK 0xff

#define LCD_SET_RS_CMD (LCDRSPORT.OUTSET |= LCD_RS_bm)

#define LCD_SET_RS_DATA (LCDRSPORT.OUTCLR |=LCD_RS_bm)

#define LCD_ENABLE (LCDEPORT.OUTSET |= LCD_E_bm)

#define LCD_DISABLE (LCDEPORT.OUTCLR |= LCD_E_bm)

void WriteCommandLCD( uint8_t ucCmd, bool bFgBusy );

void WriteDataLCD(uint8_t ucData);

void SetXY( uint8_t X, bool Y ) ;

void WriteCGRAM( uint8_t ucCGRAM_Add, const uint8_t *pStr, uint8_t ucBytes );	//写字符发生器RAM 

void DisOneChar(uint8_t X, uint8_t Y, uint8_t ucData);

void DisListChar(uint8_t X, uint8_t Y, const uint8_t *pStr, uint8_t ucStrLen);

#define CLEAR_SCREEN	WriteCommandLCD( 0x01,true )

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?