91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 31KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-05-29
  • 語言: 其他
  • 標(biāo)簽: STC15F??12864??STC15_??

資源簡介

基于Keil uVision4開發(fā)環(huán)境,使用STC15F2K60S2驅(qū)動(dòng)12864(帶字庫,串行口通信)的代碼,親測可用

資源截圖

代碼片段和文件信息

#include?

#include?

#include?

#include?

#define?uchar?unsigned?char

#define?uint?unsigned?int

sbit?key?=?P4^5;

sbit?CS=P2^7;//第4根線??RS????PSB接地

sbit?SID=P2^6;//第5根線??RW

sbit?SCK=P2^5;//第6根線??E

uchar?code?AC_TABLE[]={

0x800x810x820x830x840x850x860x87//第一行漢字位置

0x900x910x920x930x940x950x960x97//第二行漢字位置

0x880x890x8a0x8b0x8c0x8d0x8e0x8f//第三行漢字位置

0x980x990x9a0x9b0x9c0x9d0x9e0x9f//第四行漢字位置

};

/********************************?函數(shù)名稱????:SendByte??串口發(fā)送一個(gè)字節(jié)*****/

void?SendByte(uchar?Dbyte)

{

uchar?i;

for(i=0;i<8;i++)

{

SCK=0;

Dbyte=Dbyte<<1;

SID=CY;

SCK=1;

SCK=0;

}

}

/***********接收一個(gè)字節(jié)***/

uchar?ReceiveByte(void)

{

uchar?itemp1temp2;

temp1=0;

temp2=0;

for(i=0;i<8;i++)

{

temp1=temp1<<1;

SCK=0;

SCK=1;

SCK=0;

if(SID)temp1++;

}

for(i=0;i<8;i++)

{

temp2=temp2<<1;

SCK=0;

SCK=1;

SCK=0;

if(SID)temp2++;

}

return((0xf0&temp1)+(0x0f&temp2));

}

void?CheckBusy(void)

{

do?SendByte(0xfc);

while(0x80&ReceiveByte());

}

void?WriteCommand(uchar?Cbyte)

{

CS=1;

CheckBusy();

SendByte(0xf8);

SendByte(0xf0&Cbyte);

SendByte(0xf0&Cbyte<<4);

CS=0;

}

void?WriteData(uchar?Dbyte)

{

CS=1;

CheckBusy();

SendByte(0xfa);

SendByte(0xf0&Dbyte);

SendByte(0xf0&Dbyte<<4);

CS=0;

}

uchar?ReadData(void)

{

CheckBusy();

SendByte(0xfe);

return?ReceiveByte();

}

void?Delay(uint?MS)

{

uchar?ususn;

while(MS!=0)

{

usn=2;

while(usn!=0)

{

us=0xf5;

while(us!=0)

{

us--;

};

usn--;

}

MS--;

}

}

void?LcmInit(void)

{

WriteCommand(0x30);

WriteCommand(0x03);

WriteCommand(0x0C);

WriteCommand(0x01);

WriteCommand(0x06);

}

void?LcmClearTXT(void)

{

uchar?i;

WriteCommand(0x30);

WriteCommand(0x80);

for(i=0;i<64;i++)

WriteData(0x20);

}

void?PutStr(uchar?rowuchar?coluchar?*puts)

{

WriteCommand(0x30);

WriteCommand(AC_TABLE[8*row+col]);

while(*puts!=‘\0‘)

{

if(col==8)

{

col=‘0‘;

row++;

}

if(row==4)row=‘0‘;

WriteCommand(AC_TABLE[8*row+col]);

WriteData(*puts);

puts++;

WriteData(*puts);

puts++;

col++;

}

}

void?DisplayDots(uchar?DotByte)

{

uchar?ij;

WriteCommand(0x34);

WriteCommand(0x36);

for(i=0;i<32;i++)

{

WriteCommand(0x80|i);

WriteCommand(0x80);

for(j=0;j<32;j++)

{

WriteData(DotByte);

}

DotByte=~DotByte;

}

}

void?main(void)

{

Delay(100);

LcmInit();

LcmClearTXT();

// PutStr(00“歡迎光臨老師試試“);

PutStr(10“請輸入密碼:“);

// PutStr(20“http://blog.rayu“

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----

?????文件??????12359??2018-10-17?11:59??12864串行通訊\12864

?????文件???????3257??2018-10-17?12:02??12864串行通訊\12864.c

?????文件???????1757??2018-10-17?11:59??12864串行通訊\12864.hex

?????文件?????????42??2018-10-17?11:59??12864串行通訊\12864.lnp

?????文件???????9590??2018-10-17?11:59??12864串行通訊\12864.LST

?????文件??????13258??2018-10-17?11:59??12864串行通訊\12864.M51

?????文件??????13706??2018-10-17?11:59??12864串行通訊\12864.OBJ

?????文件????????162??2019-04-03?21:19??12864串行通訊\12864.plg

????.......?????71971??2019-04-03?21:20??12864串行通訊\12864.uvgui.strange?man

????.......?????72077??2018-10-17?12:06??12864串行通訊\12864.uvgui_strange?man.bak

????.......??????5628??2019-04-03?21:20??12864串行通訊\12864.uvopt

?????文件??????13447??2018-10-16?14:36??12864串行通訊\12864.uvproj

?????目錄??????????0??2019-04-03?21:20??12864串行通訊

-----------?---------??----------?-----??----

???????????????217254????????????????????13


評論

共有 條評論