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

📄 sram.c

📁 测试DSP扩展存储器
💻 C
字号:
//#include <Configuration1cfg.h>
#include <stdio.h>
#include <csl.h>
#include <csl_mcbsp.h>

extern   cregister  volatile unsigned int ISR;

MCBSP_Handle hMcbsp0,hMcbsp1;
MCBSP_Config mcbspCfg0,mcbspCfg1;

Uint32 temp=0,temp1=0;


void main()
{
	int i=1;
	Uint32 Data[100];
	volatile unsigned int *a=(volatile unsigned int *)0x80000000;
	volatile unsigned int *srama=(volatile unsigned int *)0xa0008000;

	CSL_init();
	init();
	printf("-----------------\nhello world!\n");


	/* enable NMI and GI */
	IRQ_nmiEnable();
//	IRQ_globalEnable();

	// For SRAM test.
	printf("%x\n",&srama);
	
	//*srama=0xa0008000;
	temp=0x0008000;
	while(i)
	{
		*srama=temp;
		temp1=*srama;
		if(temp1!=temp)	
			i=0;
		temp=temp+4;
		srama++;
		//temp1++;
		
	}
	puts("done");
	//temp1=*a;
	//printf("%d\n",*a);

	MCBSP_enableSrgr(hMcbsp0);
	MCBSP_enableRcv(hMcbsp0); /* Enable McBSP channel                     */
	MCBSP_enableXmt(hMcbsp0); /* McBSP port 0 as the transmitter/receiver */
	MCBSP_getConfig(hMcbsp0,&mcbspCfg0);

	while(1)
		{
			//if(temp1) printf("%d",temp1);
			for(i=0;i<100;i++);
//			ISR=0x00000200;
		}
		 
/*		
	while(i)
	{


	//while(i)
	//	{
			temp=MCBSP_rrdy(hMcbsp0);
			if(temp)
				temp1=MCBSP_read(hMcbsp0);
			//	Data[i--] = MCBSP_read(hMcbsp0);
				for(temp=0;temp<10;temp++);
			//MCBSP_getConfig(hMcbsp0,&mcbspCfg0);
	//	}
			if (MCBSP_xrdy(hMcbsp0))
			{
				MCBSP_write(hMcbsp0,temp1);
				MCBSP_getConfig(hMcbsp0,&mcbspCfg0);

			}

	}			
*/
	puts("hello");
	for(i=0;i<10;i++)
	//puts("hello world!");	 
	printf("hello world!%d\n",i);
	IRQ_disable(IRQ_EVT_RINT0);

}


interrupt void c_int09(void)
{
	Uint32 temp0;
	puts("int9  ok");
	temp1=MCBSP_read(hMcbsp0);
	printf("%d\n",temp1);
/*	for(temp0=0;temp0<10;temp0++);
	if (MCBSP_xrdy(hMcbsp0))
			{
				MCBSP_write(hMcbsp0,temp1);
				MCBSP_getConfig(hMcbsp0,&mcbspCfg0);
				puts("transmit ok.");
			}
*/
}

⌨️ 快捷键说明

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