ginput doxygen

This commit is contained in:
Joel Bodenmann 2012-12-18 20:06:10 +01:00
parent 9c738e00fa
commit e1de308dfa
7 changed files with 101 additions and 49 deletions

View File

@ -1,26 +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/>.
*/
/**
* @addtogroup TOUCHSCREEN
* @details The TOUCHSCREEN module provides high level abstraction to interface
* touchscreens.
*/

View File

@ -38,6 +38,8 @@
#include "ginput_lld_mouse_board.h"
#elif defined(BOARD_FIREBULL_STM32_F103)
#include "ginput_lld_mouse_board_firebull_stm32f103.h"
#elif defined(BOARD_OLIMEX_STM32_E407)
#include "ginput_lld_mouse_board_olimex_stm32_e407.h"
#else
#include "ginput_lld_mouse_board_example.h"
#endif

View File

@ -80,3 +80,4 @@
*/
#endif /* _GFXCONF_H */

View File

@ -50,15 +50,58 @@ typedef struct GEventDial_t {
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)
/**
* @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);

View File

@ -108,11 +108,22 @@ typedef struct GEventKeyboard_t {
extern "C" {
#endif
/* Keyboard Functions */
GSourceHandle ginputGetKeyboard(uint16_t instance); // Instance = 0 to n-1
/**
* @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);
/* Get the current keyboard button status.
* Returns FALSE on error (eg invalid 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);
@ -124,3 +135,4 @@ extern "C" {
#endif /* _GINPUT_KEYBOARD_H */
/** @} */

View File

@ -89,7 +89,7 @@ extern "C" {
* @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 instance ID, from 0 to 9999
* @param[in] instance The ID of the mouse input instance (from 0 to 9999)
*
* @return The source handle of the created instance
*/
@ -100,7 +100,7 @@ extern "C" {
* @note Unlinke a listener event, this status cannot record meta events such as
* "CLICK".
*
* @param[in] instance The instance
* @param[in] instance The ID of the mouse input instance
* @param[in] pmouse The mouse event
*
* @return FALSE on an error (eg. invalid instance)
@ -110,7 +110,7 @@ extern "C" {
/**
* @brief Performs a calibration
*
* @param[in] instance The instance to be calibrated
* @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
*/
@ -134,7 +134,7 @@ extern "C" {
* 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 instance
* @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
@ -145,7 +145,7 @@ extern "C" {
* @brief Test if a particular mouse/touch instance requires routines to save it's alibration data
* @note Not implemented yet
*
* @param[in] instance The instance
* @param[in] instance The ID of the mouse input instance
*
* @return TRUE if needed
*/
@ -159,3 +159,4 @@ extern "C" {
#endif /* _GINPUT_MOUSE_H */
/** @} */

View File

@ -65,12 +65,30 @@ typedef struct GEventToggle_t {
extern "C" {
#endif
/* Hardware Toggle/Switch/Button Functions */
GSourceHandle ginputGetToggle(uint16_t instance); // Instance = 0 to n-1
void ginputInvertToggle(uint16_t instance, bool_t invert); // If invert is true, invert the on/off sense for the toggle
/**
* @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);
/* Get the current toggle status.
* Returns FALSE on error (eg invalid 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);
@ -82,3 +100,4 @@ extern "C" {
#endif /* _GINPUT_TOGGLE_H */
/** @} */