Portio.h

00001 /*
00002  * portio.h - functions for port I/O.
00003  *
00004  * This file is part of the Rulbus Device Class Library (RDCL).
00005  *
00006  * Copyright (C) 2003-2004, Leiden University.
00007  *
00008  * This library is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * The library is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with mngdriver; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021  *
00022  * $Id: Portio.h 2 2004-10-12 11:54:15Z moene $
00023  */
00024 
00025 #ifndef __PORTIO_H
00026 #define __PORTIO_H
00027 
00034 #ifdef DOXYGEN
00035    #define CANIO
00036 #endif
00037 
00044 #ifdef DOXYGEN
00045    #define DriverLINX
00046 #endif
00047 
00054 #if defined(CANIO)                      // CANIO port I/O
00055 //   #include "canio.h"                   // for AddMultiPort() // using LoadLibrary
00056 //   #include "portio.h"                  // for inp() and outp()
00057    #define   SPORTIO "CanIO"
00058    #pragma message ("Note: using CanIO for port I/O.")
00059 
00060    namespace Rulbus
00061    {
00086       short inp( unsigned short port );
00087 
00108       short outp( unsigned short port, unsigned char value );
00109 
00119       bool  openIO( long base, int len );
00120 
00123    }       // namespace Rulbus
00124 
00125 #elif defined(DriverLINX)               // DriverLINXport I/O
00126    #include "dlportio32.h"              // requires windows.h
00127    #define   inp(port)         DlPortReadPortUchar (port      )
00128    #define   outp(port, byte)  DlPortWritePortUchar(port, byte)
00129    #define   SPORTIO "DriverLinx"
00130    #pragma message ("Note: using DriverLINX for port I/O.")
00131 #else
00132    #error Please specify Port IO selection: CANIO or DriverLINX .
00133 #endif
00134 
00135 #endif  // __PORTIO_H
00136 
00137 /*
00138  * end of file
00139  */
00140 

Generated on Tue Oct 12 14:11:57 2004 for Rulbus Device Class Library for Microsoft Windows by doxygen 1.3.4