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

📄 main.c

📁 开发环境ADSP6++,EBF_561开发板所有源代码
💻 C
字号:
#include "GeneralFunc.h"
#include "Init.h"
#include "Sys.h"
#include "../CPLD.h"
#include "Regdef.h"

extern void Init_SDRAM(void);
extern void Init_PLL(void);
extern void Init_EBIU(void);
extern void Init_Flash(void);

extern void Init_PPI(void);
extern void Init_PPIDMA(void);
extern void Init_Timer(void);
extern void Init_CPLD(void);

extern void Delay(unsigned int Value);
/****************************************************************/
//CtrlRegFlashAPortA myCtrlRegFlashAPortA;
PLLCTRL mypllctrl;
PPICtrl myppictrl;
DMA0Config ppidmacfg;
TIMERxCONFIG mytimer1cfg;
TIMERxCONFIG mytimer2cfg;

unsigned short PPI_DMA_DONE = 0;
unsigned short PPI_DMA_TIME = 0;

//section ("sdram0")extern unsigned char DisplayBuffer[262][960];


void main()
{	unsigned short test;
	unsigned int i,j,k;//define temporary variable
	static unsigned int m;
	
	//Init_SDRAM();	
 	Set_PLL( (short)(CORECLK/CLKIN), (short)(CORECLK/SYSCLK));
	Init_EBIU();
	Init_CPLD();
	//Init_Flash();
	
	Init_PPI();
	Init_PPIDMA();


for(i=0;i<=261;i++)
		{
		for(j=0;j<40;j++)
			{
				DisplayBuffer[i][j*3+0] = 0x00;
				DisplayBuffer[i][j*3+1] = 0x00;
				DisplayBuffer[i][j*3+2] = 0x00;
			}
		for(j=40;j<80;j++)
			{
				DisplayBuffer[i][j*3+0] = 0xff;
				DisplayBuffer[i][j*3+1] = 0x00;
				DisplayBuffer[i][j*3+2] = 0x00;//red
			}
		for(j=80;j<120;j++)
			{
				DisplayBuffer[i][j*3+0] = 0x00;
				DisplayBuffer[i][j*3+1] = 0xff;
				DisplayBuffer[i][j*3+2] = 0x00;//green
			}
		for(j=120;j<160;j++)
			{
				DisplayBuffer[i][j*3+0] = 0x00;
				DisplayBuffer[i][j*3+1] = 0x0;
				DisplayBuffer[i][j*3+2] = 0xff;//blue
			}
		for(j=160;j<200;j++)
			{
				DisplayBuffer[i][j*3+0] = 0x00;
				DisplayBuffer[i][j*3+1] = 0xff;
				DisplayBuffer[i][j*3+2] = 0xff;//red+green
			}
		for(j=200;j<240;j++)
			{
				DisplayBuffer[i][j*3+0] = 0xff;
				DisplayBuffer[i][j*3+1] = 0xff;
				DisplayBuffer[i][j*3+2] = 0x00;//red+blue
			}
		for(j=240;j<280;j++)
			{
				DisplayBuffer[i][j*3+0] = 0xff;
				DisplayBuffer[i][j*3+1] = 0x00;
				DisplayBuffer[i][j*3+2] = 0xff;//green+blue
			}
		for(j=280;j<320;j++)
			{
				DisplayBuffer[i][j*3+0] = 0xff;
				DisplayBuffer[i][j*3+1] = 0xff;
				DisplayBuffer[i][j*3+2] = 0xff;
			}

		}


/***************************************************************/
	ppidmacfg.DMA0ConfigBits.dmaen = 1;
	*pDMA1_1_CONFIG = ppidmacfg.DMA0ConfigValue;//enable dma channel
	
	Init_Timer();
	
	myppictrl.PPICtrlBits.porten = 1;
	*pPPI1_CONTROL = myppictrl.PPICtrlValue;//enable PPI

	*pTMRS4_ENABLE= 0x000c;//enable timer	
	
	while(1);


}







⌨️ 快捷键说明

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