|
SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
@license MIT License More...
Go to the source code of this file.
Macros | |
| #define | TOUCH_SDA 8 |
| #define | TOUCH_SCL 48 |
| #define | TOUCH_IRQ 1 |
| #define | TOUCH_RST 1 |
Functions | |
| bool | i2c_wr_function (uint8_t addr, uint8_t reg, uint8_t *buf, size_t len, bool writeReg, bool isWrite) |
| i2c_wr_function | |
| uint32_t | hal_callback (SensorCommCustomHal::Operation op, void *param1, void *param2) |
| void | TouchDrvDigitalWrite (uint8_t gpio, uint8_t level) |
| uint8_t | TouchDrvDigitalRead (uint8_t gpio) |
| void | TouchDrvPinMode (uint8_t gpio, uint8_t mode) |
| bool | setupTouchDrv () |
| void | setup () |
| void | loop () |
Variables | |
| TouchDrvInterface * | touchDrv |
| IoExpanderXL9555 | expander |
| int16_t | x [5] |
| int16_t | y [5] |
| uint8_t | expander_io_tp_reset = 1 |
@license MIT License
Copyright (c) 2025 lewis he
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Definition in file custom_callback_touch.ino.
| #define TOUCH_IRQ 1 |
Definition at line 46 of file custom_callback_touch.ino.
| #define TOUCH_RST 1 |
Definition at line 50 of file custom_callback_touch.ino.
| #define TOUCH_SCL 48 |
Definition at line 42 of file custom_callback_touch.ino.
| #define TOUCH_SDA 8 |
Definition at line 38 of file custom_callback_touch.ino.
| uint32_t hal_callback | ( | SensorCommCustomHal::Operation | op, |
| void * | param1, | ||
| void * | param2 | ||
| ) |
Definition at line 104 of file custom_callback_touch.ino.
References level, SensorCommCustomHal::OP_DELAY, SensorCommCustomHal::OP_DELAYMICROSECONDS, SensorCommCustomHal::OP_DIGITALREAD, SensorCommCustomHal::OP_DIGITALWRITE, SensorCommCustomHal::OP_MILLIS, and SensorCommCustomHal::OP_PINMODE.
Referenced by setupTouchDrv().
| bool i2c_wr_function | ( | uint8_t | addr, |
| uint8_t | reg, | ||
| uint8_t * | buf, | ||
| size_t | len, | ||
| bool | writeReg, | ||
| bool | isWrite | ||
| ) |
i2c_wr_function
| addr | 7-Bit Device Address |
| reg | Register address, only needs to be written when writeReg is true |
| *buf | When isWrite is true, it represents the written buf, otherwise it is the read data buffer |
| len | When isWrite is true, it indicates the length of data written , otherwise it is the data read length |
| writeReg | writeReg is the register address that needs to be written, otherwise the register address is not written |
| isWrite | Data write and read direction, true means write, false means read |
| True | means the device is executed successfully, false means it fails |
Definition at line 74 of file custom_callback_touch.ino.
Referenced by setup(), and setupTouchDrv().
| void loop | ( | ) |
Definition at line 268 of file custom_callback_touch.ino.
References TouchPoints::getPoint(), TouchPoints::getPointCount(), TouchDrvInterface::getTouchPoints(), TouchPoints::hasPoints(), i, TouchDrvInterface::isPressed(), touchDrv, TouchPoint::x, and TouchPoint::y.
| void setup | ( | ) |
Definition at line 230 of file custom_callback_touch.ino.
References TouchDrvInterface::begin(), I2CDeviceNoHal::begin(), expander, i2c_wr_function(), setupTouchDrv(), TOUCH_SCL, and TOUCH_SDA.
| bool setupTouchDrv | ( | ) |
Definition at line 178 of file custom_callback_touch.ino.
References TouchDrvInterface::begin(), expander_io_tp_reset, TouchDrvInterface::getModelName(), hal_callback(), i2c_wr_function(), TouchDrvFT6X36::interruptPolling(), TouchDrvInterface::setGpioCallback(), TouchDrvInterface::setPins(), TOUCH_IRQ, touchDrv, TouchDrvDigitalRead(), TouchDrvDigitalWrite(), and TouchDrvPinMode().
Referenced by setup().
| uint8_t TouchDrvDigitalRead | ( | uint8_t | gpio | ) |
Definition at line 160 of file custom_callback_touch.ino.
References IoExpanderBase::digitalRead(), and expander.
Referenced by setupTouchDrv().
| void TouchDrvDigitalWrite | ( | uint8_t | gpio, |
| uint8_t | level | ||
| ) |
Definition at line 151 of file custom_callback_touch.ino.
References IoExpanderBase::digitalWrite(), expander, and level.
Referenced by setupTouchDrv().
| void TouchDrvPinMode | ( | uint8_t | gpio, |
| uint8_t | mode | ||
| ) |
Definition at line 169 of file custom_callback_touch.ino.
References expander, and IoExpanderBase::pinMode().
Referenced by setupTouchDrv().
| IoExpanderXL9555 expander |
Definition at line 56 of file custom_callback_touch.ino.
Referenced by setup(), TouchDrvDigitalRead(), TouchDrvDigitalWrite(), and TouchDrvPinMode().
| uint8_t expander_io_tp_reset = 1 |
Definition at line 61 of file custom_callback_touch.ino.
Referenced by setupTouchDrv().
| TouchDrvInterface* touchDrv |
Definition at line 54 of file custom_callback_touch.ino.
Referenced by loop(), and setupTouchDrv().
| int16_t x[5] |
Definition at line 58 of file custom_callback_touch.ino.
| int16_t y[5] |
Definition at line 58 of file custom_callback_touch.ino.