Lcd companion boards support (VKLCD50RTA & VKLCD70RT)

Embed: (wiki syntax)

« Back to documentation index

Touch Class Reference

Touch driver class for VK-LCD panels. More...

#include <Touch.h>

Public Types

enum  init_err_t { TOUCH_OK = 0, TOUCH_INIT_ERR = -1, TOUCH_UNSUPP_ERR = -2, TOUCH_ERR = -3 }

Public Member Functions

 Touch (const touch_config_t *tp_cfg=&STMPE811_cfg)
 Constructor method of Touch object.
virtual ~Touch (void)
 Destructor method of Touch object.
init_err_t Init (void)
 Touch controller initialization.
virtual init_err_t Clb_Setup (void)
 Set Calibration data (raw data interpretation)
virtual init_err_t Drv_Setup (void)
 Set Touch Controller settings.
virtual void Get_Data (unsigned long long *raw)
 Get one sample of data.
virtual int Get_Fifo (unsigned long long *raw)
 Get all available samples of data.
virtual void Get_XYZ (int points)
 Transfer function (from raw coordinates to screen coordinates)
bool Handle_touch (unsigned char *pts)
 Pull the new samples if new data is available.
int Get_Last_Idx (void)
 Get index of the last sample in the ring buffer.

Static Public Member Functions

static void Irq_Alert (void)
 New Data available.

Detailed Description

Touch driver class for VK-LCD panels.

Definition at line 75 of file Touch.h.


Member Enumeration Documentation

enum init_err_t
Enumerator:
TOUCH_OK 

Initialization successful

TOUCH_INIT_ERR 

Communication interface err while configuring driver

TOUCH_UNSUPP_ERR 

Unsupported driver

TOUCH_ERR 

unknown error

Definition at line 81 of file Touch.h.


Constructor & Destructor Documentation

Touch ( const touch_config_t tp_cfg = &STMPE811_cfg )

Constructor method of Touch object.

Constructor of the Touch class.

Parameters:
[in]pointerto Config structure (touch_config_t)

Definition at line 17 of file Touch.cpp.

~Touch ( void   ) [virtual]

Destructor method of Touch object.

Destructor of the Touch class.

Definition at line 340 of file Touch.cpp.


Member Function Documentation

Touch::init_err_t Clb_Setup ( void   ) [virtual]

Set Calibration data (raw data interpretation)

Set Calibration data.

Return values:
Errorcode
errorcode

Definition at line 81 of file Touch.cpp.

Touch::init_err_t Drv_Setup ( void   ) [virtual]

Set Touch Controller settings.

Return values:
Errorcode
errorcode

Definition at line 125 of file Touch.cpp.

void Get_Data ( unsigned long long *  raw ) [virtual]

Get one sample of data.

Parameters:
[in]raw,:pointer to ring buffer to store the samples
[in]*raw : pointer to ring buffer to store the samples

Definition at line 157 of file Touch.cpp.

int Get_Fifo ( unsigned long long *  raw ) [virtual]

Get all available samples of data.

Parameters:
[in]raw,:pointer to ring buffer to store the samples
Return values:
samplescount
Parameters:
[in]*raw : pointer to ring buffer to store the samples
Return values:
samplescount

Definition at line 187 of file Touch.cpp.

int Get_Last_Idx ( void   )

Get index of the last sample in the ring buffer.

Return values:
idx

Definition at line 267 of file Touch.cpp.

void Get_XYZ ( int  points ) [virtual]

Transfer function (from raw coordinates to screen coordinates)

Coordinates Transfer function.

Parameters:
[in]points: number of samples to transfer
[in]points: number of samples which have to become meaningful

Definition at line 231 of file Touch.cpp.

bool Handle_touch ( unsigned char *  pts )

Pull the new samples if new data is available.

Parameters:
[in]pts,:pointer to a variable to put the count of the new samples
Return values:
Statusof the pen => up:false; down:true
Parameters:
[in]*pts : pointer to a variable to put the count of the new samples
Return values:
Statusof the pen (Stylus position up/down)

Definition at line 275 of file Touch.cpp.

Touch::init_err_t Init ( void   )

Touch controller initialization.

Return values:
Errorcode
errorcode

Definition at line 37 of file Touch.cpp.

void Irq_Alert ( void   ) [static]

New Data available.

IRQ interrupt handler : indicates "New Data available" which activates i2c data transfer in Handle_touch()

Definition at line 260 of file Touch.cpp.