Symbian3/PDK/Source/GUID-9E7F8D0B-2B0E-41CC-BCDF-6B01B56CEF37.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Wed, 31 Mar 2010 11:11:55 +0100
changeset 7 51a74ef9ed63
parent 5 f345bda72bc4
permissions -rw-r--r--
Week 12 contribution of API Specs and fix SDK submission

<?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-9E7F8D0B-2B0E-41CC-BCDF-6B01B56CEF37" xml:lang="en"><title>Debounce
Functions</title><shortdesc>Describes the debounce functions involved in implementing the Symbian
platform GPIO class.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>Debouncing means filtering out distortions of the signal caused, for instance,
by physical pressure on a key. Some platforms provide hardware mechanisms
for debouncing, otherwise implementers must provide for debouncing by software.
Both hardware and software debouncing involve sampling the signal at a specified
interval. The Symbian platform GPIO class provides a function <xref href="GUID-837F3EC5-5379-3B88-B27B-A092E9F2E422.dita"><apiname>SetDebounceTime()</apiname></xref> to
supply that interval but does not impose any restrictions on the implementation.
Software debouncing can be performed at the level of the pin rather than the
module, and this is strongly recommended where debouncing is performed by
software.  </p>
<section id="GUID-718F1593-206E-4738-A34A-C9D3F52063EE"><title>Implement the
debounce functions</title> <ul>
<li><p>          Implement <xref href="GUID-837F3EC5-5379-3B88-B27B-A092E9F2E422.dita"><apiname>SetDebounceTime()</apiname></xref> with return
value          <xref href="GUID-6CA4F1ED-7947-3087-B618-D35858FAA3BC.dita"><apiname>KErrNone</apiname></xref>.         </p> <p>          Verify
that the platform supports debouncing either by hardware          or software.
Use the passed in value as the sampling interval in milliseconds.         </p> <p> 
        Only implement this if the platform supports debouncing.         </p> </li>
<li><p>          Implement <xref href="GUID-72F9F470-4815-3674-A90F-1038C565F2E0.dita"><apiname>GetDebounceTime()</apiname></xref> with return
         value <xref href="GUID-6CA4F1ED-7947-3087-B618-D35858FAA3BC.dita"><apiname>KErrNone</apiname></xref>.         </p> <p>          Determine
value in milliseconds of the sampling interval used in          debouncing
and set aTime to that value.         </p> <p>          Only implement this
if the platform supports debouncing.         </p> </li>
<li><p>          Implement these functions with return value          <xref href="GUID-F89DA3F0-2A48-3F9B-8F08-29350E92D0E4.dita"><apiname>KErrNotSupported</apiname></xref>.
        </p> <ul>
<li><p>                <xref href="GUID-837F3EC5-5379-3B88-B27B-A092E9F2E422.dita"><apiname>SetDebounceTime() </apiname></xref>              </p> </li>
<li><p>                <xref href="GUID-72F9F470-4815-3674-A90F-1038C565F2E0.dita"><apiname>GetDebounceTime()</apiname></xref>              </p> </li>
</ul> <p>          Return <xref href="GUID-F89DA3F0-2A48-3F9B-8F08-29350E92D0E4.dita"><apiname>KErrNotSupported</apiname></xref> if the pin does
not          support debouncing.         </p> </li>
</ul> </section>
</conbody></concept>