⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 display.h

📁 这项工程将让您把自己的MP3播放器平台
💻 H
字号:
//++
//display.h - declarations for display.c module
//
// Copyright (C) 2005 by Spare Time Gizmos.  All rights reserved.
//
// This file is part of the Spare Time Gizmos' MP3 Player firmware.
//
// This firmware 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:
// dd-mmm-yy    who     description
// 18-May-05	RLA	New file.
//--
#ifndef _display_h_
#define _display_h_

//   Define LCD for a standard Hitachi 44780 compatible LCD display, and define
// VFD for a Futaba or Noritake parallel ASCII vacuum flourescent display.  In
// either case, DISPLAY_WIDTH and DISPLAY_HEIGHT give the number of columns and
// rows in the display...  
#if !defined(VFD) && !defined(LCD)
#error DEFINE EITHER VFD OR LCD!
#endif
#if !defined(DISPLAY_WIDTH) && !defined(DISPLAY_HEIGHT)
#define DISPLAY_WIDTH	20
#define DISPLAY_HEIGHT	4
#endif

// LCD Function codes for the HD44780 display controller...
#ifdef LCD
#define COPYRIGHT_SYMBOL	"\001"	// extended character for (C)
#define CONTROL_REGISTER	0	// LCD control register (RS=0)
#define LCD_SET_DDRAM_ADDRESS	0x80	// set cursor (DDRAM) position
#define LCD_LOAD_CGRAM		0x48	// start loading character generator RAM
#define LCD_FUNCTION_SET	0x20	// set interface length and display format
#define  LCD_8BIT	 	0x10	//  select 8 bit data bus
#define  LCD_TWO_LINES		0x08	//  select two line display
#define LCD_CURSOR_MODE_SET	0x10	// cursor mode select
#define  LCD_SHIFT_DISPLAY	0x08	//  shift (scroll) display rather than move cursor
#define  LCD_MOVE_LEFT		0x04	//  cursor shifts to the left (rather than right)
#define LCD_DISPLAY_CONTROL	0x08	// display and cursor control functions
#define  LCD_DISPLAY_ON		0x04	//  turn display on
#define  LCD_DISPLAY_OFF	0x00	//   "    "   "  off
#define  LCD_CURSOR_ON		0x02	//  turn the cursor on
#define  LCD_CURSOR_BLINK	0x01	//  blink the cursor
#define LCD_ENTRY_MODE_SET	0x04	// text entry mode set
#define  LCD_INCREMENT_CURSOR	0x02	//  cursor right when text is entered
#define LCD_CURSOR_HOME		0x02	// return the cursor to (0,0)
#define LCD_CLEAR_DISPLAY	0x01	// clear the display
#define DATA_REGISTER		1	// LCD data register (RS=1)
#endif

//   VFD functions codes for Noritake displays (e.g. CU20045SCPB-T23A).  Unlike
// LCD function codes (which are written to the control register), these are
// all ASCII control characters and escape sequences that are intermixed with
// regular data...
#ifdef VFD
#define COPYRIGHT_SYMBOL	"\251"	// extended character for (C)
#define VFD_CLEAR_DISPLAY	0x0E	// clear display control character
#define VFD_CURSOR_HOME		0x0C	// home cursor    "   "    "   "
#define VFD_CURSOR_ON		0x15	// display a cursor   "    "   "
#define VFD_CURSOR_OFF		0x14	// hide the cursor    "    "   "
#define VFD_ESCAPE		0x1B	// introducer for escape esquences
#define  VFD_SET_CURSOR		0x48	//  set the cursor position
#define  VFD_FLICKERLESS	0x53	//  set "flickerless" mode
#endif

// Initialize the display...
extern void InitializeDisplay (void);
extern void ClearDisplay(void);

// Other display functions...
extern void DisplayAt (BYTE bRow, BYTE bCol);
extern void DisplayCursor (BOOL bShow);
extern void DisplayChar (char bChar);
extern void DisplayCharAt (BYTE bRow, BYTE bCol, char bChar);
extern void DisplayString (char *pString);
extern void DisplayStringAt (BYTE bRow, BYTE bCol, char *pString);
extern void DisplayText (char *pFormat, ...);
extern void DisplayTextAt (BYTE bRow, BYTE bCol, char *pFormat, ...);

#endif	// _display_h_

⌨️ 快捷键说明

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