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

📄 dmafromradio.c

📁 zigbee通信系统中使用芯片cc2430实现点对点通信的源码
💻 C
字号:
/******************************************************************************
Filename:     dmaFromRadio.c
Target:       cc2430
Revised:      16/12-2005
Revision:     1.0
******************************************************************************/

#include "cul.h"

//-----------------------------------------------------------------------------
// See cul.h for a description of this function.
//-----------------------------------------------------------------------------
void culDmaFromRadio(DMA_DESC* pDmaChannel, BYTE *pDstAddr, BOOL generateInterrupt)
{
   SET_WORD(pDmaChannel->SRCADDRH, pDmaChannel->SRCADDRL,   &X_RFD);   // The start address of the segment
   SET_WORD(pDmaChannel->DESTADDRH, pDmaChannel->DESTADDRL, pDstAddr); // Tx FiFo address
   SET_WORD(pDmaChannel->LENH, pDmaChannel->LENL, 255);                // Maximum of the Tx FiFo.
   pDmaChannel->VLEN       = VLEN_1_P_VALOFFIRST;// The first byte indicates transfer length
   pDmaChannel->PRIORITY   = PRI_HIGH;
   pDmaChannel->M8         = M8_USE_7_BITS;

   pDmaChannel->IRQMASK    = generateInterrupt; // The DMA complete interrupt flag is set at completion.
   pDmaChannel->DESTINC    = DESTINC_1;         // The destination is constant
   pDmaChannel->SRCINC     = SRCINC_0;          // The address for data fetch is incremented by 1 byte after each transfer.
   pDmaChannel->TRIG       = DMATRIG_RADIO;     // DMA is started by the radio receiver.
   pDmaChannel->TMODE      = TMODE_SINGLE;      // One byte is transferred at each DMA trigger.
   pDmaChannel->WORDSIZE   = WORDSIZE_BYTE;     // Byte transfer.

   return;
}

⌨️ 快捷键说明

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