Adaptation/GUID-6C74A8B4-50B6-486C-A75F-A50636F4C566.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-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>
       
    13 <p>The Register Access platform service is intended for use in writing
       
    14 device drivers. Writing device drivers involves frequent access to
       
    15 hardware registers for reading, writing and modifying them. </p>
       
    16 <section id="GUID-65EDE628-937F-4472-9662-8FE36D77B12D">         
       
    17    <title>What is a register</title>             <p>A register is
       
    18 a memory location on the ASSP hardware to store data that relates
       
    19 to the operation of that hardware. For example, a register can be
       
    20 a counter, or a bit field, or the next sequence number or the next
       
    21 byte or word of data that has arrived over a bus.</p><p>The Symbian
       
    22 platform provides access functions for registers that have the following
       
    23 sizes:<ul>
       
    24 <li><p>8–bit</p></li>
       
    25 <li><p>16–bit</p></li>
       
    26 <li><p>32–bit</p></li>
       
    27 <li><p>64–bit</p></li>
       
    28 </ul></p>         </section>
       
    29 <section id="GUID-25E7482D-B837-4228-9BE5-836DF48AD664"><title>What
       
    30 functions are available</title><p>There are three types of function
       
    31 provided for register access:<ul>
       
    32 <li><p><codeph>Read</codeph> - get the value of a register</p></li>
       
    33 <li><p><codeph>Write</codeph> - write a value to a register</p></li>
       
    34 <li><p><codeph>Modify</codeph> - use bitmasks to clear or set specific
       
    35 bits in a register</p></li>
       
    36 </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,
       
    37 and the size of the register. The implementation of the Register Access
       
    38 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,
       
    39 32–bit and 64–bit versions.</p><p>The <codeph>Modify</codeph> functions
       
    40 take two bitmasks as parameters, to specify which bits to clear to
       
    41 zero (clear mask) and which bits to set to one (set mask). This means
       
    42 that you could call <codeph>Modify16(myaddress, 0xC000,0x000F)</codeph> and the top two bits would be set to zero, the bottom four bits
       
    43 would be set to one, and the ten bits in the middle would retain their
       
    44 current value.</p><p>See <xref href="GUID-DB55C1A0-2901-4661-B6B1-3B61BF6FF4FA.dita">Register Access Client
       
    45 Interface Guide</xref> for more details on each function and how to
       
    46 use them.</p></section>
       
    47 </conbody></concept>