码迷,mamicode.com
首页 > 其他好文 > 详细

28335sci中断接收

时间:2016-02-01 01:33:56      阅读:508      评论:0      收藏:0      [点我收藏+]

标签:

#include "DSP2833x_Device.h"     // DSP2833x Headerfile Include File

#include "DSP2833x_Examples.h"   // DSP2833x Examples Include File

void Init_Gpio(void)

{  EALLOW;  

GpioCtrlRegs.GPAMUX1.all=0x0000;

 GpioCtrlRegs.GPADIR.all=0xffff;

 EDIS;

}

interrupt void Scib_init(void)

{  GpioDataRegs.GPADAT.all=ScicRegs.SCIRXBUF.all;

 PieCtrlRegs.PIEACK.all=PIEACK_GROUP8;

}

void Init_Sci(void)

{

 EALLOW;

 InitSysCtrl();

 InitSciGpio();

 InitPieCtrl();  

EDIS;

 EALLOW;

 ScicRegs.SCIHBAUD=0x01;

 ScicRegs.SCILBAUD=0xe7;

 ScicRegs.SCICCR.bit.SCICHAR=7;

 ScicRegs.SCICCR.bit.STOPBITS=0;

 ScicRegs.SCICCR.bit.PARITYENA=0;

 ScicRegs.SCICTL1.bit.RXENA=1;

 ScicRegs.SCICTL2.bit.RXBKINTENA=1;

 PieVectTable.SCIRXINTC=&Scib_init;

 ScicRegs.SCICTL1.bit.SWRESET=1;

 EDIS;

 DINT;

 IER=0x0000;

 IFR=0x0000;

 PieCtrlRegs.PIECTRL.bit.ENPIE=1;

 PieCtrlRegs.PIEIER8.bit.INTx5=1;

 IER|=M_INT8;

 EINT;

 ERTM;

}

void main(void)

{  Init_Gpio();

 Init_Sci();

 GpioDataRegs.GPADAT.all=0xffff;

 while(1);

}

 

28335sci中断接收

标签:

原文地址:http://www.cnblogs.com/luxiaolai/p/5173923.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!