This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

程序问题

Other Parts Discussed in Thread: TMS320VC5505

Uint16 set_dma1_ch0_i2s2_Lout(void)
{
Uint16 temp;
Uint32 add;

DMA1_CH0_TC_LSW = XMIT_BUFF_SIZE*2;

#if(AUTO_RELOAD ==1)
DMA1_CH0_TC_MSW = 0x3204; //src incre, destination fix, sync, auto
#else
DMA1_CH0_TC_MSW = 0x2204; //src incre, destination fix, sync, No auto
#endif

temp = DMA1_CH10_EVENT_SRC;
DMA1_CH10_EVENT_SRC = temp | 0x0001; // I2S2 transmit event

if(fSineWave ==1)
{
add = (Uint32)XmitL_Sine_1K; XmitL_Sine_1K是一个数组
}
else
{
add = (Uint32)XmitL_Sine_2K;
}

add = (add<<1) + 0x10000; // change word address to byte address and add DARAM offset for DMA
DMA1_CH0_SRC_LSW = (Uint16)add;

DMA1_CH0_SRC_MSW = 0xFFFF & (add >> 16);

DMA1_CH0_DST_LSW = 0x2A08; // is20 transmit left data register lsw

// DMA starts
temp = DMA1_CH0_TC_MSW;
temp |= 0x8000;
DMA1_CH0_TC_MSW = temp;

return SUCCESS;
}

TMS320VC5505 中例程中关于DMA传输的,不是很理解为什么要这么做add = (add<<1) + 0x10000; // change word address to byte address and add DARAM offset for DMA