Touch panel library for GR-PEACH LCD Shield.

Dependents:   GR-PEACH_LCD_shield_touch_sample LCD_shield_config

Committer:
dkato
Date:
Wed Jun 29 03:28:06 2016 +0000
Revision:
0:da3d7ba2674b
first commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dkato 0:da3d7ba2674b 1 /* mbed Microcontroller Library
dkato 0:da3d7ba2674b 2 * Copyright (C) 2016 Renesas Electronics Corporation. All rights reserved.
dkato 0:da3d7ba2674b 3 *
dkato 0:da3d7ba2674b 4 * Licensed under the Apache License, Version 2.0 (the "License");
dkato 0:da3d7ba2674b 5 * you may not use this file except in compliance with the License.
dkato 0:da3d7ba2674b 6 * You may obtain a copy of the License at
dkato 0:da3d7ba2674b 7 *
dkato 0:da3d7ba2674b 8 * http://www.apache.org/licenses/LICENSE-2.0
dkato 0:da3d7ba2674b 9 *
dkato 0:da3d7ba2674b 10 * Unless required by applicable law or agreed to in writing, software
dkato 0:da3d7ba2674b 11 * distributed under the License is distributed on an "AS IS" BASIS,
dkato 0:da3d7ba2674b 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
dkato 0:da3d7ba2674b 13 * See the License for the specific language governing permissions and
dkato 0:da3d7ba2674b 14 * limitations under the License.
dkato 0:da3d7ba2674b 15 */
dkato 0:da3d7ba2674b 16 /**************************************************************************//**
dkato 0:da3d7ba2674b 17 * @file TouchKey_7_1inch.h
dkato 0:da3d7ba2674b 18 * @brief TouchKey_7_1inch API
dkato 0:da3d7ba2674b 19 ******************************************************************************/
dkato 0:da3d7ba2674b 20
dkato 0:da3d7ba2674b 21 #ifndef TOUCH_KEY_7_1INCH_H
dkato 0:da3d7ba2674b 22 #define TOUCH_KEY_7_1INCH_H
dkato 0:da3d7ba2674b 23
dkato 0:da3d7ba2674b 24 #include "TouchKey.h"
dkato 0:da3d7ba2674b 25
dkato 0:da3d7ba2674b 26 /**
dkato 0:da3d7ba2674b 27 * The class to acquire touch coordinates. (GR-PEACH 7.1inch LCD Shield edition)
dkato 0:da3d7ba2674b 28 */
dkato 0:da3d7ba2674b 29 class TouchKey_7_1inch : public TouchKey {
dkato 0:da3d7ba2674b 30
dkato 0:da3d7ba2674b 31 public:
dkato 0:da3d7ba2674b 32
dkato 0:da3d7ba2674b 33 /** Create a TouchKey_7_1inch object
dkato 0:da3d7ba2674b 34 *
dkato 0:da3d7ba2674b 35 * @param sda I2C data line pin
dkato 0:da3d7ba2674b 36 * @param scl I2C clock line pin
dkato 0:da3d7ba2674b 37 * @param tprst tprst pin
dkato 0:da3d7ba2674b 38 * @param tpint tpint pin
dkato 0:da3d7ba2674b 39 */
dkato 0:da3d7ba2674b 40 TouchKey_7_1inch(PinName tprst, PinName tpint, PinName sda = I2C_SDA, PinName scl = I2C_SCL);
dkato 0:da3d7ba2674b 41
dkato 0:da3d7ba2674b 42 virtual int GetMaxTouchNum(void);
dkato 0:da3d7ba2674b 43 virtual int GetCoordinates(int touch_buff_num, touch_pos_t * p_touch);
dkato 0:da3d7ba2674b 44
dkato 0:da3d7ba2674b 45 private:
dkato 0:da3d7ba2674b 46 typedef struct {
dkato 0:da3d7ba2674b 47 uint8_t y_h: 3,
dkato 0:da3d7ba2674b 48 reserved: 1,
dkato 0:da3d7ba2674b 49 x_h: 3,
dkato 0:da3d7ba2674b 50 valid: 1;
dkato 0:da3d7ba2674b 51 uint8_t x_l;
dkato 0:da3d7ba2674b 52 uint8_t y_l;
dkato 0:da3d7ba2674b 53 uint8_t z;
dkato 0:da3d7ba2674b 54 } xyz_data_t;
dkato 0:da3d7ba2674b 55
dkato 0:da3d7ba2674b 56 typedef struct {
dkato 0:da3d7ba2674b 57 uint8_t fingers: 4,
dkato 0:da3d7ba2674b 58 reserved: 4;
dkato 0:da3d7ba2674b 59 uint8_t keys;
dkato 0:da3d7ba2674b 60 xyz_data_t xyz_data[2];
dkato 0:da3d7ba2674b 61 } stx_report_data_t;
dkato 0:da3d7ba2674b 62
dkato 0:da3d7ba2674b 63 I2C i2c;
dkato 0:da3d7ba2674b 64 };
dkato 0:da3d7ba2674b 65
dkato 0:da3d7ba2674b 66
dkato 0:da3d7ba2674b 67 #endif