-
大小: 1.46MB文件類型: .rar金幣: 2下載: 0 次發(fā)布日期: 2023-10-21
- 語(yǔ)言: 其他
- 標(biāo)簽: ocmj4x8c??驅(qū)動(dòng)??源碼??
資源簡(jiǎn)介
ocmj4x8c顯示模塊手冊(cè)和驅(qū)動(dòng)源碼,ocmj4x8c-7模塊 89c51單片機(jī)

代碼片段和文件信息
/*****************************************************************************************************
?**??OCMJ4X8C-7驅(qū)動(dòng)程序
?** ?開(kāi)發(fā)者:?sunweiguo??
?**??時(shí)??間:?2009-09-29
?** ?在使用上遇到問(wèn)題可以通過(guò)電子郵件的方式聯(lián)系[sunweiguo@yeah.net]
?*****************************************************************************************************/
#include?“l(fā)cdocmj4x8c.h“
/*******************************************************************************
?**?函數(shù)名稱:void?lcd_init()
?**?功能描述:設(shè)備初始化
?**?參數(shù)說(shuō)明:無(wú)
?**?備 注:sunweiguo?2009-10-09
?*******************************************************************************/
void?lcd_init()
{
//復(fù)位
lcd_rst?=?LOW;
delay?(10);
lcd_rst?=?HIGH;
lcd_psb?=?HIGH;
lcd_en?=?LOW;
lcd_WriteCommand(0x34);//功能設(shè)定:8位控制接口,擴(kuò)充指令集
????lcd_WriteCommand(0x30);//功能設(shè)定:8位控制接口,基本指令集???
????lcd_WriteCommand(0x01);//清楚顯示
????lcd_WriteCommand(0x06);//點(diǎn)設(shè)定:光標(biāo)右移,整體顯示不移動(dòng)
lcd_WriteCommand(0x0c);//睡眠模式:脫離睡眠模式
return;
}
/*******************************************************************************
?**?函數(shù)名稱:void?lcd_busy()
?**?功能描述:設(shè)備忙標(biāo)志
?**?參數(shù)說(shuō)明:無(wú)
?**?備 注:sunweiguo?2009-10-09
?*******************************************************************************/
void?lcd_busy()
{
lcd_data?=?0xff;
lcd_rs?=?LOW;
lcd_rw?=?HIGH;
lcd_en?=?HIGH;
while(lcd_busy_flag);
lcd_en?=?LOW;
return;
}
/*******************************************************************************
?**?函數(shù)名稱:void?lcd_clear()
?**?功能描述:清除屏幕內(nèi)容
?**?參數(shù)說(shuō)明:無(wú)
?**?備 注:sunweiguo?2009-10-09
?*******************************************************************************/
void?lcd_clear()
{
lcd_WriteCommand(0x01);
return;
}?
/*******************************************************************************
?**?函數(shù)名稱:void?lcd_dispString(uchar?row?uint?speed?uchar?*msg)
?**?功能描述:在屏幕上顯示字符串
?**?參數(shù)說(shuō)明:1?row:行號(hào);?2??speed:顯示速度;?3??*msg:顯示內(nèi)容
?**?備 注:sunweiguo?2009-10-09
?*******************************************************************************/
void?lcd_dispString(uchar?row?uint?speed?uchar?*msg)
{
uchar?l_row=0;
//地址轉(zhuǎn)換
switch(row)
{
case?0:?l_row=0x80;?break;
case?1:?l_row=0x90;?break;
case?2:?l_row=0x88;?break;
case?3:?l_row=0x98;?break;
}
//定位顯示地址
lcd_WriteCommand(l_row);
//寫顯示數(shù)據(jù)
while?(*msg)
{
???lcd_WriteData(*msg++);
???delay(speed);
}
return;
}
?
?
?/*******************************************************************************
??**?函數(shù)名稱:void?lcd_WriteCommand(uchar?Command)
??**?功能描述:向LCD寫命令字符
??**?參數(shù)說(shuō)明:1??Command:命令字符
??**?備 注:sunweiguo?2009-10-09
??*******************************************************************************/
void?lcd_WriteCommand?(uchar?Command)
{
????//設(shè)備忙判斷
lcd_busy();
lcd_rs?=?LOW;
lcd_rw?=?LOW;
lcd_en?=?LOW;
lcd_data?=?Command;
//使能設(shè)備
lcd_en?=?HIGH;
delay(5);
lcd_en?=?LOW;
return;
}
/*******************************************************************************
?**?函數(shù)名稱:void
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????4752??2009-11-13?09:07??lcdocmj4x8c.c
?????文件???????4046??2009-11-13?09:07??lcdocmj4x8c.h
?????文件????1728956??2009-09-30?17:04??ocmj4x8c.pdf
-----------?---------??----------?-----??----
??????????????1737754????????????????????3
- 上一篇:NS2 TCL腳本
- 下一篇:飛客蠕蟲(chóng)病毒專殺工具
評(píng)論
共有 條評(píng)論