/*
 * camera_control.h - header file for camera_control.c
 *
 * $Revision: 1.10 $
 * $Date: 2004/02/13 15:12:12 $
 *
 * This file defines constants pertinent to controlling the camera on board
 * TART using the vanguard motor controller board
 *
$Log: camctl.h,v $
Revision 1.10  2004/02/13 15:12:12  Brad
misc changes.

Revision 1.9  2004/02/06 00:55:03  Brad
changed function prototype for motorDrive

Revision 1.8  2004/02/05 23:33:42  Brad
fixed all masks so that they are going forward by default.

Revision 1.7  2004/02/05 21:57:08  Brad
fixed cam_tilt_mask problem

Revision 1.6  2004/02/04 01:13:06  Brad
minor changes, except to camctl.h

Revision 1.5  2004/02/03 04:08:04  Brad
masks need work, which mask activates which motor?

Revision 1.4  2004/02/03 02:55:55  Brad
minor changes, direction still not working properly

Revision 1.3  2004/02/03 00:48:16  Brad
Added Log directive so that the versions history is stored right here

 *
 */

/* motor driver selection masks
PORTC -
 _______________________________________________________________________
|b7     |b6     |b5         |b4         |b3     |b2     |b1     |b0     |
'-----------------------------------------------------------------------'
|dirA   |dirB   |fstop      |pan        |focus  |zoom   |tilt   |n/u    |
|channel|channel|           |           |       |       |       |       |
'-----------------------------------------------------------------------'

note, room for 7 more motors to drive, only 3 more spots on the board

*/

/* uncomment this if you want to enable debugging mode */
#define DEBUG 1  

#define CAM_PAN_MASK	0xef  //channel A
#define CAM_TILT_MASK	0xfd  //channel B
#define CAM_ZOOM_MASK	0xfb  //channel A
#define CAM_FOCUS_MASK  0xf7  //channel A
#define CAM_FSTOP_MASK	0xdf  //channel A
#define CAM_HALT_MASK	0xff  


/* switched device masks */
#define CAM_PWR_MASK	0x80
#define CAM_LIGHT_MASK	0x40

#define ALL_SWITCHED_DEVS 0xFF
#define SWITCH_DEV_ON 0
#define SWITCH_DEV_OFF 1


/* command interface */
/* example:	rotate camera left
cmd packet = SYNC_BYTE,CAM_TILT,0x84
                                  ^ 
               speed of (8/16)*max chanA and (4/16)*max for chanB
*/

// ~
#define SYNC_BYTE 0x93
#define HALT_ALL 0xEE

// E
//#define CAM_TILT 		0x65  
#define CAM_TILT 		0x1
#define CAM_PAN 		0x2
#define CAM_FOCUS 		0x3
#define CAM_ZOOM 		0x4
#define CAM_FSTOP 		0x5
#define TOG_CAM_PWR 	0x6
#define TOG_CAM_LIGHT	0x7



typedef enum _bool {FALSE, TRUE} Bool;

/*		function prototypes	*/

void motorDrive(unsigned char mask, signed char speedChanA, signed char speedChanB);
void switchDevice(unsigned char, char);
void shutdown(void);


