A board support package for the LPC4088 Display Module.

Dependencies:   DM_HttpServer DM_USBHost

Dependents:   lpc4088_displaymodule_emwin lpc4088_displaymodule_demo_sphere sampleGUI sampleEmptyGUI ... more

Fork of DMSupport by EmbeddedArtists AB

Revision:
22:1a58a518435c
Parent:
10:1ac4b213f0f7
Child:
41:e06e764ff4fd
diff -r 1e6bc4aca5b7 -r 1a58a518435c Display/TouchPanel.h
--- a/Display/TouchPanel.h	Mon Jan 12 10:37:57 2015 +0100
+++ b/Display/TouchPanel.h	Fri Jan 16 11:13:39 2015 +0100
@@ -25,27 +25,24 @@
 class TouchPanel {
 public:
 
-    typedef struct {
-        uint16_t x;
-        uint16_t y;
-        uint16_t z;
-    } touchCoordinate_t;
-
     enum TouchError {
         TouchError_Ok                =   BiosError_Ok,
         TouchError_ConfigError       =   BiosError_ConfigError,
         TouchError_WrongBPP          =   BiosError_WrongBPP,
         TouchError_InvalidParam      =   BiosError_InvalidParam,
         TouchError_NoInit            =   BiosError_NoInit,
-        TouchError_CalibrationError  =   BiosError_Calibration,        
+        TouchError_CalibrationError  =   BiosError_Calibration,
+        TouchError_Timeout           =   BiosError_Timeout,
+        TouchError_TouchNotSupported =   BiosError_NotSupported,
         TouchError_MemoryError,
-        TouchError_TouchNotSupported,
-        TouchError_Timeout,
     };
 
     /**
      * Read coordinates from the touch panel.
      *
+     * In case of multitouch (capacitive touch screen) only the first touch
+     * will be returned.
+     *
      * @param coord pointer to coordinate object. The read coordinates will be
      * written to this object.
      *
@@ -53,7 +50,32 @@
      *       Ok on success
      *       An error code on failure
      */
-    virtual TouchError read(touchCoordinate_t &coord) = 0;
+    virtual TouchError read(touch_coordinate_t &coord) = 0;
+
+    /**
+     * Read up to num coordinates from the touch panel.
+     *
+     * @param coords a list of at least num coordinates
+     * @param num the number of coordinates to read
+     *
+     *  @returns
+     *       Ok on success
+     *       An error code on failure
+     */
+    virtual TouchError read(touch_coordinate_t* coord, int num) = 0;
+    
+    /**
+     * Returns information about the touch panel
+     *
+     * @param resistive true for Resistive, false for Capacitive
+     * @param maxPoints the maximum number of simultaneous touches
+     * @param calibration true if the controller can be calibrated
+     *
+     *  @returns
+     *       Ok on success
+     *       An error code on failure
+     */
+    virtual TouchError info(bool* resistive, int* maxPoints, bool* calibrated) = 0;
 
     /**
      * Start to calibrate the display
@@ -94,6 +116,8 @@
      *       An error code on failure
      */
     virtual TouchError waitForCalibratePoint(bool* morePoints, uint32_t timeout) = 0;
+    
+    virtual FunctionPointer* setListener(FunctionPointer* listener) = 0;
 };
 
 #endif