📄 csl_hdq1w.h
字号:
* Valid HDQ1W handle will be returned if status value is equal to
* CSL_SOK.
*
* @eg
* CSL_status status;
* CSL_Hdq1wObj hdq1wObj;
* CSL_Hdq1wHandle hHdq1w;
*
* hHdq1w = CSL_hdq1wOpen (&hdq1wObj, CSL_HDQ1W, NULL, &status);
*
* =============================================================================
*/
extern CSL_Hdq1wHandle CSL_hdq1wOpen (
CSL_Hdq1wObj *pHdq1wObj,
CSL_InstNum hdq1wNum,
CSL_Hdq1wParam *pHdq1wParam,
CSL_Status *pStatus
);
/*
* =============================================================================
* @func CSL_hdq1wClose
*
* @desc
* This function closes the HDQ1W specified by its handle.
*
* @arg hHdq1w
* Handle to the HDQ1W instance.
*
* @ret CSL_Status
* CSL_SOK - Successful, desired operation is done.
* CSL_ESYS_BADHANDLE - Invalid handle.
*
* @eg
* CSL_Status status;
*
* status = CSL_hdq1wClose (hHdq1w);
*
* =============================================================================
*/
extern CSL_Status CSL_hdq1wClose (
CSL_Hdq1wHandle hHdq1w
);
/*
* =============================================================================
* @func CSL_hdq1wHwSetup
*
* @desc
* This function configures the HDQ1W instance registers as per the values
* passed in the hardware setup structure.
*
* @arg hHdq1w
* Handle to the HDQ1W instance
*
* @arg setup
* Pointer to hardware setup structure
*
* @ret CSL_Status
* CSL_SOK - Hardware setup successful
* CSL_ESYS_BADHANDLE - Invalid handle
* CSL_ESYS_INVPARAMS - Invalid parameters
*
* @eg
* CSL_Hdq1wHwSetup setup;
* CSL_Status status;
*
* setup.1wireBitMode = TRUE;
* setup.interruptEnable = TRUE;
* setup.mode = CSL_HDQ1W_MODE_1WIRE;
*
* status = CSL_hdq1wHwSetup (hHdq1w, &setup);
*
* =============================================================================
*/
extern CSL_Status CSL_hdq1wHwSetup (
CSL_Hdq1wHandle hHdq1w,
CSL_Hdq1wHwSetup *setup
);
/*
* =============================================================================
* @func CSL_hdq1wHwSetupRaw
*
* @desc
* This function configures the HDQ1W using the register values passed
* through the config-structure.
*
* @arg hHdq1w
* Handle to the HDQ1W instance
*
* @arg hdq1wConfig
* Pointer to config structure which contains the information to
* program HDQ1W to a useful state
*
* @ret CSL_Status
* CSL_SOK - Configuration successful
* CSL_ESYS_BADHANDLE - Invalid handle
* CSL_ESYS_INVPARAMS - Invalid configuration parameters
*
* @eg
* CSL_Hdq1wConfig hdq1wConfig = CSL_HDQ1W_CONFIG_DEFAULTS;
* CSL_status status;
* ...
* status = CSL_hdq1wHwSetupRaw (hHdq1w, &hdq1wConfig);
*
* =============================================================================
*/
extern CSL_Status CSL_hdq1wHwSetupRaw (
CSL_Hdq1wHandle hHdq1w,
CSL_Hdq1wConfig *hdq1wConfig
);
/*
* =============================================================================
* @func CSL_hdq1wGetHwSetup
*
* @desc
* This function gets the hardware setup parameters of the HDQ1W module
* specified by the given Handle.
*
* @arg hHdq1w
* Handle to the HDQ1W instance
*
* @arg setup
* Pointer to data structure to hold the setup parameters
*
* @ret CSL_Status
* CSL_SOK - Successful, desired operation is done.
* CSL_ESYS_BADHANDLE - Invalid handle.
*
* @eg
* CSL_Status status;
* CSL_Hdq1wHwSetup setup;
* ...
* status = CSL_hdq1wGetHwSetup (hHdq1w, &setup);
*
* =============================================================================
*/
extern CSL_Status CSL_hdq1wGetHwSetup (
CSL_Hdq1wHandle hHdq1w,
CSL_Hdq1wHwSetup *setup
);
/*
* =============================================================================
* @func CSL_hdq1wHwControl
* @desc
* This function is used for controlling the HDQ1W instance. It accepts the
* commands & data to control the hardware.
*
* @arg hHdq1w
* Handle to the HDQ1W instance
*
* @arg cmd
* Command to be executed
*
* @arg cmdArg
* Data pointer corresponding to command
*
* @ret CSL_Status
* CSL_SOK - Command execution successful
* CSL_ESYS_INVCMD - Invalid command
*
* @eg
* CSL_Hdq1wHandle hHdq1w;
* CSL_Hdq1wHwControlCmd cmd = CSL_HDQ1W_CMD_SET_GB;
* ...
* status = CSL_hdq1wHwControl (hHdq1w, cmd, NULL);
*
* =============================================================================
*/
extern CSL_Status CSL_hdq1wHwControl (
CSL_Hdq1wHandle hHdq1w,
CSL_Hdq1wHwControlCmd cmd,
void *cmdArg
);
/*
* =============================================================================
* @func CSL_hdq1wGetHwStatus
*
* @desc
* This function is used to get the values of various parameters of an
* instance of HDQ1W. The value returned depends on the query passed.
*
* @arg hHdq1w
* Handle to the HDQ1W instance
*
* @arg myQuery
* User's query
*
* @arg response
* Slot to hold the retrived value depending on the query
*
* @ret CSL_Status
* CSL_SOK - Query successful
* CSL_ESYS_INVQUERY - Invalid query
* CSL_ESYS_BADHANDLE - Invalid handle
*
* @eg
* CSL_Status status;
* Uint8 response;
*
* status = CSL_hdq1wGetHwStatus (hHdq1w, CSL_HDQ1W_QUERY_RX_DATA,
* (void *)&response);
*
* =============================================================================
*/
extern CSL_Status CSL_hdq1wGetHwStatus (
CSL_Hdq1wHandle hHdq1w,
CSL_Hdq1wHwStatusQuery myQuery,
void *response
);
/** ============================================================================
* @n@b CSL_hdq1wGetBaseAddress
*
* @b Description
* @n This function gets the base address of the peripheral instance. This
* function will be called inside the CSL_hdq1wOpen() function call.
*
* @b Arguments
* @verbatim
hdq1wNum Specifies the instance of HDQ1W
pHdq1wParam Module specific parameters
pBaseAddress Pointer to the base address structure in which base
address details are returned
@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 Base address structure is modified
*
* @b Example
* @verbatim
CSL_Status status;
CSL_Hdq1wBaseAddress baseAddress;
...
status = CSL_hdq1wGetBaseAddress (CSL_HDQ1W, NULL, &baseAddress);
@endverbatim
* =============================================================================
*/
extern CSL_Status CSL_hdq1wGetBaseAddress (
CSL_InstNum hdq1wNum,
CSL_Hdq1wParam *pHdq1wParam,
CSL_Hdq1wBaseAddress *pBaseAddress
);
#ifdef __cplusplus
}
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -