|
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-90E2A645-56B0-4FC2-AE92-CD72FEC23AE6" xml:lang="en"><title>Input |
|
13 and Output Functions</title><shortdesc>Describes the input and output functions involved in implementing |
|
14 the Symbian platform GPIO class.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
15 <p>There is no general reason why a pin which is available for use for GPIO |
|
16 should not also be available for some other function, and the Symbian platform |
|
17 GPIO specification allows for this. There are certain circumstances where |
|
18 pin sharing should be prevented, for instance when a pin is in use as an interrupt |
|
19 source, and these cases are specified individually. </p> |
|
20 <section id="GUID-84ACB7AB-F6DE-42F5-8C89-C7598FBC7AC1"><title>Implement the |
|
21 Input/output functions</title> <ul> |
|
22 <li><p> Implement <xref href="GUID-EB28CB99-7191-345B-90FC-7708E9D190C7.dita"><apiname>SetOutputState()</apiname></xref> for each value |
|
23 of <xref href="GUID-7C1D78B4-9897-3C38-8EE7-7C311B885B0B.dita"><apiname>TGpioState</apiname></xref>. </p> <ul> |
|
24 <li><p> Implement <xref href="GUID-EB28CB99-7191-345B-90FC-7708E9D190C7.dita"><apiname>SetOutputState()</apiname></xref> with |
|
25 <codeph>aState</codeph> == <xref href="GUID-ABF52F3A-CDC3-3AC6-89ED-FB7F5B781A25.dita"><apiname>ELow</apiname></xref> and return |
|
26 value <xref href="GUID-6CA4F1ED-7947-3087-B618-D35858FAA3BC.dita"><apiname>KErrNone</apiname></xref>. </p> <p> |
|
27 Verify that the pin is being used as a binary output. Set it |
|
28 to its low electric state. </p> </li> |
|
29 <li><p> Implement <xref href="GUID-EB28CB99-7191-345B-90FC-7708E9D190C7.dita"><apiname>SetOutputState()</apiname></xref> with |
|
30 <codeph>aState</codeph> == <xref href="GUID-28B7F356-760B-38EA-90B1-AD3594375CBC.dita"><apiname>EHigh</apiname></xref> and return |
|
31 value <xref href="GUID-6CA4F1ED-7947-3087-B618-D35858FAA3BC.dita"><apiname>KErrNone</apiname></xref>. </p> <p> |
|
32 Verify that the pin is being used as a binary output. Set it |
|
33 to its high electric state. </p> </li> |
|
34 <li><p> Implement <xref href="GUID-EB28CB99-7191-345B-90FC-7708E9D190C7.dita"><apiname>SetOutputState()</apiname></xref> with |
|
35 <codeph>aState</codeph> == <xref href="GUID-A538A8AF-DA50-3641-A794-19CAFF5B28F2.dita"><apiname>EDefaultIdleState</apiname></xref> and |
|
36 return value <xref href="GUID-6CA4F1ED-7947-3087-B618-D35858FAA3BC.dita"><apiname>KErrNone</apiname></xref>. </p> <p> |
|
37 Verify that the pin is being used as a binary output. Set its |
|
38 electric state to its default idle state. </p> </li> |
|
39 <li><p> Implement <xref href="GUID-EB28CB99-7191-345B-90FC-7708E9D190C7.dita"><apiname>SetOutputState()</apiname></xref> with |
|
40 return value <xref href="GUID-F89DA3F0-2A48-3F9B-8F08-29350E92D0E4.dita"><apiname>KErrNotSupported</apiname></xref>. |
|
41 </p> <p> If the specified electric state is not supported |
|
42 return <xref href="GUID-F89DA3F0-2A48-3F9B-8F08-29350E92D0E4.dita"><apiname>KErrNotSupported</apiname></xref>. </p> </li> |
|
43 </ul> </li> |
|
44 <li><p> Implement <xref href="GUID-E88C05CA-8882-3C6A-9B64-8048DB7DA622.dita"><apiname>GetOutputState()</apiname></xref> with return |
|
45 value <xref href="GUID-6CA4F1ED-7947-3087-B618-D35858FAA3BC.dita"><apiname>KErrNone</apiname></xref>. </p> <p> Verify |
|
46 that the pin is being used as a binary output. Determine its electric |
|
47 state and set <codeph>aState</codeph> to the appropriate value of |
|
48 <xref href="GUID-7C1D78B4-9897-3C38-8EE7-7C311B885B0B.dita"><apiname>TGpioState</apiname></xref>. </p> </li> |
|
49 <li><p> Implement <xref href="GUID-9BFB4B87-1400-33C0-B116-AC6FA349BE1E.dita"><apiname>GetInputState()</apiname></xref> with return |
|
50 value <xref href="GUID-6CA4F1ED-7947-3087-B618-D35858FAA3BC.dita"><apiname>KErrNone</apiname></xref>. </p> <p> Verify |
|
51 that the pin is being used as a binary input. Determine its electric |
|
52 state and set <codeph>aState</codeph> to the appropriate value of |
|
53 <xref href="GUID-7C1D78B4-9897-3C38-8EE7-7C311B885B0B.dita"><apiname>TGpioState</apiname></xref>. </p> </li> |
|
54 </ul></section> |
|
55 </conbody></concept> |