📄 csl_pwrdwn.h
字号:
/** Pointer to the object that holds reference to the
* instance of PWRDWN requested after the call
*/
CSL_PwrdwnObj *hPwrdwnObj,
/** Instance of PWRDWN to which a handle is requested
*/
CSL_InstNum pwrdwnNum,
/** Module specific parameters;
* Currently there are none; the user should pass 'NULL'
*/
CSL_PwrdwnParam *hPwrdwnParam,
/** This returns the status (success/errors) of the call.
* Could be 'NULL' if the user does not want status information.
*/
CSL_Status *hStatus
);
/** ===========================================================================
* @n@b CSL_pwrdwnClose
*
* @b Description
* @n This function closes the specified instance of pwrdwn.
*
* @b Arguments
* @verbatim
hPwrdwn Handle to the PWRDWN instance
@endverbatim
*
* <b> Return Value </b> CSL_Status
* @li CSL_SOK - Close successful
* @li CSL_ESYS_BADHANDLE - Invalid handle
*
* <b> Pre Condition </b>
* @n CSL_pwrdwnInit(), CSL_pwrdwnOpen() must be opened prior to this call.
*
* <b> Post Condition </b>
* @n 1. The PWRDWN CSL APIs can not be called until the PWRDWN
* CSL is reopened again using CSL_pwrdwnOpen()
*
* @b Modifies
* @n None
*
* @b Example:
* @verbatim
CSL_PwrdwnObj pwrObj;
CSL_PwrdwnConfig pwrConfig;
CSL_PwrdwnHandle hPwr;
// Init Module
...
if (CSL_pwrdwnInit(NULL) != CSL_SOK)
exit;
// Opening a handle for the Module
hPwr = CSL_pwrdwnOpen(&pwrObj, CSL_PWRDWN_0, NULL, NULL);
// Setup the arguments fof the Config structure
...
// Close
CSL_pwrdwnClose(hPwr);
@endverbatim
* ===========================================================================
*/
CSL_Status CSL_pwrdwnClose (
/** Pointer to the object that holds reference to the
* instance of PWRDWN requested after the call
*/
CSL_PwrdwnHandle hPwrdwn
);
/** ===========================================================================
* @n@b CSL_pwrdwnHwSetup
*
* @b Description
* @n It configures the timer instance registers as per the values passed
* in the hardware setup structure.
*
* @b Arguments
* @verbatim
hPwrdwn Handle to the pwrdwn instance
setup Pointer to hardware 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 CSL_pwrdwnInit(), CSL_pwrdwnOpen() must be opened prior to this call
*
* <b> Post Condition </b>
* @n The specified instance will be setup according to value passed
*
* @b Modifies
* @n Hardware registers for the specified instance
*
* @b Example:
@verbatim
CSL_PwrdwnObj pwrObj;
CSL_PwrdwnHwSetup pwrSetup;
CSL_PwrdwnHandle hPwr;
// Init Module
...
if (CSL_pwrdwnInit(NULL) != CSL_SOK)
exit;
// Opening a handle for the Module
hPwr = CSL_pwrdwnOpen (&pwrObj, CSL_PWRDWN_0, NULL, NULL);
// Setup the arguments for the Setup structure
...
// Setup
CSL_pwrdwnHwSetup(hPwr,&pwrSetup);
// Close handle
CSL_pwrdwnClose(hPwr);
@endverbatim
* ============================================================================
*/
CSL_Status CSL_pwrdwnHwSetup (
/** Pointer to the object that holds reference to the
* instance of PWRDWN. */
CSL_PwrdwnHandle hPwrdwn,
/** Pointer to setup structure which contains the
* information to program PWRDWN to a useful state
*/
CSL_PwrdwnHwSetup *setup
);
/** ===========================================================================
* @n@b CSL_pwrdwnGetHwSetup
*
* @b Description
* @n It retrives the hardware setup parameters
*
* @b Arguments
* @verbatim
hPwr Handle to the PWRDWN instance
hwSetup Pointer to hardware setup structure
@endverbatim
*
* <b> Return Value </b> CSL_Status
* @li CSL_SOK - Hardware setup retrived
* @li CSL_ESYS_BADHANDLE - Invalid handle
*
* <b> Pre Condition </b>
* @b CSL_pwrdwnInit(), CSL_pwrdwnOpen() must be opened prior to this call.
*
* <b> Post Condition </b>
* @n The hardware set up structure will be populated with values from
* the registers
*
* @b Modifies
* @n None
*
* @b Example
@verbatim
CSL_PwrdwnObj pwrObj;
CSL_PwrdwnHwSetup pwrSetup,querySetup;
CSL_PwrdwnHandle hPwr;
CSL_BitMask32 pageSleep;
// Init Module
...
if (CSL_pwrdwnInit(NULL) != CSL_SOK)
exit;
// Opening a handle for the Module
hPwr = CSL_pwrdwnOpen (&pwrObj, CSL_PWRDWN_0, NULL, NULL);
// Setup the arguments for the Setup structure
...
// Setup
CSL_pwrdwnHwSetup(hPwr,&pwrSetup);
// Query Setup
CSL_pwrdwnGetHwSetup(hPwr,&querySetup);
// Close handle
CSL_pwrdwnClose(hPwr);
@endverbatim
* ============================================================================
*/
CSL_Status CSL_pwrdwnGetHwSetup (
/** Pointer to the object that holds reference to the
* instance of PWRDWN requested after the call
*/
CSL_PwrdwnHandle hPwrdwn,
/** Pointer to setup structure which contains the
* information to program PWRDWN to a useful state
*/
CSL_PwrdwnHwSetup *setup
);
/** ===========================================================================
* @n@b CSL_pwrdwnHwControl
*
* @b Description
* @n This function performs various control operations on the PWRDWN instance,
* based on the command passed.
*
* @b Arguments
* @verbatim
hPwrdwn Handle to the timer instance
cmd Operation to be performed on the PWRDWN
cmdArg Arguement specific to the command
@endverbatim
*
* <b> Return Value </b> CSL_Status
* @li CSL_SOK - Command execution successful.
* @li CSL_ESYS_BADHANDLE - Invalid handle
* @li CSL_ESYS_INVCMD - Invalid command
*
* <b> Pre Condition </b>
* CSL_pwrdwnInit(), CSL_pwrdwnOpen() must be opened prior to this call
*
* <b> Post Condition </b>
* @n Registers of the timer instance are configured according to the command
* and the command arguments. The command determines which registers are
* modified.
*
* @b Modifies
* @n Registers determined by the command
*
* @b Example:
@verbatim
CSL_PwrdwnObj pwrObj;
CSL_PwrdwnHwSetup pwrSetup;
CSL_PwrdwnHandle hPwr;
CSL_BitMask32 pageSleep;
// Init Module
...
if (CSL_pwrdwnInit(NULL) != CSL_SOK)
exit;
// Opening a handle for the Module
hPwr = CSL_pwrdwnOpen (&pwrObj, CSL_PWRDWN_0, NULL, NULL);
// Setup the arguments for the Setup structure
...
// Setup
CSL_pwrdwnHwSetup(hPwr,&pwrSetup);
// Hw Control
pageSleep = 0xFFF00F00;
CSL_pwrdwnHwControl(hPwr,CSL_PWRDWN_CMD_UMAP0_PAGE_SLEEP,&pageSleep);
// Close handle
CSL_pwrdwnClose(hPwr);
@endverbtim
* ============================================================================
*/
CSL_Status CSL_pwrdwnHwControl (
/** Pointer to the object that holds reference to the
* instance of PWRDWN.
*/
CSL_PwrdwnHandle hPwrdwn,
/** The command to this API indicates the action to be taken
*/
CSL_PwrdwnHwControlCmd cmd,
/** An optional argument @a void* casted
*/
void *arg
);
/** ===========================================================================
* @n@b CSL_pwrdwnGetHwStatus
*
* @b Description
* @n This function is used to get the value of various parameters of the
* PWRDWN instance. The value returned depends on the query passed.
*
* @b Arguments
* @verbatim
hPwr Handle to the PWRDWN instance
query Query to be performed
response Pointer to buffer to return the data requested by
the query passed
@endverbatim
*
* <b> Return Value </b> CSL_Status
* @li CSL_SOK - Successful completion of the
* query
*
* @li CSL_ESYS_BADHANDLE - Invalid handle
*
* @li CSL_ESYS_INVQUERY - Query command not supported
*
* <b> Pre Condition </b>
* @n CSL_pwrdwnInit(), CSL_pwrdwnOpen() must be opened prior to this call
*
* <b> Post Condition </b>
* Data requested by the query is returned through the variable "response"
*
* @b Modifies
* @n The input arguement "response" is modified
*
* @b Example:
@verbatim
CSL_PwrdwnObj pwrObj;
CSL_PwrdwnHwSetup pwrSetup;
CSL_PwrdwnHandle hPwr;
CSL_BitMask32 pageSleep;
// Init Module
...
if (CSL_pwrdwnInit(NULL) != CSL_SOK)
exit;
// Opening a handle for the Module
hPwr = CSL_pwrdwnOpen (&pwrObj, CSL_PWRDWN_0, NULL, NULL);
// Setup the arguments for the Setup structure
...
// Setup
CSL_pwrdwnHwSetup(hPwr,&pwrSetup);
// Hw Status Query
CSL_pwrdwnGetHwStatus(hPwr,CSL_PWRDWN_QUERY_UMAP0_STATUS,&pageSleep);
// Close handle
CSL_pwrdwnClose(hPwr);
@endverbatim
* ============================================================================
*/
CSL_Status CSL_pwrdwnGetHwStatus (
/** Pointer to the object that holds reference to the
* instance of PWRDWN requested after the call
*/
CSL_PwrdwnHandle hPwrdwn,
/** The query to this API which indicates the status
* to be returned
*/
CSL_PwrdwnHwStatusQuery query,
/** Placeholder to return the status. @a void* casted */
void *response
);
/** ============================================================================
* @n@b CSL_pwrdwnGetBaseAddress
*
* @b Description
* @n This function gets the base address of the given pwrdwn
* instance.
*
* @b Arguments
* @verbatim
hPwrdwn Pointer to the peripheral data object for pwrdwn
pwrdwnNum Specifies the instance of the pwrdwn to be
opened.
pPwrdwnParam pwrdwn 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 pwrdwn instance is not
* available.
*
* <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_PwrdwnHandle hPwrdwn;
CSL_PwrdwnBaseAddress baseAddress;
CSL_PwrdwnParam params;
CSL_pwrdwnGetBaseAddress(CSL_PWRDWN_0, ¶ms, &baseAddress) ;
@endverbatim
* ===========================================================================
*/
CSL_Status CSL_pwrdwnGetBaseAddress (
/** Instance number */
CSL_InstNum pwrdwnNum,
/** Module specific parameters */
CSL_PwrdwnParam *hPwrdwnParam,
/** Base address details */
CSL_PwrdwnBaseAddress *pBaseAddress
);
/** ===========================================================================
* @n@b CSL_pwrdwnHwSetupRaw
*
* @b Description
* @n This function initializes the device registers with the register-values
* provided through the config data structure.
*
* @b Arguments
* @verbatim
hPwrdwn Pointer to the object that holds reference to the
instance of PWRDWN requested after the call
config Pointer to the config structure containing the
device register values
@endverbatim
*
* <b> Return Value </b> CSL_Status
* @li CSL_SOK - Configuration successful
* @li CSL_ESYS_BADHANDLE - Invalid handle
* @li CSL_ESYS_INVPARAMS - Configuration structure
* pointer is not properly
* initialized
*
* <b> Pre Condition </b>
* @n CSL_pwrdwnInit(), CSL_pwrdwnOpen() must be opened prior to this call
*
* <b> Post Condition </b>
* @n The registers of the specified General purpose timer instance will be setup
* according to the values passed through the config structure
*
* @b Modifies
* @n Hardware registers of the specified General purpose timer instance
*
* @b Example
@verbatim
CSL_PwrdwnObj pwrObj;
CSL_PwrdwnConfig pwrConfig;
CSL_PwrdwnHandle hPwr;
// Init Module
...
if (CSL_pwrdwnInit(NULL) != CSL_SOK)
exit;
// Opening a handle for the Module
hPwr = CSL_pwrdwnOpen (&pwrObj, CSL_PWRDWN_0, NULL, NULL);
// Setup the arguments for the Config structure
...
// Setup
CSL_pwrdwnHwSetupRaw(hPwr,&pwrConfig);
// Close handle
CSL_pwrdwnClose(hPwr);
@endverbatim
* ============================================================================
*/
CSL_Status CSL_pwrdwnHwSetupRaw (
/** Pointer to the object that holds reference to the
* instance of PWRDWN requested after the call
*/
CSL_PwrdwnHandle hPwrdwn,
/** Pointer to config structure which contains the
* register values to program PWRDWN to a useful state
*/
CSL_PwrdwnConfig *config
);
/**
@}
*/
#ifdef __cplusplus
}
#endif
#endif /* _CSL_PWRDWN_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -