Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

pciotest.c

Go to the documentation of this file.
00001 
00002 /* test out pcio driver */
00003 
00004 /*
00005   Modification history:
00006 
00007   7-Mar-1995  Fred Proctor changed pcioDrv.hh to pcioDrv.h.
00008   21-Dec-1994  Fred Proctor removed pcioInit()
00009   ??? Steve Legowik created
00010   */
00011 
00012 #include <stdio.h>
00013 #include <string.h>
00014 #include <signal.h>
00015 #include <stdlib.h>
00016 #include "pcioDrv.h"
00017 
00018 int main()
00019 {
00020   int data;
00021   int port;
00022   char cmd[10];
00023 
00024   signal( SIGINT, exit );
00025 
00026   while (1)
00027   {
00028     printf("\n>> ");
00029     scanf("%9s", cmd);
00030     if( 0 == strcmp(cmd, "in") )
00031     {
00032       scanf("%x", &port);
00033       data = inputb( port );
00034       printf("\tport %x = %x\n", port, data);
00035     }
00036     else if ( 0 == strcmp(cmd, "out") )
00037     {
00038       scanf("%x %x", &port, &data);
00039       outputb( port, data );
00040     }
00041     else
00042       printf("Commands are: \n\tin <port>\n\tout <port> <data>\n");
00043   }
00044 
00045   return 0;
00046 }

Generated on Sun Dec 2 15:56:51 2001 for rcslib by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001