📄 lcd.h
字号:
/*********************************************************************
* File: lcd.h
* Purpose:
*
*
* Copyright:
* 1999-2000 MOTOROLA, INC. All Rights Reserved.
* You are hereby granted a copyright license to use, modify, and
* distribute the SOFTWARE so long as this entire notice is
* retained without alteration in any modified and/or redistributed
* versions, and that such modified versions are clearly identified
* as such. No licenses are granted by implication, estoppel or
* otherwise under any patents or trademarks of Motorola, Inc. This
* software is provided on an "AS IS" basis and without warranty.
*
* To the maximum extent permitted by applicable law, MOTOROLA
* DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, INCLUDING
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
* PURPOSE AND ANY WARRANTY AGAINST INFRINGEMENT WITH REGARD TO THE
* SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF) AND ANY
* ACCOMPANYING WRITTEN MATERIALS.
*
* To the maximum extent permitted by applicable law, IN NO EVENT
* SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER (INCLUDING
* WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS
* INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY
* LOSS) ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.
*
* Motorola assumes no responsibility for the maintenance and support
* of this software
********************************************************************/
#ifdef _LCD_H
/********************************************************************/
#define LCD_SID (0x04000000)
#define LCD_SCLK (0x08000000)
#define LCD_RS (0x20000000)
#define LCD_RST (0x00000020) //GPO37
#define LCD_CS2 (0x00200000)
/********************************************************************/
#define MSB (0x80)
#define LCD_CTRL (0)
#define LCD_DATA (1)
/*--- LCD controller instructions ---*/
#define LCD_DOFF (0xAE) //Turn OFF LCD panel
#define LCD_DON (0xAF) //Turn ON LCD panel
#define LCD_INIT_DLINE (0x40) //Specify DDRAM line for COM1
#define LCD_SET_REF_VM (0x81) //Set reference voltage mode
#define LCD_SET_REF_VR (0x00) //Set reference voltage register (6 LSB's)
#define LCD_PAGE (0xB0) //Set Page address
#define LCD_COL_MSB (0x10) //Set Column address MSB (4 LSB's)
#define LCD_COL_LSB (0x00) //Set Column address LSB (4 LSB's)
#define LCD_NORMAL (0xA6) //Select normal display
#define LCD_REVERSE (0xA7) //Select reversed display
#define LCD_EOFF (0xA4) //Select normal display
#define LCD_EON (0xA5) //Select entire display ON
#define LCD_SET_MOD_RD (0xE0) //Set modify-read mode
#define LCD_RST_MOD_RD (0xEE) //Release modify-read mode
#define LCD_RESET (0xE2) //Initialise internal functions
#define LCD_SHL_NORMAL (0xC0) //Select normal COM output direction
#define LCD_SHL_REVERSE (0xC8) //Select reversed COM output direction
#define LCD_PWR_CTRL_VC (0x2C) //Voltage converter circuit OFF/ON (3rd LSB)
#define LCD_PWR_CTRL_VR (0x2E) //Voltage regulator OFF/ON (2nd LSB)
#define LCD_PWR_CTRL_VF (0x2F) //Voltage follower OFF/ON (LSB)
#define LCD_REG_RSEL (0x20) //Select resistance ration of regulator resistor (3 LSB's)
#define LCD_SM_OFF (0xAC) //Set static indicator mode OFF
#define LCD_SM_ON (0xAD) //Set static indicator mode ON
#define LCD_SI_REG (0x00) //Set static indicator register (2 LSB's)
#define LCD_BIAS_SELECT (0xA3) //Select LCD bias (LSB)
#define LCD_ADC (0xA0) //Select normal or reversed SEG output direction (LSB)
/*--- Basic LCD definitions for character printing ---*/
#define END 132 //number of pixel columns
#define HEX8BIT 0 //definition for 8-bit hexadecimal option
#define HEX16BIT 1 //definition for 16-bit hexadecimal option
#define DECIMAL 2 //definition for decimal option
/*--- Function Prototypes ---*/
void SetLCDReset(void);
void ClearLCDReset(void);
void WriteLCDByte(uint8 data, uint8 rs);
void LCDInit(void);
void LCDClear(void);
void LCDScroll(uint8 times);
#endif /* _LCD_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -