#include "DSP280x_Device.h"
#include "DSP280x_Examples.h"
char a=0xfe;
void sci_init(void)
{
InitSysCtrl();
InitSciGpio();
EALLOW;
SciaRegs.SCICCR.bit.PARITYENA=0;
SciaRegs.SCICCR.bit.STOPBITS=0;
SciaRegs.SCICCR.bit.SCICHAR=7;
SciaRegs.SCIHBAUD=0x01;
SciaRegs.SCILBAUD=0x44;
SciaRegs.SCICTL1.all=0x0003;
SciaRegs.SCICTL1.bit.RXENA=1;
SciaRegs.SCICTL2.bit.RXBKINTENA=1;
SciaRegs.SCICTL1.all=0x23;
EDIS;
}
void gpio_init(void)
{
EALLOW;
GpioCtrlRegs.GPAMUX1.all=0x0000;
GpioCtrlRegs.GPADIR.all=0xffff;
EDIS;
}
interrupt void scia(void)
{
while(ScibRegs.SCIRXST.bit.RXRDY !=0);
GpioDataRegs.GPADAT.all=SciaRegs.SCIRXBUF.all;
PieCtrlRegs.PIEACK.all=PIEACK_GROUP9;
}
void INIT_init(void)
{
InitPieCtrl();
InitPieVectTable();
DINT;
IER=0x0000;
IFR=0x0000;
EALLOW;
PieVectTable.SCIRXINTA=&scia;
EDIS;
PieCtrlRegs.PIECTRL.bit.ENPIE =1;
PieCtrlRegs.PIEIER9.bit.INTx1=1;
IER|=M_INT9;
EINT;
ERTM;
}
void main(void)
{
sci_init();
INIT_init();
gpio_init();
while(1);
}