⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 csl_vlynq.h

📁 TI达芬奇dm644x各硬件模块测试代码
💻 H
📖 第 1 页 / 共 4 页
字号:
/* config defaults */#define CSL_VLYNQ_CONFIG_DEFAULTS  { \    CSL_VLYNQ_CTRL_RESETVAL      ,   \    CSL_VLYNQ_INTPRI_RESETVAL    ,   \    CSL_VLYNQ_INTSTATCLR_RESETVAL,   \    CSL_VLYNQ_INTPENDSET_RESETVAL,   \    CSL_VLYNQ_INTPTR_RESETVAL ,      \    CSL_VLYNQ_XAM_RESETVAL    ,      \    CSL_VLYNQ_RAMS1_RESETVAL  ,      \    CSL_VLYNQ_RAMO1_RESETVAL  ,      \    CSL_VLYNQ_RAMS2_RESETVAL  ,      \    CSL_VLYNQ_RAMO2_RESETVAL  ,      \    CSL_VLYNQ_RAMS3_RESETVAL  ,      \    CSL_VLYNQ_RAMO3_RESETVAL  ,      \    CSL_VLYNQ_RAMS4_RESETVAL  ,      \    CSL_VLYNQ_RAMO4_RESETVAL  ,      \    CSL_VLYNQ_INTVEC0_RESETVAL,      \    CSL_VLYNQ_INTVEC1_RESETVAL,      \    CSL_VLYNQ_RCTRL_RESETVAL  ,      \    CSL_VLYNQ_RINTPRI_RESETVAL,      \    CSL_VLYNQ_RINTSTATCLR_RESETVAL,  \    CSL_VLYNQ_RINTPENDSET_RESETVAL,  \    CSL_VLYNQ_RINTPTR_RESETVAL ,     \    CSL_VLYNQ_RXAM_RESETVAL    ,     \    CSL_VLYNQ_RRAMS1_RESETVAL  ,     \    CSL_VLYNQ_RRAMO1_RESETVAL  ,     \    CSL_VLYNQ_RRAMS2_RESETVAL  ,     \    CSL_VLYNQ_RRAMO2_RESETVAL  ,     \    CSL_VLYNQ_RRAMS3_RESETVAL  ,     \    CSL_VLYNQ_RRAMO3_RESETVAL  ,     \    CSL_VLYNQ_RRAMS4_RESETVAL  ,     \    CSL_VLYNQ_RRAMO4_RESETVAL  ,     \    CSL_VLYNQ_RINTVEC0_RESETVAL,     \    CSL_VLYNQ_RINTVEC1_RESETVAL      \}/* ************************************************************************\ * VLYNQ global function declarations\* ************************************************************************//* * ============================================================================ *   @func CSL_vlynqInit * *   @desc *        This function is idempotent in that calling it many times is same as *        calling it once.This function initializes the VLYNQ CSL data *        structures. * *   @arg pContext *        Context information for VLYNQ * *   @ret CSL_Status *        CSL_SOK - Always returns * *   @eg *     CSL_vlynqInit (pContext); * ============================================================================= */CSL_Status  CSL_vlynqInit(    CSL_VlynqContext * pContext);/* *============================================================================ *   @func CSL_vlynqOpen * *   @desc *        This function populates the peripheral data object for the instance *        and returns a handle to the instance. *        The open call sets up the data structures for the particular instance *        of VLYNQ device. The device can be re-opened anytime after it has been *        normally closed if so required. VLYNQ 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. * *   @arg pVlynqObj *        Pointer to the VLYNQ instance object * *   @arg vlynqNum *        Instance of the VLYNQ to be opened. * *   @arg pVlynqParam *        Pointer to module specific parameters * *   @arg pStatus *        pointer for returning status of the function call * *   @ret CSL_VlynqHandle *        Valid VLYNQ instance handle will be returned if status value is *        equal to CSL_SOK. * *   @eg *        CSL_status        status; *        CSL_VlynqObj        vlynqObj; *        CSL_VlynqHandle     hVlynq; * *        hVlynq = CSL_VlynqOpen (&vlynqObj, *                            CSL_VLYNQ_PER_CNT, *                            NULL, *                            &status *                            ); * * =========================================================================== */CSL_VlynqHandle CSL_vlynqOpen (    /** Pointer to the object that holds reference to the     *  instance of VLYNQ requested after the call     */    CSL_VlynqObj              *hVlynqObj,    /** Instance of VLYNQ to which a handle is requested     */    CSL_InstNum              vlynqNum,    /** Specifies if VLYNQ should be opened with exclusive or     *  shared access to the associate pins     */    CSL_VlynqParam            *pVlynqParam,    /** This returns the status (success/errors) of the call     */    CSL_Status              *status);/* * ============================================================================= *   @func CSL_vlynqClose * *   @b Description *   @n This function closes the specified instance of VLYNQ. * *   @arg  hVlynq           Handle to the VLYNQ instance * *   @ret CSL_Status *         CSL_SOK            - Close successful *         CSL_ESYS_BADHANDLE - Invalid handle * *   @eg *     CSL_vlynqClose (hVlynq); * ============================================================================= */CSL_Status  CSL_vlynqClose(    /** Pointer to the object that holds reference to the     *  instance of VLYNQ requested after the call     */    CSL_VlynqHandle                         hVlynq);/** 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_VlynqHwSetup. * *  <b> Usage Constraints: </b> *  Both @a CSL_vlynqInit() and @a CSL_vlynqOpen() 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_VlynqHandle hVlynq;     CSL_VlynqHwSetup hwSetup = CSL_VLYNQ_HWSETUP_DEFAULTS;     CSL_vlynqHwSetup(hVlynq, &hwSetup);  @endverbatim * * @return Returns the status of the setup operation * */CSL_Status  CSL_vlynqHwSetup(    /** Pointer to the object that holds reference to the     *  instance of VLYNQ requested after the call     */    CSL_VlynqHandle                         hVlynq,    /** Pointer to setup structure which contains the     *  information to program VLYNQ to a useful state     */    CSL_VlynqHwSetup                        *setup);/** This function gets the current setup of the VLYNQ. The status is *  returned through @a CSL_VlynqHwSetup. The obtaining of status *  is the reverse operation of @a CSL_vlynqHwSetup() function. * *  <b> Usage Constraints: </b> *  Both @a CSL_vlynqInit() and @a CSL_vlynqOpen() must be called successfully *  in that order before @a CSL_vlynqGetHwSetup() can be called. * * @b Example: * @verbatim      CSL_VlynqHandle hVlynq;      CSL_Status status;      CSL_VlynqHwSetup *mysetup;       ...      status = CSL_vlynqGetHwSetup(hVlynq, &mysetup);   @endverbatim * * @return returns the status of the operation (see @a CSL_Status) * */CSL_Status  CSL_vlynqGetHwSetup(    /** Pointer to the object that holds reference to the     *  instance of VLYNQ requested after the call     */    CSL_VlynqHandle                         hVlynq,    /** Pointer to setup structure which contains the     *  information to program VLYNQ to a useful state     */    CSL_VlynqHwSetup                        *setup);/** =========================================================================== *   @func CSL_vlynqHwSetupRaw * *   @desc *       This function configures the registers of VLYNQ as per the values given *       in the Config structure. * *   @arg hVlynq *        Handle to the VLYNQ instance * *   @arg hwConfig *        Pointer to VLYNQ config structure * *   @ret CSL_Status *         CSL_SOK             - Configuration successful *         CSL_ESYS_BADHANDLE  - Invalid handle * *   @eg * *        CSL_Status            status  ; *        CSL_VlynqConfig        hwConfig; * *        status = CSL_vlynqHwsetupRaw (hVlynq, &hwConfig); * * =========================================================================== */CSL_Status  CSL_vlynqHwSetupRaw (    CSL_VlynqHandle           hVlynq,    CSL_VlynqConfig *         config);/** Control operations for the VLYNQ.  For a particular control operation, the *  pointer to the corresponding data type needs to be passed as argument Hw *  Control 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_VlynqHwControlCmd. * *  <b> Usage Constraints: </b> *  Both @a CSL_vlynqInit() and @a CSL_vlynqOpen() must be called successfully *  in that order before @a CSL_vlynqHwControl() can be called. For the *  argument type that can be @a void* casted & passed with a particular *  command refer to @a CSL_VlynqHwControlCmd * * @b Example: * @verbatim       CSL_VlynqHandle hVlynq;       CSL_Status status;       ...       status = CSL_vlynqHwControl(hVlynq,                                    CSL_VLYNQ_CMD_START,                                   &command);   @endverbatim * *  @return returns the status of the operation (see @a CSL_Status) * */CSL_Status  CSL_vlynqHwControl(    /** Pointer to the object that holds reference to the     *  instance of VLYNQ requested after the call     */    CSL_VlynqHandle                         hVlynq,    /** The command to this API indicates the action to be taken     */    CSL_VlynqHwControlCmd                   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_VlynqHwStatusQuery * *  <b> Usage Constraints: </b> *  Both @a CSL_vlynqInit() and @a CSL_vlynqOpen() must be called successfully *  in that order before @a CSL_vlynqGetHwStatus() can be called. For the *  argument type that can be @a void* casted & passed with a particular *  command refer to @a CSL_VlynqHwStatusQuery * * @b Example: * @verbatim      CSL_VlynqHandle hVlynq;      CSL_Status status;      Uint16  *response;       ...      status = CSL_vlynqGetHwStatus(hVlynq,                           CSL_VLYNQ_QUERY_BUS_BUSY,                                  &response);   @endverbatim * * @return Returns the status of the operation (see @a CSL_Status) * */CSL_Status  CSL_vlynqGetHwStatus(    /** Pointer to the object that holds reference to the     *  instance of VLYNQ requested after the call     */    CSL_VlynqHandle                         hVlynq,    /** The query to this API which indicates the status     *  to be returned     */    CSL_VlynqHwStatusQuery                  query,    /** Placeholder to return the status. @a void* casted */    void                                    *response);/** =========================================================================== *   @n@b CSL_vlynqGetBaseAddress * *   @b Description *   @n  Function to get the base address of the peripheral instance. *       This function is used for getting the base address of the peripheral *       instance. This function will be called inside the CSL_vlynqOpen() *       function call. This function is open for re-implementing if the user *       wants to modify the base address of the peripheral object to point to *       a different location and there by allow CSL initiated write/reads into *       peripheral MMR's go to an alternate location. * *   @b Arguments *   @verbatim            vlynqNum          Specifies the instance of VLYNQ to be opened.            pVlynqParam       Module specific parameters.            pBaseAddress    Pointer to baseaddress 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. * *   <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_VlynqBaseAddress  baseAddress;       ...      status = CSL_vlynqGetBaseAddress(CSL_VLYNQ_PER_CNT, NULL, &baseAddress);    @endverbatim * =========================================================================== */CSL_Status   CSL_vlynqGetBaseAddress (    CSL_InstNum              vlynqNum,    CSL_VlynqParam *         pVlynqParam,    CSL_VlynqBaseAddress *   pBaseAddress);#ifdef __cplusplus}#endif#endif /* _CSL_VLYNQ_H_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -