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

📄 mac_support.h

📁 ucos在NEC平台下的移植
💻 H
字号:
/*******************************************************************************************************
 *                                                                                                     *
 *        **********                                                                                   *
 *       ************                                                                                  *
 *      ***        ***                                                                                 *
 *      ***   +++   ***                                                                                *
 *      ***   + +   ***                                                                                *
 *      ***   +                         CHIPCON CC2420 INTEGRATED 802.15.4 MAC AND PHY                 *
 *      ***   + +   ***                       Various Support/Utility Functions                        *
 *      ***   +++   ***                                                                                *
 *      ***        ***                                                                                 *
 *       ************                                                                                  *
 *        **********                                                                                   *
 *                                                                                                     *
 *******************************************************************************************************
 * CONFIDENTIAL                                                                                        *
 * The use of this file is restricted by the signed MAC software license agreement.                    *
 *                                                                                                     *
 * Copyright Chipcon AS, 2004                                                                          *
 *******************************************************************************************************
 * This module contains support/utility functions for the MAC sublayer.                                *
 *******************************************************************************************************
 * Compiler: AVR-GCC                                                                                   *
 * Target platform: CC2420DB, CC2420 + any ATMEGA MCU                                                  *
 *******************************************************************************************************
 * The revision history is located at the bottom of this file                                          *
 *******************************************************************************************************/
#ifndef MAC_SUPPORT_H
#define MAC_SUPPORT_H




/*******************************************************************************************************
 *******************************************************************************************************
 **************************               FUNCTION PROTOTYPES                 **************************
 *******************************************************************************************************
 *******************************************************************************************************/


//-------------------------------------------------------------------------------------------------------
// Creates a task that modifies a flag when run, and then just exits
void msupWaitTask(MAC_TASK_INFO *pTask);

// Compares two QWORDs
ZBOOL msupCompareQword(QWORD *pA, QWORD *pB);

// Copies an array of data in the reverse order
void msupReverseCopy(BYTE *pDestination, BYTE *pSource, UINT8 length);

// Pseudo-random generator
void msupInitRandom(void);
BYTE msupGetRandomByte(void);
// Transiver output power
void msupSetTransmitPower(void);

// RF channel
ZBOOL msupChannelValid(UINT8 logicalChannel);
void msupSetChannel(UINT8 logicalChannel, ZBOOL changePib);

// Generates packet headers
void msupPrepareHeader(MAC_TX_PACKET *pTxPacket, BYTE type, BYTE addrModes, WORD srcPanId, ADDRESS *pSrcAddr, WORD destPanId, ADDRESS *pDestAddr, BYTE txOptions);

// CC2420 FIFO/RAM access
void msupReadFifo(void *pData, UINT8 count);
void msupWriteFifo(void *pData, UINT8 count);
void msupWriteRam(void *pData, UINT16 address, UINT8 count, ZBOOL disableInterrupts);
void msupReadRam(void *pData, UINT16 address, UINT8 count);

// Calculates the duration of a packet, including acknowledgment and interframe-spacing
UINT8 msupCalcPacketDuration(UINT8 length, ZBOOL ackRequest);

// Simple calculations (using the current PIB attribute values)
UINT32 msupCalcCapDuration(void);
UINT32 msupCalcSuperframeDuration(void);
UINT32 msupCalcBeaconInterval(void);

MAC_ENUM msupTransmitPanConflict(BYTE coordAddrMode, WORD coordPANId, ADDRESS *pCoordAddress, ZBOOL securityEnable);
//-------------------------------------------------------------------------------------------------------


#endif




/*******************************************************************************************************
 * Revision history:
 *
 * $Log: mac_support.h,v $
 * Revision 1.6  2005/02/02 15:08:44  thl
 * Added functionality for pan id conflict according to IEEE802.15.4-2003
 *
 * Revision 1.5  2005/01/05 10:45:19  thl
 * Added full suport for ppib.phyTransmitPower, will also now adjust the transmit power
 * of the radio chip. to include set compile switch MAC_OPT_TRANSMIT_POWER=1 in
 * make file.
 *
 * Revision 1.4  2004/08/13 13:04:44  jol
 * CC2420 MAC Release v0.7
 *
 *
 *******************************************************************************************************/

⌨️ 快捷键说明

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