/*-=-=-=-=-=-=-=-=-=-=-=- RCCL/RCI Notice of Copyright -=-=-=-=-=-=-=-=-=-=-*
 *									    *
 *	Copyright (C) 1987, 1991 by John E. Lloyd.			    *
 *									    *
 *	Information on copyright permissions, as well as a complete	    *
 *	disclaimer of warranty, is given in the file COPYRIGHT.		    *
 *									    *
 *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/

/*---------McGill-Computer-Vision-and-Robotics-Laboratory--C-Module---------
 *		
 * NAME:	penadant.h
 *
 * USAGE:	#include <robot/pendant.h>
 *
 * DESCRIPTION: include file for programs that wish direct access to the teach
 *		pendant.
 *
 * NOTES:	See the little report that was prepared on the teach
 *		pendant protocal for and explaination of what all this
 *		means: PUMA 260 Teach Pendant Protocal, December, 1984,
 *		by John Lloyd.
 *		
 * AUTHOR/DATE: John Lloyd, March, 1984
 *
 * UPDATES:
 *
 *-------------McGill-Computer-Vision-and-Robotics-Laboratory--------------*/

#ifndef PENDANTH
#define PENDANTH

#define RECORD		0x0001
#define HOLD_RUN1	0x0002
#define X_MINUS		0x0004
#define X_PLUS		0x0008
#define Y_MINUS		0x0010
#define Y_PLUS		0x0020
#define Z_MINUS		0x0040
#define Z_PLUS		0x0080

#define RX_MINUS	0x0100
#define RX_PLUS		0x0200
#define RY_MINUS	0x0400
#define RY_PLUS		0x0800
#define RZ_MINUS	0x1000
#define RZ_PLUS		0x2000
#define CLAMP1		0x4000
#define CLAMP2		0x8000

#define TOOL_BUTTON	0x00010000
#define WORLD_BUTTON	0x00020000
#define JOINT_BUTTON	0x00040000
#define FREE_BUTTON	0x00080000
#define COMP		0x00100000
#define TP_MINUS	0x00400000
#define TP_PLUS		0x00800000

#define TICK_ON_LOW	0x00000000
#define TICK_ON_MED	0x04000000
#define TICK_ON_HIGH	0x07000000
#define TICK_OFF_LOW	0x10000000
#define TICK_OFF_MED	0x80000000
#define TICK_OFF_HIGH	0xff000000

#define NEXT_STEP	0x0001
#define MOVE_TP		0x0002
#define POUND_SIGN	0x0006
#define HOLD_RUN5	0x0007

#define PANIC1		0x0002
#define PANIC5		0x00c0

/* Teach pendant output codes */

#define CAL_LED		0x0001
#define TOOL_LED	0x0002
#define WORLD_LED	0x0004
#define JOINT_LED	0x0006
#define FREE_LED	0x0008
#define COMP_LED	0x000a
#define OFF_LED		0x000c	/* for the old teach pendant */
#define NULL_LED	0x000e	/* for the old teach pendant */

#define RUN_LED		0x0010
#define TEACH_LED	0x0020
#define HOLD_LED	0x0030

#define M_NULL		0x8000
#define M_LIMIT1	0x8100
#define M_LIMIT2	0x8200
#define M_LIMIT3	0x8300
#define M_LIMIT4	0x8400
#define M_LIMIT5	0x8500
#define M_LIMIT6	0x8600
#define M_LIMIT7	0x8700
#define M_TOO_CLOSE	0x8800
#define M_TOO_FAR	0x8900
#define M_TEACH_MODE_J	0x8a00
#define M_MANUAL_MODE	0x8b00
#define M_ARM_PWR_OFF	0x8c00
#define M_PROG_RUNNING	0x8d00
#define M_HOLD		0x8e00
#define M_FATAL_ERROR	0x8f00

#define M_UNIMATION1	0x9800
#define M_NO_POINTS	0x9900
#define M_TEACH_MODE_S	0x9a00
#define M_COMP_MODE	0x9b00

#endif
