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

📄 csl_mmcsdhwsetupraw.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_mmcsdHwSetupRaw.c
 *
 *    Path: \\(CSLPATH)\\ipmodules\\mmcsd\\src
 *
 *  @brief File for functional layer of CSL API @a CSL_mmcsdHwSetupRaw()
 *
 *  Description
 *    - The @a CSL_mmcsdHwSetupRaw() function definition & it's associated functions
 *
 */

/* =============================================================================
 *  Revision History
 *  ===============
 *  12-Oct-2004 Hs Updated according to review comments
 *  01-Sep-2004 Hs File Created.
 * =============================================================================
 */

#include <csl_mmcsd.h>

/** ============================================================================
 *   @n@b CSL_mmcsdHwSetupRaw
 *
 *   @b Description
 *   @n This function initializes the device registers with the register-values
 *      provided through the Config Data structure.
 *
 *   @b Arguments
 *   @verbatim
            hMmcsd        Handle to the GP timer instance

            config          Pointer to config structure
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_SOK             - Configuration successful
 *   @li                    CSL_ESYS_BADHANDLE  - Invalid handle
 *   @li                    CSL_ESYS_INVPARAMS  - Configuration is not
 *                                                properly initialized
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  The registers of the specified MMCSD instance will be setup
 *       according to value passed.
 *
 *   @b Modifies
 *   @n Hardware registers of the specified MMCSD instance.
 *
 *   @b Example
 *   @verbatim
        CSL_MmcsdHandle       hMmcsd;
        CSL_MmcsdConfig       config = CSL_MMCSD_CONFIG_DEFAULTS;
        CSL_Status          status;

        status = CSL_mmcsdHwSetupRaw (hMmcsd, &config);

     @endverbatim
 * ===========================================================================
 */
#pragma CODE_SECTION (CSL_mmcsdHwSetupRaw, ".text:csl_section:mmcsd");
CSL_Status  CSL_mmcsdHwSetupRaw (
    CSL_MmcsdHandle     hMmcsd,
    CSL_MmcsdConfig     *config
)
{
    if (hMmcsd == NULL)
        return CSL_ESYS_BADHANDLE;

    if (config == NULL )
        return CSL_ESYS_INVPARAMS;

    hMmcsd->regs->MMCCTL     = config->MMCCTL;
    hMmcsd->regs->MMCCLK     = config->MMCCLK;
    hMmcsd->regs->MMCIM      = config->MMCIM;
    hMmcsd->regs->MMCTOR     = config->MMCTOR;
    hMmcsd->regs->MMCTOD     = config->MMCTOD;
    hMmcsd->regs->MMCBLEN    = config->MMCBLEN;
    hMmcsd->regs->MMCNBLK    = config->MMCNBLK;
    hMmcsd->regs->MMCNBLC    = config->MMCNBLC;
    hMmcsd->regs->MMCDRR     = config->MMCDRR;
    hMmcsd->regs->MMCDXR     = config->MMCDXR;
    hMmcsd->regs->MMCCMD     = config->MMCCMD;
    hMmcsd->regs->MMCARGHL   = config->MMCARGHL;
    hMmcsd->regs->MMCRSP01   = config->MMCRSP01;
    hMmcsd->regs->MMCRSP23   = config->MMCRSP23;
    hMmcsd->regs->MMCRSP45   = config->MMCRSP45;
    hMmcsd->regs->MMCRSP67   = config->MMCRSP67;
    hMmcsd->regs->MMCDRSP    = config->MMCDRSP;
    hMmcsd->regs->MMCCIDX    = config->MMCCIDX;
    hMmcsd->regs->MMCCKC     = config->MMCCKC;
    hMmcsd->regs->MMCTORC    = config->MMCTORC;
    hMmcsd->regs->MMCTODC    = config->MMCTODC;
    hMmcsd->regs->MMCBLNC    = config->MMCBLNC;
    hMmcsd->regs->SDIOCTL    = config->SDIOCTL;
    hMmcsd->regs->SDIOIEN    = config->SDIOIEN;
    hMmcsd->regs->MMCFIFOCTL = config->MMCFIFOCTL;

    return CSL_SOK;
}

⌨️ 快捷键说明

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