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

📄 csl_wdtgetbaseaddress.c

📁 TI的DM6446的硬件平台搭建的相关例子
💻 C
字号:
/*  ============================================================================
 *   Copyright (c) Texas Instruments Inc 2002, 2003, 2004, 2005                 
 *                                                                              
 *   Use of this software is controlled by the terms and conditions found in the
 *   license agreement under which this software has been supplied.             
 *   ===========================================================================
 */

/**  @file  csl_wdtGetBaseAddress.c
 *
 *   @brief  File for functional layer of CSL API @a CSL_wdtGetBaseAddress()
 *
 *   Path: \\(CSLPATH)\\soc\\davinci\\arm9\\src
 *
 */

/* =============================================================================
 *  Revision History
 *  ===============
 *  11-Oct-2004 Hs  updated the code review comments
 *  01-Sep-2004 Hmm File created.
 * =============================================================================
 */

#include <soc.h>
#include <csl_wdt.h>

/** ============================================================================
 *   @n@b CSL_wdtGetBaseAddress
 *
 *   @b Description
 *   @n  This function gets the base address of the given watchdog timer
 *       instance.
 *
 *   @b Arguments
 *   @verbatim
            wdtNum          Specifies the instance of the watchdog timer to be
                            opened.

            pWdtParam       Watchdog timer 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     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 is modified.
 *
 *   @b Example
 *   @verbatim
        CSL_Status            status;
        CSL_WdtBaseAddress    baseAddress;

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

    @endverbatim
 * ===========================================================================
 */
#pragma CODE_SECTION (CSL_wdtGetBaseAddress, ".text:csl_section:wdt");
CSL_Status CSL_wdtGetBaseAddress (
    CSL_InstNum             wdtNum,
    CSL_WdtParam *          pWdtParam,
    CSL_WdtBaseAddress *    pBaseAddress
)
{
    CSL_Status status = CSL_SOK;

    pWdtParam = pWdtParam;

    if (pBaseAddress == NULL) {
        return CSL_ESYS_INVPARAMS;
    }

    switch (wdtNum) {
        case CSL_WDT:
            pBaseAddress->regs = (CSL_WdtRegsOvly)CSL_WDT_1_REGS;
            break;

        default:
            pBaseAddress->regs = (CSL_WdtRegsOvly)NULL;
            status = CSL_ESYS_FAIL;
            break;
    }

    return status;
}

⌨️ 快捷键说明

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