?? 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 + -