📄 dsp281x_initdsp.c
字号:
//#########################################################################
//
// FIFlE: DSP2812x_DeviceInit.c;
// DESCRIPTION: DSP2812x device system and peripherals control initialization;
// WRITER: ZHANG XiaoLang;
// DATE: 2008/3/11;
//
//###############################################################################
#include "DSP281x_Device.h" // DSP281x Headerfile Include File;
#include "DSP281x_Examples.h"
// External symbols created by the linker cmd file
extern Uint16 RamfuncsLoadStart;
extern Uint16 RamfuncsLoadEnd;
extern Uint16 RamfuncsRunStart;
//--------------------------------------------------------------------------
//function: initialize the device;
//--------------------------------------------------------------------------
void InitDSP(void)
{
InitSysCtrl(); // Initialize the DSP's core Registers
StopCpuTimer0(); // Just stop it;
DisableDog(); // Disable the watch dog;
InitGpio(); // Initialize the GPIO to default state;
// Copy all FLASH sections that need to run from RAM (use memcpy() from RTS library)
// Section ramfuncs contains user defined code that runs from CSM secured RAM
memcpy( &RamfuncsRunStart,
&RamfuncsLoadStart,
&RamfuncsLoadEnd - &RamfuncsLoadStart);
CfgFlash(); // Initialize the FLASH ;
InitXintf(); // Initialize the external interface;
InitPieVectTable(); // Function call to init PIE vector table ( code : DSP281x_PieVect.c )
InitPieCtrl(); // Function Call to init PIE-unit ( code : DSP281x_PieCtrl.c)
InitXIntrupt(); // Configure the external interrupts;
InitSci();
InitEv(); // Configure EV
//#if PSXII_MAX7219
// InitPort_PS();
//#else
InitSpi();
//#endif
InitCpuTimers();
EnableInterrupts(); //Fuction call to enable interrupts used( code : DSP281x_PieCtrl.c)
ConfigCpuTimer(&CpuTimer0, 120, 1000000);
StartCpuTimer0();
}
void delay(Uint32 DULim)
{
Uint32 i;
for (i = 0x00000000 ; i < DULim ; i++);
// KickDog();
}
//--------------------------------------------------------------------------
// No more;
//--------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -