Symbian3/PDK/Source/GUID-6AC01B10-92C1-4E56-813B-6853DFCF3386.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Tue, 30 Mar 2010 11:56:28 +0100
changeset 5 f345bda72bc4
parent 3 46218c8b8afa
permissions -rw-r--r--
Week 12 contribution of PDK documentation_content. See release notes for details. Fixes Bug 2054, Bug 1583, Bug 381, Bug 390, Bug 463, Bug 1897, Bug 344, Bug 1319, Bug 394, Bug 1520, Bug 1522, Bug 1892"

<?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-6AC01B10-92C1-4E56-813B-6853DFCF3386" xml:lang="en"><title>DMA
Requests</title><shortdesc>This document describes how device drivers use DMA
requests to initiate a DMA transfer.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>DMA transfer requests are the way in which a device driver sets up and
initiates a DMA transfer. A transfer request internally comprises a linked
list of DMA descriptor headers and is associated with a single DMA channel.
A transfer request also stores a client-provided call-back function, which
is invoked when the whole request completes, whether successfully or not.
A DMA request can be in any of the four states: Not configured, Idle, Being
transferred, and Pending. However, these states are not used by the driver. </p>
<p>A device driver creates a DMA request by specifying a DMA channel and a
DMA callback function to be called after the request completion. A DMA request
can also be split up or fragmented. </p>
<p>The following shows the creation of a DMA request: </p>
<codeblock id="GUID-B2753DE7-800E-57CC-B2B6-CA2548AC25C4" xml:space="preserve">TInt DExDriverUartTxDma::Init()
    {
    ...
    // A DMA request has to be created for any DMA transfer. This 
    // specifies the channel on which the DMA request shall be 
    // made, the service callback function to be called after the 
    // request completion (TxDmaService), and an object pointer that will be passed 
    // as an argument to DMA request service function (this).
    // A DMA request is a list of fragments small enough to be 
    // transferred in one go by the DMA Controller.
    //
    iTxDmaRequest = new DDmaRequest(*iTxDmaChannel, TxDmaService,    this);
    if(iTxDmaRequest == NULL)
        {
        return KErrNoMemory;
        }
    ...
    }</codeblock>
</conbody></concept>