www.pudn.com > sound-source-location.rar > st7565.h, change:2014-07-30,size:1510b


#ifndef __ST7565_H 
#define __ST7565_H 
 
 
/*************************************** 
Ļӷʽ  
RS  -->   PB5 
RD  -->   PB7  
WR  -->   PB6 
D0  -->   PC0 
D1  -->   PC1 
D2  -->   PC2 
D3  -->   PC3 
D4  -->   PC4 
D5  -->   PC5 
D1  -->   PC6 
D1  -->   PC7 
CS  -->   PB3 
RSET-->   PB4 
****************************************/ 
 
#include "stm32f10x.h" 
#include "bitband.h" 
#include "delay.h" 
 
#ifndef uchar 
#define uchar uint8_t 
#endif 
 
#ifndef uint  
#define uint unsigned int 
#endif 
 
#define DATA_PORT   
 
#define LCD12864_CS  		GPIOout(GPIOB,3) 
#define LCD12864_RSET		GPIOout(GPIOB,4) 
#define LCD12864_RS			GPIOout(GPIOB,5) 
#define LCD12864_WR			GPIOout(GPIOB,6) 
#define LCD12864_RD			GPIOout(GPIOB,7) 
#define SET_DATA_OUT()	{GPIOC->CRL=0X33333333;}//??????? 
#define SET_DATA_IN()		{GPIOC->CRL=0X88888888;GPIOC->BSRR=0XFF;}//??????? 
#define DATAOUT(X) 			{GPIOC->ODR|=0xffffffff;GPIOC->ODR&=X;} 
#define DATAIN					(uint8_t)(GPIOC->IDR&0x00ff) 
#define LcdSt7565_WriteData(dat) {	LCD12864_CS = 0;LCD12864_RD = 1;LCD12864_RS = 1;LCD12864_WR = 0;delay_us(1);delay_us(1);DATAOUT(dat);delay_us(1);delay_us(1);LCD12864_WR = 1;	} 
#define LcdSt7565_WriteCmd(cmd) {LCD12864_CS = 0;LCD12864_RD = 1;LCD12864_RS = 0;LCD12864_WR = 0;delay_us(1);delay_us(1);DATAOUT(cmd);delay_us(1);delay_us(1);LCD12864_WR = 1;} 
 
	 
uchar Lcd12864_Write16CnCHAR(uchar x, uchar y, uchar *cn); 
void Lcd12864_ClearScreen(void); 
void Lcd12864_Init(); 
//void LcdSt7565_WriteCmd(uint8_t cmd); 
 
#endif