中文字幕 另类精品,亚洲欧美一区二区蜜桃,日本在线精品视频免费,孩交精品乱子片免费

<sup id="3hn2b"></sup>

    1. <sub id="3hn2b"><ol id="3hn2b"></ol></sub><legend id="3hn2b"></legend>

      1. <xmp id="3hn2b"></xmp>

      2. 新聞中心

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

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

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

        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設置波特率*/

        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ù)據(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)設置MODEM控制位*/

        outportb(ComPortAddr+4,0xob);

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

        outportb(ComPortAddr+1,Ox01);

        /*set OC interrupt vector設置中斷源*/

        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語言相關文章:c語言教程


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


        通信相關文章:通信原理


        交換機相關文章:交換機工作原理



        上一頁 1 2 3 4 下一頁

        評論


        相關推薦

        技術專區(qū)

        關閉