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

📄 csl_mshwsetup.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_msHwSetup.c * *  @brief    File for functional layer of CSL API \a CSL_msHwSetup() * *  Path: \\(CSLPATH)\\ipmodules\\memstick\\src * *  Description *   - The \a CSL_msHwSetup() function definition & it's associated functions * *  Date 7th June, 2004 *  Author Santosh Narayanan * *//* ============================================================================= *  Revision History *  ================ *  14-Dec-2004 kpn Updated the file for the new CSL format. * ============================================================================= */#include <csl_ms.h>/** ============================================================================ *   @n@b CSL_msHwSetup * *   @b Description *   @n It configures the memory stick registers as per the values passed *      in the hardware setup structure. * *   @b Arguments *   @verbatim            hMs             Handle to the ms            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  MS registers are configured according to the hardware setup parameters * *   @b Modifies *   @n MS registers * *   @b Example *   @verbatim            CSL_MsHandle        hMs;            CSL_MsObj           msObj;            CSL_MsHwSetup       hwSetup;            CSL_status          status;            ...            hMs = CSL_msOpen(&msObj, CSL_MS, NULL, &status);            status = CSL_msHwSetup(hMs, &hwSetup);     @endverbatim * ============================================================================= */#pragma CODE_SECTION (CSL_msHwSetup, ".text:csl_section:ms");CSL_Status CSL_msHwSetup (    CSL_MsHandle            hMs,    CSL_MsHwSetup          *hwSetup){    if (hwSetup == NULL) {        return CSL_ESYS_INVPARAMS;    }    if (hMs == NULL) {        return CSL_ESYS_BADHANDLE;    }    hMs->regs->MSSYST  = ((hMs->regs->MSSYST & 0x0000FFFF)               |                         CSL_FMK ( MS_MSSYST_RST, hwSetup->reset)        |                         CSL_FMK ( MS_MSSYST_SRAC, hwSetup->mode)        |                         CSL_FMK ( MS_MSSYST_NOCRC, hwSetup->crc)        |                         CSL_FMK ( MS_MSSYST_INTCLR, hwSetup->intClear)  |                         CSL_FMK ( MS_MSSYST_INTEN, hwSetup->intHost)    |                         CSL_FMK ( MS_MSSYST_MSIEN, hwSetup->intDevice)  |                         CSL_FMK ( MS_MSSYST_FCLR, hwSetup->fifoClear)   |                         CSL_FMK ( MS_MSSYST_FDIR, hwSetup->fifoDir)     |                         CSL_FMK ( MS_MSSYST_DAM, hwSetup->dmaMode)      |                         CSL_FMK ( MS_MSSYST_DRM, hwSetup->drm)          |                         CSL_FMK ( MS_MSSYST_DRQSL, hwSetup->drqInt)     |                         CSL_FMK ( MS_MSSYST_REI, hwSetup->rei)          |                         CSL_FMK ( MS_MSSYST_REO, hwSetup->reo)          |                         CSL_FMK ( MS_MSSYST_BSY, hwSetup->bsyCount));    hMs->regs->MSMCR = (CSL_FMK (MS_MSMCR_BS, hwSetup->byteSwap) |                       CSL_FMK (MS_MSMCR_CD, hwSetup->clockDivider));    return CSL_SOK;}

⌨️ 快捷键说明

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