csl_dma.h
来自「dsp在音频处理中的运用」· C头文件 代码 · 共 1,072 行 · 第 1/3 页
H
1,072 行
}global;
struct lcdch {
Uint16 LCDCSDP;
Uint16 LCDCCR;
Uint16 LCDCTRL;
Uint16 LCDTOPB1L;
Uint16 LCDTOPB1U;
Uint16 LCDBOTB1L;
Uint16 LCDBOTB1U;
Uint16 LCDTOPB2L;
Uint16 LCDTOPB2U;
Uint16 LCDBOTB2L;
Uint16 LCDBOTB2U;
Uint16 LCDSRCEIB1;
Uint16 LCDSRCFIB1L;
Uint16 LCDSRCEIB2;
Uint16 LCDSRCFIB2L;
Uint16 LCDSRCENB1;
Uint16 LCDSRCENB2;
Uint16 LCDSRCFNB1;
Uint16 LCDSRCFNB2;
Uint16 LCDLCHCTRL;
}lcdch;
} 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_CDEI_RESETVAL,\
CSL_DMA_CDFI_RESETVAL,\
CSL_DMA_COLORL_RESETVAL,\
CSL_DMA_COLORU_RESETVAL,\
CSL_DMA_CCR2_RESETVAL,\
CSL_DMA_CLNKCTRL_RESETVAL,\
CSL_DMA_LCHCTRL_RESETVAL\
} \
{ \
CSL_DMA_GCR_RESETVAL,\
CSL_DMA_GSCR_RESETVAL,\
CSL_DMA_GRST_RESETVAL\
} \
{ \
CSL_DMA_LCDCSDP_RESETVAL,\
CSL_DMA_LCDCCR_RESETVAL,\
CSL_DMA_LCDCTRL_RESETVAL,\
CSL_DMA_LCDTOPB1L_RESETVAL,\
CSL_DMA_LCDTOPB1U_RESETVAL,\
CSL_DMA_LCDBOTB1L_RESETVAL,\
CSL_DMA_LCDBOTB1U_RESETVAL,\
CSL_DMA_LCDTOPB2L_RESETVAL,\
CSL_DMA_LCDTOPB2U_RESETVAL,\
CSL_DMA_LCDBOTB2L_RESETVAL,\
CSL_DMA_LCDBOTB2U_RESETVAL,\
CSL_DMA_LCDSRCEIB1_RESETVAL,\
CSL_DMA_LCDSRCFIB1L_RESETVAL,\
CSL_DMA_LCDSRCEIB2_RESETVAL,\
CSL_DMA_LCDSRCFIB2L_RESETVAL,\
CSL_DMA_LCDSRCENB1_RESETVAL,\
CSL_DMA_LCDSRCENB2_RESETVAL,\
CSL_DMA_LCDSRCFNB1_RESETVAL,\
CSL_DMA_LCDSRCFNB2_RESETVAL,\
CSL_DMA_LCDLCHCTRL_RESETVAL\
} \
}
/** @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;
...
hDma = CSL_dmaOpen(&dmaObj,
CSL_DMA_1,
NULL,
&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
*/
CSL_DmaObj* pDmaObj,
/** Instance of DMA to which a handle is requested
*/
CSL_InstNum dmaNum,
/** Module specific parameters;
* Currently there are none; the user should pass 'NULL'
*/
CSL_DmaParam *pDmaParam,
/** This returns the status (success/errors) of the call.
* Could be 'NULL' if the user does not want status information.
*/
CSL_Status *pStatus
);
/*
* ======================================================
* @func CSL_dmaClose
* ======================================================
*/
/** @brief
* Close (Invalidate) a DMA channel (passed as handle) after it has finished
* operating. The channel cannot be accessed any more.
*
*/
/* ======================================================
* @arg hDma
* Handle to channel
* @ret CSL_Status
*
* ======================================================
*/
CSL_Status CSL_dmaClose(
CSL_DmaHandle hDma
);
/*
* ======================================================
* @func CSL_dmaHwSetup
* ======================================================
*/
/** @brief
* Configures a DMA channel using the different config structures.
* Sets up a particular DMA channel (passed as handle) using the
* configurations specified in the different structures (CSL_dmaHwSetupSrc,
* CSL_DmaSetupSrcPort, CSL_DmaSetupDstPort and CSL_DmaSetupGlobal). This function
* calls the respective functions.
* The function will return an error if cannot complete the request
*
*/
/* ======================================================
* @arg hDma
* Handle to the DMA Channel
* @arg setup
* DMA setup structure for the DMA Channel
* @ret CSL_Status
*
*
* ======================================================
*/
CSL_Status CSL_dmaHwSetup(
CSL_DmaHandle hDma,
CSL_DmaHwSetup *setup
);
/** This function initializes the device registers with the register-values
* provided through the Config Data structure. For information passed through
* the Config Data structure refer to @a CSL_DmaConfig.
*
* <b> Usage Constraints: </b>
* The user has to allocate space for & fill in the main setup structure
* appropriately before calling this function.
*
* @b Example:
* @verbatim
CSL_DmaHandle hDma;
CSL_DmaConfig config;
config.channel.CSSAL = 0x1234;
config.channel.CSSAU = 0x0078;
....
....
....
CSL_dmaHwSetupRaw(hDma, &config);
@endverbatim
*
* @return Returns the status of the setup operation
*
*/
CSL_Status CSL_dmaHwSetupRaw(
CSL_DmaHandle hDma,
CSL_DmaConfig * setup
);
/*
* ======================================================
* @func CSL_dmaHwControl
* ======================================================
*/
/** @brief Controls the parameters of a particular DMA channel (passed as handle)
*
*/
/* ======================================================
* The function will return an error if cannot complete the request
*
* @arg hDma
* Handle to the channel
* @arg cmd
* The operation to be performed.
* @arg voidPtr
* This is a void pointer, and will be cast to the required type.
* @ret CSL_Status
* CSL_SOK : Successful, desired operation is done.
* CSL_ESYS_INVCNTLCMD : Control Command is not supported.
*
* ======================================================
*/
CSL_Status CSL_dmaHwControl(
CSL_DmaHandle hDma,
CSL_DmaControlCmd cmd,
void *voidPtr
);
/*
** @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
);
/*
* ======================================================
* @func CSL_dmaGetHwStatus
* ======================================================
*/
/** @brief
* Traces the various parameters of a particular DMA channel (passed as handle)
*
*/
/* ======================================================
*
* Usage Constraints:
* Channel should have been opened before with a valid handle
* We should know that the registers can be read back.
*
* The are various Operations that can be done here are:
* 1) Trace the channel setup configuration
* 2) Get the Status of the channel
*
* The function will return an error if cannot complete the request
*
* @arg hDma
* Handle to the channel
* @arg cmd
* The Values to be traced back
* @arg voidPtr
* This is a void pointer, and will be cast to the required type.
* @ret CSL_Status
*
*
* ======================================================
*/
CSL_Status CSL_dmaGetHwStatus(
CSL_DmaHandle hDma,
CSL_DmaHwStatusQuery query,
void *voidPtr
);
/** @brief Function to get the Base-address of the peripheral instance.
*
* This function is used for getting the base-address of the peripheral
* instance. This function will be called inside the @ CSL_dmaOpen()
* function call.
*
* Note: This function is open for re-implementing if the user wants to modify
* the base address of the peripheral object to point to a different
* location and there by allow CSL initiated write/reads into peripheral
* MMR's go to an alternate location. Please refer the documentation for
* more details.
*
* @b Example:
* @verbatim
CSL_Status status;
CSL_DmaBaseAddress baseAddress;
...
status = CSL_dmaGetBaseAddress(CSL_DMA_1, NULL, &baseAddress);
@endverbatim
*
* @return Returns the status of the operation (see @a CSL_Status)
*
*/
CSL_Status CSL_dmaGetBaseAddress(
/** Instance number
*/
CSL_InstNum dmaNum,
/** Module specific parameters
*/
CSL_DmaParam * pDmaParam,
/** Base address details
*/
CSL_DmaBaseAddress *pBaseAddress
);
#ifdef __cplusplus
}
#endif
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?