On Time RTOS-32 Documentation
Welcome
RTTarget-32
RTKernel-32
RTFiles-32
RTIP-32
RTPEG-32
RTUSB-32
RTUSB-32 Programming Manual
RTUSB-32 Reference Manual
Introduction
Initialization
Device Query
Device Configuration
Pipe I/O
Message Queues
Keyboard Class Driver
Mouse Class Driver
Touch Screen Driver
Structure RTUSBTouchConfig
Function USBTouchScreen
Function USBTouchToPhys
Function USBTouchCalibrate
Function USBSetTouchPos
Printer Class Driver
Mass Storage Class Driver
AX772 USB-Ethernet Driver
AX172 USB-Ethernet Driver
CDC ECM USB-Ethernet Driver
Audio Class Driver
Media Transfer Protocol Class Driver
RTUSB-32 Error Codes and Diagnostics
|
Structure RTUSBTouchConfig
The USB touch screen driver can handle one USB touch screen. It reads configuration information from structure RTUSBTouchConfig. The default values are given below. Applications can either modify selected values before the driver is registered or an alternate RTUSBTouchConfig structure can be linked.
#define USB_TOUCH_SWAP_XY 0x00000001UL
#define USB_TOUCH_RAW_XY 0x00000002UL
#define USB_TOUCH_INV_X 0x00000004UL
#define USB_TOUCH_INV_Y 0x00000008UL
typedef struct {
int TaskPriority; // touch thread priority
int TaskStackSize; // touch thread stack size
int ScaleX; // X acceleration
int ScaleY; // Y acceleration
int ScaleX2; // X divisor
int ScaleY2; // Y divisor
int OfsX; // Offset X
int OfsY; // Offset Y
int MaxX; // Max X coordinate
int MaxY; // Max Y coordinate
DWORD Flags; // see USB_TOUCH_... constants
} RTUSB32TouchConfig;
RTUSB32TouchConfig RTUSBTouchConfig = {
0, // TaskPriority
2*1024, // TaskStackSize
1, // ScaleX
1, // ScaleY
1, // ScaleX2
1, // ScaleY2
0, // OfsX
0, // OfsY
0, // MaxX
0, // MaxY
0 // Flags
};
The driver's internal thread needs very little CPU time and stack space. Its priority should generally be the same as the application's user interface. ScaleX and ScaleY are factors by which the touch coordinates are multiplied; ScaleX2 and ScaleY2 are the respective divisors. OfsX and OfsY are added. Function USBTouchCalibrate recalculates these values. MaxX and MaxY can be set to limit the coordinates the mouse pointer can move to (with 0, no limits are imposed). The coordinates can never become negative. Member Flags may receive value USB_TOUCH_SWAP_XY to make the driver swap X and Y values (for example, to accommodate for a touch screen installed upside-down). USB_TOUCH_RAW_XY may be specified to force the driver to use raw coordinate values from the touch device. USB_TOUCH_RAW_XY is currently only support for 3M EX II touch screens. USB_TOUCH_INV_X and USB_TOUCH_INV_Y may be used to invert the X and Y coordinates.
The USB touch screen driver is used by registering its attachment/detachment callback USBTouchScreen.
Function USBTouchScreen
|