diff options
author | Joel Bodenmann <joel@unormal.org> | 2013-02-11 09:25:26 +0100 |
---|---|---|
committer | Joel Bodenmann <joel@unormal.org> | 2013-02-11 09:25:26 +0100 |
commit | 885b3d53b3a491c62fb0634b78cb9857723ac15d (patch) | |
tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 /include/ginput | |
parent | 851e5fb09bdc086d734647128fd3051c3a8528e2 (diff) | |
download | uGFX-885b3d53b3a491c62fb0634b78cb9857723ac15d.tar.gz uGFX-885b3d53b3a491c62fb0634b78cb9857723ac15d.tar.bz2 uGFX-885b3d53b3a491c62fb0634b78cb9857723ac15d.zip |
removed GDISP_LLD() macro
Diffstat (limited to 'include/ginput')
-rw-r--r-- | include/ginput/dial.h | 123 | ||||
-rw-r--r-- | include/ginput/ginput.h | 61 | ||||
-rw-r--r-- | include/ginput/keyboard.h | 140 | ||||
-rw-r--r-- | include/ginput/lld/mouse.h | 121 | ||||
-rw-r--r-- | include/ginput/lld/toggle.h | 73 | ||||
-rw-r--r-- | include/ginput/mouse.h | 171 | ||||
-rw-r--r-- | include/ginput/options.h | 127 | ||||
-rw-r--r-- | include/ginput/toggle.h | 112 |
8 files changed, 0 insertions, 928 deletions
diff --git a/include/ginput/dial.h b/include/ginput/dial.h deleted file mode 100644 index 5679685e..00000000 --- a/include/ginput/dial.h +++ /dev/null @@ -1,123 +0,0 @@ -/*
- 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.
- *
- * @defgroup Dial Dial
- * @ingroup GINPUT
- *
- * @details A dial provides a powerful way to navigate through menus
- * on a display.
- *
- * @pre GFX_USE_GINPUT must be set to TRUE in your gfxconf.h
- * @pre GINPUT_NEED_DIAL must be set to TRUE in your gfxconf.h
- *
- * @{
- */
-#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
-
- /**
- * @brief Create a dial input instance
- *
- * @param[in] instance The ID of the dial input instance (from 0 to 9999)
- *
- * @return The soure handle of the created dial instance
- */
- GSourceHandle ginputGetDial(uint16_t instance);
-
- /**
- * @brief Reset the value back to the hardware default
- *
- * @param[in] instance The ID of the dial input instance
- */
- void ginputResetDialRange(uint16_t instance);
-
- /**
- * @brief Get the maximum value
- * @details The readings are scaled to be 0 ... max-1.
- * 0 means over the full uint16_t range.
- *
- * @param[in] instance The ID of the dial input instance
- *
- * @return The maximum value
- */
- uint16_t ginputGetDialRange(uint16_t instance);
-
- /**
- * @brief Set the maximum value
- * @note This shouldn't be set higher that the hardwares possible maximum value
- *
- * @param[in] instance The ID of the dial input instance
- * @param[in] max The maximum value to be set
- */
- void ginputSetDialRange(uint16_t instance, uint16_t max);
-
- /**
- * @brief Set the level change required before a dial even is generated (threshold)
- * @note This is done after range scaling
- *
- * @param[in] instance The ID of the dial input instance
- * @param[in] diff The amount of level changes
- */
- void ginputSetDialSensitivity(uint16_t instance, uint16_t diff);
-
- /**
- * @brief Get the current dial status
- *
- * @param[in] instance The ID of the dial input instance
- * @param[in] pdial The dial event struct
- *
- * @return Returns FALSE on an error (eg invalid instance)
- */
- bool_t ginputGetDialStatus(uint16_t instance, GEventDial *pdial);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GINPUT_NEED_DIAL */
-
-#endif /* _GINPUT_DIAL_H */
-/** @} */
diff --git a/include/ginput/ginput.h b/include/ginput/ginput.h deleted file mode 100644 index 59f7640c..00000000 --- a/include/ginput/ginput.h +++ /dev/null @@ -1,61 +0,0 @@ -/*
- 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/ginput.h
- * @brief GINPUT GFX User Input subsystem header file.
- *
- * @addtogroup GINPUT
- *
- * @details GINPUT provides an easy and common interface to use different input devices
- * such as touchscreens and mices.
- *
- * @pre GFX_USE_GINPUT must be set to TRUE in your gfxconf.h
- *
- * @{
- */
-#ifndef _GINPUT_H
-#define _GINPUT_H
-
-#include "gfx.h"
-
-#if GFX_USE_GINPUT || defined(__DOXYGEN__)
-
-/* How to use...
-
- 1. Get source handles for all the inputs you are interested in.
- - Attempting to get a handle for one instance of an input more than once will return the same handle
- 2. Create a listener
- 3. Assign inputs to your listener.
- - Inputs can be assigned or released from a listener at any time.
- - An input can be assigned to more than one listener.
- 4. Loop on getting listener events
- 5. When complete destroy the listener
-*/
-
-// Include various ginput types
-#include "ginput/mouse.h"
-#include "ginput/keyboard.h"
-#include "ginput/toggle.h"
-#include "ginput/dial.h"
-
-#endif /* GFX_USE_GINPUT */
-
-#endif /* _GINPUT_H */
-/** @} */
diff --git a/include/ginput/keyboard.h b/include/ginput/keyboard.h deleted file mode 100644 index 9f5df32e..00000000 --- a/include/ginput/keyboard.h +++ /dev/null @@ -1,140 +0,0 @@ -/*
- 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/keyboard.h
- * @brief GINPUT GFX User Input subsystem header file.
- *
- * @defgroup Keyboard Keyboard
- * @ingroup GINPUT
- * @{
- */
-
-#ifndef _GINPUT_KEYBOARD_H
-#define _GINPUT_KEYBOARD_H
-
-#if GINPUT_NEED_KEYBOARD || defined(__DOXYGEN__)
-
-/*===========================================================================*/
-/* Type definitions */
-/*===========================================================================*/
-
-#define GINPUT_KEYBOARD_NUM_PORTS 1 // The total number of keyboard inputs
-
-// Event types for various ginput sources
-#define GEVENT_KEYBOARD (GEVENT_GINPUT_FIRST+2)
-
-typedef struct GEventKeyboard_t {
- GEventType type; // The type of this event (GEVENT_KEYBOARD)
- uint16_t instance; // The keyboard instance
- char c; // The Ascii code for the current key press.
- // The only possible values are 0(NUL), 8(BS), 9(TAB), 13(CR), 27(ESC), 32(SPACE) to 126(~), 127(DEL)
- // 0 indicates an extended only key.
- uint16_t code; // An extended keyboard code. Codes less than 128 match their ascii equivelent.
- #define GKEY_NULL 0
- #define GKEY_BACKSPACE 8
- #define GKEY_TAB 9
- #define GKEY_CR 13
- #define GKEY_ESC 27
- #define GKEY_SPACE 32
- #define GKEY_DEL 127
- #define GKEY_UP 0x0101
- #define GKEY_DOWN 0x0102
- #define GKEY_LEFT 0x0103
- #define GKEY_RIGHT 0x0104
- #define GKEY_HOME 0x0105
- #define GKEY_END 0x0106
- #define GKEY_PAGEUP 0x0107
- #define GKEY_PAGEDOWN 0x0108
- #define GKEY_INSERT 0x0109
- #define GKEY_DELETE 0x010A
- #define GKEY_SHIFT 0x0201
- #define GKEY_CNTRL 0x0202
- #define GKEY_ALT 0x0203
- #define GKEY_WINKEY 0x0204
- #define GKEY_RCLKEY 0x0205
- #define GKEY_FNKEY 0x0206
- #define GKEY_FN1 0x0301
- #define GKEY_FN2 0x0302
- #define GKEY_FN3 0x0303
- #define GKEY_FN4 0x0304
- #define GKEY_FN5 0x0305
- #define GKEY_FN6 0x0306
- #define GKEY_FN7 0x0307
- #define GKEY_FN8 0x0308
- #define GKEY_FN9 0x0309
- #define GKEY_FN10 0x030A
- #define GKEY_FN11 0x030B
- #define GKEY_FN12 0x030C
- uint16_t current_buttons; // A bit is set to indicate various meta status.
- #define GMETA_KEY_DOWN 0x0001
- #define GMETA_KEY_SHIFT 0x0002
- #define GMETA_KEY_CNTRL 0x0004
- #define GMETA_KEY_ALT 0x0008
- #define GMETA_KEY_WINKEY 0x0010
- #define GMETA_KEY_RCLKKEY 0x0020
- #define GMETA_KEY_FN 0x0040
- #define GMETA_KEY_MISSED_EVENT 0x8000
- uint16_t last_buttons; // The value of current_buttons on the last event
-} GEventKeyboard;
-
-// Keyboard Listen Flags - passed to geventAddSourceToListener()
-#define GLISTEN_KEYREPEATS 0x0001 // Return key repeats (where the key is held down to get a repeat character)
-#define GLISTEN_KEYCODES 0x0002 // Return all key presses including extended code key presses (not just ascii codes)
-#define GLISTEN_KEYALL 0x0004 // Return keyup's, keydown's and everything in between (but not repeats unless GLISTEN_KEYREPEATS is set).
-#define GLISTEN_KEYSINGLE 0x8000 // Return only when one particular extended code key is pressed or released. The particular extended code is OR'd into this value
- // eg. (GLISTEN_KEYSINGLE | GKEY_CR)
- // No other flags may be set with this flag.
-
-/*===========================================================================*/
-/* External declarations. */
-/*===========================================================================*/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
- /**
- * @brief Create a keyboard input instance
- *
- * @param[in] instance The ID of the keyboard input instance (from 0 to 9999)
- *
- * @return The source handle of the created input instance
- */
- GSourceHandle ginputGetKeyboard(uint16_t instance);
-
- /**
- * @brief Get the current keyboard status
- *
- * @param[in] instance The ID of the keyboard input instance
- * @param[in] pkeyboard The keyboard event struct
- *
- * @return Returns FALSE on an error (eg invalid instance)
- */
- bool_t ginputGetKeyboardStatus(uint16_t instance, GEventKeyboard *pkeyboard);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GINPUT_NEED_KEYBOARD */
-
-#endif /* _GINPUT_KEYBOARD_H */
-/** @} */
-
diff --git a/include/ginput/lld/mouse.h b/include/ginput/lld/mouse.h deleted file mode 100644 index 5f4ba52c..00000000 --- a/include/ginput/lld/mouse.h +++ /dev/null @@ -1,121 +0,0 @@ -/*
- 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/lld/mouse.h
- * @brief GINPUT LLD header file for mouse/touch drivers.
- *
- * @defgroup Mouse Mouse
- * @ingroup GINPUT
- * @{
- */
-
-#ifndef _LLD_GINPUT_MOUSE_H
-#define _LLD_GINPUT_MOUSE_H
-
-#if GINPUT_NEED_MOUSE || defined(__DOXYGEN__)
-
-#include "ginput_lld_mouse_config.h"
-
-// GEVENT_MOUSE or GEVENT_TOUCH - What type of device is this.
-#ifndef GINPUT_MOUSE_EVENT_TYPE
- #define GINPUT_MOUSE_EVENT_TYPE GEVENT_MOUSE
-#endif
-
-// TRUE/FALSE - Does the mouse/touch driver require calibration?
-#ifndef GINPUT_MOUSE_NEED_CALIBRATION
- #define GINPUT_MOUSE_NEED_CALIBRATION FALSE
-#endif
-
-// TRUE/FALSE - Can the mouse/touch driver itself save calibration data?
-#ifndef GINPUT_MOUSE_LLD_CALIBRATION_LOADSAVE
- #define GINPUT_MOUSE_LLD_CALIBRATION_LOADSAVE FALSE
-#endif
-
-// n or -1 - n means to test calibration result (+/- pixels), -1 means not to.
-#ifndef GINPUT_MOUSE_MAX_CALIBRATION_ERROR
- #define GINPUT_MOUSE_MAX_CALIBRATION_ERROR -1
-#endif
-
-// n - How many times to read (and average) per poll
-#ifndef GINPUT_MOUSE_READ_CYCLES
- #define GINPUT_MOUSE_READ_CYCLES 1
-#endif
-
-// n - Millisecs between poll's
-#ifndef GINPUT_MOUSE_POLL_PERIOD
- #define GINPUT_MOUSE_POLL_PERIOD 25
-#endif
-
-// n - Movement allowed without discarding the CLICK or CLICKCXT event (+/- pixels)
-#ifndef GINPUT_MOUSE_MAX_CLICK_JITTER
- #define GINPUT_MOUSE_MAX_CLICK_JITTER 1
-#endif
-
-// n - Movement allowed without discarding the MOVE event (+/- pixels)
-#ifndef GINPUT_MOUSE_MAX_MOVE_JITTER
- #define GINPUT_MOUSE_MAX_MOVE_JITTER 0
-#endif
-
-// ms - Millisecs seperating a CLICK from a CXTCLICK
-#ifndef GINPUT_MOUSE_CLICK_TIME
- #define GINPUT_MOUSE_CLICK_TIME 700
-#endif
-
-
-typedef struct MouseReading_t {
- coord_t x, y, z;
- uint16_t buttons;
- } MouseReading;
-
-/*===========================================================================*/
-/* External declarations. */
-/*===========================================================================*/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
- void ginput_lld_mouse_init(void);
- void ginput_lld_mouse_get_reading(MouseReading *pt);
-
- #if GINPUT_MOUSE_LLD_CALIBRATION_LOADSAVE
- const char *ginput_lld_mouse_calibration_load(uint16_t instance);
- void ginput_lld_mouse_calibration_save(uint16_t instance, const uint8_t *calbuf, size_t sz);
- #endif
-
- /* This routine is provided to low level drivers to wakeup a value read from a thread context.
- * Particularly useful if GINPUT_MOUSE_POLL_PERIOD = TIME_INFINITE
- */
- void ginputMouseWakeup(void);
-
- /* This routine is provided to low level drivers to wakeup a value read from an ISR
- * Particularly useful if GINPUT_MOUSE_POLL_PERIOD = TIME_INFINITE
- */
- void ginputMouseWakeupI(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GINPUT_NEED_MOUSE || GINPUT_NEED_TOUCH */
-
-#endif /* _LLD_GINPUT_MOUSE_H */
-/** @} */
-
diff --git a/include/ginput/lld/toggle.h b/include/ginput/lld/toggle.h deleted file mode 100644 index a75a670f..00000000 --- a/include/ginput/lld/toggle.h +++ /dev/null @@ -1,73 +0,0 @@ -/*
- 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/lld/toggle.h
- * @brief GINPUT header file for toggle drivers.
- *
- * @defgroup Toggle Toggle
- * @ingroup GINPUT
- * @{
- */
-
-#ifndef _LLD_GINPUT_TOGGLE_H
-#define _LLD_GINPUT_TOGGLE_H
-
-#if GINPUT_NEED_TOGGLE || defined(__DOXYGEN__)
-
-// Describes how the toggle bits are obtained
-typedef struct GToggleConfig_t {
- void *id;
- unsigned mask;
- unsigned invert;
- iomode_t mode;
-} GToggleConfig;
-
-/*===========================================================================*/
-/* External declarations. */
-/*===========================================================================*/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
- extern const GToggleConfig GInputToggleConfigTable[GINPUT_TOGGLE_CONFIG_ENTRIES];
-
- void ginput_lld_toggle_init(const GToggleConfig *ptc);
- unsigned ginput_lld_toggle_getbits(const GToggleConfig *ptc);
-
- /* This routine is provided to low level drivers to wakeup a value read from a thread context.
- * Particularly useful if GINPUT_TOGGLE_POLL_PERIOD = TIME_INFINITE
- */
- void ginputToggleWakeup(void);
-
- /* This routine is provided to low level drivers to wakeup a value read from an ISR
- * Particularly useful if GINPUT_TOGGLE_POLL_PERIOD = TIME_INFINITE
- */
- void ginputToggleWakeupI(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GFX_USE_GINPUT && GINPUT_NEED_TOGGLE */
-
-#endif /* _LLD_GINPUT_TOGGLE_H */
-/** @} */
-
diff --git a/include/ginput/mouse.h b/include/ginput/mouse.h deleted file mode 100644 index 5385ff17..00000000 --- a/include/ginput/mouse.h +++ /dev/null @@ -1,171 +0,0 @@ -/*
- 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/mouse.h
- * @brief GINPUT GFX User Input subsystem header file for mouse and touch.
- *
- * @defgroup Mouse Mouse
- * @ingroup GINPUT
- *
- * @details GINPUT allows it to easily interface touchscreens and mices to
- * your application.
- *
- * @pre GFX_USE_GINPUT must be set to TRUE in your gfxconf.h
- * @pre GINPUT_NEED_MOUSE must be set to TRUE in your gfxconf.h
- *
- * @{
- */
-
-#ifndef _GINPUT_MOUSE_H
-#define _GINPUT_MOUSE_H
-
-#if GINPUT_NEED_MOUSE || defined(__DOXYGEN__)
-
-/*===========================================================================*/
-/* Type definitions */
-/*===========================================================================*/
-
-/* This type definition is also used by touch */
-typedef struct GEventMouse_t {
- GEventType type; // The type of this event (GEVENT_MOUSE or GEVENT_TOUCH)
- uint16_t instance; // The mouse/touch instance
- coord_t x, y, z; // The position of the mouse.
- // - For touch devices, Z is the current pressure if supported (otherwise 0)
- // - For mice, Z is the 3rd dimension if supported (otherwise 0)
- uint16_t current_buttons; // A bit is set if the button is down.
- // - For touch only bit 0 is relevant
- // - For mice the order of the buttons is (from 0 to n) left, right, middle, any other buttons
- // - Bit 15 being set indicates that an important mouse event has been missed.
- #define GINPUT_MOUSE_BTN_LEFT 0x0001
- #define GINPUT_MOUSE_BTN_RIGHT 0x0002
- #define GINPUT_MOUSE_BTN_MIDDLE 0x0004
- #define GINPUT_MOUSE_BTN_4 0x0008
- #define GINPUT_MISSED_MOUSE_EVENT 0x8000
- #define GINPUT_TOUCH_PRESSED GINPUT_MOUSE_BTN_LEFT
- uint16_t last_buttons; // The value of current_buttons on the last event
- enum GMouseMeta_e {
- GMETA_NONE = 0, // There is no meta event currently happening
- GMETA_MOUSE_DOWN = 1, // Button 0 has just gone down
- GMETA_MOUSE_UP = 2, // Button 0 has just gone up
- GMETA_MOUSE_CLICK = 4, // Button 0 has just gone through a short down - up cycle
- GMETA_MOUSE_CXTCLICK = 8 // For mice - The right button has just been depressed
- // For touch - a long press has just occurred
- } meta;
- } GEventMouse;
-
-// Mouse/Touch Listen Flags - passed to geventAddSourceToListener()
-#define GLISTEN_MOUSEMETA 0x0001 // Create events for meta events such as CLICK and CXTCLICK
-#define GLISTEN_MOUSEDOWNMOVES 0x0002 // Creates mouse move events when the primary mouse button is down (touch is on the surface)
-#define GLISTEN_MOUSEUPMOVES 0x0004 // Creates mouse move events when the primary mouse button is up (touch is off the surface - if the hardware allows).
-#define GLISTEN_MOUSENOFILTER 0x0008 // Don't filter out mouse moves where the position hasn't changed.
-#define GLISTEN_TOUCHMETA GLISTEN_MOUSEMETA
-#define GLISTEN_TOUCHDOWNMOVES GLISTEN_MOUSEDOWNMOVES
-#define GLISTEN_TOUCHUPMOVES GLISTEN_MOUSEUPMOVES
-#define GLISTEN_TOUCHNOFILTER GLISTEN_MOUSENOFILTER
-
-#define GINPUT_MOUSE_NUM_PORTS 1 // The total number of mouse/touch inputs supported
-
-// Event types for the mouse ginput source
-#define GEVENT_MOUSE (GEVENT_GINPUT_FIRST+0)
-#define GEVENT_TOUCH (GEVENT_GINPUT_FIRST+1)
-
-/*===========================================================================*/
-/* External declarations. */
-/*===========================================================================*/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
- /**
- * @brief Creates an instance of a mouse and returns the Source handler
- * @note hack: if the instance is 9999, no calibration will be performed!
- *
- * @param[in] instance The ID of the mouse input instance (from 0 to 9999)
- *
- * @return The source handle of the created instance
- */
- GSourceHandle ginputGetMouse(uint16_t instance);
-
- /**
- * @brief Get the current mouse position and button status
- * @note Unlinke a listener event, this status cannot record meta events such as
- * "CLICK".
- *
- * @param[in] instance The ID of the mouse input instance
- * @param[in] pmouse The mouse event
- *
- * @return FALSE on an error (eg. invalid instance)
- */
- bool_t ginputGetMouseStatus(uint16_t instance, GEventMouse *pmouse);
-
- /**
- * @brief Performs a calibration
- *
- * @param[in] instance The ID of the mouse input instance
- *
- * @return FALSE if the driver dosen't support a calibration of if the handle is invalid
- */
- bool_t ginputCalibrateMouse(uint16_t instance);
-
- /* Set the routines to save and fetch calibration data.
- * This function should be called before first calling ginputGetMouse() for a particular instance
- * as the gdispGetMouse() routine may attempt to fetch calibration data and perform a startup calibration if there is no way to get it.
- * If this is called after gdispGetMouse() has been called and the driver requires calibration storage, it will immediately save the data is has already obtained.
- * The 'requireFree' parameter indicates if the fetch buffer must be free()'d to deallocate the buffer provided by the Fetch routine.
- */
- typedef void (*GMouseCalibrationSaveRoutine)(uint16_t instance, const uint8_t *calbuf, size_t sz); // Save calibration data
- typedef const char * (*GMouseCalibrationLoadRoutine)(uint16_t instance); // Load calibration data (returns NULL if not data saved)
-
- /**
- * @brief Set the routines to store and restore calibration data
- *
- * @details This function should be called before first calling ginputGetMouse() for a particular instance
- * as the gdispGetMouse() routine may attempt to fetch calibration data and perform a startup calibration if there is no way to get it.
- * If this is called after gdispGetMouse() has been called and the driver requires calibration storage, it will immediately save the
- * data is has already obtained.
- * The 'requireFree' parameter indicates if the fetch buffer must be free()'d to deallocate the buffer provided by the Fetch routine.
- *
- * @param[in] instance The ID of the mouse input instance
- * @param[in] fnsave The routine to save the data
- * @param[in] fnload The routine to restore the data
- * @param[in] requireFree ToDo
- */
- void ginputSetMouseCalibrationRoutines(uint16_t instance, GMouseCalibrationSaveRoutine fnsave, GMouseCalibrationLoadRoutine fnload, bool_t requireFree);
-
- /**
- * @brief Test if a particular mouse/touch instance requires routines to save it's alibration data
- * @note Not implemented yet
- *
- * @param[in] instance The ID of the mouse input instance
- *
- * @return TRUE if needed
- */
- bool_t ginputRequireMouseCalibrationStorage(uint16_t instance);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GINPUT_NEED_MOUSE */
-
-#endif /* _GINPUT_MOUSE_H */
-/** @} */
-
diff --git a/include/ginput/options.h b/include/ginput/options.h deleted file mode 100644 index e7635fb5..00000000 --- a/include/ginput/options.h +++ /dev/null @@ -1,127 +0,0 @@ -/*
- 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/options.h
- * @brief GINPUT sub-system options header file.
- *
- * @addtogroup GINPUT
- * @{
- */
-
-#ifndef _GINPUT_OPTIONS_H
-#define _GINPUT_OPTIONS_H
-
-/**
- * @name GINPUT Functionality to be included
- * @{
- */
- /**
- * @brief Should mouse/touch functions be included.
- * @details Defaults to FALSE
- * @note Also add the a mouse/touch hardware driver to your makefile.
- * Eg.
- * include $(GFXLIB)/drivers/ginput/touch/MCU/ginput_lld.mk
- */
- #ifndef GINPUT_NEED_MOUSE
- #define GINPUT_NEED_MOUSE FALSE
- #endif
- /**
- * @brief Should keyboard functions be included.
- * @details Defaults to FALSE
- * @note Also add the a keyboard hardware driver to your makefile.
- * Eg.
- * include $(GFXLIB)/drivers/ginput/keyboard/XXXX/ginput_lld.mk
- */
- #ifndef GINPUT_NEED_KEYBOARD
- #define GINPUT_NEED_KEYBOARD FALSE
- #endif
- /**
- * @brief Should hardware toggle/switch/button functions be included.
- * @details Defaults to FALSE
- * @note Also add the a toggle hardware driver to your makefile.
- * Eg.
- * include $(GFXLIB)/drivers/ginput/toggle/Pal/ginput_lld.mk
- */
- #ifndef GINPUT_NEED_TOGGLE
- #define GINPUT_NEED_TOGGLE FALSE
- #endif
- /**
- * @brief Should analog dial functions be included.
- * @details Defaults to FALSE
- * @note Also add the a dial hardware driver to your makefile.
- * Eg.
- * include $(GFXLIB)/drivers/ginput/dial/analog/ginput_lld.mk
- */
- #ifndef GINPUT_NEED_DIAL
- #define GINPUT_NEED_DIAL FALSE
- #endif
-/**
- * @}
- *
- * @name GINPUT Optional Sizing Parameters
- * @{
- */
-/**
- * @}
- *
- * @name GINPUT Optional Low Level Driver Defines
- * @{
- */
- /**
- * @brief Use a custom board definition for the mouse/touch driver even if a board definition exists.
- * @details Defaults to FALSE
- * @details If TRUE, add ginput_lld_mouse_board.h to your project directory and customise it.
- * @note Not all GINPUT mouse/touch low level drivers use board definition files.
- */
- #ifndef GINPUT_MOUSE_USE_CUSTOM_BOARD
- #define GINPUT_MOUSE_USE_CUSTOM_BOARD FALSE
- #endif
- /**
- * @brief Use a custom board definition for the keyboard driver even if a board definition exists.
- * @details Defaults to FALSE
- * @details If TRUE, add ginput_lld_keyboard_board.h to your project directory and customise it.
- * @note Not all GINPUT keyboard low level drivers use board definition files.
- */
- #ifndef GINPUT_KEYBOARD_USE_CUSTOM_BOARD
- #define GINPUT_KEYBOARD_USE_CUSTOM_BOARD FALSE
- #endif
- /**
- * @brief Use a custom board definition for the toggle driver even if a board definition exists.
- * @details Defaults to FALSE
- * @details If TRUE, add ginput_lld_toggle_board.h to your project directory and customise it.
- * @note Not all GINPUT toggle low level drivers use board definition files.
- */
- #ifndef GINPUT_TOGGLE_USE_CUSTOM_BOARD
- #define GINPUT_TOGGLE_USE_CUSTOM_BOARD FALSE
- #endif
- /**
- * @brief Use a custom board definition for the dial driver even if a board definition exists.
- * @details Defaults to FALSE
- * @details If TRUE, add ginput_lld_dial_board.h to your project directory and customise it.
- * @note Not all GINPUT dial low level drivers use board definition files.
- */
- #ifndef GINPUT_DIAL_USE_CUSTOM_BOARD
- #define GINPUT_DIAL_USE_CUSTOM_BOARD FALSE
- #endif
-/** @} */
-
-#endif /* _GINPUT_OPTIONS_H */
-/** @} */
diff --git a/include/ginput/toggle.h b/include/ginput/toggle.h deleted file mode 100644 index bec4ed32..00000000 --- a/include/ginput/toggle.h +++ /dev/null @@ -1,112 +0,0 @@ -/*
- 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/toggle.h
- * @brief GINPUT GFX User Input subsystem header file.
- *
- * @defgroup Toggle Toggle
- * @ingroup GINPUT
- *
- * @details GINPUT allows it to interface toggle buttons easily to your
- * application.
- *
- * @pre GFX_USE_GINPUT must be set to TRUE in your gfxconf.h
- * @pre GINPUT_NEED_TOGGLE must be set to TRUE in your gfxconf.h
- *
- * @{
- */
-
-#ifndef _GINPUT_TOGGLE_H
-#define _GINPUT_TOGGLE_H
-
-#if GINPUT_NEED_TOGGLE || defined(__DOXYGEN__)
-
-/*===========================================================================*/
-/* Low Level Driver details and error checks. */
-/*===========================================================================*/
-
-// Get the hardware definitions - Number of instances etc.
-#include "ginput_lld_toggle_config.h"
-
-#ifndef GINPUT_TOGGLE_POLL_PERIOD
- #define GINPUT_TOGGLE_POLL_PERIOD 200
-#endif
-
-/*===========================================================================*/
-/* Type definitions */
-/*===========================================================================*/
-
-// Event types for various ginput sources
-#define GEVENT_TOGGLE (GEVENT_GINPUT_FIRST+3)
-
-typedef struct GEventToggle_t {
- GEventType type; // The type of this event (GEVENT_TOGGLE)
- uint16_t instance; // The toggle instance
- bool_t on; // True if the toggle/button is on
- } GEventToggle;
-
-// Toggle Listen Flags - passed to geventAddSourceToListener()
-#define GLISTEN_TOGGLE_ON 0x0001 // Return an event when the toggle turns on
-#define GLISTEN_TOGGLE_OFF 0x0002 // Return an event when the toggle turns off
-
-/*===========================================================================*/
-/* External declarations. */
-/*===========================================================================*/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
- /**
- * @brief Create a toggle input instance
- *
- * @param[in] instance The ID of the toggle input instance (from 0 to 9999)
- *
- * @return The source handle of the created instance
- */
- GSourceHandle ginputGetToggle(uint16_t instance);
-
- /**
- * @brief Can be used to invert the sense of a toggle
- *
- * @param[in] instance The ID of the toggle input instance
- * @param[in] invert If TRUE, will be inverted
- */
- void ginputInvertToggle(uint16_t instance, bool_t invert);
-
- /**
- * @brief Get the current toggle status
- *
- * @param[in] instance The ID of the toggle input instance
- * @param[in] ptoggle The toggle event struct
- *
- * @return Returns FALSE on an error (eg invalid instance)
- */
- bool_t ginputGetToggleStatus(uint16_t instance, GEventToggle *ptoggle);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GINPUT_NEED_TOGGLE */
-
-#endif /* _GINPUT_TOGGLE_H */
-/** @} */
-
|