国产肉体XXXX裸体137大胆,国产成人久久精品流白浆,国产乱子伦视频在线观看,无码中文字幕免费一区二区三区 国产成人手机在线-午夜国产精品无套-swag国产精品-国产毛片久久国产

新聞中心

EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > 基于C語言的RS232串行接口通信實現(xiàn)

基于C語言的RS232串行接口通信實現(xiàn)

作者: 時間:2012-08-27 來源:網(wǎng)絡(luò) 收藏

void Init-COM(int ComPortAddr,unsigned char IntVectNum,im Baud,unsigned char Data,unsigned char Stop,unsigned char Parity)

{

unsigned char High,Low;

int f.

comportaddr=ComPortAddr;

intvectnum=IntVectNum;

CharslnBuf=0;Circln=0;CircOut=0;

/*set baud rate設(shè)置波特率*/

f=(Baud/100):

f=1152/t;High=f/256;

Low=f-High*256;

outportb(ComPortAddr+3,0x80);

outportb(ComPortAddr,LOW);

outportb(ComPortAddr+l,High);

/*set data bits,stop bits,and parity設(shè)置數(shù)據(jù)位。停止位。校驗*/

Data=(Data-5)|((Stop-1)*4);

if(Parity=2)Data=Data|0x18;

else if(Parity==1)Data=Data|0x8;

outportb(ComPortAddr+3,Data);

/*set MCR(DTR,RTS=0,OUTl,OUT2=1)設(shè)置MODEM控制位*/

outportb(ComPortAddr+4,0xob);

/*set input data ready interrupt mode設(shè)置輸入數(shù)據(jù)中斷模式*/

outportb(ComPortAddr+1,Ox01);

/*set OC interrupt vector設(shè)置中斷源*/

disable ();

OldAsyncInt=getvect(IntVectNum);

setvect(ImVectNum,AsyncInt);

enable ();

/*open interrupt打開中斷*/

maskb=inp(Port8259+1);

if(IntVectNum一0x0c)outport(Port8259+1,maskbOxef);/*INT4*/

else outport(Port8259+1,maskb0xf7);/*INT3*/

}

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


數(shù)字通信相關(guān)文章:數(shù)字通信原理


通信相關(guān)文章:通信原理


交換機(jī)相關(guān)文章:交換機(jī)工作原理



上一頁 1 2 3 4 下一頁

評論


相關(guān)推薦

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

關(guān)閉