📄 lcd.h
字号:
/* ***********************************************************************
**
** Copyright (C) 2002 Jesper Hansen <jesperh@telia.com> and
** Romuald Bialy (MIS) <romek_b@o2.pl>.
**
**
** Yampp-7/USB - low level support library
**
**
*************************************************************************
**
** This file is part of the yampp system.
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
** as published by the Free Software Foundation; either version 2
** of the License, or (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software Foundation,
** Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
*************************************************************************
**
** Revision History
**
** when what who why
**
** 2002-09-22 1.0 MIS initial public release
**
*********************************************************************** */
#ifndef LCD_H
#define LCD_H
#include "..\Constants.h"
#define EEPROM_LANGTAB 0x010 // 20 bytes
#define EEPROM_LANGCHARS 0x028 // 20*14 = 280 bytes
#define LCD_CS PB4
#ifdef EPSON_LCD
#define LCD_CMD_PWRCTRL 0x20
#define LCD_CMD_BSTRON 0xD1
#define LCD_CMD_SLEEPIN 0x95
#define LCD_CMD_SLEEPOUT 0x94
#define LCD_CMD_INVON 0xA7
#define LCD_CMD_SETCON 0x81
#define LCD_CMD_DISPON 0xAF
#define LCD_CMD_CASET 0x15
#define LCD_CMD_PASET 0x75
#define LCD_CMD_RAMWR 0x5C
#define LCD_CMD_RGBSET 0xCE
#define LCD_CMD_MADCTL 0xBC
#define MADCTL_HORIZ 0x00
#define MADCTL_VERT 0x04
#else
#define LCD_CMD_SWRESET 0x01
#define LCD_CMD_BSTRON 0x03
#define LCD_CMD_SLEEPIN 0x10
#define LCD_CMD_SLEEPOUT 0x11
#define LCD_CMD_INVON 0x21
#define LCD_CMD_SETCON 0x25
#define LCD_CMD_DISPON 0x29
#define LCD_CMD_CASET 0x2A
#define LCD_CMD_PASET 0x2B
#define LCD_CMD_RAMWR 0x2C
#define LCD_CMD_RGBSET 0x2D
#define LCD_CMD_MADCTL 0x36
#define LCD_CMD_COLMOD 0x3A
#define MADCTL_HORIZ 0x48
#define MADCTL_VERT 0x68
#endif
#ifndef LCD_ASM
void lcd_init(void); // LCD initialise
void lcd_off(void); // LCD power down
void lcd_contrast(u08 contr); // Set LCD contrast (0x00 - 0x7F)
void lcd_clrscr(void);
void lcd_putchar(u08 data);
void lcd_puts(char s[]);
void lcd_progputs(char s[]);
void lcd_bar(u16 val, u16 colour); // Display progressbar on LCD
void lcd_gotoxy(u08 x, u08 y);
void lcd_window(u08 xp, u08 yp, u08 xe, u08 ye);
void lcd_color(u08 bkg, u08 text); // Set characters color
void lcd_wrdata(u08 data); // Send one data byte to LCD.
void lcd_wrcmd(u08 cmd);
#endif
#endif // ifndef LCD_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -