Introduction
The tcDspTouchScreen class is used to provide access to a touch screen overlay device. It is usually used in concert with the tcDspDisplay class (although this is not a requirement). Routines are provided to determine whether or not the screen is being touched, what position is the last touch (in pixels or raw ADC counts), and set/get calibration parameters.
Convenience routines are also provided to assist with calibrating the touch screen device.
- See also:
- MityDSP::tcDspTouchScreen Class Reference
-
MityDSP::tcDspDisplay Class Reference
Example
This is a simple example of tcDspTouchScreen creation and usage:
{
bool touched;
tcDspTouchScreen *myTouchScreen;
tcDspDisplay::tsScreenCoords myPos;
myTouchScreen = new tcDspTouchScreen((void *)0xB0000280, 320, 240,
myTouchSem);
printf("Touch screen upper left...\n");
myTouchScreen->CalUpperLeft(SYS_FOREVER);
printf("Touch screen lower right...\n");
myTouchScreen->CalLowerRight(SYS_FOREVER);
myTouchScreen->EventEnable(tcDspTouchScreen::eePenDown);
while (true)
{
do
{
touched = myTouchScreen->GetPosition(myPos);
...
} while (touched);
}
}