?? dec6713_sdram.c
字號:
/********************************************************************************\
\* DEC6713_SDRAM.c V2.00 *\
\* Copyright 2004 by SEED Electronic Technology LTD. *\
\* All rights reserved. SEED Electronic Technology LTD. *\
\* Restricted rights to use, duplicate or disclose this code are *\
\* granted through contract. *\
\* Designed by: Hongshuai.Li *\
\* Discription: Erase, write and read the whole chip! *\
\* Data: Modified 05.10.2005 *\
\********************************************************************************/
/********************************************************************************\
\* The example writes some data in one space of SDRAM. Then copy these data to
another space of SDRAM. At last read these data into data buffer. You can
observe these data in the related address space, and observe message in the
watch window for running process of the routine. *\
\********************************************************************************/
#include <csl.h>
#include <csl_irq.h>
#include <csl_cache.h>
#include <csl_emif.h>
#include <DEC6713.h>
#include <stdio.h>
#include <std.h>
/********************************************************************************/
Uint16 *Src_StartAdd;
Uint16 TempData=0;
extern far void vectors();
/********************************************************************************\
\********************************************************************************/
main()
{
Uint32 i;
// Uint32 Length = 0;
Src_StartAdd = (Uint16 *)0xA0000000;
/* Initialize csl. */
/* The CSL_init() function must be called once at the beginning of your program
before calling any other CSL API functions */
CSL_init();
/* Initialize DSK6713 board. */
DEC6713_init();
while (1)
{
Src_StartAdd = (Uint16 *)0xA0000000;
*Src_StartAdd=0x0324;
for(i=0;i<6000;i++);
Src_StartAdd = (Uint16 *)0xA000000f;
TempData=*Src_StartAdd;
}
/* while (1)
{
for(i=0;i<0x001000;i++)
{
*(Src_StartAdd++) =0x54;
}
printf("\nFinish writing Source data.");
Src_StartAdd = (Uint16 *)0x80000000;
for(i=0;i<0x001000;i++)
{
TempData = *(Src_StartAdd ++);
if(TempData != 0x54)
{
printf("\nTesting is failure!");
printf("\nAddress 0x%x is error!",i);
exit(0);
}
else continue;
}
printf("\nTesting is success!");
} /**/
}
/********************************************************************************\
\* End of DEC6713_SDRAM.c *\
\********************************************************************************/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -