写linux的驱动程序,想用2410的DMA方式读取数据,部分代码如下:
...
//把data的值传给*buf
void spi_tx_data(U8 data)
{
U8 *buf = NULL;
DMA_M2M(&data,buf,1,0,0); /* transmit
}
...
void DMA_M2M(U8 *src,U8 *dst,int tc,int dsz,int burst)
{
// int length;
// length = tc*(burst ? 4:1)*((dsz==0)+(dsz==1)*2+(dsz==2)*4);
rDISRC1 = src;
rDISRCC1 = (0<<1)|(0<<0); /*Inc,the src is in the AHB */
rDIDST1 = dst;
rDIDSTC1 = (0<<1)|(0<<0); /*Inc,the dst is in the AHB */
rDCON1 = (1<<31)|(1<<30)|(burst<<28)|(1<<27)|(0<<24)|(0<<23)|
(0<<22)|(dsz<<20)|(tc);
rDMASKTRIG1 = (1<<1)|1; /*DMA is turned on */
DPRINTK("CURR_TC=%i\n",(rDSTAT1&0xfffff));
while(1){
if(!(rDSTAT1&0xfffff)){
DPRINTK("CURR_TC=%i\n",rDSTAT1&0xfffff);
break;
}
}
}
怎么不行呢,希望各位能指点一二,谢谢
[align=right][color=#000066][此贴子已经被作者于2006-10-18 14:58:55编辑过][/color][/align]
关键词:
求助
读取
问题
请教