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

parport.h

Go to the documentation of this file.
00001 #ifndef PARPORT_H
00002 #define PARPORT_H
00003 
00004 /*
00005   parport.h
00006 
00007   Decls for parallel port I/O
00008 
00009   Modification history:
00010 
00011   13-Mar-2000 WPS added unused attribute to parport_h to avoid 'defined but not used' compiler warning, and added (void) to functions with no arguments to avoid 'declaration is not a prototype' compiler warnings.
00012   14-Jan-1999 WPS added extern "C"'s so that PARPORT_IO_ADDRESS can
00013   be used in C++ files with the Microsoft Visual C++ compiler which apparantly
00014   considers a C integer and a C++ integer to be different.
00015   7-Aug-1998  FMP changed extInit/Quit() to extDioInit/Quit()
00016   9-Jul-1998  FMP created PARPORT_IO_ADDRESS variable, set DEFAULT_ to be
00017   0x278 for *external* card
00018   24-Oct-1997 FMP created
00019   */
00020 
00021 #ifdef __cplusplus
00022 extern "C" {
00023 #endif
00024 
00025 /* ident tag */
00026 #ifndef __GNUC__
00027 #ifndef __attribute__
00028 #define __attribute__(x)
00029 #endif
00030 #endif
00031 
00032 static char __attribute__((unused)) parport_h[] = "$Id: parport.h,v 1.2 2000/10/27 20:34:42 terrylr Exp $";
00033 
00034 
00035 /* base I/O address */
00036 extern unsigned long int PARPORT_IO_ADDRESS;
00037 
00038 /* change the default for your board */
00039 #define DEFAULT_PARPORT_IO_ADDRESS 0x278
00040 /* #define DEFAULT_PARPORT_IO_ADDRESS 0x378 */
00041 
00042 extern int pptDioInit(const char * stuff);
00043 extern int pptDioQuit(void);
00044 
00045 /* returns the max input index, output index; max bytes, shorts, and words */
00046 extern int pptDioMaxInputs(void);       /* index < this for pptDioRead() */
00047 extern int pptDioMaxOutputs(void);      /* index < this for pptDioWrite(),Check() */
00048 
00049 /* reads value of digital input at index, stores in value */
00050 extern int pptDioRead(int index, int *value);
00051 
00052 /* writes value (non-zero means 1, 0 is 0) at digital out at index */
00053 extern int pptDioWrite(int index, int value);
00054 
00055 /* reads value of digital OUT at index, stores in value. Useful
00056    for checking values of previous writes. Returns 0 if OK, -1 if
00057    bad index or can't read if they're write-only. */
00058 extern int pptDioCheck(int index, int *value);
00059 
00060 /* byte, short, and word reads, writes. Index starts at 0, indexes up
00061    through bytes, short ints, and ints */
00062 extern int pptDioByteRead(int index, unsigned char *byte);
00063 extern int pptDioShortRead(int index, unsigned short *sh);
00064 extern int pptDioWordRead(int index, unsigned int *word);
00065 extern int pptDioByteWrite(int index, unsigned char byte);
00066 extern int pptDioShortWrite(int index, unsigned short sh);
00067 extern int pptDioWordWrite(int index, unsigned int word);
00068 extern int pptDioByteCheck(int index, unsigned char *byte);
00069 extern int pptDioShortCheck(int index, unsigned short *sh);
00070 extern int pptDioWordCheck(int index, unsigned int *word);
00071 
00072 
00073 #ifdef __cplusplus
00074 }
00075 #endif
00076 
00077 #endif

Generated on Sun Dec 2 15:27:41 2001 for EMC by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001