[457] | 1 | /*
|
---|
| 2 | * TOPPERS BASE PLATFORM MIDDLEWARE
|
---|
| 3 | *
|
---|
| 4 | * Copyright (C) 2017-2018 by TOPPERS PROJECT
|
---|
| 5 | * Educational Working Group.
|
---|
| 6 | *
|
---|
| 7 | * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
|
---|
| 8 | * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改
|
---|
| 9 | * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する.
|
---|
| 10 | * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
|
---|
| 11 | * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
|
---|
| 12 | * スコード中に含まれていること.
|
---|
| 13 | * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
|
---|
| 14 | * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用
|
---|
| 15 | * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記
|
---|
| 16 | * の無保証規定を掲載すること.
|
---|
| 17 | * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
|
---|
| 18 | * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ
|
---|
| 19 | * と.
|
---|
| 20 | * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
|
---|
| 21 | * 作権表示,この利用条件および下記の無保証規定を掲載すること.
|
---|
| 22 | * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
|
---|
| 23 | * 報告すること.
|
---|
| 24 | * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
|
---|
| 25 | * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
|
---|
| 26 | * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理
|
---|
| 27 | * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを
|
---|
| 28 | * 免責すること.
|
---|
| 29 | *
|
---|
| 30 | * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お
|
---|
| 31 | * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的
|
---|
| 32 | * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ
|
---|
| 33 | * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ
|
---|
| 34 | * の責任を負わない.
|
---|
| 35 | *
|
---|
| 36 | * @(#) $Id$
|
---|
| 37 | */
|
---|
| 38 | /**
|
---|
| 39 | ******************************************************************************
|
---|
| 40 | * @attention
|
---|
| 41 | *
|
---|
| 42 | * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
|
---|
| 43 | *
|
---|
| 44 | * Redistribution and use in source and binary forms, with or without modification,
|
---|
| 45 | * are permitted provided that the following conditions are met:
|
---|
| 46 | * 1. Redistributions of source code must retain the above copyright notice,
|
---|
| 47 | * this list of conditions and the following disclaimer.
|
---|
| 48 | * 2. Redistributions in binary form must reproduce the above copyright notice,
|
---|
| 49 | * this list of conditions and the following disclaimer in the documentation
|
---|
| 50 | * and/or other materials provided with the distribution.
|
---|
| 51 | * 3. Neither the name of STMicroelectronics nor the names of its contributors
|
---|
| 52 | * may be used to endorse or promote products derived from this software
|
---|
| 53 | * without specific prior written permission.
|
---|
| 54 | *
|
---|
| 55 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
---|
| 56 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
---|
| 57 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
---|
| 58 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
---|
| 59 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
---|
| 60 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
---|
| 61 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
---|
| 62 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
---|
| 63 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
---|
| 64 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
| 65 | *
|
---|
| 66 | ******************************************************************************
|
---|
| 67 | */
|
---|
| 68 |
|
---|
| 69 | #ifndef _STTS_FT06X06_H_
|
---|
| 70 | #define _STTS_FT06X06_H_
|
---|
| 71 |
|
---|
| 72 | #include <kernel.h>
|
---|
| 73 | #include <t_syslog.h>
|
---|
| 74 | #include <t_stdlib.h>
|
---|
| 75 | #include "device.h"
|
---|
| 76 | #include "i2c.h"
|
---|
| 77 |
|
---|
| 78 | #ifdef __cplusplus
|
---|
| 79 | extern "C" {
|
---|
| 80 | #endif
|
---|
| 81 |
|
---|
| 82 | /* Set Multi-touch as non supported */
|
---|
| 83 | #ifndef TS_MULTI_TOUCH_SUPPORTED
|
---|
| 84 | #define TS_MULTI_TOUCH_SUPPORTED 0
|
---|
| 85 | #endif
|
---|
| 86 |
|
---|
| 87 | /* Set Auto-calibration as non supported */
|
---|
| 88 | #ifndef TS_AUTO_CALIBRATION_SUPPORTED
|
---|
| 89 | #define TS_AUTO_CALIBRATION_SUPPORTED 0
|
---|
| 90 | #endif
|
---|
| 91 |
|
---|
| 92 | /* Maximum border values of the touchscreen pad */
|
---|
| 93 | #define FT_6206_MAX_WIDTH ((uint16_t)800) /* Touchscreen pad max width */
|
---|
| 94 | #define FT_6206_MAX_HEIGHT ((uint16_t)480) /* Touchscreen pad max height */
|
---|
| 95 |
|
---|
| 96 | /* Touchscreen pad max width and height values for FT6x36 Touch*/
|
---|
| 97 | #define FT_6206_MAX_WIDTH_HEIGHT ((uint16_t)240)
|
---|
| 98 |
|
---|
| 99 | /* Max detectable simultaneous touches */
|
---|
| 100 | #define FT6206_MAX_DETECTABLE_TOUCH 2
|
---|
| 101 |
|
---|
| 102 | /**
|
---|
| 103 | * @brief : Definitions for FT6206 I2C register addresses on 8 bit
|
---|
| 104 | **/
|
---|
| 105 |
|
---|
| 106 | /* Current mode register of the FT6206 (R/W) */
|
---|
| 107 | #define FT6206_DEV_MODE_REG 0x00
|
---|
| 108 |
|
---|
| 109 | /* Possible values of FT6206_DEV_MODE_REG */
|
---|
| 110 | #define FT6206_DEV_MODE_WORKING 0x00
|
---|
| 111 | #define FT6206_DEV_MODE_FACTORY 0x04
|
---|
| 112 |
|
---|
| 113 | #define FT6206_DEV_MODE_MASK 0x7
|
---|
| 114 | #define FT6206_DEV_MODE_SHIFT 4
|
---|
| 115 |
|
---|
| 116 | /* Gesture ID register */
|
---|
| 117 | #define FT6206_GEST_ID_REG 0x01
|
---|
| 118 |
|
---|
| 119 | /* Possible values of FT6206_GEST_ID_REG */
|
---|
| 120 | #define FT6206_GEST_ID_NO_GESTURE 0x00
|
---|
| 121 | #define FT6206_GEST_ID_MOVE_UP 0x10
|
---|
| 122 | #define FT6206_GEST_ID_MOVE_RIGHT 0x14
|
---|
| 123 | #define FT6206_GEST_ID_MOVE_DOWN 0x18
|
---|
| 124 | #define FT6206_GEST_ID_MOVE_LEFT 0x1C
|
---|
| 125 | #define FT6206_GEST_ID_ZOOM_IN 0x48
|
---|
| 126 | #define FT6206_GEST_ID_ZOOM_OUT 0x49
|
---|
| 127 |
|
---|
| 128 | /* Touch Data Status register : gives number of active touch points (0..2) */
|
---|
| 129 | #define FT6206_TD_STAT_REG 0x02
|
---|
| 130 |
|
---|
| 131 | /* Values related to FT6206_TD_STAT_REG */
|
---|
| 132 | #define FT6206_TD_STAT_MASK 0x0F
|
---|
| 133 | #define FT6206_TD_STAT_SHIFT 0x00
|
---|
| 134 |
|
---|
| 135 | /* Values Pn_XH and Pn_YH related */
|
---|
| 136 | #define FT6206_TOUCH_EVT_FLAG_PRESS_DOWN 0x00
|
---|
| 137 | #define FT6206_TOUCH_EVT_FLAG_LIFT_UP 0x01
|
---|
| 138 | #define FT6206_TOUCH_EVT_FLAG_CONTACT 0x02
|
---|
| 139 | #define FT6206_TOUCH_EVT_FLAG_NO_EVENT 0x03
|
---|
| 140 |
|
---|
| 141 | #define FT6206_TOUCH_EVT_FLAG_SHIFT 6
|
---|
| 142 | #define FT6206_TOUCH_EVT_FLAG_MASK (3 << FT6206_TOUCH_EVT_FLAG_SHIFT)
|
---|
| 143 |
|
---|
| 144 | #define FT6206_MSB_MASK 0x0F
|
---|
| 145 | #define FT6206_MSB_SHIFT 0
|
---|
| 146 |
|
---|
| 147 | /* Values Pn_XL and Pn_YL related */
|
---|
| 148 | #define FT6206_LSB_MASK 0xFF
|
---|
| 149 | #define FT6206_LSB_SHIFT 0
|
---|
| 150 |
|
---|
| 151 | #define FT6206_P1_XH_REG 0x03
|
---|
| 152 | #define FT6206_P1_XL_REG 0x04
|
---|
| 153 | #define FT6206_P1_YH_REG 0x05
|
---|
| 154 | #define FT6206_P1_YL_REG 0x06
|
---|
| 155 |
|
---|
| 156 | /* Touch Pressure register value (R) */
|
---|
| 157 | #define FT6206_P1_WEIGHT_REG 0x07
|
---|
| 158 |
|
---|
| 159 | /* Values Pn_WEIGHT related */
|
---|
| 160 | #define FT6206_TOUCH_WEIGHT_MASK 0xFF
|
---|
| 161 | #define FT6206_TOUCH_WEIGHT_SHIFT 0
|
---|
| 162 |
|
---|
| 163 | /* Touch area register */
|
---|
| 164 | #define FT6206_P1_MISC_REG 0x08
|
---|
| 165 |
|
---|
| 166 | /* Values related to FT6206_Pn_MISC_REG */
|
---|
| 167 | #define FT6206_TOUCH_AREA_MASK (0x04 << 4)
|
---|
| 168 | #define FT6206_TOUCH_AREA_SHIFT 0x04
|
---|
| 169 |
|
---|
| 170 | #define FT6206_P2_XH_REG 0x09
|
---|
| 171 | #define FT6206_P2_XL_REG 0x0A
|
---|
| 172 | #define FT6206_P2_YH_REG 0x0B
|
---|
| 173 | #define FT6206_P2_YL_REG 0x0C
|
---|
| 174 | #define FT6206_P2_WEIGHT_REG 0x0D
|
---|
| 175 | #define FT6206_P2_MISC_REG 0x0E
|
---|
| 176 |
|
---|
| 177 | /* Threshold for touch detection */
|
---|
| 178 | #define FT6206_TH_GROUP_REG 0x80
|
---|
| 179 |
|
---|
| 180 | /* Values FT6206_TH_GROUP_REG : threshold related */
|
---|
| 181 | #define FT6206_THRESHOLD_MASK 0xFF
|
---|
| 182 | #define FT6206_THRESHOLD_SHIFT 0
|
---|
| 183 |
|
---|
| 184 | /* Filter function coefficients */
|
---|
| 185 | #define FT6206_TH_DIFF_REG 0x85
|
---|
| 186 |
|
---|
| 187 | /* Control register */
|
---|
| 188 | #define FT6206_CTRL_REG 0x86
|
---|
| 189 |
|
---|
| 190 | /* Values related to FT6206_CTRL_REG */
|
---|
| 191 |
|
---|
| 192 | /* Will keep the Active mode when there is no touching */
|
---|
| 193 | #define FT6206_CTRL_KEEP_ACTIVE_MODE 0x00
|
---|
| 194 |
|
---|
| 195 | /* Switching from Active mode to Monitor mode automatically when there is no touching */
|
---|
| 196 | #define FT6206_CTRL_KEEP_AUTO_SWITCH_MONITOR_MODE 0x01
|
---|
| 197 |
|
---|
| 198 | /* The time period of switching from Active mode to Monitor mode when there is no touching */
|
---|
| 199 | #define FT6206_TIMEENTERMONITOR_REG 0x87
|
---|
| 200 |
|
---|
| 201 | /* Report rate in Active mode */
|
---|
| 202 | #define FT6206_PERIODACTIVE_REG 0x88
|
---|
| 203 |
|
---|
| 204 | /* Report rate in Monitor mode */
|
---|
| 205 | #define FT6206_PERIODMONITOR_REG 0x89
|
---|
| 206 |
|
---|
| 207 | /* The value of the minimum allowed angle while Rotating gesture mode */
|
---|
| 208 | #define FT6206_RADIAN_VALUE_REG 0x91
|
---|
| 209 |
|
---|
| 210 | /* Maximum offset while Moving Left and Moving Right gesture */
|
---|
| 211 | #define FT6206_OFFSET_LEFT_RIGHT_REG 0x92
|
---|
| 212 |
|
---|
| 213 | /* Maximum offset while Moving Up and Moving Down gesture */
|
---|
| 214 | #define FT6206_OFFSET_UP_DOWN_REG 0x93
|
---|
| 215 |
|
---|
| 216 | /* Minimum distance while Moving Left and Moving Right gesture */
|
---|
| 217 | #define FT6206_DISTANCE_LEFT_RIGHT_REG 0x94
|
---|
| 218 |
|
---|
| 219 | /* Minimum distance while Moving Up and Moving Down gesture */
|
---|
| 220 | #define FT6206_DISTANCE_UP_DOWN_REG 0x95
|
---|
| 221 |
|
---|
| 222 | /* Maximum distance while Zoom In and Zoom Out gesture */
|
---|
| 223 | #define FT6206_DISTANCE_ZOOM_REG 0x96
|
---|
| 224 |
|
---|
| 225 | /* High 8-bit of LIB Version info */
|
---|
| 226 | #define FT6206_LIB_VER_H_REG 0xA1
|
---|
| 227 |
|
---|
| 228 | /* Low 8-bit of LIB Version info */
|
---|
| 229 | #define FT6206_LIB_VER_L_REG 0xA2
|
---|
| 230 |
|
---|
| 231 | /* Chip Selecting */
|
---|
| 232 | #define FT6206_CIPHER_REG 0xA3
|
---|
| 233 |
|
---|
| 234 | /* Interrupt mode register (used when in interrupt mode) */
|
---|
| 235 | #define FT6206_GMODE_REG 0xA4
|
---|
| 236 |
|
---|
| 237 | #define FT6206_G_MODE_INTERRUPT_MASK 0x03
|
---|
| 238 | #define FT6206_G_MODE_INTERRUPT_SHIFT 0x00
|
---|
| 239 |
|
---|
| 240 | /* Possible values of FT6206_GMODE_REG */
|
---|
| 241 | #define FT6206_G_MODE_INTERRUPT_POLLING 0x00
|
---|
| 242 | #define FT6206_G_MODE_INTERRUPT_TRIGGER 0x01
|
---|
| 243 |
|
---|
| 244 | /* Current power mode the FT6206 system is in (R) */
|
---|
| 245 | #define FT6206_PWR_MODE_REG 0xA5
|
---|
| 246 |
|
---|
| 247 | /* FT6206 firmware version */
|
---|
| 248 | #define FT6206_FIRMID_REG 0xA6
|
---|
| 249 |
|
---|
| 250 | /* FT6206 Chip identification register */
|
---|
| 251 | #define FT6206_CHIP_ID_REG 0xA8
|
---|
| 252 |
|
---|
| 253 | /* Possible values of FT6206_CHIP_ID_REG */
|
---|
| 254 | #define FT6206_ID_VALUE 0x11
|
---|
| 255 | #define FT6x36_ID_VALUE 0xCD
|
---|
| 256 |
|
---|
| 257 | /* Release code version */
|
---|
| 258 | #define FT6206_RELEASE_CODE_ID_REG 0xAF
|
---|
| 259 |
|
---|
| 260 | /* Current operating mode the FT6206 system is in (R) */
|
---|
| 261 | #define FT6206_STATE_REG 0xBC
|
---|
| 262 |
|
---|
| 263 | typedef struct _TouchScreen_PortControlBlock{
|
---|
| 264 | uint32_t reset_clk_base;
|
---|
| 265 | uint32_t reset_clk_bit;
|
---|
| 266 | uint32_t reset_gpio_base;
|
---|
| 267 | uint32_t reset_gpio_pinno;
|
---|
| 268 | uint32_t reset_gpio_mode;
|
---|
| 269 | uint32_t reset_gpio_otype;
|
---|
| 270 | uint32_t reset_gpio_pull;
|
---|
| 271 | uint32_t reset_gpio_speed;
|
---|
| 272 | uint32_t reset_gpio_release;
|
---|
| 273 |
|
---|
| 274 | uint32_t int_clk_base;
|
---|
| 275 | uint32_t int_clk_bit;
|
---|
| 276 | uint32_t int_gpio_base;
|
---|
| 277 | uint32_t int_gpio_pinno;
|
---|
| 278 | uint32_t int_gpio_mode;
|
---|
| 279 | uint32_t int_gpio_pull;
|
---|
| 280 | uint32_t int_gpio_speed;
|
---|
| 281 | } TS_PortControlBlock;
|
---|
| 282 |
|
---|
| 283 | /** @typedef TouchScreen_Handle_t
|
---|
| 284 | * TouchScreen Handle definition.
|
---|
| 285 | */
|
---|
| 286 | typedef struct
|
---|
| 287 | {
|
---|
| 288 | I2C_Handle_t *hi2c;
|
---|
| 289 | const TS_PortControlBlock *pcb;
|
---|
| 290 | void (*ifunc)(void);
|
---|
| 291 | uint8_t initialized;
|
---|
| 292 | uint8_t enable_it;
|
---|
| 293 | uint16_t max_width;
|
---|
| 294 | uint16_t max_height;
|
---|
| 295 | uint8_t I2C_Address;
|
---|
| 296 | uint8_t tsOrientation;
|
---|
| 297 |
|
---|
| 298 | /* field holding the current number of simultaneous active touches */
|
---|
| 299 | uint8_t currActiveTouchNb;
|
---|
| 300 |
|
---|
| 301 | /* field holding the touch index currently managed */
|
---|
| 302 | uint8_t currActiveTouchIdx;
|
---|
| 303 | } TouchScreen_Handle_t;
|
---|
| 304 |
|
---|
| 305 |
|
---|
| 306 |
|
---|
| 307 | /**** NEW FEATURES enabled when Multi-touch support is enabled ****/
|
---|
| 308 |
|
---|
| 309 | /** @brief With FT6206 : maximum 2 touches detected simultaneously
|
---|
| 310 | */
|
---|
| 311 | #define TS_MAX_NB_TOUCH ((uint32_t) FT6206_MAX_DETECTABLE_TOUCH)
|
---|
| 312 |
|
---|
| 313 | #define TS_SWAP_NONE ((uint8_t) 0x01)
|
---|
| 314 | #define TS_SWAP_X ((uint8_t) 0x02)
|
---|
| 315 | #define TS_SWAP_Y ((uint8_t) 0x04)
|
---|
| 316 | #define TS_SWAP_XY ((uint8_t) 0x08)
|
---|
| 317 |
|
---|
| 318 | #define TS_ORIENTATION_PORTRAIT ((uint8_t) 0x00)
|
---|
| 319 | #define TS_ORIENTATION_LANDSCAPE ((uint8_t) 0x01)
|
---|
| 320 | #define TS_ORIENTATION_LANDSCAPE_ROT180 ((uint8_t) 0x02)
|
---|
| 321 |
|
---|
| 322 | /**
|
---|
| 323 | * @brief TS_StateTypeDef
|
---|
| 324 | * Define TS State structure
|
---|
| 325 | */
|
---|
| 326 | typedef struct
|
---|
| 327 | {
|
---|
| 328 | uint8_t touchDetected; /* Total number of active touches detected at last scan */
|
---|
| 329 | uint16_t touchX[TS_MAX_NB_TOUCH]; /* Touch X[0], X[1] coordinates on 12 bits */
|
---|
| 330 | uint16_t touchY[TS_MAX_NB_TOUCH]; /* Touch Y[0], Y[1] coordinates on 12 bits */
|
---|
| 331 |
|
---|
| 332 | #if (TS_MULTI_TOUCH_SUPPORTED == 1)
|
---|
| 333 | uint8_t touchWeight[TS_MAX_NB_TOUCH]; /* Touch_Weight[0], Touch_Weight[1] : weight property of touches */
|
---|
| 334 | uint8_t touchEventId[TS_MAX_NB_TOUCH]; /* Touch_EventId[0], Touch_EventId[1] : take value of type @ref TS_TouchEventTypeDef */
|
---|
| 335 | uint8_t touchArea[TS_MAX_NB_TOUCH]; /* Touch_Area[0], Touch_Area[1] : touch area of each touch */
|
---|
| 336 | uint32_t gestureId; /*!< type of gesture detected : take value of type @ref TS_GestureIdTypeDef */
|
---|
| 337 | #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
|
---|
| 338 | } TS_StateTypeDef;
|
---|
| 339 |
|
---|
| 340 | /**
|
---|
| 341 | * @brief TS_GestureIdTypeDef
|
---|
| 342 | * Define Possible managed gesture identification values returned by touch screen
|
---|
| 343 | * driver.
|
---|
| 344 | */
|
---|
| 345 | typedef enum
|
---|
| 346 | {
|
---|
| 347 | GEST_ID_NO_GESTURE = 0x00, /*!< Gesture not defined / recognized */
|
---|
| 348 | GEST_ID_MOVE_UP = 0x01, /*!< Gesture Move Up */
|
---|
| 349 | GEST_ID_MOVE_RIGHT = 0x02, /*!< Gesture Move Right */
|
---|
| 350 | GEST_ID_MOVE_DOWN = 0x03, /*!< Gesture Move Down */
|
---|
| 351 | GEST_ID_MOVE_LEFT = 0x04, /*!< Gesture Move Left */
|
---|
| 352 | GEST_ID_ZOOM_IN = 0x05, /*!< Gesture Zoom In */
|
---|
| 353 | GEST_ID_ZOOM_OUT = 0x06, /*!< Gesture Zoom Out */
|
---|
| 354 | GEST_ID_NB_MAX = 0x07 /*!< max number of gesture id */
|
---|
| 355 | } TS_GestureIdTypeDef;
|
---|
| 356 |
|
---|
| 357 | /**
|
---|
| 358 | * @brief TS_TouchEventTypeDef
|
---|
| 359 | * Define Possible touch events kind as returned values
|
---|
| 360 | * by touch screen IC Driver.
|
---|
| 361 | */
|
---|
| 362 | typedef enum
|
---|
| 363 | {
|
---|
| 364 | TOUCH_EVENT_NO_EVT = 0x00, /*!< Touch Event : undetermined */
|
---|
| 365 | TOUCH_EVENT_PRESS_DOWN = 0x01, /*!< Touch Event Press Down */
|
---|
| 366 | TOUCH_EVENT_LIFT_UP = 0x02, /*!< Touch Event Lift Up */
|
---|
| 367 | TOUCH_EVENT_CONTACT = 0x03, /*!< Touch Event Contact */
|
---|
| 368 | TOUCH_EVENT_NB_MAX = 0x04 /*!< max number of touch events kind */
|
---|
| 369 | } TS_TouchEventTypeDef;
|
---|
| 370 |
|
---|
| 371 | /**
|
---|
| 372 | * @brief Table for touchscreen event information display on LCD :
|
---|
| 373 | * table indexed on enum @ref TS_TouchEventTypeDef information
|
---|
| 374 | */
|
---|
| 375 | extern char * ts_event_string_tab[TOUCH_EVENT_NB_MAX];
|
---|
| 376 |
|
---|
| 377 | /**
|
---|
| 378 | * @brief Table for touchscreen gesture Id information display on LCD : table indexed
|
---|
| 379 | * on enum @ref TS_GestureIdTypeDef information
|
---|
| 380 | */
|
---|
| 381 | extern char * ts_gesture_id_string_tab[GEST_ID_NB_MAX];
|
---|
| 382 |
|
---|
| 383 | extern ER touchscreen_init(TouchScreen_Handle_t *hts, uint16_t ts_SizeX, uint16_t ts_SizeY, uint8_t orientation);
|
---|
| 384 | extern ER touchscreen_getstate(TouchScreen_Handle_t *hts, TS_StateTypeDef *TS_State);
|
---|
| 385 | extern ER touchscreen_enable_it(TouchScreen_Handle_t *hts);
|
---|
| 386 | extern ER touchscreen_disable_it(TouchScreen_Handle_t *hts);
|
---|
| 387 |
|
---|
| 388 | #if (TS_MULTI_TOUCH_SUPPORTED == 1)
|
---|
| 389 | extern ER touchscreen_get_gestureid(TouchScreen_Handle_t *hts, TS_StateTypeDef *TS_State);
|
---|
| 390 | extern ER touchscreen_reset_data(TS_StateTypeDef *TS_State);
|
---|
| 391 | #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
|
---|
| 392 |
|
---|
| 393 |
|
---|
| 394 |
|
---|
| 395 | #ifdef __cplusplus
|
---|
| 396 | }
|
---|
| 397 | #endif
|
---|
| 398 |
|
---|
| 399 | #endif /* _STTS_FT06X06_H_ */
|
---|
| 400 |
|
---|