mac_support.h

来自「ucos在NEC平台下的移植」· C头文件 代码 · 共 96 行

H
96
字号
/*******************************************************************************************************
 *                                                                                                     *
 *        **********                                                                                   *
 *       ************                                                                                  *
 *      ***        ***                                                                                 *
 *      ***   +++   ***                                                                                *
 *      ***   + +   ***                                                                                *
 *      ***   +                         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: NEC Electronics PM plus V5.20                                                             *
 * Target platform: CC2420DB, CC2420 + 78K0/KF2                                                        *
 *******************************************************************************************************
 * 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
BOOL 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
BOOL msupChannelValid(UINT8 logicalChannel);
void msupSetChannel(UINT8 logicalChannel, BOOL 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 (BYTE *pData, UINT8 count);
void msupWriteFifo(BYTE *pData, UINT8 count);
void msupWriteRam (BYTE *pData, UINT16 address, UINT8 count, BOOL disableInterrupts);
void msupReadRam  (BYTE *pData, UINT16 address, UINT8 count);

// Calculates the duration of a packet, including acknowledgment and interframe-spacing
UINT8 msupCalcPacketDuration(UINT8 length, BOOL 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, BOOL securityEnable);///
//-------------------------------------------------------------------------------------------------------

#endif




/*******************************************************************************************************
 * Revision history:
 *
 * $Log: mac_support.h,v $
 * Revision 1.4  2004/08/13 13:04:44  jol
 * CC2420 MAC Release v0.7
 *
 *
 *******************************************************************************************************/

⌨️ 快捷键说明

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