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

📄 csl_wdt.h

📁 TI达芬奇dm644x各硬件模块测试代码
💻 H
📖 第 1 页 / 共 2 页
字号:
 *   @n This is the initialization function for the watchdog timer CSL. The
 *      function must be called before calling any other API from this CSL.
 *      This function is idem-potent. Currently, the function just return status
 *      CSL_SOK, without doing anything.
 *
 *   @b Arguments
 *   @verbatim
        pContext    Pointer to module-context. As watchdog timer doesn't have
                    any context based information user is expected to pass NULL.
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                        CSL_SOK - Always returns
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  The CSL for watchdog timer is initialized
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim
            CSL_wdtInit();
     @endverbatim
 * =============================================================================
 */
CSL_Status  CSL_wdtInit (

    CSL_WdtContext          *pContext
);

/** ============================================================================
 *   @n@b CSL_wdtOpen
 *
 *   @b Description
 *   @n This function returns the handle to the Watchdog timer controller
 *      instance. This handle is passed to all other CSL APIs.
 *
 *   @b Arguments
 *   @verbatim
            wdtObj          Pointer to watchdog timer object.

            wdtNum          Instance of watchdog timer CSL to be opened.
                            There is only one instance of the watchdog timer
                            available. So, the value for this parameter will be
                            CSL_WDT always.

            pWdtParam       Module specific parameters.

            status          Status of the function call
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_WdtHandle
 *   @n                         Valid watchdog timer handle will be returned if
 *                              status value is equal to CSL_SOK.
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n   1.    The status is returned in the status variable. If status
 *              returned is
 *   @li            CSL_SOK             Valid watchdog timer handle is returned
 *   @li            CSL_ESYS_FAIL       The watchdog timer instance is invalid
 *
 *        2.    Watchdog timer object structure is populated
 *
 *   @b Modifies
 *   @n    1. The status variable
 *
 *         2. Watchdog timer object structure
 *
 *   @b Example
 *   @verbatim
            CSL_status              status;
            CSL_WdtObj              wdtObj;
            CSL_WdtHandle           hWdt;

            hWdt = CSL_wdtOpen (&wdtObj, CSL_WDT, NULL, &status);
            ...
    @endverbatim
 * =============================================================================
 */
CSL_WdtHandle CSL_wdtOpen (
    CSL_WdtObj *            wdtObj,
    CSL_InstNum             wdtNum,
    CSL_WdtParam *          pWdtParam,
    CSL_Status*             status
);

/** ============================================================================
 *   @n@b CSL_wdtGetBaseAddress
 *
 *   @b Description
 *   @n  This function gets the base address of the given watchdog timer
 *       instance.
 *
 *   @b Arguments
 *   @verbatim
            hWdt            Pointer to the peripheral data object of the
                            watchdog timer instance

            wdtNum          Specifies the instance of the watchdog timer for
                            which the base address is requested

            pWdtParam       Module specific parameters.

            pBaseAddress    Pointer to the base address structure to return the
                            base address details.
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_OK            Open call is successful
 *   @li                    CSL_ESYS_FAIL     The watchdog timer 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.
 *
 *   @b Example
 *   @verbatim
        CSL_Status          status;
        CSL_WdtBaseAddress  baseAddress;

       ...
      status = CSL_wdtGetBaseAddress(CSL_WDT, NULL, &baseAddress);

    @endverbatim
 * ===========================================================================
 */
CSL_Status CSL_wdtGetBaseAddress (
        CSL_InstNum         wdtNum,
        CSL_WdtParam        *pWdtParam,
        CSL_WdtBaseAddress  *pBaseAddress
);

/** ============================================================================
 *   @n@b csl_wdtClose.c
 *
 *   @b Description
 *   @n This function marks that CSL for the watchdog timer instance is closed.
 *      CSL for the watchdog timer instance need to be reopened before using any
 *      watchdog timer CSL API.
 *
 *   @b Arguments
 *   @verbatim
            hwdt         Handle to the watchdog timer instance
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_SOK            - Watchdog timer is closed
 *                                               successfully
 *
 *   @li                    CSL_ESYS_BADHANDLE - The handle passed is invalid
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  1. The watchdog timer CSL APIs can not be called until the watchdog timer
 *          CSL is reopened again using CSL_wdtOpen()
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim
            CSL_wdtClose (hWdt);
    @endverbatim
 * ===========================================================================
 */
CSL_Status  CSL_wdtClose (
    CSL_WdtHandle           hWdt
);

/** ============================================================================
 *   @n@b CSL_wdtHwSetup
 *
 *   @b Description
 *   @n It configures the watchdog timer registers as per the values passed
 *      in the hardware setup structure.
 *
 *   @b Arguments
 *   @verbatim
            hWdt            Handle to the watchdog timer

            hwSetup         Pointer to harware 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  None
 *
 *   <b> Post Condition </b>
 *   @n  Watchdog timer registers are configured according to the hardware setup
 *       parameters
 *
 *   @b Modifies
 *   @n Watchdog timer registers
 *
 *   @b Example
 *   @verbatim

            status = CSL_wdtHwSetup(hWdt, &hwSetup);
     @endverbatim
 * ===========================================================================
 */
CSL_Status  CSL_wdtHwSetup(
    CSL_WdtHandle           hWdt,
    CSL_WdtHwSetup          *hwSetup
);

/** ============================================================================
 *   @n@b CSL_wdtHwControl
 *
 *   @b Description
 *   @n This function performs various control operations on the watchdog timer,
 *      based on the command passed.
 *
 *   @b Arguments
 *   @verbatim
            hWdt         Handle to the watchdog timer

            cmd          Operation to be performed on the timer

            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>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  Watchdog timer registers are configured according to the command and
 *       the command arguements. The command determines which registers are
 *       modified.
 *
 *   @b Modifies
 *   @n Watchdog timer registers determined by the command
 *
 *   @b Example
 *   @verbatim
            Uint32    wdtCount = 0xABCDEF00;
            status = CSL_wdtHwControl(hWdt, CSL_WDT_CMD_LOAD12, &wdtCount);
     @endverbatim
 * =============================================================================
 */
CSL_Status  CSL_wdtHwControl(
    CSL_WdtHandle          hWdt,
    CSL_WdtHwControlCmd    cmd,
    void                   *cmdArg
);

/** ============================================================================
 *   @n@b CSL_wdtGetHwStatus
 *
 *   @b Description
 *   @n This function is used to get the value of various parameters of the
 *      watchdog timer. The value returned depends on the query passed.
 *
 *   @b Arguments
 *   @verbatim
            hWdt            Handle to the watchdog timer

            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  None
 *
 *   <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
            Uint16       count = 0;
            CSL_Status   status;

            status = CSL_wdtGetHwStatus(hWdt, CSL_WDT_QUERY_COUNT,
                                        &count);
     @endverbatim
 * =============================================================================
 */
CSL_Status  CSL_wdtGetHwStatus (
    CSL_WdtHandle          hWdt,
    CSL_WdtHwStatusQuery   query,
    void                   *response
);

/** ============================================================================
 *   @n@b CSL_wdtHwSetupRaw
 *
 *   @b Description
 *   @n This function initializes the device registers with the register-values
 *      provided through the config data structure.
 *
 *   @b Arguments
 *   @verbatim
            hWdt            Handle to the watchdog timer instance

            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  None
 *
 *   <b> Post Condition </b>
 *   @n  The registers of the specified watchdog timer instance will be setup
 *       according to the values passed through the config structure
 *
 *   @b Modifies
 *   @n Hardware registers of the specified watchdog timer instance
 *
 *   @b Example
 *   @verbatim
        CSL_WdtHandle           hWdt;
        CSL_WdtConfig           config = CSL_WDT_CONFIG_DEFAULTS;
        CSL_Status              status;

        status = CSL_wdtHwSetupRaw (hWdt, &config);

     @endverbatim
 * ===========================================================================
 */
CSL_Status  CSL_wdtHwSetupRaw (
    CSL_WdtHandle         hWdt,
    CSL_WdtConfig         *config
);

/** ============================================================================
 *   @n@b CSL_wdtGetHwSetup
 *
 *   @b Description
 *   @n It retrives the hardware setup parameters of the watchdog timer module
 *      specified by the given handle.
 *
 *   @b Arguments
 *   @verbatim
            hWdt            Handle to the watchdog timer

            hwSetup         Pointer to the harware setup structure

     @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_SOK             - Retrieving the hardware setup
 *                                                parameters is successful
 *   @li                    CSL_ESYS_BADHANDLE  - The handle is passed is
 *                                                invalid
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  The hardware setup structure is populated with the hardware setup
 *       parameters
 *
 *   @b Modifies
 *   @n hwSetup variable
 *
 *   @b Example
 *   @verbatim
            CSL_WdtHandle   hWdt;
            CSL_WdtHwSetup  hwSetup;

            status = CSL_wdtGetHwSetup(hWdt, &hwSetup);
     @endverbatim
 * ===========================================================================
 */
CSL_Status  CSL_wdtGetHwSetup(    
    CSL_WdtHandle       hWdt,
    CSL_WdtHwSetup      *hwSetup
);

#ifdef __cplusplus
}
#endif

#endif  /* _CSL_WDT_H_ */

⌨️ 快捷键说明

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