f2812communication.c

来自「TMSC320F2812串口SCI通信,SCIA,SCIB,波特率设置」· C语言 代码 · 共 53 行

C
53
字号
/*****************************************************************************/
/*                         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(;;);
    
}   

⌨️ 快捷键说明

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