idma2.h

Go to the documentation of this file.
00001 /* 
00002  * Copyright (c) 2009, Texas Instruments Incorporated
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  *
00009  * *  Redistributions of source code must retain the above copyright
00010  *    notice, this list of conditions and the following disclaimer.
00011  *
00012  * *  Redistributions in binary form must reproduce the above copyright
00013  *    notice, this list of conditions and the following disclaimer in the
00014  *    documentation and/or other materials provided with the distribution.
00015  *
00016  * *  Neither the name of Texas Instruments Incorporated nor the names of
00017  *    its contributors may be used to endorse or promote products derived
00018  *    from this software without specific prior written permission.
00019  *
00020  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00021  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
00022  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00023  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
00024  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00025  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00026  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00027  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00028  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00029  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
00030  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00031  * 
00032  */
00033 /*
00034  *  ======== idma2.h ========
00035  *  Declaration of the IDMA2 interface.
00036  */
00037 
00038 #ifndef IDMA2_
00039 #define IDMA2_
00040 
00041 #include "ialg.h"
00042 
00043 #ifdef __cplusplus
00044 extern "C" {
00045 #endif
00046 
00047 /*
00048  *  ======== IDMA2_Handle ========
00049  *  Handle to "logical" DMA channel.
00050  */
00051 typedef struct IDMA2_Obj *IDMA2_Handle;
00052 
00053 #if defined(_54_) || defined(_55_)
00054 typedef Void (*IDMA2_AdrPtr)();
00055 #define IDMA2_ADRPTR(addr) ((IDMA2_AdrPtr)((LgUns)addr<<1))
00056 #else
00057 typedef Void * IDMA2_AdrPtr;
00058 #endif
00059 
00060 /*
00061  *  ======== IDMA2_ElementSize ========
00062  *  8, 16 or 32-bit aligned transfer.
00063  */
00064 typedef enum IDMA2_ElementSize {
00065     IDMA2_ELEM8,         /* 8-bit data element */
00066     IDMA2_ELEM16,        /* 16-bit data element */
00067     IDMA2_ELEM32         /* 32-bit data element */
00068 } IDMA2_ElementSize;
00069 
00070 /*
00071  *  ======== IDMA2_TransferType ========
00072  *  Type of the DMA transfer.
00073  */
00074 typedef enum IDMA2_TransferType {
00075     IDMA2_1D1D,          /* 1-dimensional to 1-dimensional transfer */
00076     IDMA2_1D2D,          /* 1-dimensional to 2-dimensional transfer */
00077     IDMA2_2D1D,          /* 2-dimensional to 1-dimensional transfer */
00078     IDMA2_2D2D           /* 2-dimensional to 2-dimensional transfer */
00079 } IDMA2_TransferType;
00080 
00081 /*
00082  *  ======== IDMA2_Params ========
00083  *  DMA transfer specific parameters. Defines the configuration of a
00084  *  logical channel.
00085  */
00086 typedef struct IDMA2_Params {
00087     IDMA2_TransferType xType;           /* 1D1D, 1D2D, 2D1D or 2D2D */
00088     IDMA2_ElementSize  elemSize;        /* Element transfer size */
00089     Uns    numFrames;       /* Num of frames for 2D transfers */
00090     Int    srcElementIndex; /* In 8-bit bytes  */
00091     Int    dstElementIndex; /* In 8-bit bytes */
00092     Int    srcFrameIndex;   /* Jump in 8-bit bytes for 2D transfers */
00093     Int    dstFrameIndex;   /* Jump in 8-bit bytes for 2D transfers */
00094 } IDMA2_Params;
00095 
00096 /*
00097  *  ======== IDMA2_ChannelRec ========
00098  *  DMA record used to describe the logical channels.
00099  */
00100 typedef struct IDMA2_ChannelRec {
00101     IDMA2_Handle  handle;       /* Handle to logical DMA channel */
00102     Int           queueId;      /* Selects the serialization queue */
00103 } IDMA2_ChannelRec;
00104 
00105 /*
00106  *  ======== IDMA2_Fxns ========
00107  *  These fxns are used to query/grant the DMA resources requested by
00108  *  the algorithm at initialization time, and to change these resources
00109  *  at runtime. All these fxns are implemented by the algorithm, and
00110  *  called by the client of the algorithm.
00111  *
00112  *    implementationId    - unique pointer that identifies the module
00113  *                          implementing this interface.
00114  *    dmaChangeChannels() - apps call this whenever the logical channels
00115  *                          are moved at runtime.
00116  *    dmaGetChannelCnt()  - apps call this to query algorithm about max
00117  *                          number of logical dma channel requested.
00118  *    dmaGetChannels()    - apps call this to query algorithm about its
00119  *                          dma channel requests at init time, or to get
00120  *                          the current channel holdings.
00121  *    dmaInit()           - apps call this to grant dma handle(s) to the
00122  *                          algorithm at initialization. Algorithm initializes
00123  *                          the instance object.
00124  */
00125 typedef struct IDMA2_Fxns {
00126     Void        *implementationId;
00127     Void        (*dmaChangeChannels)(IALG_Handle, IDMA2_ChannelRec *);
00128     Int         (*dmaGetChannelCnt)(Void);
00129     Int         (*dmaGetChannels)(IALG_Handle, IDMA2_ChannelRec *);
00130     Int         (*dmaInit)(IALG_Handle, IDMA2_ChannelRec *);
00131 } IDMA2_Fxns;
00132 
00133 #ifdef __cplusplus
00134 }
00135 #endif
00136 
00137 #endif  /* IDMA2_ */
00138 
00139 /*
00140  *  @(#) ti.xdais; 1, 2.0, 1,192; 3-13-2009 12:27:22; /db/wtree/library/trees/dais/dais-o05x/src/
00141  */
00142 

Copyright 2009, Texas Instruments Incorporated