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

📄 lcd.h

📁 针对日本瑞莎单片机r8c/23 开发的LIN网络通讯程序包括主节点和从节点
💻 H
字号:
/*****************************************************************
 * Driver for ACM0802C LCD Module (8 characters by 2 lines )
 * on the Renesas RSK boards - header file
 *
 *  Copyright (c) 2004 Renesas Technology America, Inc.
 *  All rights reserved.
 *
 *	V1.0  RSK Can D-Kit Release, Feb 14, 2006.
 *  V1.12  RSK Can D-Kit, March 23, 2006; ad can-id displayed
 *
 *****************************************************************/

#ifndef RSK_LCD_H
#define RSK_LCD_H

void InitDisplay( void );
void DisplayString(unsigned char position, const char far * string);
void LCD_write(unsigned char data_or_ctrl, unsigned char value);
void DisplayDelay(unsigned long int units);

char* IntToAsciiDec(char* dest_string, int min_digits, unsigned int value);
char* IntToAsciiHex(char* dest_string, int min_digits, unsigned int value);
void lcd_show_2dig_hex(unsigned char  data, unsigned char  position);
void lcd_show_4dig_hex(unsigned char  data_msb, unsigned char  data_lsb, unsigned char  position);

/* The special bitmap characters are mapped to display values 0 to 7 */
#define RENESAS_LOGO "\x0\x1\x2\x3\x4\x5\x6\x7\x0"
//const	char RENESAS_LOGO[] = {0,1,2,3,4,5,6,7,0};

#define HIGH 1
#define LOW 0
#define DATA_PORT		p0			// Data bus port
#define RS_PIN 			p1_1  		// RS Register Select pin
#define RS_PIN_MASK		0x0			// bit mask from entire port
#define RS_PIN_DDR		pd1_1		// RS pin DDR
#define EN_PIN			p1_2  		// Display Enable pin
#define EN_PIN_MASK		0x02		// bit mask from entire port
#define EN_PIN_DDR		pd1_2		// EN pin DDR

#define PORT_DDR		pd0			// Data bus direction register
#define PORT_DDR_VALUE	0x0f		// Can't read DDR reg, so have can't OR values

#define DATA_WR 1
#define CTRL_WR 0

/* Set to ensure base delay */
#define DELAY_TIMING		0x0130

#define MAXIMUM_LINES		2		// number of lines on the LCD display
#define NUMB_CHARS_PER_LINE	8		// Maximum charactors per line of LCD display.  

#define LINE1_1STCH 	0
#define LINE2_1STCH 	16

/**********************************************************************************/
// LCD commands - use LCD_write function to write these commands to the LCD. 
/**********************************************************************************/
#define LCD_CLEAR        0x01    // Clear LCD display and home cursor   
#define LCD_HOME_L1      0x80    // 0x80 move cursor to line 1               
#define LCD_HOME_L2      0xC0    // 0xC0 move cursor to line 2               
#define CURSOR_MODE_DEC  0x04    // Cursor auto decrement after R/W     
#define CURSOR_MODE_INC  0x06    // Cursor auto increment after R/W     
#define FUNCTION_SET     0x28    // Setup, 4 bits,2 lines, 5X7          
#define LCD_CURSOR_ON    0x0E    // Display ON with Cursor              
#define LCD_CURSOR_OFF   0x0C    // Display ON with Cursor off
#define LCD_CURSOR_BLINK 0x0D    // Display on with blinking cursor     
#define LCD_CURSOR_LEFT  0x10    // Move Cursor Left One Position       
#define LCD_CURSOR_RIGHT 0x14    // Move Cursor Right One Position      

#endif
/* eof */

⌨️ 快捷键说明

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