Specifications
Sample SMARTSET Session 43
The calibration routine used by SMARTSET lets you select a video mode
supported by your display before you calibrate. As the screen size and position
may vary among video modes, you should calibrate in the video mode used by
your application. For our example, we calibrated in text mode.
Typically, touchscreen driver developers will write their own calibration routine
rather than using this feature of SMARTSET. Later in this manual, sample source
code for a calibration program is given.
Now Enable the Calibration Mode on the Touch Mode submenu. The calibration
points are ignored until Calibration Mode is enabled.
Return to the Touch Testing screen. Notice that the origin is now in the upper-left
corner, and the coordinate is approximately 0,0 at the edge of the image, and
4095,4095 at the lower right corner of the image. If you touch beyond the image in
the overscan area, you will see negative coordinates in the upper left, and
coordinates greater than 4095,4095 in the lower right.
Range Checking Mode
Next, Enable Range Checking on the Touch Mode submenu. This mode instructs
the controller to check if a touch is within the calibrated area or in the overscan
area.
Return to the Touch Testing screen again. Now the controller indicates "out of
range" by adding 40 to the Status field when you touch the overscan area. Range
Checking does not affect the coordinates. The only effect is a slight degradation in
coordinate throughput because the controller has to perform additional analysis.
Trim Mode
Enable Trim Mode on the Touch Mode submenu. This mode instructs the
controller to push the coordinates of a touch in the overscan area to the edge of
the calibrated area. In most applications, a touch in the overscan area should be
accepted as a valid touch in the closest touch zone on the edge of the image. Trim
Mode only works if Range Checking is also Enabled.
Return to the Touch Testing screen again. The Status still indicates "out of Range"
when you touch the overscan area. However, the coordinates are trimmed to 0,0
and 4095,4095 at the extremes.
Scaling
The process of scaling is similar to that of calibration. Usually it is desired to map
the touch coordinates into a range other than the controller's default range of 0 to