Adaptation/GUID-009D71C6-481F-5EF1-B230-EB64F67047C8.dita
changeset 15 307f4279f433
equal deleted inserted replaced
14:578be2adaf3e 15:307f4279f433
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE concept
       
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
       
    12 <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
       
    13 digitiser ADC values and screen coordinates. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    14 <p>Calibration is done through a user-side calibration application. </p>
       
    15 <p>The platform specific layer performs the following calculation to convert
       
    16 between ADC values and co-ordinates: </p>
       
    17 <fig id="GUID-932E1DED-C393-5C26-A08F-E270CF5DC90B">
       
    18 <image href="GUID-D6861A7A-1845-52AF-BB09-4B97E6B8AA13_d0e10260_href.png" placement="inline"/>
       
    19 </fig>
       
    20 <p>Where the <b>R</b> matrix determines the scaling and rotation, and the <b>T</b> vector
       
    21 determines the translation. </p>
       
    22 <p>This conversion is implemented by the platform specific layer's implementation
       
    23 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>.
       
    24 Default implementations are provided by the template port. Note, however,
       
    25 that in these implementations, the calculation is slightly more complex because
       
    26 screen coordinate values are left shifted 16 bits. This allows the operations
       
    27 to use integer divisions without loosing precision. </p>
       
    28 <p>All that you need to do is to provide an initial set of values for <b>R</b> and <b>T</b>.
       
    29 An example of how to set them up is included in the template port. </p>
       
    30 <p>The principle is that the application draws cross hairs on the screen,
       
    31 and then invites the user to touch these points. The digitiser ADC value is
       
    32 used to calculate the digitiser to screen pixel value transformation. </p>
       
    33 <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
       
    34 Hardware Abstraction</xref> component using four <xref href="GUID-8B3280A2-318F-380C-B2A4-894C3C675868.dita"><apiname>UserHal</apiname></xref> functions. </p>
       
    35 <p>On a cold restart, the calibration application goes through the following
       
    36 steps: </p>
       
    37 <ul>
       
    38 <li id="GUID-DDEF3346-09D3-56B1-A9EE-CC520620611B"><p>Gets the calibration
       
    39 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>
       
    40 <li id="GUID-F93D82ED-924D-5268-807F-8F52F18A1A9E"><p>Sets calibration points
       
    41 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>
       
    42 <li id="GUID-C368C9AA-BE3C-5B95-AEDA-703B91059AFB"><p>Saves calibration data
       
    43 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>
       
    44 </ul>
       
    45 <p>On a warm restart, the calibration application just restores calibration
       
    46 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>
       
    47 </conbody></concept>