資源簡介
STM32并行方式驅動LCD12864,12864是3.3V版本
代碼片段和文件信息
#include?“lcd12864.h“
#include?“stm32f10x.h“
#include?“stm32f10x_conf.h“
#include?“time.h“
#include?“lcd12864.h“
/*
Delay_MS(unsigned?char?t)為延時t×1MS函數
需自行編寫!!
*/
//初始化
void?LCD_Init(void)
{
PSB_H;
RST_H;
Delay_MS(5);
LCD_WriteCmd(0x30);
Delay_MS(5);
LCD_WriteCmd(0x0c);
Delay_MS(5);
LCD_WriteCmd(0x01);
Delay_MS(5);
}
//忙檢測
void?LCD_Busy()
{
SetGPIO_In();
RS_L;
RW_H;
EN_L;
Delay_MS(5);
EN_H;
while(0x80==(0x80&GPIO_ReadInputData(LCD_DB)))
{
Delay_MS(10);
break;
}
EN_L;
SetGPIO_Out();
}
//寫指令
void?LCD_WriteCmd(unsigned?char?cmd)
{
SetGPIO_Out();
LCD_Busy();
RS_L;
RW_L;
EN_L;
Delay_MS(5);
EN_H;
GPIO_Write(LCD_DBcmd);
Delay_MS(5);
EN_L;
}
//寫數據
void?LCD_WriteData(unsigned?char?dat)
{
SetGPIO_Ou
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????1280??2017-04-18?16:25??main.c
?????文件????????2097??2017-04-18?16:34??lcd12864.c
?????文件????????1141??2017-04-18?16:30??lcd12864.h
?????文件?????????247??2017-04-18?16:39??先讀我.txt
評論
共有 條評論