📄 csl_hpi.h
字号:
* @b Arguments
* @verbatim
hpiNum Specifies the instance of the hpi to be opened.
pHpiParam Module specific parameters.
pBaseAddress Pointer to base address 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 parameter
*
* <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_HpiBaseAddress baseAddress;
...
status = CSL_hpiGetBaseAddress(CSL_HPI, NULL,
&baseAddress);
...
@endverbatim
* ===========================================================================
*/
extern CSL_Status CSL_hpiGetBaseAddress (
CSL_InstNum hpiNum,
CSL_HpiParam *pHpiParam,
CSL_HpiBaseAddress *pBaseAddress
);
/** ============================================================================
* @n@b CSL_hpiClose
*
* @b Description
* @n This function closes the specified instance of HPI.
*
* @b Arguments
* @verbatim
hHpi Handle to the HPI
@endverbatim
*
* <b> Return Value </b> CSL_Status
* @li CSL_SOK - Close successful
* @li CSL_ESYS_BADHANDLE - Invalid handle
*
* <b> Pre Condition </b>
* @n The HPI instance should be opened before this close operation.
*
* <b> Post Condition </b>
* @n The HPI CSL APIs can not be called until the HPI CSL is reopened
* again using CSL_hpiOpen().
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_HpiHandle hHpi;
CSL_Status status;
...
status = CSL_hpiClose(hHpi);
@endverbatim
* ===========================================================================
*/
extern CSL_Status CSL_hpiClose (
CSL_HpiHandle hHpi
);
/** ============================================================================
* @n@b CSL_hpiHwSetup
*
* @b Description
* @n It configures the hpi registers as per the values passed
* in the hardware setup structure.
*
* @b Arguments
* @verbatim
hHpi Handle to the hpi
hwSetup Pointer to harware setup structure
@endverbatim
*
* <b> Return Value </b> CSL_Status
* @li CSL_SOK - Hardware setup successful
* @li CSL_ESYS_BADHANDLE - The handle passed is invalid
* @li CSL_ESYS_INVPARAMS - The parameter passed is
* invalid
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n HPI registers are configured according to the hardware setup
* parameters.
*
* @b Modifies
* @n HPI registers
*
* @b Example
* @verbatim
CSL_status status;
CSL_HpiHwSetup myHwSetup;
CSL_HpiHandle hHpi;
myHwSetup.HPIC = hwSetup->hpiCtrl;
.....
status = CSL_hpiHwSetup(hHpi, &hwSetup);
@endverbatim
* ===========================================================================
*/
extern CSL_Status CSL_hpiHwSetup (
CSL_HpiHandle hHpi,
CSL_HpiHwSetup *hwSetup
);
/** ============================================================================
* @n@b CSL_hpiHwControl
*
* @b Description
* @n This function takes an input control command with an optional argument
* and accordingly controls the operation/configuration of HPI.
*
* @b Arguments
* @verbatim
hHpi Handle to the HPI instance
cmd The command to this API indicates the action to be
taken on HPI.
arg An optional argument.
@endverbatim
*
* <b> Return Value </b> CSL_Status
* @li CSL_SOK - Command successful.
* @li CSL_ESYS_BADHANDLE - The handle passed is invalid
* @li CSL_ESYS_INVCMD - Invalid command
* @li CSL_ESYS_INVPARAMS - Invalid parameter
*
* <b> Pre Condition </b>
* @n CSL_hpiInit() and CSL_hpiOpen() must be called successfully in order
* before calling CSL_hpiHwControl().
*
* <b> Post Condition </b>
* @n HPI registers are configured according to the command passed.
*
* @b Modifies
* @n The hardware registers of HPI.
*
* @b Example
* @verbatim
CSL_HpiHandle hHpi;
CSL_HpiHwControlCmd cmd;
void arg;
status = CSL_hpiHwControl(hHpi, cmd, &arg);
@endverbatim
* =============================================================================
*/
extern CSL_Status CSL_hpiHwControl (
CSL_HpiHandle hHpi,
CSL_HpiHwControlCmd cmd,
void *arg
);
/** ============================================================================
* @n@b CSL_hpiGetHwStatus
*
* @b Description
* @n Gets the status of the different operations of HPI.
*
* @b Arguments
* @verbatim
hHpi Handle to the HPI instance
query The query to this API of HPI which indicates the
status to be returned.
response Placeholder to return the status.
@endverbatim
*
* <b> Return Value </b> CSL_Status
* @li CSL_SOK - Query successful
* @li CSL_ESYS_BADHANDLE - Invalid handle
* @li CSL_ESYS_INVQUERY - The Query passed is invalid
* @li CSL_ESYS_INVPARAMS - Invalid parameter
*
* <b> Pre Condition </b>
* @n CSL_hpiInit() and CSL_hpiOpen() must be called successfully in order
* before calling CSL_hpiGetHwStatus().
*
* <b> Post Condition </b>
* @n None
*
* @b Modifies
* @n Third parameter response vlaue
*
* @b Example
* @verbatim
CSL_HpiHandle hHpi;
CSL_HpiHwStatusQuery query;
void reponse;
status = CSL_hpiGetHwStatus(hHpi, query, &response);
@endverbatim
* =============================================================================
*/
extern CSL_Status CSL_hpiGetHwStatus (
CSL_HpiHandle hHpi,
CSL_HpiHwStatusQuery query,
void *response
);
/** ============================================================================
* @n@b CSL_hpiHwSetupRaw
*
* @b Description
* @n This function initializes the device registers with the register-values
* provided through the Config Data structure.
*
* @b Arguments
* @verbatim
hHpi Handle to the HPI instance
config Pointer to Config structure
@endverbatim
*
* <b> Return Value </b> CSL_Status
* @li CSL_SOK - Configuration successful
* @li CSL_ESYS_BADHANDLE - Invalid handle
* @li CSL_ESYS_INVPARAMS - Configuration is not
properly initialized
* <b> Pre Condition </b>
* @n CSL_hpiInit() and CSL_hpiOpen() must be called successfully in
* order before calling CSL_hpiGetHwSetupRaw().
*
* <b> Post Condition </b>
* @n The registers of the specified HPI instance will be setup
* according to input configuration structure values.
*
* @b Modifies
* @n Hardware registers of the specified HPI instance.
*
* @b Example
* @verbatim
CSL_HpiHandle hHpi;
CSL_HpiConfig config = CSL_HPI_CONFIG_DEFAULTS;
CSL_Status status;
status = CSL_hpiHwSetupRaw(hHpi, &config);
@endverbatim
* =============================================================================
*/
extern CSL_Status CSL_hpiHwSetupRaw (
CSL_HpiHandle hHpi,
CSL_HpiConfig *config
);
/** ============================================================================
* @n@b CSL_hpiGetHwSetup
*
* @b Description
* @n It retrives the hardware setup parameters of the hpi
* specified by the given handle.
*
* @b Arguments
* @verbatim
hHpi Handle to the hpi
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 CSL_hpiInit() and CSL_hpiOpen() must be called successfully in order
* before calling CSL_hpiGetHwSetup().
*
* <b> Post Condition </b>
* @n The hardware setup structure is populated with the hardware setup
* parameters
*
* @b Modifies
* @n hwSetup variable
*
* @b Example
* @verbatim
CSL_HpiHandle hHpi;
CSL_HpiHwSetup hwSetup;
...
status = CSL_hpiGetHwSetup(hHpi, &hwSetup);
...
@endverbatim
* ===========================================================================
*/
extern CSL_Status CSL_hpiGetHwSetup(
CSL_HpiHandle hHpi,
CSL_HpiHwSetup *hwSetup
);
#ifdef __cplusplus
}
#endif
#endif /* _CSL_HPI_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -