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

📄 dmatoradio.c

📁 cc2430的点对点通信的实际工程
💻 C
字号:
/******************************************************************************
Filename:     dmaToRadio.c
Target:       cc2430
Revised:      16/12-2005
Revision:     1.0
******************************************************************************/

#include "cul.h"

//-----------------------------------------------------------------------------
// See cul.h for a description of this function.
//-----------------------------------------------------------------------------
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_HIGH;                         // High priority
   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_NONE;                         // DMA is started by writing the DMAREQ register.
   pDmaChannel->TMODE          = TMODE_BLOCK;                          // The whole block is transferred.
   pDmaChannel->WORDSIZE       = WORDSIZE_BYTE;                        // One byte is transferred each time.

   return;
}

⌨️ 快捷键说明

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