M5Unified
m5::Touch_Class Class Reference

#include <Touch_Class.hpp>

Collaboration diagram for m5::Touch_Class:

Classes

struct  point_t
 
struct  touch_detail_t
 

Public Member Functions

std::uint8_t getCount (void) const
 
const touch_detail_tgetDetail (std::size_t index=0) const
 
const m5gfx::touch_point_t & getTouchPointRaw (std::size_t index=0) const
 
void setHoldThresh (std::uint16_t msec)
 
void setFlickThresh (std::uint16_t distance)
 
bool isEnabled (void) const
 
void begin (m5gfx::LGFX_Device *gfx)
 
void update (std::uint32_t msec)
 
void end (void)
 

Static Public Attributes

static constexpr std::size_t TOUCH_MAX_POINTS = 3
 
static constexpr std::size_t TOUCH_MIN_UPDATE_MSEC = 4
 

Protected Member Functions

bool update_detail (touch_detail_t *dt, std::uint32_t msec, bool pressed, m5gfx::touch_point_t *tp)
 
bool update_detail (touch_detail_t *dt, std::uint32_t msec)
 

Protected Attributes

std::uint32_t _last_msec = 0
 
std::int32_t _flickThresh = 8
 
std::int32_t _msecHold = 500
 
m5gfx::LGFX_Device * _gfx = nullptr
 
touch_detail_t _touch_detail [TOUCH_MAX_POINTS]
 
m5gfx::touch_point_t _touch_raw [TOUCH_MAX_POINTS]
 
std::uint8_t _touch_count
 

Detailed Description

Definition at line 37 of file Touch_Class.hpp.

Member Function Documentation

◆ begin()

void m5::Touch_Class::begin ( m5gfx::LGFX_Device *  gfx)
inline

Definition at line 102 of file Touch_Class.hpp.

Here is the caller graph for this function:

◆ end()

void m5::Touch_Class::end ( void  )
inline

Definition at line 104 of file Touch_Class.hpp.

◆ getCount()

std::uint8_t m5::Touch_Class::getCount ( void  ) const
inline

Get the current number of touchpoints.

Returns
number of touchpoints.

Definition at line 88 of file Touch_Class.hpp.

Here is the caller graph for this function:

◆ getDetail()

const touch_detail_t& m5::Touch_Class::getDetail ( std::size_t  index = 0) const
inline

Definition at line 91 of file Touch_Class.hpp.

Here is the caller graph for this function:

◆ getTouchPointRaw()

const m5gfx::touch_point_t& m5::Touch_Class::getTouchPointRaw ( std::size_t  index = 0) const
inline

Definition at line 94 of file Touch_Class.hpp.

Here is the caller graph for this function:

◆ isEnabled()

bool m5::Touch_Class::isEnabled ( void  ) const
inline

Definition at line 100 of file Touch_Class.hpp.

Here is the caller graph for this function:

◆ setFlickThresh()

void m5::Touch_Class::setFlickThresh ( std::uint16_t  distance)
inline

Definition at line 98 of file Touch_Class.hpp.

◆ setHoldThresh()

void m5::Touch_Class::setHoldThresh ( std::uint16_t  msec)
inline

Definition at line 96 of file Touch_Class.hpp.

◆ update()

void m5::Touch_Class::update ( std::uint32_t  msec)

Avoid high frequency updates

Definition at line 8 of file Touch_Class.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_detail() [1/2]

bool m5::Touch_Class::update_detail ( touch_detail_t dt,
std::uint32_t  msec 
)
protected

Definition at line 111 of file Touch_Class.cpp.

◆ update_detail() [2/2]

bool m5::Touch_Class::update_detail ( touch_detail_t dt,
std::uint32_t  msec,
bool  pressed,
m5gfx::touch_point_t *  tp 
)
protected

Definition at line 55 of file Touch_Class.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ _flickThresh

std::int32_t m5::Touch_Class::_flickThresh = 8
protected

Definition at line 108 of file Touch_Class.hpp.

◆ _gfx

m5gfx::LGFX_Device* m5::Touch_Class::_gfx = nullptr
protected

Definition at line 110 of file Touch_Class.hpp.

◆ _last_msec

std::uint32_t m5::Touch_Class::_last_msec = 0
protected

Definition at line 107 of file Touch_Class.hpp.

◆ _msecHold

std::int32_t m5::Touch_Class::_msecHold = 500
protected

Definition at line 109 of file Touch_Class.hpp.

◆ _touch_count

std::uint8_t m5::Touch_Class::_touch_count
protected

Definition at line 113 of file Touch_Class.hpp.

◆ _touch_detail

touch_detail_t m5::Touch_Class::_touch_detail[TOUCH_MAX_POINTS]
protected

Definition at line 111 of file Touch_Class.hpp.

◆ _touch_raw

m5gfx::touch_point_t m5::Touch_Class::_touch_raw[TOUCH_MAX_POINTS]
protected

Definition at line 112 of file Touch_Class.hpp.

◆ TOUCH_MAX_POINTS

constexpr std::size_t m5::Touch_Class::TOUCH_MAX_POINTS = 3
staticconstexpr

Definition at line 40 of file Touch_Class.hpp.

◆ TOUCH_MIN_UPDATE_MSEC

constexpr std::size_t m5::Touch_Class::TOUCH_MIN_UPDATE_MSEC = 4
staticconstexpr

Definition at line 41 of file Touch_Class.hpp.


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