///////////////////////////////////////////////////
// BitsyXGPIO.h
// 720020-1180x
//
// Applied Data Systems
//
// The BitsyX exposes two processor GPIOs (80 and 33) on 
// connector J7..13 and J7..14 respectively
//
// This class can be used to control the state of these lines.
//
// *************************** WARNING ****************************
// ** These connector run directly to the processor and have     **
// ** absolutely no protection designed in.  Improper voltage or **
// ** ESD on these lines can easily damage the device processor  **
// ** so take care when connecting and using these lines         **
// ****************************************************************
//
// History
// -------
// 720020-11801: June 22, 2004 (ctacke)
//  - Initial implementation
///////////////////////////////////////////////////

#include <windows.h>

#define OUTPUT	1
#define INPUT	0
#define ON		1
#define OFF		0
#define SET		1
#define CLEAR	0

#define GPIO80	1
#define GPIO33	2

class BitsyXGPIO
{
	private:
		LPVOID	m_hGPIO;
		BYTE	m_direction;

	public:
		BitsyXGPIO(BYTE direction=0x03);
		~BitsyXGPIO();

		BYTE Read();
		void Write(BYTE state);
		void SetDirection(BYTE direction);
};