完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
void sciaFifoInit(void) {
EALLOW; // Map SCI interrupts to ISR functions PieVectTable.SCIRXINTA = &sciaRxFifoIsr; PieVectTable.SCITXINTA = &sciaTxFifoIsr; EDIS; SciaRegs.SCICCR.all =0x0007; // 1 Stop bit, no loopback // no parity, 8 char bits, // async mode, idle-line protocol SciaRegs.SCICTL1.all =0x0003; // Enable TX, RX, internal SCICLK, // disable RX ERR, SLEEP, TXWAKE SciaRegs.SCICTL2.bit.TXINTENA =1; // Enable Tx interrupt SciaRegs.SCICTL2.bit.RXBKINTENA =1; // Enable RX interrupt SciaRegs.SCIHBAUD = 0x0000; // SCI BRR = LSPCLK/(SCI BAUDx8) - 1 SciaRegs.SCILBAUD = 0x00C2; // BRR = (15MHz/(Baud x 8)) - 1. 9600 Baud = 194d = C2h. SciaRegs.SCIFFTX.all = 0xC022; // Hold SCI in reset, enable FIFO, hold FIFO in reset, clear FIFO status, clear int, enable int, set int level to 0 SciaRegs.SCIFFRX.all = 0x0022; // Clear overflow flag, hold FIFO in reset, clear FIFO status, clear int, enable int, set int level to 3 SciaRegs.SCIFFCT.all = 0x00; // Disable auto-baud feature and set Tx delay to 0 SciaRegs.SCICTL1.all = 0x0023; // Relinquish SCI from Reset SciaRegs.SCIFFTX.bit.TXFIFOXRESET = 1; SciaRegs.SCIFFRX.bit.RXFIFORESET = 1; PieCtrlRegs.PIECTRL.bit.ENPIE = 1; // Enable the PIE block PieCtrlRegs.PIEIER9.bit.INTx1=1; // PIE Group 9, INT1 PieCtrlRegs.PIEIER9.bit.INTx2=1; // PIE Group 9, INT2 IER |= M_INT9; } interrupt void sciaRxFifoIsr (void) { // SCI FIFO interrupt (SCIRXINTA) indicating the SCI FIFO has recieved some data Uint16 rxBuffer[CNTRL_BUF_LEN]; Uint16 i; for (i=0; i } sciaTx(0); // Tx response to confirm reciept SciaRegs.SCIFFRX.bit.RXFFOVRCLR=1; // Clear Overflow flag SciaRegs.SCIFFRX.bit.RXFFINTCLR=1; // Clear Interrupt flag PieCtrlRegs.PIEACK.bit.ACK9 = 1; // Acknowledge CPU interrupt } interrupt void sciaTxFifoIsr(void) { PieCtrlRegs.PIEACK.bit.ACK9 = 1; // Acknowledge CPU interrupt } |
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
基于 DSP5509 进行数字图像处理中 Sobel 算子边缘检测的硬件连接电路图
2426 浏览 0 评论
695 浏览 0 评论
普中科技F28335开发板中,如何使用aic23播放由代码生成的正弦波
2865 浏览 0 评论
3629 浏览 1 评论
1205 浏览 1 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-25 13:05 , Processed in 0.602325 second(s), Total 74, Slave 57 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号