www.pudn.com > SCIB_RS232.rar > F2812communication.c


/*****************************************************************************/ 
/*                         IO communication program                          */  
/*****************************************************************************/ 
                                                              
#include "DSP281x_Device.h" 
#include "DSP281x_Examples.h" 
  
#pragma DATA_SECTION(Kdata, "KDRAMdata");  
unsigned int Kdata[128]; 
 
#pragma DATA_SECTION(Fdata, "FPGAdata"); 
unsigned int Fdata[6];  
 
 
 
//struct ECAN_REGS ECanaShadow ; 
void main(void) 
{    
     
    InitSysCtrl();      //Initialize System Control registers, PLL, WatchDog, Clocks to default state: 
                        //This function is found in the DSP281x_SysCtrl.c file. 
     
	InitGpio();         //Select GPIO for the device or for the specific application: 
                        //This function is found in the DSP281x_Gpio.c file. 
	DINT;               //Disable and clear all CPU interrupts: 
	 
	InitPieCtrl();      //Initialize Pie Control Registers To Default State: 
                        //This function is found in the DSP281x_PieCtrl.c file.         
    IER = 0x0000; 
	IFR = 0x0000; 
    InitPieVectTable(); //Initialize the PIE Vector Table To a Known State: 
                        //This function is found in DSP281x_PieVect.c. 
                        //This function populates the PIE vector table with pointers 
                        //to the shell ISR functions found in DSP281x_DefaultIsr.c.	  
    InitXIntrupt();     //This function initializes external interrupts to a known state. 
                        //which will be found in DSP281x_XInterrupt.c 
     
    /*** Initialize the FLASH ***/ 
	//InitFlash();		// Initialize the FLASH (FILE: SysCtrl.c) 
 
    InitPeripherals();  //Initialize all the Device Peripherals to a known state: 
                        //This function is found in DSP281x_InitPeripherals.c 
     
    EnableInterrupts(); //This function enables the PIE module and CPU interrupt  
     
    eCAN_TX(); 
     
    eCAN_RX(); 
     
    for(;;); 
     
}