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

📄 lcd_funct.h

📁 8051和DS8007怎样操作使用SMARTCARD的源代码
💻 H
字号:
/*---------------------------------------------------------------------------
 *  Copyright (C) 2004 Dallas Semiconductor Corporation, All Rights Reserved.
 * 
 *  Permission is hereby granted, free of charge, to any person obtaining a
 *  copy of this software and associated documentation files (the "Software"),
 *  to deal in the Software without restriction, including without limitation
 *  the rights to use, copy, modify, merge, publish, distribute, sublicense,
 *  and/or sell copies of the Software, and to permit persons to whom the
 *  Software is furnished to do so, subject to the following conditions:
 * 
 *  The above copyright notice and this permission notice shall be included
 *  in all copies or substantial portions of the Software.
 * 
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 *  MERCHANTABILITY,  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 *  IN NO EVENT SHALL DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES
 *  OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 *  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 *  OTHER DEALINGS IN THE SOFTWARE.
 * 
 *  Except as contained in this notice, the name of Dallas Semiconductor
 *  shall not be used except as stated in the Dallas Semiconductor
 *  Branding Policy.
 * ---------------------------------------------------------------------------
 */

/** 
 * \file LCD_Funct.h
 * \brief Header file for the Lumex LCM-S02002DSF LCD Module
 *
 * This file contains routines required to communicate with the
 * Lumex LCM-S02002DSF 2 line by 20 character LCD module used on
 * the DS8007 Smart Card Interface Board from Dallas Semiconductor.
 *
 */


/* Define byte location register */
sfr		LCD_Dat = 0xA0;			// LCD_D7-D0 = P2.7-P2.0

/* define bit location registers */
sbit	LCD_RS = 0x92;			// LCD_RS = P1.2
sbit	LCD_RW = 0x93;			// LCD_RW = P1.3
sbit	LCD_EN = 0x95;			// LCD_EN = P1.5


// LCD Clear Display command
#define DispClear	0x01

// LCD Function Set command
// 8-bit interface; 2-line mode; 5x8 characters
#define FnctSet		0x3C

// LCD Display Control command
// display ON; cusrsor ON; cursor blink OFF
#define	DispCnt		0x0F

// LCD Set Entry Mode command
// increment DDRAM address; shift display OFF
#define EntryMode	0x06

// LCD set DDRAM line 2 address command
// set DDRAM address to first character of second line
#define Line2Ad		0xC0

// establish default port pin value (input)
#define DefaultP	0xFF

/**
 * \brief	Initialize LCD Module
 *
 * \param	none
 * \return	none
 *
 */
void LCD_Init(void);

/**
 * \brief	Move LCD cursor to a specific location
 *
 * \param	Line number, character position on line
 * \return	0 for succeful completion, -1 for out of range inputs
 *
 */
int LCD_Curpos(uint8_t, uint8_t);

/**
 * \brief   Write a command to the LCD module.
 *
 * \param   value of the command to write
 * \return  none
 */
void LCD_WRCmd(uint8_t);

/**
 * \brief   Write a ascii character to the LCD module.
 *
 * \param   value of the character to write
 * \return  none
 */
void LCD_WRChr(uint8_t);

/**
 * \brief   Write a string of characters to the LCD module.
 *
 * \param   value of the string to write
 * \return  none
 */
void LCD_WRStr(uint8_t[]);

/**
 * \brief   Test Busy flag of the LCD module.
 *
 * \param   none
 * \return  none
 */
void LCD_Busy(void);

/**
 * \brief   Delay for a time interval ~50 ms
 *
 * \param   none
 * \return  none
 */
void LCD_Delay(void);

⌨️ 快捷键说明

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