|
DMA的配置程序如下所示:
void culDmaToRadio(DMA_DESC* pDmaChannel, WORD length, BYTE* pSrcAddr, BOOL generateInterrupt){
SET_WORD(pDmaChannel->SRCADDRH, pDmaChannel->SRCADDRL, pSrcAddr); // The start address of the segment
SET_WORD(pDmaChannel->DESTADDRH, pDmaChannel->DESTADDRL, &X_RFD); // Tx FIFO address
SET_WORD(pDmaChannel->LENH, pDmaChannel->LENL, length); // Setting the length of the transfer (bytes)
pDmaChannel->VLEN = VLEN_USE_LEN; // Using the length field
pDmaChannel->PRIORITY = PRI_LOW;
pDmaChannel->M8 = M8_USE_8_BITS; // Transferring all 8 bits in each byte.
pDmaChannel->IRQMASK = generateInterrupt; // The DMA complete interrupt flag is set at completion.
pDmaChannel->DESTINC = DESTINC_0; // The destination address is constant
pDmaChannel->SRCINC = SRCINC_1; // The address for data fetch is inremented by 1 byte
// after each transfer.
pDmaChannel->TRIG = DMATRIG_RADIO; // DMA is started by writing the radio
pDmaChannel->TMODE = TMODE_SINGLE; // Byte for byte is transferred.
pDmaChannel->WORDSIZE = WORDSIZE_BYTE; // One byte is transferred each time.
return;
}
其中pDmaChannel->TMODE = TMODE_SINGLE;将DMA配置为射频模块的单次触发模式,手册上说这种模式每触发一次传送一个字节,然后等待下一次触发,当传送完指定数量的自己数据时,传送完成。
我想知道到底是射频模块的什么动作触发了DMA数据传输?是STX();语句吗?每次触发只传送一个字节,那剩下字节的传送是怎么触发的,这时无线龙CC110处理器CMSA方式的程序。 |
阿莫论坛20周年了!感谢大家的支持与爱护!!
月入3000的是反美的。收入3万是亲美的。收入30万是移民美国的。收入300万是取得绿卡后回国,教唆那些3000来反美的!
|