|
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-D003030D-8506-4210-9194-7A3819205D68" xml:lang="en"><title>Hardware |
|
13 Registers</title><shortdesc>This document describes how device drivers use hardware registers.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <section id="GUID-47A733FB-8AC9-40A0-B879-C8C01B0AB1ED"> <p>The |
|
15 APIs to access hardware peripheral registers are provided by a Symbian base |
|
16 port. For example, the base port for the OMAP 2420 provides the <codeph>TOmap::SetRegister()</codeph> and <codeph>TOmap::GetRegister()</codeph> functions |
|
17 to access its peripheral controller registers. Peripheral drivers would generally |
|
18 use these APIs. Some examples: </p> <ol id="GUID-78156A20-8B2F-52FB-8A9F-159B6EE8714E"> |
|
19 <li id="GUID-330A1D4C-E054-5DC3-A1F5-D85A9F600834"><p>To set the UART LCR |
|
20 register: </p> <codeblock id="GUID-35EE35C4-B89B-52D1-AC25-13C63BA55435" xml:space="preserve">TOmap::SetRegister8(iPortAddr+KHoUART_LCR, KHbUartLCRFifoConfig);</codeblock> </li> |
|
21 <li id="GUID-06BE62D4-4ED7-5186-A191-9908C10B1C7E"><p>To get the UART MDR |
|
22 register: </p> <codeblock id="GUID-64F8101B-CDDF-57E9-93D4-08B4BBA117CB" xml:space="preserve">TOmap::Register8(iPortAddr+KHoUART_MDR1)</codeblock> </li> |
|
23 <li id="GUID-D549BAC4-5842-5E8D-B086-28A5366DBC4D"><p>To modify only the specified |
|
24 bits of the register: here, the UART LCR register bit 6 is being set to 0 |
|
25 (LCR[6] = 0) </p> <codeblock id="GUID-C705FB36-1D4E-557F-B30D-6B6AD21E5B5C" xml:space="preserve">TOmap::ModifyRegister8(iPortAddr+KHoUART_LCR, |
|
26 (TUint8)KHtUartLCRBreakEnable, |
|
27 (TUint8)KSetNone);</codeblock> </li> |
|
28 </ol> </section> |
|
29 </conbody></concept> |