?? main.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 + -