diff options
author | Andrew Hannam <andrewh@inmarket.com.au> | 2012-12-06 18:45:54 +1000 |
---|---|---|
committer | Andrew Hannam <andrewh@inmarket.com.au> | 2012-12-06 18:45:54 +1000 |
commit | 07f34835358ef65de310934ae726b66c7ca46f68 (patch) | |
tree | 6b6875cc38f19bc1dd41b3b7edc8ea10ab7dbc84 /include/ginput/dial.h | |
parent | e236a0a6b79ccd4446df72256740913392cf12f7 (diff) | |
download | uGFX-07f34835358ef65de310934ae726b66c7ca46f68.tar.gz uGFX-07f34835358ef65de310934ae726b66c7ca46f68.tar.bz2 uGFX-07f34835358ef65de310934ae726b66c7ca46f68.zip |
Restructure
Create global include file called gfx.h which knows about sub-system
dependancies.
Deprecate Touchscreen (GINPUT touch is now working properly)
Merge Graph into GWIN
Change directory structure to reflect sub-system structure
Many small bugs fixed
Split Nokia6610 gdisp driver into GE8 and GE12 controller versions
Fixed broken demos.
GFX sub-systems are now clearly defined and new ones should be much
easier to add.
Diffstat (limited to 'include/ginput/dial.h')
-rw-r--r-- | include/ginput/dial.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/include/ginput/dial.h b/include/ginput/dial.h new file mode 100644 index 00000000..90db94ac --- /dev/null +++ b/include/ginput/dial.h @@ -0,0 +1,72 @@ +/*
+ ChibiOS/GFX - Copyright (C) 2012
+ Joel Bodenmann aka Tectu <joel@unormal.org>
+
+ This file is part of ChibiOS/GFX.
+
+ ChibiOS/GFX is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ ChibiOS/GFX is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ 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 include/ginput/dial.h
+ * @brief GINPUT GFX User Input subsystem header file.
+ *
+ * @addtogroup GINPUT
+ * @{
+ */
+#ifndef _GINPUT_DIAL_H
+#define _GINPUT_DIAL_H
+
+#if GINPUT_NEED_DIAL || defined(__DOXYGEN__)
+
+/*===========================================================================*/
+/* Type definitions */
+/*===========================================================================*/
+
+// Event types for various ginput sources
+#define GEVENT_DIAL (GEVENT_GINPUT_FIRST+4)
+
+typedef struct GEventDial_t {
+ GEventType type; // The type of this event (GEVENT_DIAL)
+ uint16_t instance; // The dial instance
+ uint16_t value; // The dial value
+ } GEventDial;
+
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Dial Functions */
+ GSourceHandle ginputGetDial(uint16_t instance); // Instance = 0 to n-1
+ void ginputResetDialRange(uint16_t instance); // Reset the maximum value back to the hardware default.
+ uint16_t ginputGetDialRange(uint16_t instance); // Get the maximum value. The readings are scaled to be 0...max-1. 0 means over the full uint16_t range.
+ void ginputSetDialRange(uint16_t instance, uint16_t max); // Set the maximum value.
+ void ginputSetDialSensitivity(uint16_t instance, uint16_t diff); // Set the level change required before a dial event is generated.
+ // - This is done after range scaling
+ /* Get the current keyboard button status.
+ * Returns FALSE on error (eg invalid instance)
+ */
+ bool_t ginputGetDialStatus(uint16_t instance, GEventDial *pdial);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GINPUT_NEED_DIAL */
+
+#endif /* _GINPUT_DIAL_H */
+/** @} */
|