概述
#include "DSP2833x_Device.h"
#include "DSP2833x_Examples.h"
char buf[]={0x30,0x32,0x34,0x35,0x67,0x23,0x45,0x56,0x30,0x32,0x34,0x35,0x67,0x23,0x45,0x56};
void delay(void)
{
long int i,j;
for(j=0;j<2550;j++)
for(i=0;i<2550;i++);
}
interrupt void send(void)
{
int i;
for(i=0;i<12;i++)
{
ScibRegs.SCITXBUF=buf[i];
}
// ScibRegs.SCIFFTX.bit.TXFFINTCLR=1; //如果在发送中断里清发送中断标志,则会一直不停地发送
PieCtrlRegs.PIEACK.all=0xffff;
}
void init(void)
{
InitSysCtrl();
InitScibGpio();
ScibRegs.SCICCR.bit.PARITY=0;
ScibRegs.SCICCR.bit.SCICHAR=7;
ScibRegs.SCICCR.bit.STOPBITS=0;
ScibRegs.SCIHBAUD=0x01;
ScibRegs.SCILBAUD=0xE7;
ScibRegs.SCICTL1.bit.TXENA=1;
ScibRegs.SCIFFTX.bit.SCIFFENA=1;
ScibRegs.SCIFFTX.bit.TXFFST=8;
ScibRegs.SCICTL1.bit.TXENA=1;
ScibRegs.SCIFFTX.bit.TXFFIENA=1;
ScibRegs.SCICTL1.bit.SWRESET=1;
DINT;
IER=0;
IFR=0;
InitPieCtrl();
InitPieVectTable();
PieCtrlRegs.PIEIER9.bit.INTx4=1;
PieCtrlRegs.PIECTRL.bit.ENPIE = 1;
EALLOW;
PieVectTable.SCITXINTB=&send;
EDIS;
IER=M_INT9;
EINT;
}
int main(void)
{
init();
ScibRegs.SCIFFTX.bit.TXFFINTCLR=1; // 很重要 若不清fifo发送中断标志则,不进入发送中断
while(1)
{
ScibRegs.SCIFFTX.bit.TXFFINTCLR=1;
delay();
}
return 0;
}
转载于:https://www.cnblogs.com/luxiaolai/p/3297587.html
最后
以上就是愉快冥王星为你收集整理的28335 sci fifo send的全部内容,希望文章能够帮你解决28335 sci fifo send所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复