2 * GraphLCD driver library
4 * port.h - parallel port class with low level routines
6 * This file is released under the GNU General Public License. Refer
7 * to the COPYING file distributed with this package.
9 * (c) 2004 Andreas Regel <andreas.regel AT powarman.de>
12 #ifndef _GLCDDRIVERS_PORT_H_
13 #define _GLCDDRIVERS_PORT_H_
18 const int kForward = 0;
19 const int kReverse = 1;
21 const unsigned char kStrobeHigh = 0x00; // Pin 1
22 const unsigned char kStrobeLow = 0x01;
23 const unsigned char kAutoHigh = 0x00; // Pin 14
24 const unsigned char kAutoLow = 0x02;
25 const unsigned char kInitHigh = 0x04; // Pin 16
26 const unsigned char kInitLow = 0x00;
27 const unsigned char kSelectHigh = 0x00; // Pin 17
28 const unsigned char kSelectLow = 0x08;
42 int Open(const char * device);
45 bool IsDirectIO() const { return (!usePPDev); }
46 int GetPortHandle() const { return ((usePPDev) ? fd : port); }
51 void SetDirection(int direction);
52 unsigned char ReadControl();
53 void WriteControl(unsigned char values);
54 unsigned char ReadStatus();
55 unsigned char ReadData();
56 void WriteData(unsigned char data);
68 int Open(const char * device, void (*FP)(int));
71 int ReadData(unsigned char * data);
72 void WriteData(unsigned char data);
73 void WriteData(unsigned char * data, unsigned short length);