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

📄 csl_cfgopen.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_cfgOpen.c
 *
 *  @brief    File for functional layer of CSL API @a CSL_cfgOpen()
 *
 *  Description
 *    - The @a CSL_cfgOpen() function definition & it's associated functions
 *
 *  PATH  \\(CSLPATH)\\ipmodules\\config\\src
 *
 *  @date 3 June, 2004
 *  @author Chad Courtney
 */

/* =============================================================================
 *  Revision History
 *  ===============
 *  11-Apr-2005 Brn updated the file for doxygen compatibiliy
 *
 * =============================================================================
 */

#include <csl_cfg.h>

/** ===========================================================================
 *   @n@b CSL_cfgOpen
 *
 *   @b Description
 *        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 CFG device. The device can be re-opened anytime after it has
 *        been normally closed if so required. CFG 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 Arguments
 *   @verbatim
        pCfgObj         Pointer to the CFG instance object

        cfgNum          Instance of the CFG to be opened.

        pCfgParam       Pointer to module specific parameters

        pStatus         pointer for returning status of the function call
     @endverbatim
 *
 *   <b> Return Value </b> CSL_CfgHandle
 *        Valid CFG instance handle will be returned if status value is
 *        equal to CSL_SOK.
 *
 *   @b Example
 *   @verbatim
 *        CSL_status        status;
 *        CSL_CfgObj        cfgObj;
 *        CSL_CfgHandle     hCfg;
 *
 *        hCfg = CSL_cfgOpen (&cfgObj, CSL_CFG_PER_CNT, NULL, &status);
 *  @endverbatim
 * ===========================================================================
 */
#pragma CODE_SECTION (CSL_cfgOpen, ".text:csl_section:init");
CSL_CfgHandle CSL_cfgOpen (
    /** Pointer to the handle object - to be allocated by the user
     */
    CSL_CfgObj           *pCfgObj,
    /** Specifies the instance of CFG to be opened */
    CSL_InstNum          cfgNum,
    /** Module specific parameters;
     * Currently there are none; the user should pass 'NULL'
     */
    CSL_CfgParam         *pBwmParam,
    /** This returns the status (success/errors) of the call.
     * Could be 'NULL' if the user does not want status information.
     */
    CSL_Status           *pStatus
)
{
    /* bandwidth Management number */
    if (pCfgObj == NULL)
        return NULL;

    pCfgObj->cfgNum = cfgNum;
    pCfgObj->regs = (CSL_CfgRegsOvly)CSL_MEMPROT_CONFIG_REGS;
    if (pStatus)
        *pStatus = CSL_SOK;
    return pCfgObj;
}

⌨️ 快捷键说明

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