ugfx/include/touchpad.h

101 lines
2.7 KiB
C
Raw Normal View History

2012-08-13 02:12:42 +00:00
/*
2012-09-26 18:18:18 +00:00
ChibiOS/GFX - Copyright (C) 2012
2012-08-13 02:12:42 +00:00
Joel Bodenmann aka Tectu <joel@unormal.org>
This file is part of ChibiOS/GFX.
2012-08-13 02:12:42 +00:00
ChibiOS/GFX is free software; you can redistribute it and/or modify
2012-08-13 02:12:42 +00:00
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,
2012-08-13 02:12:42 +00:00
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/>.
*/
/**
2012-11-03 01:56:59 +00:00
* @file include/touchpad.h
2012-08-13 02:12:42 +00:00
* @brief TOUCHPAD Touchpad Driver subsystem header file.
*
2012-11-02 19:26:06 +00:00
* @addtogroup TOUCHPAD
2012-08-13 02:12:42 +00:00
* @{
*/
2012-11-03 01:56:59 +00:00
2012-08-13 02:12:42 +00:00
#ifndef _TOUCHPAD_H
#define _TOUCHPAD_H
2012-10-20 23:47:11 +00:00
#if GFX_USE_TOUCHPAD || defined(__DOXYGEN__)
2012-08-13 02:12:42 +00:00
/**
* @brief specifies how many conversions are made for a readout.
*
* @note higher is more accurate, but takes more time
*/
#define CONVERSIONS 3
/*===========================================================================*/
/* Driver constants. */
/*===========================================================================*/
/*===========================================================================*/
/* Low Level Driver details and error checks. */
/*===========================================================================*/
/* Include the low level driver information */
#include "touchpad_lld.h"
/* For definitions of coord_t, we require gdisp.h */
#include "gdisp.h"
2012-08-13 02:12:42 +00:00
/*===========================================================================*/
/* Type definitions */
/*===========================================================================*/
/**
* @brief Struct used for calibration
*/
2012-10-10 11:46:18 +00:00
typedef struct cal_t {
float ax;
float bx;
float cx;
float ay;
float by;
float cy;
2012-10-10 11:46:18 +00:00
} cal_t;
2012-08-13 02:12:42 +00:00
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
#ifdef __cplusplus
extern "C" {
#endif
void tpInit(const TOUCHPADDriver *tp);
coord_t tpReadX(void);
coord_t tpReadY(void);
2012-09-07 20:57:35 +00:00
void tpCalibrate(void);
2012-08-13 02:12:42 +00:00
#if TOUCHPAD_HAS_IRQ
bool_t tpIRQ(void);
2012-08-13 02:12:42 +00:00
#endif
#if TOUCHPAD_HAS_PRESSURE
uint16_t tpReadZ(void);
#endif
#ifdef __cplusplus
}
#endif
2012-10-20 23:47:11 +00:00
#endif /* GFX_USE_TOUCHPAD */
2012-08-13 02:12:42 +00:00
#endif /* _TOUCHPAD_H */
/** @} */