csl_dma.h

来自「dsp在音频处理中的运用」· C头文件 代码 · 共 1,054 行 · 第 1/3 页

H
1,054
字号
    (Bool)CSL_DMA_GTCR_SARAMTCE_RESETVAL, \    (Bool)CSL_DMA_GTCR_DARAMTCE_RESETVAL, \    (CSL_DmaIndexMode)CSL_DMA_GSCR_INDEXMODE_RESETVAL \    }/** @brief Structure for setup of Source port * * This is of type structure CSL_DmaSetupPort explained elsewhere. */typedef struct CSL_DmaHwSetupPort CSL_DmaHwSetupSrcPort;/** @brief Structure for setup of Destination port * * This is of type structure CSL_DmaSetupPort explained elsewhere. */typedef struct CSL_DmaHwSetupPort CSL_DmaHwSetupDstPort;/** @brief Structure that is used to setup Source/Destination port * * This structure is part of the CSL_DmaHwSetup structure, and contains * parameters for setting source or destination ports. This is passed as * a parmeter to the CSL_dmaHwSetup function. Also the structure is used * to collect the global setup information from the CSL_dmaGetHwStatus * function. */typedef struct CSL_DmaHwSetupPort {    /** Burst enable */    CSL_DmaBurstEn  burstEn;    /** Packing	*/    CSL_DmaOnOff  packing;    /** Port */    CSL_DmaPort  port;    /** Addressing mode */    CSL_DmaAmode  amode;    /** Start Address (word address) */    Uint32  staddr;    /** Frame index */    Int16   frmIndex;    /** Element index */    Int16   elmIndex;} CSL_DmaHwSetupPort;/** @brief Structure that is used to setup DMA channel * * This structure captures setup parameters corresponding to a channel. This * structure is part of the CSL_DmaHwSetup structure, and is passed as a * member of the CSL_DmaHwSetup parameter to the CSL_dmaHwSetup function. * Also the structure is used to collect the global setup information from * the CSL_dmaGetHwStatus function. */typedef struct CSL_DmaHwSetupChannel {    /** Data size for transfer(8/16/32 bit) */    CSL_DmaDataSize datatype;    /** Element Count */    Uint16  elmCnt;    /** Frame count */    Uint16  frmCnt;    /** Channel Priority */    CSL_DmaPriority     prio;    /** Synchronization Control */    CSL_DmaSync sync;    /** Frame synchronization */    CSL_DmaFrameSync    fs;    /** End of Programming Status Bit */    CSL_DmaOnOff    endprog;    /** Repetitive Operation */    CSL_DmaOnOff    repeat;    /** Auto-initialization */    CSL_DmaOnOff    autoinit;} CSL_DmaHwSetupChannel;/** @brief Structure that is used to configure interrupts * * This structure captures info on what interrupts need to be enabled. This * structure is part of the CSL_DmaHwSetup structure, and is passed as a * member of the CSL_DmaHwSetup to the CSL_dmaHwSetup function. Also the * structure is used to collect the global setup information from the * CSL_dmaGetHwStatus function. */typedef struct CSL_DmaHwSetupIntr {    /** End-of-block Interrupt Enable */    CSL_DmaOnOff    blockie;    /** Last Interrupt Enable */    CSL_DmaOnOff    lastie;    /** Frame Interrupt Enable */    CSL_DmaOnOff    frameie;    /** Half Interrupt Enable */    CSL_DmaOnOff    firsthalfie;    /** Drop Interrupt Enable */    CSL_DmaOnOff    dropie;    /** Timeout Interrupt Enable */    CSL_DmaOnOff    timeoutie;} CSL_DmaHwSetupIntr;/** @brief Structure that is used to setup global settings of DMA * * This structure is part of the CSL_DmaHwSetup structure, and is passed as a * member of the CSL_DmaHwSetup to the CSL_dmaHwSetup OR CSL_dmaOpen function. * Also the structure is used to collect the global setup information from * the CSL_dmaGetHwStatus function. */typedef struct CSL_DmaHwSetupGlobal {    /** DMA clocks auto gating enable */    CSL_DmaOnOff    autogating;    /** DMA reaction to the suspend signal */    Bool    free;    /** Exclusive priority for API channel */    Bool    apiexcl;    /** Priority for API channel */    CSL_DmaPriority apiprio;    /** SARAM timeout counter enable */    Bool    stce;    /** DARAM timeout counter enable */    Bool    dtce;    /** Source/Destination Index Mode Control(Same or Different) */    CSL_DmaIndexMode    indexMode;} CSL_DmaHwSetupGlobal;/** @brief Structure that is used to setup DMA * * This structure is used to pass setup parameters to the CSL_dmaHwSetup * function, which in turn writes to various registers of the DMA hardware * to configure the peripheral for a particular data transfer. */typedef struct CSL_DmaHwSetup {    /** Pointer to the source port setup structure */    CSL_DmaHwSetupSrcPort   *srcStruct;    /** Pointer to the destination port setup structure */    CSL_DmaHwSetupDstPort   *dstStruct;    /** Pointer to the channel setup structure */    CSL_DmaHwSetupChannel   *channelStruct;    /** Pointer to the interrupt setup structure */    CSL_DmaHwSetupIntr      *intrStruct;    /** Pointer to the global setup structure */    CSL_DmaHwSetupGlobal    *globalStruct;} CSL_DmaHwSetup;/** * @brief   The config-structure * * Used to configure the DMA using CSL_dmaHwSetupRaw(..) */typedef struct  {    struct channel {    Uint16 CSDP;    Uint16 CCR;    Uint16 CICR;    Uint16 CSSAL;    Uint16 CSSAU;    Uint16 CDSAL;    Uint16 CDSAU;    Uint16 CEN;    Uint16 CFN;    Uint16 CSFI;    Uint16 CSEI;    Uint16 CDFI;    Uint16 CDEI;    }channel;    struct global  {    Uint16 GCR;    Uint16 GTCR;    Uint16 GSCR;    }global;} CSL_DmaConfig;/** * @brief   Default values for the config-structure */#define CSL_DMA_CONFIG_DEFAULTS {              \    {   \    CSL_DMA_CSDP_RESETVAL,  \    CSL_DMA_CCR_RESETVAL,   \    CSL_DMA_CICR_RESETVAL,  \    CSL_DMA_CSSAL_RESETVAL, \    CSL_DMA_CSSAU_RESETVAL, \    CSL_DMA_CDSAL_RESETVAL, \    CSL_DMA_CDSAU_RESETVAL, \    CSL_DMA_CEN_RESETVAL,   \    CSL_DMA_CFN_RESETVAL,   \    CSL_DMA_CSFI_RESETVAL,  \    CSL_DMA_CSEI_RESETVAL,  \    CSL_DMA_CDFI_RESETVAL,  \    CSL_DMA_CDEI_RESETVAL  \    }   \    {   \    CSL_DMA_GCR_RESETVAL,   \    CSL_DMA_GTCR_RESETVAL,  \    CSL_DMA_GSCR_RESETVAL  \    }   \}/** @brief Structure that is used to get status of DMA * * The CSL_DmaStatus structure is used to get status of DMA. This structure * is passed as an argument to CSL_dmaGetHwStatus function when the query * used is CSL_DMA_QUERY_STATUS */typedef struct CSL_DmaStatus {    /** Timeout occured? */    Bool        timeout;    /** Event dropped during transfer ? */    Bool        eventDrop;    /** Has first half of current frame been transferred? */    Bool        halfframe;    /** Has a complete frame been transferred? */    Bool        frame;    /** Has transfer of last frame started? */    Bool        lastframe;    /** Has current transfer in the channel been finished? (another may have started if DMA_CCR */    Bool        block;    /** Is channel waiting for synchronized GDMA request to be scheduled? */    Bool        sync;    /** Source address counter */    Uint16      srcAddrCntr;    /** Destination address counter */    Uint16      dstAddrCntr;} CSL_DmaStatus;/** @brief This object contains the reference to the instance of DMA opened *  using the @a CSL_dmaOpen(). * *  The pointer to this, is passed to all DMA CSL APIs. */typedef struct CSL_DmaObj {    /** This is a pointer to the global registers of the instance of DMA      * referred to by this object */    CSL_DmaGlobalRegsOvly   gRegs;	/** This is the instance of DMA being referred to by this object  */	CSL_InstNum  	perNum;    /** This is a pointer to the channel registers of the instance of DMA channel     * referred to by this object */    CSL_DmaChaRegsOvly      regs;    /** This is the instance of DMA channel being referred to by this object */    Int           chaNum;} CSL_DmaObj;typedef struct CSL_DmaObj *CSL_DmaHandle;/** @brief This will have the base-address information for the peripheral *  instance */typedef struct {    /** This is a pointer to the global registers of the instance of DMA      * referred to by this object */    CSL_DmaGlobalRegsOvly   gRegs;    /** This is a pointer to the channel registers of the instance of DMA channel     * referred to by this object */    CSL_DmaChaRegsOvly      regs;} CSL_DmaBaseAddress;/** @brief Module specific parameters.  */typedef struct{	/** Bit mask to be used for selecting module specific parameters. For this 	 *  module, this is not used as there is only one module specific parameter. 	 *  So user need not worry about this.	 */	CSL_BitMask16   flags;    /**The channel number for DMA is to be specified. Channel numbers are       * defined as macro CSL_DMA_CHA<n> where n is channel number supported.     */    Int chaNum;} CSL_DmaParam;/** @brief Module specific context information. Present implementation doesn't have *  any Context information. */typedef struct {	/** Context information of DMA.     *  The below declaration is just a place-holder for future 	 *  implementation. 	 */    Uint16	contextInfo;} CSL_DmaContext;/**************************************************************************\* DMA global function declarations\**************************************************************************//**************************************************************************\* DMA global function declarations\**************************************************************************//** @brief Peripheral specific initialization function. * * This is the peripheral specific intialization function. This function is * idempotent in that calling it many times is same as calling it once. * This function initializes the CSL data structures, and doesn't touches * the hardware. * * <b> Usage Constraints: </b> * This function should be called before using any of the CSL APIs in the DMA * module. * *  Note: As DMA doesn't have any context based information, currently, the function *  just returns CSL_SOK. User is expected to pass NULL in the function call. * * @b Example: * @verbatim   ...   if (CSL_SOK != CSL_dmaInit(NULL)) {       return;   }   @endverbatim * * @return returns the status of the operation * */CSL_Status CSL_dmaInit(	/** DMA specific context information	 */	CSL_DmaContext * pContext	);/** @brief Opens the instance of DMA requested. * *  The open call sets up the data structures for the particular instance of *  DMA device. The device can be re-opened anytime after it has been normally *  closed if so required. The handle returned by this call is input as an *  essential argument for rest of the APIs described for this module. * *  <b> Usage Constraints: </b> *  DMA must be successfully initialized via @a CSL_dmaInit() before calling *  this function. Memory for the @a CSL_dmaObj must be allocated outside *  this call. This object must be retained while usage of this peripheral. * *  @b Example: *  @verbatim	  CSL_DmaObj     dmaObj;	  CSL_Status       status;	  CSL_DmaParam  dmaParam;	  dmaParam.chaNum = CSL_DMA_CHA2 ; 		...	  hDma = CSL_dmaOpen(&dmaObj,                          CSL_DMA,                          &dmaParam,                          &status);   @endverbatim * * @return returns a handle @a CSL_DmaHandle to the requested instance of * DMA if the call is successful, otherwise, a @a NULL is returned. * */CSL_DmaHandle CSL_dmaOpen (    /** Pointer to the object that holds reference to the     *  instance of DMA requested after the call     */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?