aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAndrew Hannam <andrewh@inmarket.com.au>2012-11-09 18:47:05 -0800
committerAndrew Hannam <andrewh@inmarket.com.au>2012-11-09 18:47:05 -0800
commit0eeb2a2b8f0c6bfb77256522c720e6915d57c217 (patch)
tree03ce8e6d759d5482185ae4a4797555ac0a922bfa /include
parentd3b4c499ab0267dbcad3d5972bb0317fdba9043e (diff)
parentaffd9792ff42fab8f376bd2c87a71b25fd52baf7 (diff)
downloaduGFX-0eeb2a2b8f0c6bfb77256522c720e6915d57c217.tar.gz
uGFX-0eeb2a2b8f0c6bfb77256522c720e6915d57c217.tar.bz2
uGFX-0eeb2a2b8f0c6bfb77256522c720e6915d57c217.zip
Merge pull request #1 from Tectu/master
Included Tectu changes
Diffstat (limited to 'include')
-rw-r--r--include/console.h9
-rw-r--r--include/gdisp.h5
-rw-r--r--include/gdisp_emulation.c1
-rw-r--r--include/gdisp_fonts.h4
-rw-r--r--include/gdisp_lld.h10
-rw-r--r--include/gdisp_lld_msgs.h4
-rw-r--r--include/graph.h19
-rw-r--r--include/touchscreen.h (renamed from include/touchpad.h)48
-rw-r--r--include/touchscreen_lld.h (renamed from include/touchpad_lld.h)78
9 files changed, 112 insertions, 66 deletions
diff --git a/include/console.h b/include/console.h
index 9891ea56..224de096 100644
--- a/include/console.h
+++ b/include/console.h
@@ -18,6 +18,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/**
+ * @file include/console.h
+ * @brief CONSOLE header file.
+ *
+ * @addtogroup CONSOLE
+ * @{
+ */
+
#ifndef CONSOLE_H
#define CONSOLE_H
@@ -81,4 +89,5 @@ msg_t gfxConsoleWrite(GConsole *console, const uint8_t *bp, size_t n);
#endif /* GFX_USE_CONSOLE */
#endif /* CONSOLE_H */
+/** @} */
diff --git a/include/gdisp.h b/include/gdisp.h
index 3964e9bd..9be97a12 100644
--- a/include/gdisp.h
+++ b/include/gdisp.h
@@ -17,13 +17,15 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+
/**
- * @file gdisp.h
+ * @file include/gdisp.h
* @brief GDISP Graphic Driver subsystem header file.
*
* @addtogroup GDISP
* @{
*/
+
#ifndef _GDISP_H
#define _GDISP_H
@@ -317,3 +319,4 @@ void gdispDrawBox(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color);
#endif /* _GDISP_H */
/** @} */
+
diff --git a/include/gdisp_emulation.c b/include/gdisp_emulation.c
index ec3e6a66..2c3f7caf 100644
--- a/include/gdisp_emulation.c
+++ b/include/gdisp_emulation.c
@@ -767,3 +767,4 @@ void *GDISP_LLD(query)(unsigned what) {
#endif /* GFX_USE_GDISP */
#endif /* GDISP_EMULATION_C */
+
diff --git a/include/gdisp_fonts.h b/include/gdisp_fonts.h
index 4b9f2287..e3b07e86 100644
--- a/include/gdisp_fonts.h
+++ b/include/gdisp_fonts.h
@@ -17,8 +17,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+
/**
- * @file gdisp_fonts.h
+ * @file include/gdisp_fonts.h
* @brief GDISP internal font definitions.
* @details This is not generally needed by an application. It is used
* by the low level drivers that need to understand a font.
@@ -88,3 +89,4 @@ struct font {
#endif /* _GDISP_FONTS_H */
/** @} */
+
diff --git a/include/gdisp_lld.h b/include/gdisp_lld.h
index 6dd826d9..8b7dd0e7 100644
--- a/include/gdisp_lld.h
+++ b/include/gdisp_lld.h
@@ -17,8 +17,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+
/**
- * @file gdisp_lld.h
+ * @file include/gdisp_lld.h
* @brief GDISP Graphic Driver subsystem low level driver header.
*
* @addtogroup GDISP
@@ -146,7 +147,7 @@
/**
* @brief Driver Control Constants
- * @detail Unsupported control codes are ignored.
+ * @details Unsupported control codes are ignored.
* @note The value parameter should always be typecast to (void *).
* @note There are some predefined and some specific to the low level driver.
* @note GDISP_CONTROL_POWER - Takes a gdisp_powermode_t
@@ -166,7 +167,7 @@
/**
* @brief Driver Query Constants
- * @detail Unsupported query codes return (void *)-1.
+ * @details Unsupported query codes return (void *)-1.
* @note There are some predefined and some specific to the low level driver.
* @note The result should be typecast the required type.
* @note GDISP_QUERY_WIDTH - Gets the width of the screen
@@ -398,7 +399,7 @@
* GDISP_PIXELFORMAT_RGB666
* GDISP_PIXELFORMAT_CUSTOM
* @note If you use GDISP_PIXELFORMAT_CUSTOM and packed bit fills
- * you need to also define @P gdispPackPixels(buf,cx,x,y,c)
+ * you need to also define @p gdispPackPixels(buf,cx,x,y,c)
* @note If you are using GDISP_HARDWARE_BITFILLS = FALSE then the pixel
* format must not be a packed format as the software blit does
* not support packed pixels
@@ -648,3 +649,4 @@ extern "C" {
#endif /* _GDISP_LLD_H */
/** @} */
+
diff --git a/include/gdisp_lld_msgs.h b/include/gdisp_lld_msgs.h
index a5cb885b..5885a70c 100644
--- a/include/gdisp_lld_msgs.h
+++ b/include/gdisp_lld_msgs.h
@@ -17,8 +17,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+
/**
- * @file gdisp_lld_msgs.h
+ * @file include/gdisp_lld_msgs.h
* @brief GDISP Graphic Driver subsystem low level driver message structures.
*
* @addtogroup GDISP
@@ -191,3 +192,4 @@ typedef union gdisp_lld_msg {
#endif /* GFX_USE_GDISP */
#endif /* _GDISP_LLD_MSGS_H */
/** @} */
+
diff --git a/include/graph.h b/include/graph.h
index 9b4603bd..bc0d3d15 100644
--- a/include/graph.h
+++ b/include/graph.h
@@ -18,6 +18,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/**
+ * @file include/graph.h
+ * @brief GRAPH module header file.
+ *
+ * @addtogroup GRAPH
+ * @{
+ */
+
#ifndef GRAPH_H
#define GRAPH_H
@@ -25,7 +33,11 @@
#define GFX_USE_GRAPH FALSE
#endif
-#if GFX_USE_GRAPH
+#if GFX_USE_GRAPH || defined(__DOXYGEN__)
+
+/*===========================================================================*/
+/* Type definitions */
+/*===========================================================================*/
typedef struct _Graph {
coord_t origin_x;
@@ -52,6 +64,10 @@ typedef struct _Graph {
extern "C" {
#endif
+/*===========================================================================*/
+/* Type definitions */
+/*===========================================================================*/
+
void graphDrawSystem(Graph *g);
void graphDrawDot(Graph *g, coord_t x, coord_t y, uint16_t radius, color_t color);
void graphDrawDots(Graph *g, int coord[][2], uint16_t entries, uint16_t radius, uint16_t color);
@@ -64,4 +80,5 @@ void graphDrawNet(Graph *g, int coord[][2], uint16_t entries, uint16_t radius, u
#endif /* GFX_USE_GRAPH */
#endif
+/** @} */
diff --git a/include/touchpad.h b/include/touchscreen.h
index 1db5ac98..4d48e38d 100644
--- a/include/touchpad.h
+++ b/include/touchscreen.h
@@ -19,16 +19,17 @@
*/
/**
- * @file touchpad.h
- * @brief TOUCHPAD Touchpad Driver subsystem header file.
+ * @file include/touchscreen.h
+ * @brief TOUCHSCREEN Touchscreen driver subsystem header file.
*
- * @addgroup TOUCHPAD
+ * @addtogroup TOUCHSCREEN
* @{
*/
-#ifndef _TOUCHPAD_H
-#define _TOUCHPAD_H
-#if GFX_USE_TOUCHPAD || defined(__DOXYGEN__)
+#ifndef TOUCHSCREEN_H
+#define TOUCHSCREEN_H
+
+#if GFX_USE_TOUCHSCREEN || defined(__DOXYGEN__)
/**
* @brief specifies how many conversions are made for a readout.
@@ -46,7 +47,10 @@
/*===========================================================================*/
/* Include the low level driver information */
-#include "touchpad_lld.h"
+#include "touchscreen_lld.h"
+
+/* For definitions of coord_t, we require gdisp.h */
+#include "gdisp.h"
/*===========================================================================*/
/* Type definitions */
@@ -56,10 +60,12 @@
* @brief Struct used for calibration
*/
typedef struct cal_t {
- float xm;
- float ym;
- float xn;
- float yn;
+ float ax;
+ float bx;
+ float cx;
+ float ay;
+ float by;
+ float cy;
} cal_t;
/*===========================================================================*/
@@ -70,25 +76,25 @@ typedef struct cal_t {
extern "C" {
#endif
-void tpInit(const TOUCHPADDriver *tp);
-uint16_t tpReadX(void);
-uint16_t tpReadY(void);
-void tpCalibrate(void);
+void tsInit(const TouchscreenDriver *ts);
+coord_t tsReadX(void);
+coord_t tsReadY(void);
+void tsCalibrate(void);
-#if TOUCHPAD_HAS_IRQ
- uint8_t tpIRQ(void);
+#if TOUCHSCREEN_HAS_IRQ
+ bool_t tsIRQ(void);
#endif
-#if TOUCHPAD_HAS_PRESSURE
- uint16_t tpReadZ(void);
+#if TOUCHSCREEN_HAS_PRESSURE
+ uint16_t tsReadZ(void);
#endif
#ifdef __cplusplus
}
#endif
-#endif /* GFX_USE_TOUCHPAD */
+#endif /* GFX_USE_TOUCHSCREEN */
-#endif /* _TOUCHPAD_H */
+#endif /* TOUCHSCREEN_H */
/** @} */
diff --git a/include/touchpad_lld.h b/include/touchscreen_lld.h
index c73591c7..53c66b53 100644
--- a/include/touchpad_lld.h
+++ b/include/touchscreen_lld.h
@@ -19,54 +19,58 @@
*/
/**
- * @file touchpad_lld.h
- * @brief TOUCHPAD Driver subsystem low level driver header.
+ * @file include/touchscreen_lld.h
+ * @brief TOUCHSCREEN Driver subsystem low level driver header.
*
- * @addgroup TOUCHPAD
+ * @addtogroup TOUCHSCREEN
* @{
*/
-#ifndef _TOUCHPAD_LLD_H
-#define _TOUCHPAD_LLD_H
+#ifndef TOUCHSCREEN_LLD_H
+#define TOUCHSCREEN_LLD_H
-#if GFX_USE_TOUCHPAD || defined(__DOXYGEN__)
+#if GFX_USE_TOUCHSCREEN || defined(__DOXYGEN__)
/*===========================================================================*/
/* Include the low level driver configuration information */
/*===========================================================================*/
-#include "touchpad_lld_config.h"
+#include "touchscreen_lld_config.h"
/*===========================================================================*/
/* Error checks. */
/*===========================================================================*/
-#ifndef TOUCHPAD_NEED_MULTITHREAD
- #define TOUCHPAD_NEED_MULTITHREAD FALSE
+#ifndef TOUCHSCREEN_NEED_MULTITHREAD
+ #define TOUCHSCREEN_NEED_MULTITHREAD FALSE
#endif
-#ifndef TOUCHPAD_XY_INVERTED
- #define TOUCHPAD_XY_INVERTED FALSE
+#ifndef TOUCHSCREEN_XY_INVERTED
+ #define TOUCHSCREEN_XY_INVERTED FALSE
#endif
-#ifndef TOUCHPAD_STORE_CALIBRATION
- #define TOUCHPAD_STORE_CALIBRATION FALSE
+#ifndef TOUCHSCREEN_STORE_CALIBRATION
+ #define TOUCHSCREEN_STORE_CALIBRATION FALSE
#endif
-#ifndef TOUCHPAD_HAS_IRQ
- #define TOUCHPAD_HAS_IRQ FALSE
+#ifndef TOUCHSCREEN_VERIFY_CALIBRATION
+ #define TOUCHSCREEN_VERIFY_CALIBRATION FALSE
#endif
-#ifndef TOUCHPAD_HAS_PRESSURE
- #define TOUCHPAD_HAS_PRESSURE FALSE
+#ifndef TOUCHSCREEN_HAS_IRQ
+ #define TOUCHSCREEN_HAS_IRQ FALSE
#endif
-#ifndef TOUCHPAD_SPI_PROLOGUE
- #define TOUCHPAD_SPI_PROLOGUE()
+#ifndef TOUCHSCREEN_HAS_PRESSURE
+ #define TOUCHSCREEN_HAS_PRESSURE FALSE
#endif
-#ifndef TOUCHPAD_SPI_EPILOGUE
- #define TOUCHPAD_SPI_EPILOGUE()
+#ifndef TOUCHSCREEN_SPI_PROLOGUE
+ #define TOUCHSCREEN_SPI_PROLOGUE()
+#endif
+
+#ifndef TOUCHSCREEN_SPI_EPILOGUE
+ #define TOUCHSCREEN_SPI_EPILOGUE()
#endif
/*===========================================================================*/
@@ -74,9 +78,9 @@
/*===========================================================================*/
/**
- * @brief Structure representing a Touchpad driver.
+ * @brief Structure representing a touchscreen driver.
*/
-typedef struct _TOUCHPADDriver {
+typedef struct TouchscreenDriver {
/*
* @brief Pointer to SPI driver.
* @note SPI driver must be enabled in mcuconf.h and halconf.h
@@ -93,27 +97,27 @@ typedef struct _TOUCHPADDriver {
/*
* @brief Touchscreen controller TPIRQ pin GPIO port
*/
- ioportid_t tpIRQPort;
+ ioportid_t tsIRQPort;
/*
* @brief Touchscreen controller TPIRQ GPIO pin
* @note The interface is polled as of now, interrupt support is
* to be implemented in the future.
*/
- ioportmask_t tpIRQPin;
+ ioportmask_t tsIRQPin;
/*
* @brief Initialize the SPI with the configuration struct given or not
* If TRUE, spiStart is called by the init, otherwise not
* @note This is provided in such a case when SPI port is being shared
* across multiple peripherals, so not to disturb the SPI bus.
- * You can use TOUCHPAD_SPI_PROLOGUE() and TOUCHPAD_SPI_EPILOGUE()
+ * You can use TOUCHSCREEN_SPI_PROLOGUE() and TOUCHSCREEN_SPI_EPILOGUE()
* macros to change the SPI configuration or speed before and
* after using the touchpad. An example case would be sharing the
* bus with a fast flash memory chip.
*/
bool_t direct_init;
-} TOUCHPADDriver;
+} TouchscreenDriver;
/*===========================================================================*/
@@ -126,26 +130,26 @@ extern "C" {
#endif
/* Core functions */
- void tp_lld_init(const TOUCHPADDriver *tp);
+ void ts_lld_init(const TouchscreenDriver *ts);
- uint16_t tp_lld_read_value(uint8_t cmd);
- uint16_t tp_lld_read_x(void);
- uint16_t tp_lld_read_y(void);
+ uint16_t ts_lld_read_value(uint8_t cmd);
+ uint16_t ts_lld_read_x(void);
+ uint16_t ts_lld_read_y(void);
- #if TOUCHPAD_HAS_IRQ
- uint8_t tp_lld_irq(void);
+ #if TOUCHSCREEN_HAS_IRQ
+ uint8_t ts_lld_irq(void);
#endif
- #if TOUCHPAD_HAS_PRESSURE
- uint16_t tp_lld_read_z(void);
+ #if TOUCHSCREEN_HAS_PRESSURE
+ uint16_t ts_lld_read_z(void);
#endif
#ifdef __cplusplus
}
#endif
-#endif /* GFX_USE_TOUCHPAD */
+#endif /* GFX_USE_TOUCHSCREEN */
-#endif /* _TOUCHPAD_LLD_H */
+#endif /* _TOUCHSCREEN_LLD_H */
/** @} */