/*
 * camera_control.h - header file for camera_control.c
 * current version: 0.1
 *
 *
 * This file defines constants pertinent to controlling the camera on board
 * TART using the vanguard motor controller board
 *
 */

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

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

*/

#define CAM_PAN_MASK	0x2f
#define CAM_TILT_MASK	0x2f
#define CAM_ZOOM_MASK	0x1f
#define CAM_FOCUS_MASK  0x1f
#define CAM_FSTOP_MASK	0x0f
#define CAM_HALT_MASK	0x3f


/* 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
                                  ^ channel A direction, speed of (4/16)*max
*/
#define SYNC_BYTE 0x93
#define HALT_ALL 0xEE

#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

#define TOGGLE_CAM_PWR


typedef enum _bool {FALSE, TRUE} Bool;

/*		function prototypes	*/

void motorDrive(unsigned char, char, char);
void switchDevice(unsigned char, char);
void shutdown(void);
void SCIHandler(void);

