Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: GR-PEACH_LCD_shield_touch_sample LCD_shield_config
Diff: TouchKey_4_3inch.h
- Revision:
- 0:da3d7ba2674b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/TouchKey_4_3inch.h Wed Jun 29 03:28:06 2016 +0000
@@ -0,0 +1,67 @@
+/* mbed Microcontroller Library
+ * Copyright (C) 2016 Renesas Electronics Corporation. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**************************************************************************//**
+* @file TouchKey_4_3inch.h
+* @brief TouchKey_4_3inch API
+******************************************************************************/
+
+#ifndef TOUCH_KEY_4_3INCH_H
+#define TOUCH_KEY_4_3INCH_H
+
+#include "TouchKey.h"
+
+/**
+ * The class to acquire touch coordinates. (GR-PEACH 4.3inch LCD Shield edition)
+ */
+class TouchKey_4_3inch : public TouchKey {
+
+public:
+
+ /** Create a TouchKey_4_3inch object
+ *
+ * @param tprst tprst pin
+ * @param tpint tpint pin
+ * @param sda I2C data line pin
+ * @param scl I2C clock line pin
+ */
+ TouchKey_4_3inch(PinName tprst, PinName tpint, PinName sda = I2C_SDA, PinName scl = I2C_SCL);
+ virtual int GetMaxTouchNum(void);
+ virtual int GetCoordinates(int touch_buff_num, touch_pos_t * p_touch);
+
+private:
+ typedef struct {
+ uint8_t y_h: 3,
+ reserved: 1,
+ x_h: 3,
+ valid: 1;
+ uint8_t x_l;
+ uint8_t y_l;
+ } xyz_data_t;
+
+ typedef struct {
+ uint8_t fingers: 3,
+ reserved: 5;
+ uint8_t keys;
+ xyz_data_t xyz_data[2];
+ } stx_report_data_t;
+
+ I2C i2c;
+};
+
+#endif
+
+
+