Initial contribution of the Adaptation Documentation.
<?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-660A8E4C-F930-415C-8CCC-CB1DCCAA2442" xml:lang="en"><title>Interrupts</title><shortdesc>This document describes how device drivers use interrupts.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<section id="GUID-7B450286-637E-4BAB-9D36-9228764CD0D4">
<p>Devices generate interrupts to indicate hardware events. Generally
drivers provide an interrupt service routine (ISR) to handle the interrupts
and perform the required responses to the events. Symbian provides an <xref href="GUID-E7A7083C-97B9-39B9-A147-4A6E314EE3A3.dita"><apiname>Interrupt</apiname></xref> class
(implemented by the ASSP) with an API to bind and unbind an interrupt source
and an ISR. </p> <codeblock id="GUID-9EB4BFFE-55A2-56D4-BCF3-6D278C3EC4F4" xml:space="preserve">// Bind the interrupt source ID and interrupt service routine
TInt Bind(TInt aId, TIsr aIsr, TAny* aPtr);
// Unbind the interrupt
TInt Unbind(TInt aId);
// Enable interrupts on device interrupt source
TInt Enable(TInt aId);
// Disable interrupts on device interrupt source
TInt Disable(TInt aId);
// Clear the device interrupt
TInt Clear(TInt aId);
// Set the priority of the interrupt
TInt SetPriority(TInt aId, TInt aPriority);</codeblock> <p>Interrupt handling
is typically done in a PDD, as device hardware access is done at that level.
Interrupt handling is generally done in two stages in the driver. High priority
and short time running tasks are done in the ISR, and the remaining processing
is deferred for handling later. </p> <p>Interrupt handling is a blocking high
priority task and needs to take a minimal amount of time. The Kernel will
be in an indeterminate state and puts restrictions on doing various operations. </p>
</section>
</conbody></concept>