lcd.h
来自「OCM4X8C驱动 作者:孙新虎 sunxinhu@163.com 日期:200」· C头文件 代码 · 共 44 行
H
44 行
#ifndef __lcd_h__
#define __lcd_h__
#define LCD_RS PB1
#define LCD_RW PB2
#define LCD_E PB3
#define LCD_RST PB4
#define LCD_POWER_OFF() DDRB &= ~_BV(PB0)
#define LCD_POWER_ON() DDRB |= _BV(PB0)
#define CLR_RS() PORTB &= ~_BV(LCD_RS)
#define SET_RS() PORTB |= _BV(LCD_RS)
#define CLR_RW() PORTB &= ~_BV(LCD_RW)
#define SET_RW() PORTB |= _BV(LCD_RW)
#define CLR_E() PORTB &= ~_BV(LCD_E)
#define SET_E() PORTB |= _BV(LCD_E)
#define CLR_RST() PORTB &= ~_BV(LCD_RST)
#define SET_RST() PORTB |= _BV(LCD_RST)
//LCD指令集
#define CLR_DISPLAY 0x01
#define CLR_DDRAM_COUNT 0x02
void delay(uint8_t i); //短时间延时
void lcd_power_on(void); //打开LCD电源
void lcd_power_off(void); //关闭LCD电源
void lcd_rst(void);
void lcd_chk_busy(void); //测试忙
void lcd_write_data(uint8_t data); //向LCD写入数据
void lcd_write_command(uint8_t command); //向LCD写入命令
void lcd_write_chinese(uint16_t ch);
uint8_t lcd_read_byte(void); //从LCD读数据
void lcd_init(void); //LCD初始化
void test(void); //测试
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?