新聞中心

EEPW首頁 > 模擬技術(shù) > 設(shè)計(jì)應(yīng)用 > t6963c驅(qū)動(dòng)程序-驅(qū)動(dòng)代碼

t6963c驅(qū)動(dòng)程序-驅(qū)動(dòng)代碼

作者: 時(shí)間:2012-04-25 來源:網(wǎng)絡(luò) 收藏

-,T6963C液晶顯示控制器多用于小規(guī)模的液晶顯示器件,常被裝配在圖形液晶顯示模塊上,以內(nèi)
藏控制器型圖形液晶顯示模塊的形式出現(xiàn)。

評(píng):系轉(zhuǎn)載,液晶控制器T6963的C語言,T6963應(yīng)用廣泛,特別是240×128的液晶基本上都是用這個(gè)芯片。

#include "absacc.h"
#include "math.h"
#include "ASCII816.h" //字符點(diǎn)陣庫 0x20--0x7F
#include "HZTable.h" //漢字點(diǎn)陣庫(自做)
#include "menu.h" //漢字點(diǎn)陣庫(自做)

//set following data by user according to LCD
#define ComPort 0xB101
#define DataPort 0xB000
#define GraphAddr 0x0000 //head of graph

//以8*8字符計(jì)算,顯示屏橫向、縱向可以顯示的字符個(gè)數(shù)
//以240*128為例:
#define LineChar 30 //一行16個(gè)字符(8*8)
#define ColumnChar 16 //總共16列


//指令,數(shù)據(jù) 讀寫狀態(tài)檢查
#define RWCheck() { unsigned char sta; do{ sta=XBYTE[ComPort] 0x03; } while(sta!=0x03); }
//數(shù)據(jù)自動(dòng)讀 狀態(tài)檢查
#define AutoRCheck() { unsigned char sta; do{ sta=XBYTE[ComPort] 0x04; } while(sta!=0x04); }
//數(shù)據(jù)自動(dòng)寫 狀態(tài)檢查
#define AutoWCheck() { unsigned char sta; do{ sta=XBYTE[ComPort] 0x08; } while(sta!=0x08); }

/*------輸入/出函數(shù),與T6963通訊------------------------------------------------*/
/*------------------------------------------------------------------------*/

// 向數(shù)據(jù)口發(fā)Data
#define OutPortData(dat ) { RWCheck(); XBYTE[DataPort]=dat; }

//寫有 1 個(gè)參數(shù)命令
#define OutPortCom1(command) { RWCheck(); XBYTE[ComPort]= command; }

//寫有 2 個(gè)參數(shù)命令
#define OutPortCom2(dat, command) { OutPortData(dat); OutPortCom1(command); }

//寫有 3 個(gè)參數(shù)命令
#define OutPortCom3(data1, data2, command) { OutPortData(data1); OutPortData(data2); OutPortCom1(command);}


unsigned char InPortData() { RWCheck(); return(XBYTE[DataPort]); }

/*-----------------------------------------------------------------------------------*/
//顯示8*16字符
//lin:行(0-7), column: 列(0-15)
//ch:字符代碼(標(biāo)準(zhǔn)ASCII碼)
void ShowChar(unsigned char lin,unsigned char column,unsigned char ch)
{
unsigned char i;
unsigned char dat;
unsigned int StartAddr;

StartAddr=lin*LineChar +column; //定位起始行

for(i=0;i16;i++)
{
dat=ASCII816[ ch-0x20 ][i];
OutPortCom3( (unsigned char)(StartAddr), (unsigned char)(StartAddr>>8), 0x24); //set address
OutPortCom2( dat, 0xc4);

StartAddr=StartAddr + LineChar;
}
}

/*----------------------------------------------------------------------------------------------*/
//顯示一個(gè)漢字(16*16點(diǎn)陣)
//lin:行(0-7), column: 列(0-7)
//hzcode: 漢字代碼(自定義的)
void ShowHZ(unsigned char lin,unsigned char column,unsigned int hzcode)
{
unsigned char i;
unsigned int StartAddr;

c語言相關(guān)文章:c語言教程



上一頁 1 2 3 4 下一頁

關(guān)鍵詞: t6963c 驅(qū)動(dòng)程序 驅(qū)動(dòng)代碼

評(píng)論


相關(guān)推薦

技術(shù)專區(qū)

關(guān)閉