📄 csl_emifhwsetupraw.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_emifHwSetupRaw.c
*
* @brief File for functional layer of CSL API @a CSL_emifHwSetupRaw()
*
* Path: \\(CSLPATH)\\ipmodules\\emifs\\src
*
* Description
* - The @a CSL_emifHwSetupRaw() function definition & it's associated functions
*
*/
/* ============================================================================
* Copyright (c) Texas Instruments Inc 2002, 2003, 2004
*
* Use of this software is controlled by the terms and conditions found in the
* license agreement under which this software has been supplied.
* ===========================================================================
*/
/* =============================================================================
* Revision History
* ===============
* 30-Aug-2004 brn File Created for the new CSL architecture.
* 11-Oct-2004 brn File updated with the code review comments
* =============================================================================
*/
#include <csl_emif.h>
/** ============================================================================
* @n@b CSL_emifHwSetupRaw
*
* @b Description
* @n This function initializes the device registers with the register-values
* provided through the config data structure.
*
* @b Arguments
* @verbatim
hEmif Handle to the external memory interface instance
config Pointer to the config structure containing the
device register values
@endverbatim
*
* <b> Return Value </b> CSL_Status
* @li CSL_SOK - Configuration successful
* @li CSL_ESYS_BADHANDLE - Invalid handle
* @li CSL_ESYS_INVPARAMS - Configuration structure
* pointer is not properly
* initialized
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n The registers of the specified compact camera port instance will be
* setup according to the values passed through the config structure
*
* @b Modifies
* @n Hardware registers of the specified compact camera port instance
*
* @b Example
* @verbatim
CSL_EmifHandle hEmif;
CSL_EmifConfig config = CSL_EMIF_CONFIG_DEFAULTS;
CSL_Status status;
...
status = CSL_emifHwSetupRaw (hCcp, &config);
...
@endverbatim
* =============================================================================
*/
#pragma CODE_SECTION (CSL_emifHwSetupRaw, ".text:csl_section:ccp");
CSL_Status CSL_emifHwSetupRaw (
CSL_EmifHandle hEmif,
CSL_EmifConfig *config
)
{
if(hEmif == NULL)
return CSL_ESYS_BADHANDLE;
if(config == NULL)
return CSL_ESYS_INVPARAMS;
/* setting the information of external memory interface async waight
config register */
hEmif->regs->AWCCR = config->AWCCR;
/* setting the information of external memory interface SRAM bank
config regieter */
hEmif->regs->SDBCR = config->SDBCR;
/* setting the information of external memory interface SDRAM refresh
control register */
hEmif->regs->SDRCR = config->SDRCR;
/* setting the information of external memory interface asynchronous banck
control register1 */
hEmif->regs->AB1CR = config->AB1CR;
/* setting the information of external memory interface asynchronous banck
control register2 */
hEmif->regs->AB2CR = config->AB2CR;
/* setting the information of external memory interface asynchronous banck
control register3 */
hEmif->regs->AB3CR = config->AB3CR;
/* setting the information of external memory interface asynchronous banck
control register4 */
hEmif->regs->AB4CR = config->AB4CR;
/* setting the information of external memory interface SDRAM timing
register */
hEmif->regs->SDTIMR = config->SDTIMR;
/* setting the information of external memory interface DDR PHY control
register */
hEmif->regs->DDRPHYCR = config->DDRPHYCR;
/* setting the information of external memory interface SDRAN self refresh
timing register */
hEmif->regs->SDSRETR = config->SDSRETR;
/* setting the information of external memory interface interrupt raw
register */
hEmif->regs->EIRR = config->EIRR;
/* setting the information of external memory interface interrupt masked
register */
hEmif->regs->EIMR = config->EIMR;
/* setting the information of external memory interface interrupt mask set
register */
hEmif->regs->EIMSR = config->EIMSR;
/* setting the information of external memory interface intrrupt mask clear
register */
hEmif->regs->EIMCR = config->EIMCR;
/* setting the information of external memory interface io control
register */
hEmif->regs->IOCTRLR = config->IOCTRLR;
/* setting the information of external memory interface nand flash control
register */
hEmif->regs->NANDFCR = config->NANDFCR ;
return CSL_SOK;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -