SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
touch_interface.ino File Reference

@license MIT License More...

#include <TouchDrv.hpp>
#include <IoExpanderDrv.hpp>
#include <SensorWireHelper.h>
Include dependency graph for touch_interface.ino:

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

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

TouchDrvInterfacetouchDrv
 
IoExpanderXL9555 expander
 
int16_t x [5]
 
int16_t y [5]
 
uint8_t expander_io_tp_reset = 1
 

Detailed Description

@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.

Author
Lewis He (lewis.nosp@m.he@o.nosp@m.utloo.nosp@m.k.co.nosp@m.m)
Date
2025-01-20
Note
TouchDrvInterface_Example use LilyGo T-RGB,T-RGB has three types of screens, each of which uses different touch driver chips. The example demonstrates using the touch interface class and one sketch is suitable for three types of touch chips.

Definition in file touch_interface.ino.

Macro Definition Documentation

◆ TOUCH_IRQ

#define TOUCH_IRQ   1

Definition at line 44 of file touch_interface.ino.

◆ TOUCH_RST

#define TOUCH_RST   1

Definition at line 48 of file touch_interface.ino.

◆ TOUCH_SCL

#define TOUCH_SCL   48

Definition at line 40 of file touch_interface.ino.

◆ TOUCH_SDA

#define TOUCH_SDA   8

Definition at line 36 of file touch_interface.ino.

Function Documentation

◆ loop()

◆ setup()

◆ setupTouchDrv()

◆ TouchDrvDigitalRead()

uint8_t TouchDrvDigitalRead ( uint8_t  gpio)

Definition at line 70 of file touch_interface.ino.

References IoExpanderBase::digitalRead(), and expander.

Referenced by setupTouchDrv().

◆ TouchDrvDigitalWrite()

void TouchDrvDigitalWrite ( uint8_t  gpio,
uint8_t  level 
)

Definition at line 61 of file touch_interface.ino.

References IoExpanderBase::digitalWrite(), expander, and level.

Referenced by setupTouchDrv().

◆ TouchDrvPinMode()

void TouchDrvPinMode ( uint8_t  gpio,
uint8_t  mode 
)

Definition at line 79 of file touch_interface.ino.

References expander, and IoExpanderBase::pinMode().

Referenced by setupTouchDrv().

Variable Documentation

◆ expander

◆ expander_io_tp_reset

uint8_t expander_io_tp_reset = 1

Definition at line 59 of file touch_interface.ino.

Referenced by setupTouchDrv().

◆ touchDrv

TouchDrvInterface* touchDrv

Definition at line 52 of file touch_interface.ino.

Referenced by loop(), and setupTouchDrv().

◆ x

◆ y