欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

outportb函數(shù)與inportb函數(shù)是什么

outportb函數(shù)與inportb函數(shù)是什么,針對這個問題,這篇文章詳細(xì)介紹了相對應(yīng)的分析和解答,希望可以幫助更多想解決這個問題的小伙伴找到更簡單易行的方法。

成都創(chuàng)新互聯(lián)公司秉承實(shí)現(xiàn)全網(wǎng)價值營銷的理念,以專業(yè)定制企業(yè)官網(wǎng),網(wǎng)站設(shè)計(jì)、網(wǎng)站制作,微信平臺小程序開發(fā),網(wǎng)頁設(shè)計(jì)制作,移動網(wǎng)站建設(shè),全網(wǎng)整合營銷推廣幫助傳統(tǒng)企業(yè)實(shí)現(xiàn)“互聯(lián)網(wǎng)+”轉(zhuǎn)型升級專業(yè)定制企業(yè)官網(wǎng),公司注重人才、技術(shù)和管理,匯聚了一批優(yōu)秀的互聯(lián)網(wǎng)技術(shù)人才,對客戶都以感恩的心態(tài)奉獻(xiàn)自己的專業(yè)和所長。

outportb函數(shù)是屬于Turbo C(TC)語言庫函數(shù),這是一個輸出到硬件端口的函數(shù),似乎是當(dāng)年學(xué)習(xí)C語言的時候用這個東西,現(xiàn)在用的C++里面沒有這個函數(shù),今天在做一個軟件說明書時,看到這個函數(shù),在網(wǎng)上搜索了下,放在這里,以備大家使用時查明:

-----------------------------------------------------------------

outportb函數(shù)
函數(shù)原型: void outportb(unsigned char port, unsigned char value)
函數(shù)功能: 向port地址的接口輸出value
函數(shù)返回:
函數(shù)說明: port 端口地址,value要輸出的8位數(shù)
所屬文件: <dos.h>
程序例:

#include <stdio.h> 

  #include <dos.h> 

  int main(void) 

  { 

  int value = 64; 

  int port = 0; 

  outportb(port, value); 

  printf("Value %d sent to port number %d\n", value, port); 

  return 0; 

}

---------------------------------------------------------------------------------------------

另附上與之對應(yīng)的inportb函數(shù)的說明

函數(shù)名: inportb

功 能:返回從指定硬件端口讀入的一個8位二進(jìn)制(一個字節(jié))。

用 法: int inportb(int port);

 程序例:

#include <stdio.h> 

  #include <dos.h> 

  int main(void) 

  { 

  int value ; 

  int port =0x210; 

  value=inportb(port); 

  printf("port 0x%x sent Value is%d\n", port,value ); 

  return 0; 

  }

 

而在C++中,沒有像inportb/outportb,inportw/outputw專門的端口讀寫函數(shù)  
 但可以用::CREATEFILE(。。。。)

例子:

  BOOL   CSerialPort::InitPort(CWnd*   pPortOwner, //   the   owner   (CWnd)   of   the   port   (receives   message)   
        UINT     portnr, //   portnumber   (1..4)   
        UINT     baud, //   baudrate   
        char     parity, //   parity     
        UINT     databits, //   databits     
        UINT     stopbits, //   stopbits     
        DWORD   dwCommEvents, //   EV_RXCHAR,   EV_CTS   etc   
        UINT     writebuffersize) //   size   to   the   writebuffer   
  {   
  assert(portnr   >   0   &&   portnr   <   5);   
  assert(pPortOwner   !=   NULL);   
    
  //   if   the   thread   is   alive:   Kill   
  if   (m_bThreadAlive)   
  {   
  do   
  {   
  SetEvent(m_hShutdownEvent);   
  }   while   (m_bThreadAlive);   
  TRACE("Thread   ended\n");   
  }   
    
  //   create   events   
  if   (m_ov.hEvent   !=   NULL)   
  ResetEvent(m_ov.hEvent);   
  m_ov.hEvent   =   CreateEvent(NULL,   TRUE,   FALSE,   NULL);   
    
  if   (m_hWriteEvent   !=   NULL)   
  ResetEvent(m_hWriteEvent);   
  m_hWriteEvent   =   CreateEvent(NULL,   TRUE,   FALSE,   NULL);   
    
  if   (m_hShutdownEvent   !=   NULL)   
  ResetEvent(m_hShutdownEvent);   
  m_hShutdownEvent   =   CreateEvent(NULL,   TRUE,   FALSE,   NULL);   
    
  //   initialize   the   event   objects   
  m_hEventArray[0]   =   m_hShutdownEvent; //   highest   priority   
  m_hEventArray[1]   =   m_ov.hEvent;   
  m_hEventArray[2]   =   m_hWriteEvent;   
    
  //   initialize   critical   section   
  InitializeCriticalSection(&m_csCommunicationSync);   
    
  //   set   buffersize   for   writing   and   save   the   owner   
  m_pOwner   =   pPortOwner;   
    
  if   (m_szWriteBuffer   !=   NULL)   
  delete   []   m_szWriteBuffer;   
  m_szWriteBuffer   =   new   char[writebuffersize];   
    
  m_nPortNr   =   portnr;   
    
  m_nWriteBufferSize   =   writebuffersize;   
  m_dwCommEvents   =   dwCommEvents;   
    
  BOOL   bResult   =   FALSE;   
  char   *szPort   =   new   char[50];   
  char   *szBaud   =   new   char[50];   
    
  //   now   it   critical!   
  EnterCriticalSection(&m_csCommunicationSync);   
    
  //   if   the   port   is   already   opened:   close   it   
  if   (m_hComm   !=   NULL)   
  {   
  CloseHandle(m_hComm);   
  m_hComm   =   NULL;   
  }   
    
  //   prepare   port   strings   
  sprintf(szPort,   "COM%d",   portnr);   
  sprintf(szBaud,   "baud=%d   parity=%c   data=%d   stop=%d",   baud,   parity,   databits,   stopbits);   
    
  //   get   a   handle   to   the   port   
  m_hComm   =   CreateFile(szPort, //   communication   port   string   (COMX)   
            GENERIC_READ   |   GENERIC_WRITE, //   read/write   types   
            0, //   comm   devices   must   be   opened   with   exclusive   access   
            NULL, //   no   security   attributes   
            OPEN_EXISTING, //   comm   devices   must   use   OPEN_EXISTING   
            FILE_FLAG_OVERLAPPED, //   Async   I/O   
            0); //   template   must   be   0   for   comm   devices   
    
  if   (m_hComm   ==   INVALID_HANDLE_VALUE)   
  {   
  //   port   not   found   
  delete   []   szPort;   
  delete   []   szBaud;   
    
  return   FALSE;   
  }   
    
  //   set   the   timeout   values   
  m_CommTimeouts.ReadIntervalTimeout   =   1000;   
  m_CommTimeouts.ReadTotalTimeoutMultiplier   =   1000;   
  m_CommTimeouts.ReadTotalTimeoutConstant   =   1000;   
  m_CommTimeouts.WriteTotalTimeoutMultiplier   =   1000;   
  m_CommTimeouts.WriteTotalTimeoutConstant   =   1000;   
    
  //   configure   
  if   (SetCommTimeouts(m_hComm,   &m_CommTimeouts))   
  {         
  if   (SetCommMask(m_hComm,   dwCommEvents))   
  {   
  if   (GetCommState(m_hComm,   &m_dcb))   
  {   
  m_dcb.fRtsControl   =   RTS_CONTROL_ENABLE; //   set   RTS   bit   high!   
  if   (BuildCommDCB(szBaud,   &m_dcb))   
  {   
  if   (SetCommState(m_hComm,   &m_dcb))   
  ;   //   normal   operation...   continue   
  else   
  ProcessErrorMessage("SetCommState()");   
  }   
  else   
  ProcessErrorMessage("BuildCommDCB()");   
  }   
  else   
  ProcessErrorMessage("GetCommState()");   
  }   
  else   
  ProcessErrorMessage("SetCommMask()");   
  }   
  else   
  ProcessErrorMessage("SetCommTimeouts()");   
    
  delete   []   szPort;   
  delete   []   szBaud;   
    
  //   flush   the   port   
  PurgeComm(m_hComm,   PURGE_RXCLEAR   |   PURGE_TXCLEAR   |   PURGE_RXABORT   |   PURGE_TXABORT);   
    
  //   release   critical   section   
  LeaveCriticalSection(&m_csCommunicationSync);   
    
  TRACE("Initialisation   for   communicationport   %d   completed.\nUse   Startmonitor   to   communicate.\n",   portnr);   
    
  return   TRUE;   
  }

 

關(guān)于outportb函數(shù)與inportb函數(shù)是什么問題的解答就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,如果你還有很多疑惑沒有解開,可以關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道了解更多相關(guān)知識。

網(wǎng)站欄目:outportb函數(shù)與inportb函數(shù)是什么
標(biāo)題鏈接:http://aaarwkj.com/article2/gghgic.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站導(dǎo)航、移動網(wǎng)站建設(shè)、網(wǎng)站收錄、網(wǎng)站建設(shè)、網(wǎng)站策劃、企業(yè)網(wǎng)站制作

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

商城網(wǎng)站建設(shè)
高级会所口爆视频在线播放视频 | 日韩精品少妇一区二区| 亚洲av成人在线一区二区| 97视频高清在线观看| av熟女乱一区二区三区| 国产午夜男人天堂手机| 成人性生活毛片免费视频| 伊人久久综在合线亚洲| 国产精品一区二区毛卡片| 国产精品久久一国产精品| 九色视频在线观看91| 日日做日夜夜操天天搞| 亚洲国产日韩精品av| 青青草视频免费公开播放| 日韩欧美二区三区在线| 色综合色狠狠天天综合色| 91精品午夜在线观看| 欧美成人精品高清在线| 亚洲天堂精品日韩电影| 久久久亚洲精品中文字幕蜜桃| 亚洲午夜激情免费试看| 国产精品亚洲国产精品| 日韩电影中文字幕一区| 成年视频免费观看视频| 国产丝袜肉丝在线播放| 亚洲三级黄色在线观看| 国产口爆一区二区三区| 国产三级系列在线观看| 亚洲黄色片大奶子水多| 天堂在线精品亚洲综合网| 欧美经典三级一区二区三区| 日本一本高清免费不卡| 日本又色又爽又黄的观看| 欧美精品日本一区二区| 日本激情诱惑免费在线播放| 乱码人妻精品一区二区三区| 久久午夜福利欧美视频| 高清不卡av在线播放| 清纯美女爱爱高潮av| 久久香蕉国产线看观看亚洲| 亚洲女优中文字幕在线免费|