dmaConfig.PRIORITY = DMA_PRI_HIGH;
dmaConfig.M8 = DMA_M8_USE_8_BITS;
dmaConfig.IRQMASK = DMA_IRQMASK_DISABLE;
dmaConfig.TRIG = DMA_TRIG_RADIO;
dmaConfig.TMODE = DMA_TMODE_SINGLE;
dmaConfig.WORDSIZE = DMA_WORDSIZE_BYTE;
if (radio_mode == RADIO_MODE_TX) {
dmaConfig.SRCADDRH = (BYTE)(((UINT16)&radioPktBuffer >> 8) & 0x00FF);
dmaConfig.SRCADDRL = (BYTE)(((UINT16)&radioPktBuffer) & 0x00FF);
dmaConfig.DESTADDRH = (BYTE)(((UINT16)&X_RFD >> 8) & 0x00FF);
dmaConfig.DESTADDRL = (BYTE)(((UINT16)&X_RFD) & 0x00FF);
dmaConfig.VLEN = DMA_VLEN_FIRST_BYTE_P_1;
dmaConfig.LENH = (BYTE)(((UINT16)(PACKET_LENGTH + 1) >> 8) & 0x00FF);
dmaConfig.LENL = (BYTE)((UINT16)(PACKET_LENGTH + 1) & 0x00FF);
dmaConfig.SRCINC = DMA_SRCINC_1;
dmaConfig.DESTINC = DMA_DESTINC_0;
}
else if (radio_mode == RADIO_MODE_RX) {
dmaConfig.SRCADDRH = (BYTE)(((UINT16)&X_RFD >> 8) & 0x00FF);
dmaConfig.SRCADDRL = (BYTE)(((UINT16)&X_RFD) & 0x00FF);
dmaConfig.DESTADDRH = (BYTE)(((UINT16)&radioPktBuffer >> 8) & 0x00FF);
dmaConfig.DESTADDRL = (BYTE)(((UINT16)&radioPktBuffer) & 0x00FF);
dmaConfig.VLEN = DMA_VLEN_FIRST_BYTE_P_3;
dmaConfig.LENH = (BYTE)(((UINT16)(PACKET_LENGTH + 3) >> 8) & 0x00FF);
dmaConfig.LENL = (BYTE)(((UINT16)(PACKET_LENGTH + 3) & 0x00FF));
dmaConfig.SRCINC = DMA_SRCINC_0;
dmaConfig.DESTINC = DMA_DESTINC_1;
}
DMA0CFGH = (BYTE)(((UINT16)&dmaConfig >> 8) & 0x00FF);
DMA0CFGL = (BYTE)(((UINT16)&dmaConfig) & 0x00FF);
Viki Shi:
配置CC1110的DMA模式请参考DN107:www.ti.com/…/swra164a.pdf
user5922715:
回复 Viki Shi:
好的,谢谢