📄 csl_atahwsetupraw.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_ataHwSetupRaw.c * * @brief File for functional layer of CSL API CSL_ataHwSetupRaw() * * Path: \\(CSLPATH)\\ipmodules\\ata\\src *//* ============================================================================= * Revision History * =============== * 07-Nov-2004 kpn Updated according to new cslr_ata.h file, which is generated * according to ti-3710shu-1.03 document * 24-Sep-2004 kpn File Created. * ============================================================================ */#include <csl_ata.h>/** ============================================================================ * @n@b CSL_ataHwSetupRaw * * @b Description * @n This function initializes the device registers with the register-values * provided through the Config Data structure. * * @b Arguments * @verbatim hAta Handle to the ATA 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 ATA instance will be setup * according to input configuration structure values. * * @b Modifies * @n Hardware registers of the specified ATA instance. * * @b Example * @verbatim CSL_AtaHandle hAta; CSL_AtaConfig config = CSL_ATA_CONFIG_DEFAULTS; CSL_Status status; status = CSL_ataHwSetupRaw (hAta, &config); @endverbatim * ============================================================================ */#pragma CODE_SECTION (CSL_ataHwSetupRaw, ".text:csl_section:ata");CSL_Status CSL_ataHwSetupRaw ( CSL_AtaHandle hAta, CSL_AtaConfig *config){ if (hAta == NULL) { return CSL_ESYS_BADHANDLE; } if (config == NULL ) { return CSL_ESYS_INVPARAMS; } hAta->regs->DMAENGINE.BMICP = config->BMICP; hAta->regs->DMAENGINE.BMISP = config->BMISP; hAta->regs->DMAENGINE.BMIDTPP = config->BMIDTPP; hAta->regs->DMAENGINE.BMICS = config->BMICS; hAta->regs->DMAENGINE.BMISS = config->BMISS; hAta->regs->DMAENGINE.BMIDTPS = config->BMIDTPS; hAta->regs->DMAENGINE.DMARXCNT = config->DMARXCNT; hAta->regs->DMAENGINE.DMATXCNT = config->DMATXCNT; hAta->regs->CONFIG.IDETIMP = config->IDETIMP; hAta->regs->CONFIG.IORDYTMP = config->IORDYTMP; hAta->regs->CONFIG.IDETIMS = config->IDETIMS; hAta->regs->CONFIG.IORDYTMS = config->IORDYTMS; hAta->regs->CONFIG.SIDETIM = config->SIDETIM; hAta->regs->CONFIG.SLEWCTL_L = config->SLEWCTL_L; hAta->regs->CONFIG.SLEWCTL_H = config->SLEWCTL_H; hAta->regs->CONFIG.UDMACTL = config->UDMACTL; hAta->regs->CONFIG.UDMATIM = config->UDMATIM; hAta->regs->CONFIG.MISCCTL = config->MISCCTL; hAta->regs->CONFIG.REGSTB = config->REGSTB; hAta->regs->CONFIG.REGRCVR = config->REGRCVR; hAta->regs->CONFIG.DATSTB = config->DATSTB; hAta->regs->CONFIG.DATRCVR = config->DATRCVR; hAta->regs->CONFIG.DMASTB = config->DMASTB; hAta->regs->CONFIG.DMARCVR = config->DMARCVR; hAta->regs->CONFIG.UDMASTB = config->UDMASTB; hAta->regs->CONFIG.UDMATRP = config->UDMATRP; hAta->regs->CONFIG.UDMATENV = config->UDMATENV; hAta->regs->IODFTM.TLGC = config->TLGC; hAta->regs->IODFTM.TLMR = config->TLMR; hAta->regs->IODFTM.TLMR2 = config->TLMR2; hAta->regs->IODFTM.TLMR3 = config->TLMR3; hAta->regs->IODFTM.TLEC = config->TLEC; return CSL_SOK;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -