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

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è)
欧美黄色日本一区二区| 91中文字幕精品一区二区| 亚洲乱码一区二区三区人妇| av丰满人妻一区二区| 麻豆国产原创av色哟哟| 日韩精品伦理中文字幕| 国产大学生吞精在线视频| 激情啪啪啪的免费网站| 天天爽天天看天天射天天操| 超碰在线免费视频97| 在线观看中文字幕日韩精品| 亚洲综合一区二区三区四区在线 | 日韩精品视频高清在线观看| 亚洲成人乱码一区二区| 黄色大片黄色大片黄色大片| 日本爱爱一区二区三区| 亚洲三级av在线播放| 亚洲另类欧美日韩中文字幕| 2020年国产97精品自拍| 日韩人妻精品在线一区二区| 精品一二三区在线天堂| 欧美日韩精品成人大片| 亚洲一区二区三区视频在线观看| 国产精品成人一区二区艾草 | 欧美日韩精品人妻中文| 亚洲综合久久国产一区二区| 国产黄色av片免费| 婷婷亚洲悠悠色悠在线| 男人天堂插插综合搜索| 亚洲av成人在线不卡| 人妻中出中文字幕一区二区| 国产一级黄色免费大片| 欧美一区二区男人天堂| 国产精品欧美日韩精品| 国产毛片久久久久久国产| 国内外成人皇色视频| av成熟一区二区三区| 亚洲午夜精品一区二区久久| av网址不卡在线免费观看| 亚洲熟妇人妻一区二区三区| 成年免费视频一区二区三区|