/************ CTMU.h *********/

#include "CTMURegisters.h"


/********* A/D Port Configuration Control bits ********/
#define	TOUCH_SENSOR_ZERO		0x00	// The same as ADC channels.
#define	TOUCH_SENSOR_ONE			0x01
#define	TOUCH_SENSOR_TWO			0x02
#define	TOUCH_SENSOR_THREE		0x03
#define	TOUCH_SENSOR_FOUR			0x04

/********* Edge Enable bit ********/
#define	EDGE_NOT_BLOCKED			0x01
#define	EDGE_BLOCKED				0x00

/********* Edge Sequence Enable ********/
#define	CURRENT_GROUNDED			0x01
#define	CURRENT_NOT_GROUNDED	0x00

/********* Edge 2 Polarity Select bit ********/
#define	EDGE_2_POSITIVE				0x01
#define	EDGE_2_NEGATIVE			0x00

/********* Edge 1 Polarity Select bit ********/
#define	EDGE_1_POSITIVE				0x01
#define	EDGE_1_NEGATIVE				0x00

/********* Current Source Range Select bits ********/
#define	BASE_CURRENT_100			0x03
#define	BASE_CURRENT_10				0x02
#define	BASE_CURRENT_550nA			0x01
#define	CURRENT_DISABLED			0x00


/********* Values to Set The Touch Sensors ********/
#define DEFAULT_THRESHOLD 			2500	// Un-pressed switch value.
#define DEFAULT_TRIP					250 		// Difference between pressed and un-pressed switch.
												
#define DEFAULT_HYST 				65 		// Amount to change from pressed to un-pressed.
												 
#define DEFAULT_CHARGE_TIME		2		// 2-Time to charge and discharge.
#define DEFAULT_DISCHARGE_TIME	35		// 35-Time to discharge and discharge.


/********* General Registers ********/
#define	ENABLE						0x01
#define	DISABLE						0x00
	
#define START							0x01
#define STOP							0x00

#define PRESSED 						0x01	// Decoding the Touch Semsors.
#define UNPRESSED 					0x00


/********* General Registers for Slider Tocuh Sensor ********/
#define	FACTOR_10BIT_RESOLUTION	0x05	// Factors for the Slider
#define	DIFFERENTIAL					0x12C	


/********* Number of Sensors to be read in the uC ********/
#define NUMBER_OF_TOUCH_SENSORS	0x05	// Number of Sensors to be read in the uC.