📄 csl_bwmngmt.h
字号:
CSL_Status CSL_bwmngmtClose
(
/** Pointer to the object that holds reference to the
* instance of BWMNGMT requested after the call
*/
CSL_BwmngmtHandle hBwmngmt
);
/** ============================================================================
* @n@b CSL_bwmngmtHwSetup
*
* @b Description
*
* Configures the BWMNGMT using the values passed in through the
* setup structure.
*
* <b> Usage Constraints: </b>
* Both @a CSL_bwmngmtInit() and @a CSL_bwmngmtOpen() must be called
* successfully in that order before this function can be called. The
* main setup structure consists of fields used for the configuration at
* start up. The user must allocate space for it and fill in the main
* setup structure fields appropriately before a call to this function
* is made. \n
*
* @b Arguments
* @verbatim
hBwmngmt Handle to the BWMNGMT instance
setup Setup structure for BWMNGMT
* @endverbatim
*
* <b> Return Value </b> CSL_Status
* CSL_SOK - Close successful
* CSL_ESYS_BADHANDLE - Invalid handle
* CSL_ESYS_INVPARAMS - IF setup is NULL
*
* The following registers and fields are programmed by this API \n
1. CPU Arbitration Parameters \n
- PRI field set in L1D, L2 and/or EXT \n
- MAXWAIT field set in L1D, L2 and/or EXT \n
2. IDMA Arbitration Parameter \n
- MAXWAIT field set in L1D, L2 and/or EXT \n
3. SLAP Arbitration Parameter \n
- MAXWAIT field set in L1D, L2 and/or EXT \n
4. MAP Arbitration Parameter \n
- PRI field set in EXT \n
5. UC Arbitration Parameter \n
- MAXWAIT field set in L1D and/or L2 \n
The @b control: bitmask indicates which of the three control blocks \n
(L1D, L2 and EXT) will be set with the associated PRI and MAXWAIT values \n
Note: That if associated control block is not programmable for given requestor\n
then it will not ignored but no error will be provide. This allows the user \n
to set control to CSL_BWMNGMT_BLOCK_ALL which is the default value. This will
set \n all programmed arbitration values for a given requestor to the same
value across \n the blocks which is recommended. \n
If PRI is set to CSL_BWMNGMT_PRI_NULL (-1) then no change will be made for the \n
corresponding requestors priority level. \n
If MAXWAIT is set to CSL_BWMNGMT_MAXWAIT_NULL (-1) then no change will be made \n
for the corresponding requestors maxwait setting. \n
* @b Examples:
* @verbatim
Example 1: Sets Priorities and Maxwaits to default values
CSL_BwmngmtHandle hBwmngmt;
CSL_BwmngmtHwSetup hwSetup;
hwSetup = CSL_BWMNGMT_HWSETUP_DEFAULTS;
...
// Init Successfully done
...
// Open Successfully done
...
CSL_bwmngmtHwSetup(hBwmngmt, &hwSetup);
Example 2: Sets CPU Priority to 1, CPU Maxwait to 8, MAP Priority to 6 for all
blocks (L1D, L2 and EXT)
CSL_BwmngmtHandle hBwmngmt;
CSL_BwmngmtHwSetup hwSetup;
hwSetup.cpuPriority = CSL_BWMNGMT_PRI_1;
hwSetup.cpuMaxwait = CSL_BWMNGMT_MAXWAIT_8;
hwSetup.idmaMaxwait = CSL_BWMNGMT_MAXWAIT_NULL;
hwSetup.slapMaxwait = CSL_BWMNGMT_MAXWAIT_NULL;
hwSetup.mapPriority = CSL_BWMNGMT_PRI_6;
hwSetup.ucMaxwait = CSL_BWMNGMT_MAXWAIT_NULL;
hwSetup.control = CSL_BWMNGMT_BLOCK_ALL;
...
// Init Successfully done
...
// Open Successfully done
...
CSL_bwmngmtHwSetup(hBwmngmt, &hwSetup);
@endverbatim
*
* ===========================================================================
*/
CSL_Status CSL_bwmngmtHwSetup
(
/** Pointer to the object that holds reference to the
* instance of BWMNGMT requested after the call
*/
CSL_BwmngmtHandle hBwmngmt,
/** Pointer to setup structure which contains the
* information to program BWMNGMT to a useful state
*/
CSL_BwmngmtHwSetup* setup
);
/** ============================================================================
* @n@b CSL_bwmngmtGetHwSetup
*
* @b Description
*
* <b> Usage Constraints: </b>
* Both @a CSL_bwmngmtInit() and @a CSL_bwmngmtOpen() must be called
* successfully in that order before this function can be called.\n
*
* The following registers and fields are queried by this API \n
* @b Arguments
* @verbatim
hBwmngmt Handle to the BWMNGMT instance
setup Setup structure for BWMNGMT
* @endverbatim
*
* <b> Return Value </b> CSL_Status
* CSL_SOK - Close successful
* CSL_ESYS_BADHANDLE - Invalid handle
* CSL_ESYS_INVPARAMS - IF setup is NULL
*
1. CPU Arbitration Parameters \n
- PRI field set in Control Block Specified by "control" \n
- MAXWAIT field set in Control Block Specified by "control" \n
2. IDMA Arbitration Parameter \n
- MAXWAIT field set in Control Block Specified by "control" \n
3. SLAP Arbitration Parameter \n
- MAXWAIT field set in Control Block Specified by "control" \n
4. MAP Arbitration Parameter \n
- PRI field set in Control Block Specified by "control" \n
if not EXT then returns CSL_BWMNGMT_PRI_NULL \n
5. UC Arbitration Parameter \n
- MAXWAIT field set in Control Block Specified by "control" \n
if not L1D or L2 then returns CSL_BWMNGMT_MAXWAIT_NULL \n
* @b Example:
* @verbatim
CSL_BwmngmtHandle hBwmngmt;
CSL_BwmngmtHwSetup hwSetup;
hwSetup.control = CSL_BWMNGMT_BLOCK_L1D;
// only CSL_BWMNGMT_BLOCK_L1D, CSL_BWMNGMT_BLOCK_L2, or
// CSL_BWMNGMT_BLOCK_EXT are valid
...
// Init Successfully done
...
// Open Successfully done
...
CSL_bwmngmtGetHwSetup(hBwmngmt, &hwSetup);
@endverbatim
*
* ===========================================================================
*/
CSL_Status CSL_bwmngmtGetHwSetup
(
/** Pointer to the object that holds reference to the
* instance of BWMNGMT requested after the call
*/
CSL_BwmngmtHandle hBwmngmt,
/** Placeholder to return the status; @a CSL_BwmngmtHwSetup* */
CSL_BwmngmtHwSetup* mySetup
);
/** ============================================================================
* @n@b CSL_bwmngmtHwControl
*
* @b Description
* @n Takes a command of BWMNGMT with an optional argument & implements it.
* Not Implemented. For future use
*
* @b Arguments
* @verbatim
hBwmngmt Handle to the BWMNGMT instance
cmd The command to this API indicates the action to be
taken on BWMNGMT.
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
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n None
*
* @b Modifies
* @n The hardware registers of BWMNGMT.
*
* @b Example
* @verbatim
CSL_BwmngmtHandle hBwmngmt;
CSL_BwmngmtHwControlCmd cmd;
void arg;
status = CSL_bwmngmtHwControl (hBwmngmt, cmd, &arg);
@endverbatim
* =============================================================================
*/
CSL_Status CSL_bwmngmtHwControl
(
/** Pointer to the object that holds reference to the
* instance of BWMNGMT requested after the call
*/
CSL_BwmngmtHandle hBwmngmt,
/** The command to this API which indicates the action to be taken */
CSL_BwmngmtHwControlCmd cmd,
/** Optional argument @a void* casted */
void *cmdArg
);
/** ============================================================================
* @n@b CSL_bwmngmtInit
*
* @b Description
* @n This is the initialization function for the BWMNGMT. 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 affect
* the H/W.
*
* @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 None
*
* <b> Post Condition </b>
* @n None
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
* ...
* if (CSL_sysInit() == CSL_SOK) {
* CSL_bwmngmtInit();
* }
* @endverbatim
* ===========================================================================
*/
CSL_Status CSL_bwmngmtInit
(
/** BWMNGMT Context */
CSL_BwmngmtContext * pContext
);
/** ============================================================================
* @n@b CSL_bwmngmtGetHwStatus
*
* @b Description
* @n Gets the status of the different operations of BWMNGMT. Not Implemented.
* For future use
*
* @b Arguments
* @verbatim
hBwmngmt Handle to the BWMNGMT instance
query The query to this API of BWMNGMT 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
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n None
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
CSL_BwmngmtHandle hBwmngmt;
CSL_BwmngmtHwStatusQuery query;
void reponse;
status = CSL_GetbwmngmtHwStatus (hBwmngmt, query, &response);
@endverbatim
* =============================================================================
*/
CSL_Status CSL_bwmngmtGetHwStatus
(
/** Pointer to the object that holds reference to the
* instance of BWMNGMT requested after the call
*/
CSL_BwmngmtHandle hBwmngmt,
/** The query to this API which indicates the status/setup
* to be returned
*/
CSL_BwmngmtHwStatusQuery myQuery,
/** Placeholder to return the status; @a void* casted */
void *response
);
/**
@defgroup EXAMPLE Example Usage in an ISR
@ingroup CSL_BWMNGMT_API
@{
@code
In order to clarify on the usage of some of the CSL APIs, a skeleton is
presented below
Example: Interrupt driven Low level Driver
Main routine
Void main(){
CSL_BwmngmtHwSetup hwSetup = CSL_BWMNGMT_HWSETUP_DEFAULTS;
CSL_BwmngmtObj BWMNGMTObj;
CSL_InstNum bwmngmtNum;
CSL_OpenMode openMode;
CSL_Status stat;
CSL_BwmngmtHandle hBwmngmt;
// Initialize system before making any module calls specific calls
If (CSL_sysInit() == CSL_SOK){
CSL_bwmngmtInit();
}
// Open the Module with default configuration for setup
hBwmngmt = CSL_bwmngmtOpen(&BWMNGMTObj, CSL_BWMNGMT_0, CSL_EXCLUSIVE, &hwSetup, &stat);
if (hBwmngmt == NULL)
exit;
} // End of Main
@endcode
@}
*/
#ifdef __cplusplus
}
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -