Symbian3/PDK/Source/GUID-9AD35939-26DD-4A42-8727-D0FD2F45B6DE.dita
changeset 5 f345bda72bc4
equal deleted inserted replaced
4:4816d766a08a 5:f345bda72bc4
       
     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-9AD35939-26DD-4A42-8727-D0FD2F45B6DE" xml:lang="en"><title>Pin
       
    13 Mode Functions</title><shortdesc>Describes the pin mode functions involved in implementing the Symbian
       
    14 platform GPIO class.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    15 <p>The Symbian platform GPIO class is specified at the level of the pin and
       
    16 so are the modes. A pin has three modes namely, <keyword>Enabled</keyword>, <keyword>Disabled</keyword> and <keyword>Idle</keyword> as
       
    17 specified in the enumeration <codeph>TGpioMode</codeph>. The mode of the pin
       
    18 affects the mode of the module. When a pin is set to Enabled or Disabled mode,
       
    19 the implementation should set the module to the same mode. When a pin is set
       
    20 to Idle, the implementation should attempt to set the module to Idle, but
       
    21 the state and configuration of the other pins on the module may override this.
       
    22 When a module is set to Idle the implementation should set its pins to Idle
       
    23 mode.</p>
       
    24 <section id="GUID-C8665E28-9AA5-4363-9BF1-5AA1ABA5B598"><title>Implement the
       
    25 pin mode functions</title> <ul>
       
    26 <li><p>  Implement <xref href="GUID-47A5FEB0-144E-398B-A3B0-8A524A59B7F2.dita"><apiname>SetPinMode()</apiname></xref> for each value of the 
       
    27         enumeration <xref href="GUID-BA2AE083-DB8D-327F-85FE-EAB765DAF360.dita"><apiname>TGpioMode</apiname></xref>.  </p> <ul>
       
    28 <li><p>Implement <xref href="GUID-47A5FEB0-144E-398B-A3B0-8A524A59B7F2.dita"><apiname>SetPinMode()</apiname></xref> with <codeph>aMode</codeph> == <xref href="GUID-500F8E1C-714A-3942-B584-39C44FAF6873.dita"><apiname>EEnabled</apiname></xref> and
       
    29 return value <xref href="GUID-6CA4F1ED-7947-3087-B618-D35858FAA3BC.dita"><apiname>KErrNone</apiname></xref>.</p> <p> Enable the pin for GPIO.
       
    30 Make any functionality other than  GPIO unavailable. Enable the module if
       
    31 it is not already enabled. This  typically requires power and clocks to be
       
    32 supplied to the module. </p> </li>
       
    33 <li><p> Implement <xref href="GUID-47A5FEB0-144E-398B-A3B0-8A524A59B7F2.dita"><apiname>SetPinMode()</apiname></xref> with  <codeph>aMode</codeph> == <xref href="GUID-4EC4F5AE-557D-3249-A3D3-31653DECD706.dita"><apiname>EDisabled</apiname></xref> and
       
    34 return value <xref href="GUID-6CA4F1ED-7947-3087-B618-D35858FAA3BC.dita"><apiname>KErrNone</apiname></xref>. </p> <p> Disable the pin for GPIO.
       
    35 Disable the module for GPIO. Only a  all to <xref href="GUID-AF952FD7-0B2F-3985-9B1E-02E87734AC6E.dita"><apiname>SetPinMode</apiname></xref> with <xref href="GUID-1D258A78-63B0-3AAF-8359-CB1C62883F38.dita"><apiname>aMode</apiname></xref> ==
       
    36  <xref href="GUID-500F8E1C-714A-3942-B584-39C44FAF6873.dita"><apiname>EEnabled</apiname></xref> should return the pin to the enabled state. If
       
    37  the pin is enabled for another function, that fact is irrelevant.   </p> </li>
       
    38 <li><p>                Implement <xref href="GUID-47A5FEB0-144E-398B-A3B0-8A524A59B7F2.dita"><apiname>SetPinMode()</apiname></xref> with    
       
    39            <codeph>aMode</codeph> == <xref href="GUID-89A388CF-9DF5-3CD3-AD5E-D2EE98B7F97E.dita"><apiname>EIdle</apiname></xref> and return value
       
    40                <xref href="GUID-6CA4F1ED-7947-3087-B618-D35858FAA3BC.dita"><apiname>KErrNone</apiname></xref>.              </p> <p>        
       
    41        Only implement this if the platform supports the idle state.      
       
    42        </p> <p>                When the pin is set to the idle state, the
       
    43 implementation                should also attempt to move the module to the
       
    44 idle state.              </p> </li>
       
    45 <li><p>                Implement <xref href="GUID-47A5FEB0-144E-398B-A3B0-8A524A59B7F2.dita"><apiname>SetPinMode()</apiname></xref> with return
       
    46 value                <xref href="GUID-51298FCE-7857-39F8-BFAB-49AF5556D0CC.dita"><apiname>KErrNotReady</apiname></xref>.              </p> <p> 
       
    47               Return <xref href="GUID-51298FCE-7857-39F8-BFAB-49AF5556D0CC.dita"><apiname>KErrNotReady</apiname></xref> when a pin which has
       
    48                requested a return to the idle state is not ready to do so.
       
    49              </p> </li>
       
    50 <li><p>                Implement <xref href="GUID-47A5FEB0-144E-398B-A3B0-8A524A59B7F2.dita"><apiname>SetPinMode()</apiname></xref> with return
       
    51 value                <xref href="GUID-F89DA3F0-2A48-3F9B-8F08-29350E92D0E4.dita"><apiname>KErrNotSupported</apiname></xref>.              </p> <p> 
       
    52               Return <xref href="GUID-F89DA3F0-2A48-3F9B-8F08-29350E92D0E4.dita"><apiname>KErrNotSupported</apiname></xref> if the pin is   
       
    53             not available for GPIO because it has been assigned an alternative
       
    54 function and                also where <xref href="GUID-89A388CF-9DF5-3CD3-AD5E-D2EE98B7F97E.dita"><apiname>EIdle</apiname></xref> is passed
       
    55 and the platform does not                support an idle state.          
       
    56    </p> </li>
       
    57 </ul> </li>
       
    58 <li><p>          Implement <xref href="GUID-44CFE638-7ECD-369F-8D06-E2970DF078B7.dita"><apiname>GetPinMode()</apiname></xref> for each value
       
    59 of the          enumeration <xref href="GUID-BA2AE083-DB8D-327F-85FE-EAB765DAF360.dita"><apiname>TGpioMode</apiname></xref>.         </p> </li>
       
    60 <li><p>             Implement <xref href="GUID-44CFE638-7ECD-369F-8D06-E2970DF078B7.dita"><apiname>GetPinMode()</apiname></xref> with       
       
    61      <codeph>aMode</codeph> containing <xref href="GUID-500F8E1C-714A-3942-B584-39C44FAF6873.dita"><apiname>EEnabled</apiname></xref> and return
       
    62 value             <xref href="GUID-6CA4F1ED-7947-3087-B618-D35858FAA3BC.dita"><apiname>KErrNone</apiname></xref>.           </p> <p>        
       
    63     Verify that the pin is already enabled for GPIO and able to          
       
    64   work according to its configuration. Set <xref href="GUID-1D258A78-63B0-3AAF-8359-CB1C62883F38.dita"><apiname>aMode</apiname></xref> to   
       
    65          <xref href="GUID-500F8E1C-714A-3942-B584-39C44FAF6873.dita"><apiname>EEnabled</apiname></xref>.           </p> </li>
       
    66 <li><p>             Implement <xref href="GUID-44CFE638-7ECD-369F-8D06-E2970DF078B7.dita"><apiname>GetPinMode()</apiname></xref> with       
       
    67      <codeph>aMode</codeph> containing <xref href="GUID-4EC4F5AE-557D-3249-A3D3-31653DECD706.dita"><apiname>EDisabled</apiname></xref> and return
       
    68 value             <xref href="GUID-6CA4F1ED-7947-3087-B618-D35858FAA3BC.dita"><apiname>KErrNone</apiname></xref>.           </p> <p>        
       
    69     Verify that the module is already disabled and the pin cannot        
       
    70     be used for GPIO. If the pin is enabled for another function, that fact
       
    71 is             irrelevant.           </p> </li>
       
    72 <li><p>             Implement <xref href="GUID-44CFE638-7ECD-369F-8D06-E2970DF078B7.dita"><apiname>GetPinMode()</apiname></xref> with       
       
    73      <codeph>aMode</codeph> containing <xref href="GUID-89A388CF-9DF5-3CD3-AD5E-D2EE98B7F97E.dita"><apiname>EIdle</apiname></xref> and return
       
    74 value             <xref href="GUID-6CA4F1ED-7947-3087-B618-D35858FAA3BC.dita"><apiname>KErrNone</apiname></xref>.           </p> <p>        
       
    75     Only implement this if the platform supports the idle state.         
       
    76  </p> <p>             Verify that the module is already in an idle state.
       
    77           </p> </li>
       
    78 <li><p>             Implement <xref href="GUID-44CFE638-7ECD-369F-8D06-E2970DF078B7.dita"><apiname>GetPinMode()</apiname></xref> with return
       
    79 value             <xref href="GUID-F89DA3F0-2A48-3F9B-8F08-29350E92D0E4.dita"><apiname>KErrNotSupported</apiname></xref>.           </p> <p> 
       
    80            Return <xref href="GUID-F89DA3F0-2A48-3F9B-8F08-29350E92D0E4.dita"><apiname>KErrNotSupported</apiname></xref> if the platform    
       
    81         does not support reading the pin mode.           </p> </li>
       
    82 </ul></section>
       
    83 </conbody></concept>