Adaptation/GUID-6C74A8B4-50B6-486C-A75F-A50636F4C566.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-6C74A8B4-50B6-486C-A75F-A50636F4C566" xml:lang="en"><title>Register Access Overview</title><shortdesc>Provides a summary of the Register Access platform service.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>The Register Access platform service is intended for use in writing
device drivers. Writing device drivers involves frequent access to
hardware registers for reading, writing and modifying them. </p>
<section id="GUID-65EDE628-937F-4472-9662-8FE36D77B12D">         
   <title>What is a register</title>             <p>A register is
a memory location on the ASSP hardware to store data that relates
to the operation of that hardware. For example, a register can be
a counter, or a bit field, or the next sequence number or the next
byte or word of data that has arrived over a bus.</p><p>The Symbian
platform provides access functions for registers that have the following
sizes:<ul>
<li><p>8–bit</p></li>
<li><p>16–bit</p></li>
<li><p>32–bit</p></li>
<li><p>64–bit</p></li>
</ul></p>         </section>
<section id="GUID-25E7482D-B837-4228-9BE5-836DF48AD664"><title>What
functions are available</title><p>There are three types of function
provided for register access:<ul>
<li><p><codeph>Read</codeph> - get the value of a register</p></li>
<li><p><codeph>Write</codeph> - write a value to a register</p></li>
<li><p><codeph>Modify</codeph> - use bitmasks to clear or set specific
bits in a register</p></li>
</ul></p><p>Each function takes a first argument of a <xref href="GUID-7452AD53-A7EE-3B1E-BC3D-C4202E5DAEBC.dita"><apiname>TLinAddr</apiname></xref> which is an address. The device driver only needs to know the address,
and the size of the register. The implementation of the Register Access
must map the exposed physical hardware register to a linear address.</p><p>Each type of function (read, write, modify) has 8–bit, 16–bit,
32–bit and 64–bit versions.</p><p>The <codeph>Modify</codeph> functions
take two bitmasks as parameters, to specify which bits to clear to
zero (clear mask) and which bits to set to one (set mask). This means
that you could call <codeph>Modify16(myaddress, 0xC000,0x000F)</codeph> and the top two bits would be set to zero, the bottom four bits
would be set to one, and the ten bits in the middle would retain their
current value.</p><p>See <xref href="GUID-DB55C1A0-2901-4661-B6B1-3B61BF6FF4FA.dita">Register Access Client
Interface Guide</xref> for more details on each function and how to
use them.</p></section>
</conbody></concept>