⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aic23test.c

📁 CHP 2 - Real-Time Digital Signal Processing: Implementations and Applications, Second Edition by Sen
💻 C
字号:
// 
//  Project: Experiment 2.10.7 Use AIC23 via McBSP - Chapter 2 
//  File name: aic23Test.c   
//  Function(s): main()    
//               dispID()    
//
//  Description: Experiment 2.10.7 initializes the C55x DSK McBSP and AIC23.
//               McBSP1 is for AIC23 controlling SPI and McBSP2 is the data SPI.
//               It reads data and plays audio back via on AIC23 to a speaker
//
//  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 <stdio.h>
#include "mcbsp.h"
#include "aic23.h"


#define   DATASIZE  12320
#define   FALSHMEMDATA 0 
#if FALSHMEMDATA 
// Flash memory data
#define   flashData 0x200000    // If data has been programmed by flash example already
#else
// Local memory data
short flashData[DATASIZE]={     // Else use data from SRAM
#include "dtmf18005551234.dat"
};
#endif

#pragma CODE_SECTION(main, ".text:example:main");


void main()
{
  short i,data;            
  unsigned short *flashPtr;
    
  // Initialize McBSP1 as AIC23 SPI control channel
  mcbsp1Init(); 
    
  // Initialize the AIC23  
  aic23Init();

  // Initialize McBSP2 as AIC23 SPI data channel       
  mcbsp2Init();           
                     
  flashPtr = (unsigned short *)flashData;                 
  // Playback data via AIC23
  for (i=0; i<DATASIZE; i++)
  {
    data = *flashPtr++;
    while (!aic23Tx(data));      // Send data to left channel
    while (!aic23Tx(data));      // Send data to right channel 
  }
        
  // Power down the AIC23 and reset McBSP
  aic23Powerdown();   
  mcbspReset(1);
  mcbspReset(2);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -