#ifndef TOUCHSCREEN_H
#define TOUCHSCREEN_H
        #include <targets/LPC2000.h>
        #include <ctl_api.h>
        #include <targets/LPC2478.h>
        

        void ReadTouch(void);
        void ctl_enable_touch_irq(CTL_ISR_FN_t isr);
        void InitTouch(void);
        void SendConversionRequestX(void);
        void ReadConversion(void);
        void DrvTouchScreen(void);
        ANSWER hasMovedQuery(void);
        ANSWER wasReleasedQuery(void);

        typedef enum TOUCH_STATE
        {
          TOUCH_IDLE,
          TOUCH_START,
          TOUCH_READ_X,
          TOUCH_WAIT_FOR_X,
          TOUCH_READ_Y,
          TOUCH_WAIT_FOR_Y,
          TOUCH_COMPLETED,
        }TOUCH_STATE;

        #define MAX_TOUCH_X 3960
        #define MIN_TOUCH_X 115
  
        #define MAX_TOUCH_Y 3750
        #define MIN_TOUCH_Y 150

#define TOUCHPAD_DEAD_AREA 10


#endif