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

📄 sdram_test.c

📁 ADI公司blackfin DSP开发板BF533 EZ-KIT LITE附带的全部原代码
💻 C
字号:
/*********************************************************************************

Copyright(c) 2005 Analog Devices, Inc. All Rights Reserved. 

This software is proprietary and confidential.  By using this software you agree
to the terms of the associated Analog Devices License Agreement.  

Description: Routines to test the SDRAM by reading and writing to all available
			 locations.
			
*********************************************************************************/#include "PowerDemo.h"

#include "sdram_test.h"


/*********************************************************************

	Function:		TestSDRAM

	Description:	Writes to SDRAM and reads same, returns 1 if successful.
	
***********************************************************************/	
int TestSDRAM()
{
	WriteSDRAM();
	return ReadSDRAM();
}

/*********************************************************************

	Function:		WriteSDRAM

	Description:	Writes to SDRAM.
		
***********************************************************************/	
void WriteSDRAM()
{
	u32 write_val = 0xFFFFFFFF;
	u32 i;
	volatile u32 *p = pSDRAM_PTR;
		
	for (i = 0; i < SDRAM_COUNT; p++,i++)	
	{
	    *p = write_val--;
	}
}

/*********************************************************************

	Function:		ReadSDRAM

	Description:	Reads SDRAM, returns 1 if successful.
	
***********************************************************************/	
int ReadSDRAM()
{
	u32 read_val = 0xFFFFFFFF;
	u16 ret_val = 1;
	u32 i;
	volatile u32 *p = pSDRAM_PTR;
	
	for (i = 0; i < SDRAM_COUNT; i++,p++)
	{
		if (*p != read_val--)
		{
			ret_val = 0;
			break;
		}
	}
	return ret_val;
}


/*********************************************************************

	Function:		AccessSDRAM

	Description:	Reads SDRAM base location and returns its value.
					(to provide a means to bring SDRAM out of self-refresh.
	
***********************************************************************/	
u32 AccessSDRAM()
{	
	volatile u32 *p = pSDRAM_PTR;
	return *p;
}
	

⌨️ 快捷键说明

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