home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 72 / IOPROG_72.ISO / tips / Porta Parallela / IoExample / ioexample.c next >
Encoding:
C/C++ Source or Header  |  2003-07-02  |  1.6 KB  |  32 lines

  1. /******************************************************************************/
  2. /*                                                                            */
  3. /*                          IoExample for PortTalk V2.0                       */
  4. /*                        Version 2.0, 12th January 2002                      */
  5. /*                          http://www.beyondlogic.org                        */
  6. /*                                                                            */
  7. /* Copyright ⌐ 2002 Craig Peacock. Craig.Peacock@beyondlogic.org              */
  8. /* Any publication or distribution of this code in source form is prohibited  */
  9. /* without prior written permission of the copyright holder. This source code */
  10. /* is provided "as is", without any guarantee made as to its suitability or   */
  11. /* fitness for any particular use. Permission is herby granted to modify or   */
  12. /* enhance this sample code to produce a derivative program which may only be */
  13. /* distributed in compiled object form only.                                  */
  14. /******************************************************************************/
  15.  
  16. #include <stdio.h>
  17. #include <windows.h>
  18. #include <pt_ioctl.c>
  19.  
  20. void __cdecl main(void)
  21. {
  22.     unsigned char value;
  23.     printf("IoExample for PortTalk V2.0\nCopyright 2001 Craig Peacock\nhttp://www.beyondlogic.org\n");
  24.     OpenPortTalk();
  25.     outportb(0x378, 0xFF);
  26.     value = inportb(0x378);
  27.     printf("Value returned = 0x%02X \n",value);
  28.     outp(0x378, 0xAA);
  29.     value = inp(0x378);
  30.     printf("Value returned = 0x%02X \n",value);
  31.     ClosePortTalk();
  32. }