/* a2d_driver.h
 * Technologic Systems
 * Liberty Young	Liberty/at/embeddedx86/dot/com
 * 12.5.2002
 *
 * This driver is for any 3x00, 5x00 series Single Board Computers
 * with the Analog to Digital option installed in the PLD and using 
 * the MAXIM 197 AtoD chip. 
 *
 * No warranty is implied, or given, with this device driver.
 */
#define A2D_PORT  	0x196

#ifdef CONFIG_TS_M386
# 	define A2D_BUSY_PORT 	0xF860
#	define A2D_BUSY_BIT	0x20
#elif CONFIG_TS_M486
#	define A2D_BUSY_PORT	0x195
#	define A2D_BUSY_BIT	0x01
#endif

#define CHANNELS_MAX	8 /* 0 TO 7 channels on device */
#define A2D_VER "12.8.2002 Ver 1.02"

#define A2D_MAJOR 242
/* Control bits of a2d command
 * bits 0-2 	selected channel (0 - 7)
 * bits 3	uni/bipolar ( 0 = unipolar (ie 0 to +5V)
 * 			    ( 1 = bipolar (ie -5 to +5V)
 * bit 4	selected range (0 = 5v range , 1 = 10V range)
 * bit 5-7 	padded zero (unused)
 */

#define A2D_BIPOLAR 0x08
#define A2D_UNIPOLAR 0x00
#define A2D_RANGE1  0x00 //0 TO 5V range
#define A2D_RANGE2  0x10 //0 TO 10V range

#define A2D_MAGICNUM 0xD1
#define TSA2D_CONFIG  _IOW(A2D_MAGICNUM, 1, int)
#define TSA2D_SHOWCONFIG _IOR(A2D_MAGICNUM, 2, int)


