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

📄 mac_support.h

📁 zigbee location examples
💻 H
字号:
/*******************************************************************************************************
 *                                                                                                     *
 *        **********                                                                                   *
 *       ************                                                                                  *
 *      ***        ***                                                                                 *
 *      ***   +++   ***                                                                                *
 *      ***   + +   ***                                                                                *
 *      ***   +                         CHIPCON CC2430 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.                                *
 *******************************************************************************************************/
#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 ADDRESSs
ROOT BOOL msupCompareExtendedAddress(ADDRESS   *pA, ADDRESS   *pB);

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

// RF state decoding
ROOT BOOL msupIsSfdActive(void);
ROOT BOOL msupIsTxActive(void);
ROOT BOOL msupIsCspInCriticalSection(void);

ROOT UINT32 msupGetBosCounter(void);

// Transiver output power
ROOT void msupSetTransmitPower(void);

ROOT BYTE msupGetRandomByte(void);
ROOT void msupInitRandomGenerator(BYTE   *pExtendedAddr);

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

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

// CC2420 FIFO/RAM access
ROOT void msupWriteExtendedAddress(BYTE   *pExtendedAddress);

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

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

MAC_ENUM msupTransmitPanConflict(BYTE coordAddrMode, WORD coordPANId, ADDRESS *pCoordAddress, BOOL securityEnable);

//-------------------------------------------------------------------------------------------------------


#endif

⌨️ 快捷键说明

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