Home |
Touch Screen Driver AX772/AX178 and AX172 USB-Ethernet Drivers |
Touch Screen DriverThe touch screen driver currently supports USB touch screens from the Hampshire Company (TSHARC Octopus), eGalax, 3M (EX II 8000UR and SC800), all ELO touch screens, and the ILITEK Multi-Touch-V3000 device. Other touch screen models can easily be added. Only one touch screen device can be operated at any given time. Configuration options can be set in the global configuration structure RTUSBTouchConfig. The driver is registered using its callback USBTouchScreen. As soon as a matching USB touch screen is detected, the driver will create an internal thread to handle it. Any received touch events are forwarded to the operating system's user input event queue. With On Time RTOS-32, RTTarget-32's Win32 API function WriteConsonsoleInput is used. Example (using On Time RTOS-32 and RTPEG-32):int main(void) { PegScreen * pScreen; PegPresentationManager * pPresent; RTURegisterCallback(USBKeyboard); // include USB keyboard driver RTURegisterCallback(USBMouse); // and USB mouse driver RTURegisterCallback(USBTouchScreen); // must be after USBMouse FindUSBControllers(); // start USB pScreen = CreatePegScreen_VESA_8(); pPresent = PegInitialize(pScreen, sizeof(class PegScreen)); // configure USB mouse driver RTUSBMouseConfig.MaxX = pScreen->GetXRes() - 2; RTUSBMouseConfig.MaxY = pScreen->GetYRes() - 2; // put mouse pointer on screen center USBSetMousePos(pScreen->GetXRes() / 2, pScreen->GetYRes() / 2); // configure USB touch screen driver RTUSBTouchConfig.MaxX = pScreen->GetXRes() - 2; RTUSBTouchConfig.MaxY = pScreen->GetYRes() - 2; PegAppInitialize(pPresent); PegExecute(pPresent); return 0; } Touch screens must be calibrated to correctly map touch coordinates to screen coordinates. Demo program PegDemo contains a sample touch screen calibration dialog using functions USBTouchCalibrate and USBTouchToPhys. The RTUSB-32 Reference Manual contains additional information about the driver's API.
|