📄 csl_nandhwsetupraw.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_nandHwSetupRaw.c
*
* \brief File for functional layer of CSL API \a CSL_nandHwSetupRaw()
*
* Description
* - The \a CSL_nandHwSetupRaw() function definition & it's associated
* functions
*
* Path: \\(CSLPATH)\\ipmodules\\nfc\\src
*
*/
/* =============================================================================
* Revision History
* ===============
* 04-Sep-2004 Nsr File Created.
*
* =============================================================================
*/
#include <csl_nand.h>
/** ============================================================================
* @n@b CSL_nandHwSetupRaw
*
* @b Description
* @n This function initializes the device registers with the register-values
* provided through the Config Data structure.
*
* @b Arguments
* @verbatim
hNand Handle to the Nand 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 NAND instance will be setup
* according to value passed.
*
* @b Modifies
* @n Hardware registers of the specified NAND instance.
*
* @b Example
* @verbatim
CSL_NandHandle hNand;
CSL_NandConfig config = CSL_NAND_CONFIG_DEFAULTS;
CSL_Status status;
status = CSL_nandHwSetupRaw (hNand, &config);
@endverbatim
* ===========================================================================
*/
#pragma CODE_SECTION (CSL_nandHwSetupRaw, ".text:csl_section:nand");
CSL_Status CSL_nandHwSetupRaw (
CSL_NandHandle hNand,
CSL_NandConfig *config
)
{
if (hNand == NULL)
return CSL_ESYS_BADHANDLE;
if (config == NULL )
return CSL_ESYS_INVPARAMS;
hNand->regs->AWCCR = config->AWCCR;
hNand->regs->AB1CR = config->AB1CR;
hNand->regs->AB2CR = config->AB2CR;
hNand->regs->AB3CR = config->AB3CR;
hNand->regs->AB4CR = config->AB4CR;
hNand->regs->NIRR = config->NIRR ;
hNand->regs->NIMR = config->NIMR ;
hNand->regs->NIMSR = config->NIMSR;
hNand->regs->NIMCR = config->NIMCR;
hNand->regs->NANDFCR = config->NANDFCR ;
hNand->regs->IODFTECR = config->IODFTECR;
hNand->regs->IODFTGCR = config->IODFTGCR;
hNand->regs->CE0DATA = config->CE0DATA;
hNand->regs->CE0ALE = config->CE0ALE ;
hNand->regs->CE0CLE = config->CE0CLE ;
hNand->regs->CE1DATA = config->CE1DATA;
hNand->regs->CE1ALE = config->CE1ALE ;
hNand->regs->CE1CLE = config->CE1CLE ;
hNand->regs->CE2DATA = config->CE2DATA;
hNand->regs->CE2ALE = config->CE2ALE ;
hNand->regs->CE2CLE = config->CE2CLE ;
hNand->regs->CE3DATA = config->CE3DATA;
hNand->regs->CE3ALE = config->CE3ALE ;
hNand->regs->CE3CLE = config->CE3CLE ;
return CSL_SOK;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -