modm API documentation
modm::touch2046< SpiMaster, Cs > Class Template Reference

#include <modm/driver/touch/touch2046.hpp>

Inheritance diagram for modm::touch2046< SpiMaster, Cs >:
modm::SpiDevice< SpiMaster > modm::NestedResumable< 3 >

Classes

struct  Calibration
 

Public Types

enum  Orientation { Normal }
 

Public Member Functions

void setCalibration (Calibration calibration)
 
modm::ResumableResult< std::tuple< uint16_t, uint16_t, uint16_t > > getRawValues ()
 
modm::ResumableResult< bool > isTouched ()
 
modm::ResumableResult< std::tuple< uint16_t, uint16_t > > getTouchPosition ()
 
void attachConfigurationHandler (Spi::ConfigurationHandler handler)
 

Protected Member Functions

bool acquireMaster ()
 
bool releaseMaster ()
 
modm::ResumableResult< ReturnType > resumable function (...)
 
int8_t getResumableDepth () const
 
bool isResumableRunning () const
 
void stopResumable ()
 Force all resumable functions to stop running at the current nesting level.
 

Detailed Description

template<class SpiMaster, class Cs>
class modm::touch2046< SpiMaster, Cs >

Author
Raphael Lehmann

Datasheet TSC2046: https://www.ti.com/lit/ds/symlink/tsc2046.pdf

Member Function Documentation

modm::ResumableResult< ReturnType > resumable modm::NestedResumable< 1 >::function (   ...)
inherited

Run the resumable function.

You need to implement this method in you subclass yourself.

Returns
>NestingError if still running, <=NestingError if it has finished.
template<class SpiMaster , class Cs >
modm::ResumableResult<std::tuple<uint16_t,uint16_t,uint16_t> > modm::touch2046< SpiMaster, Cs >::getRawValues ( )

Get raw X, Y and Z values

Returns
Position and intensity of touch point. Full int16_t range.
int8_t modm::NestedResumable< 1 >::getResumableDepth ( ) const
inheritedinline
Returns
the nesting depth in the current resumable function, or -1 if called outside any resumable function
template<class SpiMaster , class Cs >
modm::ResumableResult<std::tuple<uint16_t,uint16_t> > modm::touch2046< SpiMaster, Cs >::getTouchPosition ( )

Get touch position

Returns
Position (X, Y) of touch point.
bool modm::NestedResumable< 1 >::isResumableRunning ( ) const
inheritedinline
Returns
true if a resumable function is running at the current nesting level, else false
template<class SpiMaster , class Cs >
modm::ResumableResult<bool> modm::touch2046< SpiMaster, Cs >::isTouched ( )

Is screen touched?

Returns
bool true if screen is touched
template<class SpiMaster , class Cs >
void modm::touch2046< SpiMaster, Cs >::setCalibration ( Calibration  calibration)
inline

Set calibration data

See Calibration.


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