Touch
[Drivers]

Collaboration diagram for Touch:

Data Structures

struct  TOUCH_Pos_TypeDef
 Touch panel position structure. More...
struct  TOUCH_Config_TypeDef
 Touch configuration structure. More...

Defines

#define TOUCH_INIT_DEFAULT
 Initializes Touch default values.

Typedefs

typedef void( TOUCH_Upcall_TypeDef )(TOUCH_Pos_TypeDef *)
 touch panel upcall type definition

Functions

void TOUCH_Init (TOUCH_Config_TypeDef *config)
 Initialize touch panel driver.
void TOUCH_RegisterUpcall (TOUCH_Upcall_TypeDef *new_upcall)
 Register upcall which will be call every position or state change.
TOUCH_Pos_TypeDefTOUCH_GetPos (void)
 Returns current touch position and state.
int TOUCH_CalibrationTable (POINT *displayPtr, POINT *screenPtr)
 Set calibration table.
int TOUCH_IsBusy (void)
 Check status of the touch panel.

Define Documentation

#define TOUCH_INIT_DEFAULT
Value:
{ 500000,                /* 500kHz sampling frequency */             \
    1,                     /* Ignore moves not greater than 1 pixel */ \
    adcOvsRateSel128,      /* Oversampling 128 times */                \
  }

Initializes Touch default values.

Definition at line 81 of file touch.h.


Typedef Documentation

touch panel upcall type definition

Definition at line 88 of file touch.h.


Function Documentation

int TOUCH_CalibrationTable ( POINT *  displayPtr,
POINT *  screenPtr 
)

Set calibration table.

Parameters:
[in] displayPtr Table of display points
[in] screenPtr Table of adc values reflecting display points
Returns:
Returns OK if calibration table is set.

Definition at line 419 of file touch.c.

TOUCH_Pos_TypeDef* TOUCH_GetPos ( void   ) 

Returns current touch position and state.

Returns:
Current touch position and state

Definition at line 381 of file touch.c.

References TOUCH_Pos_TypeDef::adcx, TOUCH_Pos_TypeDef::adcy, TOUCH_Pos_TypeDef::pen, TOUCH_Pos_TypeDef::x, and TOUCH_Pos_TypeDef::y.

void TOUCH_Init ( TOUCH_Config_TypeDef config  ) 

Initialize touch panel driver.

Parameters:
config Driver configuration data.

Definition at line 349 of file touch.c.

References ADC_Y, BSP_PeripheralAccess(), BSP_TOUCH, TOUCH_Config_TypeDef::frequency, TOUCH_Config_TypeDef::ignore, and TOUCH_Config_TypeDef::oversampling.

Here is the call graph for this function:

int TOUCH_IsBusy ( void   ) 

Check status of the touch panel.

Returns:
0 if panel is idle (not touched).

Definition at line 327 of file touch.c.

References TOUCH_X2.

void TOUCH_RegisterUpcall ( TOUCH_Upcall_TypeDef new_upcall  ) 

Register upcall which will be call every position or state change.

Parameters:
[in] new_upcall Pointer to upcall function

Definition at line 401 of file touch.c.