Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 1:007113101ef7, committed 2014-01-28
- Comitter:
- MarioPoneder
- Date:
- Tue Jan 28 13:16:36 2014 +0000
- Parent:
- 0:e38c94c549f4
- Commit message:
- good doc
Changed in this revision
| TouchPanel.cpp | Show annotated file Show diff for this revision Revisions of this file |
| TouchPanel.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/TouchPanel.cpp Tue Jan 28 10:55:53 2014 +0000 +++ b/TouchPanel.cpp Tue Jan 28 13:16:36 2014 +0000 @@ -1,14 +1,3 @@ -/***************************************************************************//** - * @file TouchPanel.cpp - * @brief Implementation of the touch panel driver for the - * TFT color display MI0283QT-9A (320x240). - * @author Mario Poneder - * @date 28/01/2013 -*******************************************************************************/ - -/******************************************************************************/ -/***************************** Include Files **********************************/ -/******************************************************************************/ #include "TouchPanel.h" /***************************************************************************//** @@ -32,9 +21,9 @@ /***************************************************************************//** * @brief Calls the PollPanel method in specified intervals. * - * @param touchCallbackFunction Pointer to the touch callback function, - * which has to take the parameters 'x' and - * 'y' and gets called when a touch was detected. + * @param touchCallbackFunction Pointer to the touch callback function. + * Example prototype: + * @code void TouchCallback(unsigned short x, unsigned short y); @endcode * * @return None. *******************************************************************************/ @@ -87,8 +76,7 @@ /***************************************************************************//** * @brief Alternately reads the touch panel's X or Y coordinate and calls the - * touch callback function, which has to take the parameters - * 'x' and 'y', when a touch was detected. + * touch callback function when a touch was detected. * * @return None. *******************************************************************************/
--- a/TouchPanel.h Tue Jan 28 10:55:53 2014 +0000
+++ b/TouchPanel.h Tue Jan 28 13:16:36 2014 +0000
@@ -1,17 +1,6 @@
-/***************************************************************************//**
- * @file TouchPanel.h
- * @brief Header of the touch panel driver for the
- * TFT color display MI0283QT-9A (320x240).
- * @author Mario Poneder
- * @date 28/01/2013
-*******************************************************************************/
-
#ifndef __TOUCHPANEL_H__
#define __TOUCHPANEL_H__
-/******************************************************************************/
-/***************************** Include Files **********************************/
-/******************************************************************************/
#include "mbed.h"
#include "math.h"
@@ -41,13 +30,14 @@
#define RIGHT 0.89f // X coordinate
/***************************************************************************//**
- * @brief Specifies the prototype of the touch callback function.
- * Example: void TouchCallback(unsigned short x, unsigned short y);
+ * @brief TouchPanel driver for the TFT color display MI0283QT-9A (320x240).
+ * @author Mario Poneder
+ * @date 28/01/2014
*******************************************************************************/
-typedef void (*pTouchCallback_t)(unsigned short, unsigned short);
-
class TouchPanel
{
+ typedef void (*pTouchCallback_t)(unsigned short, unsigned short);
+
private:
PinName xPos; // X+ pin
@@ -74,7 +64,7 @@
void PollPanel(void);
public:
-
+
TouchPanel(PinName xPos, PinName xNeg, PinName yPos, PinName yNeg);
void SetTouchCallbackFunction(pTouchCallback_t touchCallbackFunction);
};