#include "DSP2833x_Device.h" // DSP2833x Headerfile Include File
#include "DSP2833x_Examples.h" // DSP2833x Examples Include File
#define LED4 GpioDataRegs.GPADAT.bit.GPIO0
#define LED3 GpioDataRegs.GPADAT.bit.GPIO1
#define LED1 GpioDataRegs.GPADAT.bit.GPIO6
#define LED2 GpioDataRegs.GPADAT.bit.GPIO7
interrupt void ISRTimer0(void);
void configtestled(void);
void main(void)
{
InitSysCtrl();
InitXintf16Gpio();
DINT;
InitPieCtrl();
IER = 0x0000;
IFR = 0x0000;
InitPieVectTable();
EALLOW;
PieVectTable.TINT0 = &ISRTimer0;
EDIS;
InitCpuTimers();
ConfigCpuTimer(&CpuTimer0, 150, 500000);
StartCpuTimer0();
IER |= M_INT1;
GpioDataRegs.GPBSET.bit.GPIO60=1;
PieCtrlRegs.PIECTRL.bit.ENPIE = 1;
PieCtrlRegs.PIEIER1.bit.INTx7 = 1;
EINT;
ERTM;
configtestled();
LED1=1;
DELAY_US(10);
LED2=1;
DELAY_US(10);
LED3=0;
DELAY_US(10);
LED4=0;
DELAY_US(10);
for(; ;);
}
interrupt void ISRTimer0(void)
{
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
CpuTimer0Regs.TCR.bit.TIF=1;
CpuTimer0Regs.TCR.bit.TRB=1;
LED1=~LED1;
LED2=~LED2;
LED3=~LED3;
LED4=~LED4;
}
void configtestled(void)
{
EALLOW;
GpioCtrlRegs.GPAMUX1.bit.GPIO0 = 0;
GpioCtrlRegs.GPADIR.bit.GPIO0 = 1;
GpioCtrlRegs.GPAMUX1.bit.GPIO1 = 0;
GpioCtrlRegs.GPADIR.bit.GPIO1 = 1;
GpioCtrlRegs.GPAMUX1.bit.GPIO6 = 0;
GpioCtrlRegs.GPADIR.bit.GPIO6 = 1;
GpioCtrlRegs.GPAMUX1.bit.GPIO7 = 0;
GpioCtrlRegs.GPADIR.bit.GPIO7 = 1;
EDIS;
}
|