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

📄 lcd.h

📁 基于三星S6B0741芯片的LCD
💻 H
字号:



#ifndef _LCD_H_
#define _LCD_H_

#include <avr/io.h>
#include "my_type.h"




/*
LCD interface:

	MCU         LCD

	PC2	------- CS
	PC3	-------	RST
	PC4	-------	RS	
	PC5	-------	CLK
	PC6	-------	DATA
	PD7 ---PNP----BACK LIGHT
	
*/
#define 	SET_CS() 	PORTC|= _BV(PC2)
#define 	CLR_CS() 	PORTC&= ~(_BV(PC2))

#define 	SET_RST() 	PORTC|= _BV(PC3)
#define 	CLR_RST() 	PORTC&= ~(_BV(PC3))

#define 	SET_RS() 	PORTC|= _BV(PC4)
#define 	CLR_RS() 	PORTC&= ~(_BV(PC4))

#define 	SET_CLK() 	PORTC|= _BV(PC5)
#define 	CLR_CLK() 	PORTC&= ~(_BV(PC5))

#define 	SET_DATA() 	PORTC|= _BV(PC6)
#define 	CLR_DATA() 	PORTC&= ~(_BV(PC6))

#define    LCD_IO_INIT()  DDRC |= 0X7C;//	DDRD |= 0X1F;
	


void lcd_send_command (u8 command);
void lcd_send_data (u8 data);

void lcd_init(void);
void lcd_set_column (u8 column);
void lcd_set_page (u8 page);
void lcd_set_xy (u8 page,u8 column);

void lcd_put_char (u8 asc);
/******************************************************************************
 * Function:        void lcd_put_str (u8 page,u8 column,u8 *str)
 *
 * PreCondition:    None
 *
 * Input:           u8 page: page number
 *					u8 column: column number
 *					u8 *str: string point
 *
 * Output:          None
 *
 * Side Effects:    None
 *
 * Overview:        This routine put 6*8 dot character on lcd.
 *
 * Note:            None.
 *****************************************************************************/
void lcd_put_str (u8 page,u8 column,u8 *str);

/******************************************************************************
 * Function:        void lcd_put_big_str (u8 page,u8 column,u8 *str)
 *
 * PreCondition:    None
 *
 * Input:           u8 page: page number
 *					u8 column: column number
 *					u8 *str: string point
 *
 * Output:          None
 *
 * Side Effects:    None
 *
 * Overview:        This routine put 16*8 dot character on lcd.
 *
 * Note:            It use the follow page.
 *****************************************************************************/
void lcd_put_big_str (u8 page,u8 column,u8 *str);

/*************************************
 * clear one page( 8 row).
 ************************************/
void lcd_clr_page(u8 page);
void lcd_clr_all(void);


void gray_test (void);


void font_test (void);


#endif 

⌨️ 快捷键说明

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