mcbspreset.c
来自「CHP 2 - Real-Time Digital Signal Process」· C语言 代码 · 共 39 行
C
39 行
//
// Project: Experiment 2.10.6 Configure and Use McBSP- Chapter 2
// File name: mcbspReset.c
// Function(s): mcbspReset()
//
// Description: This function resets the C5510 DSK McBSP registers
//
// For the book "Real Time Digital Signal Processing:
// Implementation and Application, 2nd Ed"
// By Sen M. Kuo, Bob H. Lee, and Wenshun Tian
// Publisher: John Wiley and Sons, Ltd
//
// Tools used: CCS v.2.12.07
// TMS320VC5510 DSK Rev-C
//
#include "mcbsp.h"
#pragma CODE_SECTION(mcbspReset, ".text:example:mcbspReset");
void mcbspReset(short mcbspx)
{
volatile short i;
ioport volatile unsigned short*p;
p = (ioport volatile unsigned short*)(McBSP_BASE+(mcbspx<<10));
for (i=0; i<31; i++) // Zero out all registers and set the bits below
{
*p++ = 0;
}
p = (ioport volatile unsigned short*)(McBSP_BASE+(mcbspx<<10)+SRGR2);
*p++ = 0x2000; // SRGR2 default to 0x2000
*p = 0x0001; // SRGR1 default to 0x0001
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?