📄 csl_vfoc.h
字号:
/** The following settings are optional, if a window is not to be setup, then pass a NULL pointer */
/** look up table entry , 64 entries */
Uint32 *lutEntry;
/** Window 0 Size Setup */
CSL_VfocWinSize *win0;
/** Window 1 Size Setup */
CSL_VfocWinSize *win1;
/** Window 2 Size Setup */
CSL_VfocWinSize *win2;
/** Window 3 Size Setup */
CSL_VfocWinSize *win3;
/** Window 4 Size Setup */
CSL_VfocWinSize *win4;
/** Window 5 Size Setup */
CSL_VfocWinSize *win5;
}CSL_VfocHwSetup;
/**************************************************************************\
* VFOC global function declarations
\**************************************************************************/
/** This function is idempotent in that calling it many times is same as
* calling it once. This function initializes the VFOC CSL data structures.
*
* <b> Usage Constraints: </b>
* CSL system initialization must be successfully completed by invoking
* @a CSL_sysInit() before calling this function. This function should be
* called before using any of the CSL APIs
*
* @b Example:
* @verbatim
...
CSL_sysInit();
if (CSL_SOK != CSL_vfocInit()) {
return;
}
@endverbatim
*
* @return returns the status of the operation
*
*/
CSL_Status CSL_vfocInit(
void
);
/** The open call sets up the data structures for the particular instance of
* VFOC device. The device can be re-opened anytime after it has been normally
* closed if so required. VFOC Hardware setup will be performed at the end of
* the open call only if the HwSetup Pointer supplied was non- NULL. The handle
* returned by this call is input as an essential argument for rest of the APIs
* described for this module.
*
* <b> Usage Constraints: </b>
* The CSL system as well as vfoc must be successfully initialized
* via @a CSL_sysInit() and @a CSL_vfocInit() before calling this
* function. Memory for the @a CSL_vfocObj must be allocated outside
* this call. This object must be retained while usage of this peripheral.
*
* @b Example:
* @verbatim
CSL_VfocObj vfocObj;
CSL_VfocHwSetup vfocSetup;
CSL_Status status;
...
hVfoc = CSL_vfocOpen(&vfocObj,
CSL_VFOC_0,
CSL_EXCLUSIVE,
&vfocSetup,
&status);
@endverbatim
*
* @return returns a handle @a CSL_VfocHandle to the requested instance of
* VFOC if the call is successful, otherwise, a @a NULL is returned.
*
*/
CSL_VfocHandle CSL_vfocOpen (
/** Pointer to the object that holds reference to the
* instance of VFOC requested after the call
*/
CSL_VfocObj *hVfocObj,
/** Instance of VFOC to which a handle is requested
*/
CSL_VfocNum vfocNum,
/** Specifies if VFOC should be opened with exclusive or
* shared access to the associate pins
*/
CSL_OpenMode openMode,
/** This returns the status (success/errors) of the call
*/
CSL_Status *status
);
/** The Close call releases the resource and appropriate shared pins.
*
* <b> Usage Constraints: </b>
* Both @a CSL_vfocInit() and @a CSL_vfocOpen() must be called successfully
* in that order before @a CSL_vfocClose() can be called.
*
* @b Example:
* @verbatim
CSL_VfocHandle hVfoc;
...
CSL_vfocClose(hVfoc);
@endverbatim
*
* @return returns the status of the operation (see @a CSL_Status)
*
*/
CSL_Status CSL_vfocClose(
/** Pointer to the object that holds reference to the
* instance of VFOC requested after the call
*/
CSL_VfocHandle hVfoc
);
/** This function initializes the device registers with the appropriate values
* provided through the HwSetup Data structure. This function needs to be called
* only if the HwSetup Structure was not previously passed through the Open call.
* After the Setup is completed, the serial device is ready for data transfer.
* For information passed through the HwSetup Data structure refer
* @a CSL_VfocHwSetup.
*
* <b> Usage Constraints: </b>
* Both @a CSL_vfocInit() and @a CSL_vfocOpen() must be called
* successfully in that order before this function can be called. The user
* has to allocate space for & fill in the main setup structure appropriately
* before calling this function
*
* @b Example:
* @verbatim
CSL_VfocHandle hVfoc;
CSL_VfocHwSetup hwSetup = CSL_VFOC_HWSETUP_DEFAULTS;
CSL_vfocHwSetup(hVfoc, &hwSetup);
@endverbatim
*
* @return Returns the status of the setup operation
*
*/
CSL_Status CSL_vfocHwSetup(
/** Pointer to the object that holds reference to the
* instance of VFOC requested after the call
*/
CSL_VfocHandle hVfoc,
/** Pointer to setup structure which contains the
* information to program VFOC to a useful state
*/
CSL_VfocHwSetup *setup
);
/** Control operations for the VFOC. For a particular control operation, the
* pointer to the corresponding data type needs to be passed as argument HwControl
* function Call. All the arguments (Structure elements included) passed to the
* HwControl function are inputs. For the list of commands supported and argument
* type that can be @a void* casted & passed with a particular command refer to
* @a CSL_VfocHwControlCmd.
*
* <b> Usage Constraints: </b>
* Both @a CSL_vfocInit() and @a CSL_vfocOpen() must be called successfully
* in that order before @a CSL_vfocHwControl() can be called. For the
* argument type that can be @a void* casted & passed with a particular command
* refer to @a CSL_VfocHwControlCmd
*
* @b Example:
* @verbatim
CSL_VfocHandle hVfoc;
CSL_Status status;
...
status = CSL_vfocHwControl(hVfoc,
CSL_VFOC_CMD_START,
&command);
@endverbatim
*
* @return returns the status of the operation (see @a CSL_Status)
*
*/
CSL_Status CSL_vfocHwControl(
/** Pointer to the object that holds reference to the
* instance of VFOC requested after the call
*/
CSL_VfocHandle hVfoc,
/** The command to this API indicates the action to be taken
*/
CSL_VfocHwControlCmd cmd,
/** An optional argument @a void* casted
*/
void *arg
);
/** This function is used to read the current device configuration, status flags
* and the value present associated registers. Following table details the various
* status queries supported and the associated data structure to record the response.
* User should allocate memory for the said data type and pass its pointer as an
* unadorned void* argument to the status query call. For details about the various
* status queries supported and the associated data structure to record the response,
* refer to @a CSL_VfocHwStatusQuery
*
* <b> Usage Constraints: </b>
* Both @a CSL_vfocInit() and @a CSL_vfocOpen() must be called successfully
* in that order before @a CSL_vfocGetHwStatus() can be called. For the
* argument type that can be @a void* casted & passed with a particular command
* refer to @a CSL_VfocHwStatusQuery
*
* @b Example:
* @verbatim
CSL_VfocHandle hVfoc;
CSL_Status status;
Uint16 response;
...
status = CSL_vfocGetHwStatus(hVfoc,
CSL_VFOC_QUERY_BUS_BUSY,
&response);
@endverbatim
*
* @return Returns the status of the operation (see @a CSL_Status)
*
*/
CSL_Status CSL_vfocGetHwStatus(
/** Pointer to the object that holds reference to the
* instance of VFOC requested after the call
*/
CSL_VfocHandle hVfoc,
/** The query to this API which indicates the status
* to be returned
*/
CSL_VfocHwStatusQuery query,
/** Placeholder to return the status. @a void* casted */
void *response
);
#ifdef __cplusplus
}
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -