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

📄 csl_pmxgetbaseaddress.c

📁 TI达芬奇dm644x各硬件模块测试代码
💻 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_pmxGetBaseAddress.c
 *
 *    @brief File for functional layer of CSL API @a CSL_pmxGetBaseAddress()
 *
 *   Path: \\(CSLPATH)\\soc\\Davinci\\arm9\\src
 *
 *  Description
 *    - The @a CSL_pmxGetBaseAddress() function definition & it's associated functions
 *
 */

/*  ============================================================================
 *  Revision History
 *  ===============
 *  18-dec-2004 BRN File Created
 *
 *  ============================================================================
 */

#include <csl_pmx.h>

/** ============================================================================
 *   @n@b CSL_pmxGetBaseAddress
 *
 *   @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_pmxOpen()
 *       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
            pmxNum        Specifies the instance of the PMX to be opened.

            pPmxParam     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.
 *   @li                    CSL_ESYS_INVPARAMS Invalid Parameter.

 *
 *   <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_PmxBaseAddress  baseAddress;

       ...
      status = CSL_pmxGetBaseAddress(CSL_PMX_PER_CNT, NULL, &baseAddress);

    @endverbatim
 * ===========================================================================
 */
#pragma CODE_SECTION (CSL_pmxGetBaseAddress, ".text:csl_section:pmx");
CSL_Status CSL_pmxGetBaseAddress (
        CSL_InstNum            pmxNum,
        CSL_PmxParam           *pPmxParam,
        CSL_PmxBaseAddress     *pBaseAddress
)
{
    CSL_Status status = CSL_SOK;

    pPmxParam = pPmxParam; /* To avoid compiler warning/remark */
    
    if(pBaseAddress == NULL) {
        status = CSL_ESYS_INVPARAMS;
    }

    switch (pmxNum) {
        case CSL_PMX:
            pBaseAddress->regs = (CSL_PmxRegsOvly)CSL_PMX_1_REGS;
            break;
        default:
            pBaseAddress->regs = NULL;
            status = CSL_ESYS_FAIL;
    }
    return status;
}

⌨️ 快捷键说明

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