Adafruit STMPE610 Arduino Library
Public Member Functions | List of all members
Adafruit_STMPE610 Class Reference

Class that stores state and functions for interacting with STMPE610. More...

#include <Adafruit_STMPE610.h>

Public Member Functions

 Adafruit_STMPE610 (uint8_t cspin, uint8_t mosipin, uint8_t misopin, uint8_t clkpin)
 Instantiates a new STMPE610 class using bitbang SPI. More...
 
 Adafruit_STMPE610 (uint8_t cspin, SPIClass *theSPI=&SPI)
 Instantiates a new STMPE610 using provided SPI. More...
 
 Adafruit_STMPE610 (TwoWire *theWire=&Wire)
 Instantiates a new STMPE610 using provided Wire. More...
 
boolean begin (uint8_t i2caddr=STMPE_ADDR)
 Setups the HW. More...
 
void writeRegister8 (uint8_t reg, uint8_t val)
 Writes 8 bit of data to specified register. More...
 
uint16_t readRegister16 (uint8_t reg)
 Reads 16 bits of data from specified register. More...
 
uint8_t readRegister8 (uint8_t reg)
 Reads 8bit of data from specified register. More...
 
void readData (uint16_t *x, uint16_t *y, uint8_t *z)
 Reads touchscreen data. More...
 
uint16_t getVersion ()
 Returns the STMPE610 version number. More...
 
boolean touched ()
 Returns true if touched, false otherwise. More...
 
boolean bufferEmpty ()
 Checks if buffer is empty. More...
 
uint8_t bufferSize ()
 Returns the FIFO buffer size. More...
 
TS_Point getPoint ()
 Returns point for touchscreen data. More...
 

Detailed Description

Class that stores state and functions for interacting with STMPE610.

Constructor & Destructor Documentation

◆ Adafruit_STMPE610() [1/3]

Adafruit_STMPE610::Adafruit_STMPE610 ( uint8_t  cspin,
uint8_t  mosipin,
uint8_t  misopin,
uint8_t  clkpin 
)

Instantiates a new STMPE610 class using bitbang SPI.

Parameters
cspinCS pin
mosipinMOSI pin
misopinMISO pin
clkpinCLK pin

◆ Adafruit_STMPE610() [2/3]

Adafruit_STMPE610::Adafruit_STMPE610 ( uint8_t  cspin,
SPIClass *  theSPI = &SPI 
)

Instantiates a new STMPE610 using provided SPI.

Parameters
cspinCS pin
*theSPIspi object

◆ Adafruit_STMPE610() [3/3]

Adafruit_STMPE610::Adafruit_STMPE610 ( TwoWire *  theWire = &Wire)

Instantiates a new STMPE610 using provided Wire.

Parameters
*theWirewire object

Member Function Documentation

◆ begin()

boolean Adafruit_STMPE610::begin ( uint8_t  i2caddr = STMPE_ADDR)

Setups the HW.

Parameters
i2caddrI2C address (defaults to STMPE_ADDR)
Returns
True if process is successful

◆ writeRegister8()

void Adafruit_STMPE610::writeRegister8 ( uint8_t  reg,
uint8_t  val 
)

Writes 8 bit of data to specified register.

Parameters
regThe register
valValue to write

◆ readRegister16()

uint16_t Adafruit_STMPE610::readRegister16 ( uint8_t  reg)

Reads 16 bits of data from specified register.

Parameters
regThe register
Returns
Data in the register

◆ readRegister8()

uint8_t Adafruit_STMPE610::readRegister8 ( uint8_t  reg)

Reads 8bit of data from specified register.

Parameters
regThe register
Returns
Data in the register

◆ readData()

void Adafruit_STMPE610::readData ( uint16_t *  x,
uint16_t *  y,
uint8_t *  z 
)

Reads touchscreen data.

Parameters
*xThe x coordinate
*yThe y coordinate
*zThe z coordinate

◆ getVersion()

uint16_t Adafruit_STMPE610::getVersion ( )

Returns the STMPE610 version number.

Returns
The STMPE610 version number

◆ touched()

boolean Adafruit_STMPE610::touched ( )

Returns true if touched, false otherwise.

Returns
True if if touched, false otherwise

◆ bufferEmpty()

boolean Adafruit_STMPE610::bufferEmpty ( )

Checks if buffer is empty.

Returns
True if empty, false otherwise

◆ bufferSize()

uint8_t Adafruit_STMPE610::bufferSize ( )

Returns the FIFO buffer size.

Returns
The FIFO buffer size

◆ getPoint()

TS_Point Adafruit_STMPE610::getPoint ( )

Returns point for touchscreen data.

Returns
The touch point using TS_Point

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