Touch Screen Drive To Realize
Touch screen embedded equipment according to its technical principle can be divided
into five categories: vector pressure sensor type, resistive, capacitive, infrared type and surface acoustic wave type. The resistive touch screens used in embedded system is more, resistive touch screens can be divided into four wire, five line, seven line to wait for a few kinds. Generally speaking, touch WinCE driven design and implementation has the following several steps:
(1) the configuration and initialization touch screen
Touch screen drive in the initialization process will call TouchPanelEnable function, this function call for DdsiTouchPanelEnable and DdsiTouchPanelDisable DDSI function. The two DDSI interface function is the key driver to realize, respectively used to open and close touch screen hardware. But in order to reduce the power consumption, the two function actually can not really operating hardware, but only to realize software control. At the same time, in the initialization is needed when this a few configuration and initialization: one is to create events hTouchPanelEvent and hCalibrationSampleAvailable, the former is under normal conditions when touch pen press or press needs after timing acquisition data were trigger; While the latter is in the calibration condition when a calibration data input was trigger. The second is check initialization required interrupt gIntrTouch (touch screen interrupt) and gIntrTouchChanged (timer interrupt), and the two interrupt related to hTouchPanelEvent events. Three is to create a ISR TouchPanelpISR thread, used to waiting for and deal with touch screen hTouchPanelEvent events, it is also the driver only in the event source.
(2) calibration touch screen reference parameter
Complete front tedious work, driver all sorts of functions were all is ready, now can actual operation touch screen. But generally speaking, resistive touch screens need calibration, that is to say the drive in the process of start to call the MDD layer corresponding DDSI function to read in the registry correction data correction touch screen. Ideally, calibration procedure as long as in the embedded devices first power up during the test run a can, reference will be stored in nonvolatile memory, lest let users in the later add electric start-up period to do calibration. However, the high quality of touch screen driver is should provide a into calibration routine way, thus in due to temperature drift or other factors calibration inaccurate in recalibrate. In an ideal situation, correction touch screen reference only two groups of original data, which is, namely, in screen diagonal read the minimum and maximum value. But in the practical application, because many resistive touch screens obvious nonlinear, if only in the minimum and maximum simple insert position between numerical can lead to driver is not accurate. Therefore, in the WinCE need to acquire more calibration point, commonly used calibration point number five.
The method is: (1) the first driver in the function DdsiTouchPanelGetDeviceCaps set the number of calibration point; (2) is a system in TouchDriverCalibrationPointGet to each calibration point screen coordinates; (3) is in the screen interface calibration point coordinates place display a position symbol, users need to accurately in position symbol press touch screen; (4) the driver through the TouchPanelReadCalibrationPoint function read corresponding touch screen coordinate values; (5) and then start the next calibration point, until the number of cycle set after the collected touch screen coordinate values and calibration point screen coordinates to TouchPanelSetCalibration function for processing, this function will produce calibration reference parameter. Calibration is completed, touch screen will start the normal operation.
(3) to judge whether the screen by touch
Once completed the touch screen hardware Settings, initialization and reference parameter calibration, then need to use a reliable method to determine whether the screen was touched. WinCE provides screen have been touch detection mechanism, and when touch events can also choose whether to interrupt master processor. Judge whether the screen by touch driver function named WaitForTouchState (). When the screen has been first touch wake host interrupt, known as the PEN_DOWN interrupt. This will make the driver is not to touch the screen when interrupt his execution, without consuming any CPU resources, and once a user touch screen, the driver will be awakened and into the conversion mode.
When be wake up with a group of modulus data waiting for conversion and produce interrupt signal. Interrupts are dealing with hardware and software of the important method, so most of the drivers were related to interrupt handling. Will interrupt handling character, WinCE adopted a unique method. It will interrupt handling is divided into two steps: the interrupt service routine (ISR) and interrupt service thread (IST). Specifically is each hardware equipment interrupt request (IRQ) and a ISR contact up, when an interrupt occurs has not been shielding, the kernel calls the interrupt registered ISR. Because ISR run in kernel mode, so should be designed to be as far as possible short, ISR's primary responsibility is to guide the kernel scheduling
by: njytouch
Why A Myford Touch Command Program Smells The Reason Why The Actual Myford Touching Regulate Process Stinks Exactly Why This Myford Touching Regulate Procedure Stinks The Reason This Myford Touching Command Method Smells The Reason The Myford Touching Manage Technique Smells The Key Reason Why The Actual Myford Touch Manage Method Stinks Get In Touch With A Certified Public Accountant (cpa) Touching The Panorama Of Srinagar Add The Finishing Touches To Your Bridal Gown Calling Cards: Your Long Distant Ticket To Get In Touch How Has Touchscreen Technology Changed The World We Live In Today? The Kitcheners Touch: Ways To Improve Kitchen Surround How To Find Quality Irish Gifts To Give A Touch Of Ireland