/* 
 * File:   config.h
 * Author: hamilton
 *
 * Created on January 15, 2014, 4:29 PM
 */

#ifndef CONFIG_H
#define	CONFIG_H

#define DEBUG  //Define this to enable debug output over second RS-232 port

#define ALLOW_RESET_BY_RS232

/* Camera Focus limits*/
#define FOCUS_CAMERA_MIN_CNTS -32768
#define FOCUS_CAMERA_MAX_CNTS 14640  //19500 


/******** Digitial I/O  *************/
/*Remember:  Read from the Port, Set to the Latch.  This avoid unpredictability and allows one to read back how an output is set*/
#define LASER_PWR_ACTIVELOW _LATD5  //Output
#define CAMERA_PWR _LATD4   //Output
#define EXTENDER_ACTIVELOW _LATD13    //Output
#define FWD_H20_ALARM_ACTIVELOW _RD12  //Input
#define AFT_H20_ALARM_ACTIVELOW _RD3   //Input
#define EEPRPROM_WP _LATD10  //Output
#define OVERTEMP_ACTIVELOW _RD6  //Input
#define TEMP_FLAG _RD2  //Input

#define AUXIO_PIN2 _LATD8 //Output
#define AUXIO_PIN3 _LATD1 //Output

#define POWERUP_ZERORATEADJUST -250;

/******** Configure Analog IO here  *********/
//These defines relate the analog channel numbers to the analog signals, they can be rearranged here without trouble later.
#define NUMAIO 1
#define AIOMASK_H 0xffff  //None of AN16-31 are selected
#define AIOMASK_L 0xfbff  //Select AN10 to be sampled and scanned, total low bits must match NUMAIO    AN10 = CAMERA_TEMP
#define INNERFILTERSAMPLES 32 //Must be 1,2,4,8,16,32,64,128   This is the number of ADC samples that are filtered to create every PWM period

#define ZOOM_ENDTOEND_TRAVELTIME 5;  //Time for zoom lens to travel end to end at full rate, in seconds

#define WIDEZOOMSTOP -24000

#endif	/* CONFIG_H */

