Adaptation/GUID-6AC01B10-92C1-4E56-813B-6853DFCF3386-GENID-1-2-1-9-1-6-1-8-1-7-1-5-1.dita
changeset 15 307f4279f433
equal deleted inserted replaced
14:578be2adaf3e 15:307f4279f433
       
     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-6AC01B10-92C1-4E56-813B-6853DFCF3386-GENID-1-2-1-9-1-6-1-8-1-7-1-5-1" xml:lang="en"><title>DMA Requests</title><shortdesc>Describes how device drivers use DMA requests to initiate
       
    13 a DMA transfer.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    14 <p>DMA transfer requests are the way in which a device driver sets
       
    15 up and initiates a DMA transfer. A transfer request internally comprises
       
    16 a linked list of DMA descriptor headers and is associated with a single
       
    17 DMA channel. A transfer request also stores an optional client-provided
       
    18 callback function, which can be invoked when the whole request completes,
       
    19 whether successfully or not. A DMA request can be in any of the four
       
    20 states: Not configured, Idle, Being transferred, and Pending. However,
       
    21 these states are not used by the driver. </p>
       
    22 <p>A device driver creates a DMA request by specifying a DMA channel
       
    23 and an optional DMA callback function to be called after the request
       
    24 completion. A DMA request must be fragmented. </p>
       
    25 <p>The following shows the creation of a DMA request: </p>
       
    26 <codeblock id="GUID-B2753DE7-800E-57CC-B2B6-CA2548AC25C4-GENID-1-2-1-9-1-6-1-8-1-7-1-5-1-3-4" xml:space="preserve">TInt DExDriverUartTxDma::Init()
       
    27     {
       
    28     ...
       
    29     // A DMA request has to be created for any DMA transfer. This 
       
    30     // specifies the channel on which the DMA request shall be 
       
    31     // made, the service callback function to be called after the 
       
    32     // request completion (TxDmaService), and an object pointer that will be passed 
       
    33     // as an argument to DMA request service function (this).
       
    34     // A DMA request is a list of fragments small enough to be 
       
    35     // transferred in one go by the DMA Controller.
       
    36     //
       
    37     iTxDmaRequest = new DDmaRequest(*iTxDmaChannel, TxDmaService,    this);
       
    38     if(iTxDmaRequest == NULL)
       
    39         {
       
    40         return KErrNoMemory;
       
    41         }
       
    42     ...
       
    43     }</codeblock>
       
    44 </conbody></concept>