2808 SCI 中断接收
#include "DSP280x_Device.h"
#include "DSP280x_Examples.h"
void Init_Gpio(void)
{
EALLOW;
GpioCtrlRegs.GPAMUX1.all=0x0000;
GpioCtrlRegs.GPADIR.all=0xffff;
EDIS;
}
interrupt void Scia_init(void)
{
GpioDataRegs.GPADAT.all=SciaRegs.SCIRXBUF.all;
PieCtrlRegs.PIEACK.all=PIEACK_GROUP9;
}
void Init_Sci(void)
{
InitSysCtrl();
InitSciGpio();
InitPieCtrl();
EALLOW;
SciaRegs.SCIHBAUD=0x01;
SciaRegs.SCILBAUD=0x44;
SciaRegs.SCICCR.bit.SCICHAR=7;
SciaRegs.SCICCR.bit.STOPBITS=0;
SciaRegs.SCICTL1.bit.RXENA=1;
SciaRegs.SCICTL2.bit.RXBKINTENA=1;
PieVectTable.SCIRXINTA=&Scia_init;
SciaRegs.SCICTL1.bit.SWRESET=1;
EDIS;
DINT;
IER=0x0000;
IFR=0x0000;
EINT;
PieCtrlRegs.PIECTRL.bit.ENPIE=1;
PieCtrlRegs.PIEIER9.bit.INTx1=1;
IER|=M_INT9;
ERTM;
}
void main(void)
{
Init_Sci();
Init_Gpio();
while(1);
}