📄 csl_spi.h
字号:
... status = CSL_spiClose (hSpi); ... @endverbatim * ============================================================================= */CSL_Status CSL_spiClose( /** Pointer to the object that holds reference to the * instance of SPI requested after the call */ CSL_SpiHandle hSpi);/** ============================================================================ * @n@b CSL_spiHwSetup * * @b Description * @n It configures the SPI registers as per the values passed * in the hardware setup structure. * * @b Arguments * @verbatim hSpi Handle to the Spi instance setup Pointer to harware setup structure @endverbatim * * <b> Return Value </b> CSL_Status * @li CSL_SOK - Hardware setup successful * @li CSL_ESYS_BADHANDLE - Invalid handle * @li CSL_ESYS_INVPARAMS - Hardware structure is not properly initialized * * <b> Pre Condition </b> * @n None * * <b> Post Condition </b> * @n SPI controller registers are configured according * to the hardware setup parameters * * @b Modifies * @n SPI controller registers * * @b Example * @verbatim CSL_SpiHandle hSpi; CSL_SpiHwSetup hwSetup; CSL_status status; ... status = CSL_spiHwSetup(hSpi, &hwSetup); @endverbatim * =========================================================================== *//** @brief programs the SPI to a useful state as specified */CSL_Status CSL_spiHwSetup( /** pointer to the object that holds reference to the instance of SPI * requested after the call */ CSL_SpiHandle hSpi, /** pointer to setup structure which contains the information to program * SPI to a useful state */ CSL_SpiHwSetup *setup);/** ============================================================================ * @n@b CSL_spiGetHwSetup * * @b Description * @n It retrives the hardware setup parameters of the SPI instance * specified by the given handle. * * @b Arguments * @verbatim hSpi Handle to the SPI intance hwSetup Pointer to the harware setup structure @endverbatim * * <b> Return Value </b> CSL_Status * @li CSL_SOK - Retrieving the hardware setup * parameters is successful * @li CSL_ESYS_BADHANDLE - The handle is passed is * invalid * @li CSL_ESYS_INVPARAMS - Invalid parameter * * <b> Pre Condition </b> * @n None * * <b> Post Condition </b> * @n Hardware setup parameters are returned in the hwSetup variable * * @b Modifies * @n hwSetup variables * * @b Example * @verbatim CSL_SpiHandle hSpi; CSL_SpiHwSetup hwSetup; ... status = CSL_SpiGetHwSetup(hSpi, &hwSetup); ... @endverbatim * =========================================================================== */CSL_Status CSL_spiGetHwSetup( /** pointer to the object that holds reference to the * instance of SPI requested after the call */ CSL_SpiHandle hSpi, /** the query to this API which indicates the status/setup * to be returned */ CSL_SpiHwSetup *setup);/** ============================================================================ * @n@b CSL_spiHwControl * * @b Description * @n Takes a command of SPI with an optional argument & implements it. * * @b Arguments * @verbatim hSpi Handle to the SPI instance cmd The command to this API indicates the action to be taken on SPI. arg An optional argument. @endverbatim * * <b> Return Value </b> CSL_Status * @li CSL_SOK - Status info return successful. * @li CSL_ESYS_BADHANDLE - Invalid handle * @li CSL_ESYS_INVCMD - Invalid command * @li CSL_ESYS_INVPARAMS - Invalid parameter * @li CSL_ESYS_NOTSUPPORTED - Action Not Supported * * <b> Pre Condition </b> * @n None * * <b> Post Condition </b> * @n None * * @b Modifies * @n The hardware registers of SPI. * * @b Example * @verbatim CSL_SpiHandle hSpi; CSL_SpiHwControlCmd cmd=CSL_SPI_CMD_CPT_DMA_ENABLE; void arg; status = CSL_spiHwControl (hSpi, cmd, &arg); @endverbatim * ============================================================================= *//** @brief controls the different operations that can be performed by * SPI */CSL_Status CSL_spiHwControl( /** pointer to the object that holds reference to the instance of SPI * requested after the call */ CSL_SpiHandle hSpi, /** the command to this API which indicates the action to be taken */ CSL_SpiHwControlCmd cmd, /** an optional argument @a void* casted */ void *arg);/** ============================================================================ * @n@b CSL_spiInit * * @b Description * @n This is the initialization function for the SPI. This function is * idempotent in that calling it many times is same as calling it once. This * function does not modify any registers or check status. It returns status * CSL_SOK. It has been kept for future use. * * @b Arguments @verbatim pContext Context information for the instance. Should be NULL @endverbatim * * <b> Return Value </b> CSL_Status * @li CSL_SOK - Always returns * * <b> Pre Condition </b> * @n CSL_sysInit() must be called. * * <b> Post Condition </b> * @n None * * @b Modifies * @n None * * @b Example * @verbatim CSL_Status Status Status = CSL_spiInit(); @endverbatim * =========================================================================== */CSL_Status CSL_spiInit( CSL_SpiContext * pContext);/** =========================================================================== * @func CSL_spiHwSetupRaw * * @desc * This function configures the registers of SPI as per the values given * in the Config structure. * * @arg hSpi * Handle to the SPI instance * * @arg hwConfig * Pointer to SPI config structure * * @ret CSL_Status * CSL_SOK - Configuration successful * CSL_ESYS_BADHANDLE - Invalid handle * * @eg * * CSL_Status status; * CSL_SpiConfig hwConfig; * * status = CSL_spiHwsetupRaw (hSpi, &hwConfig); * * =========================================================================== */extern CSL_Status CSL_spiHwSetupRaw ( CSL_SpiHandle hSpi, CSL_SpiConfig * config);/** ============================================================================ * @n@b CSL_spiGetHwStatus * * @b Description * @n Gets the status of the different settings of SPI instance. * * @b Arguments * @verbatim hSpi Handle to the SPI instance query The query to this API of SPI which indicates the status to be returned. response Placeholder to return the status. @endverbatim * * <b> Return Value </b> CSL_Status * @li CSL_SOK - Status info return successful * @li CSL_ESYS_BADHANDLE - Invalid handle * @li CSL_ESYS_INVQUERY - Invalid query command * @li CSL_ESYS_INVPARAMS - Invalid parameter * @li CSL_ESYS_NOTSUPPORTED- Action Not Supported * * <b> Pre Condition </b> * @n None * * <b> Post Condition </b> * @n None * * @b Modifies * @n None * * @b Example * @verbatim CSL_SpiHandle hSpi; CSL_SpiHwStatusQuery query=CSL_SPI_QUERY_INT_VECTOR0; CSL_SpiIntVec reponse; status = CSL_spiGetHwStatus (hSpi, query, &response); @endverbatim * ============================================================================= */CSL_Status CSL_spiGetHwStatus( /** pointer to the object that holds reference to the instance of SPI * requested after the call */ CSL_SpiHandle hSpi, /** the query to this API which indicates the status/setup to be * returned */ CSL_SpiHwStatusQuery query, /** placeholder to return the status; @a void* casted */ void *response);/** =========================================================================== * @n@b CSL_spiGetBaseAddress * * @b Description * @n 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_spiOpen() * function call. 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. * * @b Arguments * @verbatim spiNum Specifies the instance of SPI to be opened. pSpiParam Module specific parameters. pBaseAddress Pointer to baseaddress structure containing base address details. @endverbatim * * <b> Return Value </b> CSL_Status * @li CSL_OK Open call is successful * @li CSL_ESYS_FAIL The instance number is invalid. * @li CSL_ESYS_INVPARAMS Invalid Parameters passed * * <b> Pre Condition </b> * @n None * * <b> Post Condition </b> * @n Base Address structure is populated * * @b Modifies * @n 1. The status variable * * 2. Base address structure is modified. * * @b Example * @verbatim CSL_Status status; CSL_SpiBaseAddress baseAddress; ... status = CSL_spiGetBaseAddress(CSL_SPI_0, NULL, &baseAddress); @endverbatim * ============================================================================ */extern CSL_Status CSL_spiGetBaseAddress ( CSL_InstNum spiNum, CSL_SpiParam * pSpiParam, CSL_SpiBaseAddress * pBaseAddress);#ifdef __cplusplus}#endif#endif /* _CSL_SPI_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -