include "stm32f10x.h"
#include "1602.h"
#include "sys.h"
#include "delay.h"
//typedef unsigned char BYTE;
//typedef unsigned char BOOL;
unsigned char lcd_bz(void)
{ // ²âÊÔLCDæµ״̬
unsigned char result;
LCD_RS(0); //0;
LCD_RW(1); //1;
LCD_EN(1); //1;
delay_us(1);
result = (GPIO_ReadInputData(GPIOB) & 0x8000)>>8;
LCD_EN(0); // 0;
return result;
}
/******************************дÃüÁî*************************************************/
void lcd_wcmd(int cmd)
{ // дÈëÖ¸ÁîÊý¾Ýµ½LCD
while(lcd_bz());
LCD_RS(0); // 0;
LCD_RW(0); // 0;
LCD_EN(0); // 0;
delay_us(1);
//NOP();
GPIOB->BSRR = cmd<<8 & 0xff00; //½«Êý¾ÝË͵½P0¿Ú
GPIOB->BRR = ((~cmd)<<8) & 0xff00;
1