📄 csl_mcbsp.h
字号:
* =============================================================================
* @func CSL_mcbspRead
*
* @desc
* Reads the data from MCBSP. The word length for the read operation is
* specefied using wordLen argument. According to this word length,
* appropriate amount of data will read in the data object (variable);
* the pointer to which is passed as the third argument.
*
* @arg hMcbsp
* Handle to the mcbsp instance
*
* @arg wordLen
* Word length of data to be read in
*
* @arg data
* Pointer to data object (variable) that will hold the input data
*
* @ret CSL_Status
* CSL_SOK - Read successful
* CSL_EMCBSP_INVSIZE - Invalid word length
* CSL_ESYS_INVPARAMS - Invalid data pointer
*
* @eg
* CSL_mcbspHandle hMcbsp;
* Uint16 inData;
* CSL_Status status;
* ...
* // MCBSP object defined and HwSetup structure defined and initialized
* ...
*
* // Init, Open, HwSetup successfully done in that order
* ...
* // MCBSP SRG, Frame sync, RCV taken out of reset in that order
* ...
* status = CSL_mcbspRead(hMcbsp, CSL_MCBSP_WORDLEN_16, &inData);
* ...
* ===========================================================================
*/
extern CSL_Status CSL_mcbspRead (
CSL_McbspHandle hMcbsp,
CSL_McbspWordLen wordLen,
void *data
);
/*
* =============================================================================
* @func CSL_mcbspWrite
*
* @desc
* Transmits the data from MCBSP. The word length for the write operation is
* specefied using wordLen argument. According to this word length, the
* appropriate amount of data will transmitted from the data object (variable);
* the pointer to which is passed as the third argument.
*
* @arg hMcbsp
* Handle to the mcbsp instance
*
* @arg wordLen
* Word length of data to be write
*
* @arg data
* Pointer to data object (variable) that holds the data to be sent out
*
* @ret CSL_Status
* CSL_SOK - Read successful
* CSL_EMCBSP_INVSIZE - Invalid word length
* CSL_ESYS_INVPARAMS - Invalid data pointer
*
* @eg
* CSL_mcbspHandle hMcbsp;
* Uint16 outData;
* CSL_Status status;
* ...
* // MCBSP object defined and HwSetup structure defined and initialized
* ...
*
* // Init, Open, HwSetup successfully done in that order
* ...
* // MCBSP SRG, Frame sync, RCV taken out of reset in that order
* ...
* outData = 0x1234;
* status = CSL_mcbspWrite(hMcbsp,CSL_MCBSP_WORDLEN_16,&outData);
* ...
* ===========================================================================
*/
extern CSL_Status CSL_mcbspWrite (
CSL_McbspHandle hMcbsp,
CSL_McbspWordLen wordLen,
void *data
);
/*
* =============================================================================
* @func CSL_mcbspIoWrite
*
* @desc
* Sends the data using MCBSP pin which is configured as general purpose
* output.The 16-bit data trasnmitted is specified by 'outputData' argument.
* MCBSP pin to use in this write operation is identified by the second
* argument.
*
* @arg hMcbsp
* Handle to the mcbsp instance
*
* @arg outputSel
* MCBSP pin to be used as general purpose output
*
* @arg outputData
* 1 bit output data to be transmitted
*
* @ret
* None
*
* @eg
* Uint16 outData;
* CSL_Status status;
* CSL_McbspHandle hMcbsp;
* ...
* // MCBSP object defined and HwSetup structure defined and initialized
* ...
*
* // Init, Open, HwSetup successfully done in that order
* ...
* outData = 1;
* inData = CSL_mcbspIoWrite(hMcbsp, CSL_MCBSP_IO_CLKX, outData);
* ...
* ===========================================================================
*/
extern void CSL_mcbspIoWrite (
CSL_McbspHandle hMcbsp,
CSL_BitMask16 outputSel,
Uint16 outputData
);
/*
* =============================================================================
* @func CSL_mcbspIoWrite
*
* @desc
* Reads the data from MCBSP pin which is configured as general purpose
* input.The 16-bit data read from this pin is returned by this API. MCBSP
* pin to use in this read operation is identified by the second argument.
*
* @arg hMcbsp
* Handle to the mcbsp instance
*
* @arg inputSel
* MCBSP pin to be used as general purpose input
*
* @ret Uint16
* data read from the pin(s)
*
* @eg
* Uint16 inData, clkx_data, clkr_data;
* CSL_Status status;
* CSL_BitMask16 inMask;
* CSL_McbspHandle hMcbsp;
* ...
* // MCBSP object defined and HwSetup structure defined and initialized
* ...
*
* // Init, Open, HwSetup successfully done in that order
* ...
* inMask = CSL_MCBSP_IO_CLKX | CSL_MCBSP_IO_CLKR;
* inData = CSL_mcbspIoRead(hMcbsp, inMask);
*
* if ((inData & CSL_MCBSP_IO_CLKX) != 0)
* clkx_data = 1;
* else
* clkx_data = 0;
* if ((inData & CSL_MCBSP_IO_CLKR) != 0)
* clkr_data = 1;
* else
* clkr_data = 0;
* ...
* ===========================================================================
*/
extern Uint16 CSL_mcbspIoRead (
CSL_McbspHandle hMcbsp,
CSL_BitMask16 inputSel
);
/** ============================================================================
* @func CSL_mcbspHwControl
*
* @desc
* This function takes an input control command with an optional argument
* and accordingly controls the operation/configuration of MCBSP.
*
* @arg hMcbsp
* Handle to the Mcbsp instance
*
* @arg cmd
* Operation to be performed on the mcbsp instance
*
* @arg cmdArg
* Arguement specific to the command
*
* @ret CSL_Status
* CSL_SOK - Command execution successful.
* CSL_ESYS_BADHANDLE - Invalid handle
* CSL_ESYS_INVCMD - Invalid command
* CSL_ESYS_INVPARAMS - The parameter is invalid
*
* @eg
* CSL_Status status;
* CSL_BitMask16 ctrlMask;
* CSL_McbspHandle hMcbsp;
* ...
* // MCBSP object defined and HwSetup structure defined and initialized
* ...
*
* // Init successfully done
* ...
* // Open successfully done
* ...
* // HwSetup sucessfully done
* ...
* // MCBSP SRG and Frame sync taken out of reset
* ...
*
* ctrlMask = CSL_MCBSP_CTRL_RX_ENABLE | CSL_MCBSP_CTRL_TX_ENABLE;
* status = CSL_mcbspHwControl (hMcbsp, CSL_MCBSP_CMD_RESET_CONTROL,
* &ctrlMask);
* ...
* ===========================================================================
*/
extern CSL_Status CSL_mcbspHwControl (
CSL_McbspHandle hMcbsp,
CSL_McbspControlCmd cmd,
void *arg
);
/** ============================================================================
* @func CSL_mcbspGetHwStatus
*
* @desc
* Gets the status of different operations or some setup-parameters of MCBSP.
* The status is returned through the third parameter.
*
* @arg hMcbsp
* Handle to the Mcbsp instance
*
* @arg myQuery
* Query to be performed
*
* @arg response
* Pointer to buffer to return the data requested by the query passed
*
* @ret CSL_Status
* CSL_SOK - Query execution successful.
* CSL_ESYS_BADHANDLE - Invalid handle
* CSL_ESYS_INVQUERY - Invalid Query
* CSL_ESYS_INVPARAMS - The parameter is invalid
*
* @eg
* CSL_Status status;
* CSL_BitMask16 ctrlMask;
* CSL_McbspHandle hMcbsp;
* Uint16 response;
* ...
* status = CSL_mcbspGetHwStatus(hMcbsp,CSL_MCBSP_QUERY_DEV_STATUS,
* &response);
*
* if (response & CSL_MCBSP_RRDY) {
* // Receiver is ready to with new data
* ...
* }
* ...
* ===========================================================================
*/
extern CSL_Status CSL_mcbspGetHwStatus (
CSL_McbspHandle hMcbsp,
CSL_McbspHwStatusQuery myQuery,
void *response
);
/*
* ============================================================================
* @func CSL_mcbspGetHwSetup
*
* @desc
* Gets the status of some or all of the setup-parameters of MCBSP.
* To get the status of complete MCBSP h/w setup, all the sub-structure
* pointers inside the main HwSetup structure, should be non-NULL.
*
* @arg hMcbsp
* Handle to the mcbsp instance
*
* @arg hwSetup
* Pointer to hardware setup structure
*
* @ret CSL_Status
* CSL_SOK - Hardware setup successful
* CSL_ESYS_BADHANDLE - Invalid handle
* CSL_ESYS_INVPARAMS - Hardware structure is not
* properly initialized
*
* @eg
* CSL_status status;
* CSL_McbspGlobalSetup gblSetup;
* CSL_McbspClkSetup clkSetup;
* CSL_McbspEmu emuMode;
*
* CSL_McbspHwSetup readSetup = {
&gblSetup,
NULL, // RX Data-setup structure if not required
NULL, // TX Data-setup structure if not required
&clkSetup,
NULL, // Multichannel-setup structure if not required
emuMode
};
*
* status = CSL_mcbspGetHwSetup (hMcbs, &hwSetup);
*
* ===========================================================================
*/
extern CSL_Status CSL_mcbspGetHwSetup (
CSL_McbspHandle hMcbsp,
CSL_McbspHwSetup *myHwSetup
);
/** ============================================================================
* @n@b CSL_mcbspGetBaseAddress
*
* @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_mcbspOpen()
* 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
mcbspNum Specifies the instance of the MCBSP to be opened.
pMcbspParam Module specific parameters.
pBaseAddress Pointer to baseaddress structure.
@endverbatim
*
* <b> Return Value </b> CSL_Status
* @li CSL_OK Open call is successful
* @li CSL_ESYS_FAIL The instance number is invalid.
*
* <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_McbspBaseAddress baseAddress;
...
status = CSL_mcbspGetBaseAddress(CSL_MCBSP_PER_CNT, NULL, &baseAddress);
@endverbatim
* ===========================================================================
*/
CSL_Status CSL_mcbspGetBaseAddress (
CSL_InstNum mcbspNum,
CSL_McbspParam *pMcbspParam,
CSL_McbspBaseAddress *pBaseAddress
);
#ifdef __cplusplus
}
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -