Adaptation/GUID-009D71C6-481F-5EF1-B230-EB64F67047C8.dita
author Graeme Price <GRAEME.PRICE@NOKIA.COM>
Fri, 15 Oct 2010 14:32:18 +0100
changeset 15 307f4279f433
permissions -rw-r--r--
Initial contribution of the Adaptation Documentation.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-009D71C6-481F-5EF1-B230-EB64F67047C8" xml:lang="en"><title>Calibration</title><shortdesc>Calibration of the Digitizer Driver is required to convert between
digitiser ADC values and screen coordinates. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>Calibration is done through a user-side calibration application. </p>
<p>The platform specific layer performs the following calculation to convert
between ADC values and co-ordinates: </p>
<fig id="GUID-932E1DED-C393-5C26-A08F-E270CF5DC90B">
<image href="GUID-D6861A7A-1845-52AF-BB09-4B97E6B8AA13_d0e10260_href.png" placement="inline"/>
</fig>
<p>Where the <b>R</b> matrix determines the scaling and rotation, and the <b>T</b> vector
determines the translation. </p>
<p>This conversion is implemented by the platform specific layer's implementation
of <xref href="GUID-2EDAF642-2399-3594-986A-5E8A5EEA01B9.dita#GUID-2EDAF642-2399-3594-986A-5E8A5EEA01B9/GUID-A51F6890-2D47-3FCC-A51B-19479658E49F"><apiname>DDigitiser::DigitiserToScreen()</apiname></xref> and <xref href="GUID-2EDAF642-2399-3594-986A-5E8A5EEA01B9.dita#GUID-2EDAF642-2399-3594-986A-5E8A5EEA01B9/GUID-F85119E0-83DC-3C54-BDFC-4F156ADFE538"><apiname>DDigitiser::ScreenToDigitiser()</apiname></xref>.
Default implementations are provided by the template port. Note, however,
that in these implementations, the calculation is slightly more complex because
screen coordinate values are left shifted 16 bits. This allows the operations
to use integer divisions without loosing precision. </p>
<p>All that you need to do is to provide an initial set of values for <b>R</b> and <b>T</b>.
An example of how to set them up is included in the template port. </p>
<p>The principle is that the application draws cross hairs on the screen,
and then invites the user to touch these points. The digitiser ADC value is
used to calculate the digitiser to screen pixel value transformation. </p>
<p>Any calibration code will interface with the <xref href="GUID-2D977A02-5928-5441-8AE7-42A722F2A4B8.dita#GUID-2D977A02-5928-5441-8AE7-42A722F2A4B8/GUID-4DA41221-40B9-5BC7-B2C6-7C6EB4522508">User-Side
Hardware Abstraction</xref> component using four <xref href="GUID-8B3280A2-318F-380C-B2A4-894C3C675868.dita"><apiname>UserHal</apiname></xref> functions. </p>
<p>On a cold restart, the calibration application goes through the following
steps: </p>
<ul>
<li id="GUID-DDEF3346-09D3-56B1-A9EE-CC520620611B"><p>Gets the calibration
points by using <xref href="GUID-8B3280A2-318F-380C-B2A4-894C3C675868.dita#GUID-8B3280A2-318F-380C-B2A4-894C3C675868/GUID-57FFFEEF-200A-3F62-937F-181760F756A9"><apiname>UserHal::CalibrationPoints()</apiname></xref>  </p> </li>
<li id="GUID-F93D82ED-924D-5268-807F-8F52F18A1A9E"><p>Sets calibration points
by using: <xref href="GUID-8B3280A2-318F-380C-B2A4-894C3C675868.dita#GUID-8B3280A2-318F-380C-B2A4-894C3C675868/GUID-D494A58D-BBFA-3D3B-A979-A7CB4045EF23"><apiname>UserHal::SetXYInputCalibration()</apiname></xref>  </p> </li>
<li id="GUID-C368C9AA-BE3C-5B95-AEDA-703B91059AFB"><p>Saves calibration data
by using: <xref href="GUID-8B3280A2-318F-380C-B2A4-894C3C675868.dita#GUID-8B3280A2-318F-380C-B2A4-894C3C675868/GUID-B93BD9B9-9F33-337D-A110-993B717F1D50"><apiname>UserHal::SaveXYInputCalibration()</apiname></xref>  </p> </li>
</ul>
<p>On a warm restart, the calibration application just restores calibration
data using <xref href="GUID-8B3280A2-318F-380C-B2A4-894C3C675868.dita#GUID-8B3280A2-318F-380C-B2A4-894C3C675868/GUID-63CC94BD-CD0C-3B2C-8714-1A976FE7D0DD"><apiname>UserHal::RestoreXYInputCalibration()</apiname></xref>. </p>
</conbody></concept>