Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

Touch Screen Library

Enumerations

Functions


Detailed Description

Typical usage:
        TS_Open();
        TS_Enable(true);                // Enable read of the pen
        while(1)                                // Main loop
        {
                if(TS_Check())          // Check if Touch Screen is active
                {
                        // Read cursor position
                        ok = TS_ReadCursor(&sx, &sy);
                        if(ok)
                        {
                                ...
                        }
                }
        }

Enumeration Type Documentation

enum AR1021_Commands
 

Enumeration values:
TS_TouchThreshold  The TouchThreshold register sets the threshold for a touch condition to be detected as a touch.
A touch is detected if it is below the TouchThreshold setting.
Toosmall of a value might prevent the controller from accepting a real touch, while too large of a value might allow the controller to accept very light or false touch conditions.
Valid values are as follows:
0 =TouchThreshold =255
TS_SensitivityFilter  The SensitivityFilter register sets the level of touch sensitivity.
A higher value is more sensitive to a touch (accepts a lighter touch), but may exhibit a less stable touch position.
A lower value is less sensitive to a touch (requires a harder touch), but will provide a more stable touch position.
Valid values are as follows:
0 =SensitivityFilter =10
TS_SamplingFast  The SamplingFast register sets the level of touch measurement sample averaging, when touch movement is determined to be fast.
See the SpeedThreshold register for information on the touch movement threshold. A lower value will provide for a higher touch coordinate reporting rate when touch movement is fast, but may exhibit more high-frequency random noise error in the touch position.
A higher value will reduce the touch coordinate reporting rate when touch movement is fast, but will reduce high-frequency random noise error in the touch position. Valid values are as follows:
SamplingFast: <1, 4, 8, 16, 32, 64, 128>
Recommended Values: <4, 8, 16>
Higher values may improve accuracy with some sensors.
TS_SpeedThreshold  The SpeedThreshold register sets the threshold for touch movement to be considered as slow or fast.
A lower value reduces the touch movement speed that will be considered as fast.
A higher value increases the touch movement speed that will be considered as fast.
Valid values are as follows:
0 =SpeedThreshhold =255
TS_SleepDelay  The SleepDelay register sets the time duration with no touch or command activity that will cause the controller to enter a low-power Sleep mode.
Valid values are as follows:
0 =SleepDelay =255
Sleep Delay Time = SleepDelay * 100 ms; when SleepDelay > 0
A value of zero disables the Sleep mode, such that the controller will never enter low-power Sleep mode.
A touch event will wake the controller from low-power Sleep mode and start sending touch reports.
Communications sent to the controller will wake it from the lowpower Sleep mode and initiate action to the command.
TS_PenUpDelay  The PenUpDelay register sets the duration of a pen-up event that the controller will allow, without sending a pen-up report for the event.
The delay time is started upon detecting a pen-up condition.
If a pen down is reestablished before the delay time expires, then pen-down reports will continue without a pen up being sent. This effectively debounces a touch event in process.
A lower value will make the controller more responsive to pen ups, but will cause more touch drop outs with a lighter touch. A higher value will make the controller less responsive to pen ups, but will reduce the number of touch drop outs with a lighter touch.
Valid values are as follows:
0 =PenUpDelay =255
Pen-up Delay Time ?PenUpDelay * 240 ?s


Function Documentation

void TS_Calibrate  ) 
 

Perform touch screen calibration.

bool TS_Check  ) 
 

Check if touch screen is active (touch action).

Returns:
true if touch else false

void TS_Clear  ) 
 

Clear touch screen calibration.

void TS_Close  ) 
 

Turn off touch screen access.

int TS_Enable bool  enable  ) 
 

Enable or disable touch screen read.

Parameters:
enable Use true to enable false to disable.
Returns:
0 If ok, 1 on timeout (no answer)

bool TS_GetCursorCoords int *  sx,
int *  sy
 

Enable touch screen read, check if in touch, disable read and return the result and coordinates.

Parameters:
sx Return horizontal coordinate.
sy Return vertical coordinate.
Returns:
true if touch else false

void TS_Open  ) 
 

Initialize touch screen controller.

bool TS_ReadCursor int *  sx,
int *  sy
 

If touch is active retrieve cursor coordinates.

Parameters:
sx Return horizontal coordinate.
sy Return vertical coordinate.
Returns:
true if touch else false

int TS_SendCommand unsigned char *  value,
int  len,
unsigned char *  extend
 

Send a command to the touch screen controller.

Parameters:
value Command list.
len Length of command list
extend If valid pointer address (not 0) will be stored the return code of the sent command.
Returns:
0 If ok, 1 on timeout (no answer)

void TS_Set int  reg,
int  val
 

Set an internal register of the touch screen controller.

Parameters:
reg Register address.
val Value to be set.

unsigned char TS_StartAddress  ) 
 

Retrieve start address, to have access to all internal registers.

Returns:
Start address

bool TS_WaitTouch  ) 
 

Enable touch screen read, check if in touch, disable read and return the result.

Returns:
true if touch else false


Generated on Tue Apr 7 20:07:45 2015 for BF592A Library by doxygen 1.3.1