TouchScreenAdapter v0.5.0
TouchScreenAdapter is a library providing a unified touchscreen API.
Public Member Functions | List of all members
AdafruitFT6206TouchScreen Class Reference

Description

Concrete implementation of TouchScreenAdapter for Adafruit's FT6206 TouchScreen class.

Although the FT6206 reports X and Y as pixel coordinates, both axis are reversed! (ie higher numbers are up or left) So setDisplayWidth() and setDisplayHeight() are required if they are not the default 240(W) and 320(H) in order to reverse X & Y.

#include <AdafruitFT6206TouchScreen.h>

Inheritance diagram for AdafruitFT6206TouchScreen:
Inheritance graph
[legend]

Public Member Functions

 AdafruitFT6206TouchScreen (uint8_t thresh=FT62XX_DEFAULT_THRESHOLD, TwoWire *theWire=&Wire, uint8_t i2c_addr=FT62XX_DEFAULT_ADDR)
 Construct a new AdafruitFT6206TouchScreen Adapter. More...
 
bool begin (void)
 begin() Calls the FT6106 begin() method. More...
 
TouchScreenAdapter::TouchPoint getTouchPoint ()
 Get the Touch Point object. More...
 
TouchScreenAdapter::TouchPoint getTouchPointRaw ()
 Get the raw TouchPoint struct containing X/Y values directly from the underlyig library. More...
 
- Public Member Functions inherited from TouchScreenAdapter
void setDisplayWidth (uint16_t widthPx)
 Set the native (non-rotated) display width (X) in pixels. More...
 
void setDisplayHeight (uint16_t heightPx)
 Set the native (non-rotated) display height (Y) in pixels. More...
 
virtual TouchScreenAdapter::TouchPoint getTouchPoint (void)=0
 Get the TouchPoint object. More...
 
virtual TouchScreenAdapter::TouchPoint getTouchPointRaw (void)=0
 Get a TouchPoint struct containing raw values from the underlying library. More...
 
virtual bool begin (void)=0
 For compatibility with the Arduino library convention. More...
 
void setRotation (uint8_t r)
 Set the rotation touch screen. More...
 

Additional Inherited Members

- Protected Attributes inherited from TouchScreenAdapter
uint8_t rotation = 0
 The current rotation of the touch panel. Default is 0 (native orientation).
 
uint16_t DISPLAY_WIDTH = 240
 The non-rotated width of the display in pixels.
 
uint16_t DISPLAY_HEIGHT = 320
 The non-rotated height of the display in pixels.
 
uint16_t displayWidth = DISPLAY_WIDTH
 The (optionally rotated) width of the display in pixels.
 
uint16_t displayHeight = DISPLAY_HEIGHT
 The (optionally rotated) height of the display in pixels.
 

Constructor & Destructor Documentation

◆ AdafruitFT6206TouchScreen()

AdafruitFT6206TouchScreen::AdafruitFT6206TouchScreen ( uint8_t  thresh = FT62XX_DEFAULT_THRESHOLD,
TwoWire *  theWire = &Wire,
uint8_t  i2c_addr = FT62XX_DEFAULT_ADDR 
)
inline

Construct a new AdafruitFT6206TouchScreen Adapter.

When using this constructor you must setDisplayWidth() and setDisplayHeight() if they are not the default 240(W) and 320(H)

Parameters
threshThe touch threshold, defaults to FT62XX_DEFAULT_THRESHOLD
theWireThe required Wire library, defaults to the standard Wire.
i2c_addrThe I2C address, defaults to FT62XX_DEFAULT_ADDR

Member Function Documentation

◆ begin()

bool AdafruitFT6206TouchScreen::begin ( void  )
inlinevirtual

begin() Calls the FT6106 begin() method.

Returns
true Successfully initialised the Adafruit FT6206 driver
false Failed to initialise the Adafruit FT6206 driver

Implements TouchScreenAdapter.

◆ getTouchPoint()

TouchScreenAdapter::TouchPoint AdafruitFT6206TouchScreen::getTouchPoint ( void  )
inlinevirtual

Get the Touch Point object.

Returns
TouchScreenAdapter::TouchPoint

Implements TouchScreenAdapter.

◆ getTouchPointRaw()

TouchScreenAdapter::TouchPoint AdafruitFT6206TouchScreen::getTouchPointRaw ( void  )
inlinevirtual

Get the raw TouchPoint struct containing X/Y values directly from the underlyig library.

For the FT6206 this will result in the X and Y values being reversed! ie low values are botom/right and high values are top/left.

Returns
TouchScreenAdapter::TouchPoint

Implements TouchScreenAdapter.


The documentation for this class was generated from the following file: