怎样对IO端口进行操作,比如把硬件的某IO脚置1或0?谢谢。

解决方案 »

  1.   

    http://www.csdn.net/cnshare/soft/16/16791.shtm
      

  2.   

    有个类叫做WinIO,可以方便的实现
      

  3.   

    在Windows98以下,使用inp(),outp()就可以了,在2000以上,就要编写驱动或是下载WinIo这样的第三方库来实现了
      

  4.   

    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
      

  5.   

    在Micorsoft的OS中打开文件函数可以是一个端口
    用FILE *.fp;
    fp=fopen(COM1,"r");
    也是一样的