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

📄 mac_low_level.h

📁 Zigbee2006入门(源代码+文档讲解+系统推荐)
💻 H
字号:
/**************************************************************************************************
    Filename:
    Revised:        $Date: 2007-03-26 16:18:09 -0700 (Mon, 26 Mar 2007) $
    Revision:       $Revision: 13860 $

    Description:

    Describe the purpose and contents of the file.

    Copyright (c) 2006 by Texas Instruments, Inc.
    All Rights Reserved.  Permission to use, reproduce, copy, prepare
    derivative works, modify, distribute, perform, display or sell this
    software and/or its documentation for any purpose is prohibited
    without the express written consent of Texas Instruments, Inc.
**************************************************************************************************/

#ifndef MAC_LOW_LEVEL_H
#define MAC_LOW_LEVEL_H

/* ------------------------------------------------------------------------------------------------
 *                                            Includes
 * ------------------------------------------------------------------------------------------------
 */
#include "hal_types.h"
#include "mac_high_level.h"


 /* ------------------------------------------------------------------------------------------------
 *                                            Defines
 * ------------------------------------------------------------------------------------------------
 */
/* identifies low-level code as specific to Chipcon SmartRF03(tm) technology */
#define MAC_LOW_LEVEL_SMARTRF03

#define MAC_BACKOFF_TIMER_DEFAULT_ROLLOVER  (((uint32) MAC_A_BASE_SUPERFRAME_DURATION) << 14)

/* macTxFrame() parameter values for txType */
#define MAC_TX_TYPE_SLOTTED_CSMA            0x00
#define MAC_TX_TYPE_UNSLOTTED_CSMA          0x01
#define MAC_TX_TYPE_SLOTTED                 0x02

/* macSleep() parameter values for sleepState */
#define MAC_SLEEP_STATE_OSC_OFF             0x01
#define MAC_SLEEP_STATE_RADIO_OFF           0x02

/* macRxPromiscuousMode() parameter values */
#define MAC_PROMISCUOUS_MODE_OFF            0x00  /* must be zero; reserved for boolean use */
#define MAC_PROMISCUOUS_MODE_COMPLIANT      0x01
#define MAC_PROMISCUOUS_MODE_WITH_BAD_CRC   0x02


/* ------------------------------------------------------------------------------------------------
 *                                           Global Externs
 * ------------------------------------------------------------------------------------------------
 */
extern uint8 const macTxSlottedDelay;


/* ------------------------------------------------------------------------------------------------
 *                                           Prototypes
 * ------------------------------------------------------------------------------------------------
 */

/* mac_low_level.c */
void macLowLevelInit(void);
void macLowLevelReset(void);


/* mac_sleep.c */
void macSleepWakeUp(void);
uint8 macSleep(uint8 sleepState);

/* mac_radio.c */
uint8 macRadioRandomByte(void);
void macRadioSetPanCoordinator(uint8 panCoordinator);
void macRadioSetPanID(uint16 panID);
void macRadioSetShortAddr(uint16 shortAddr);
void macRadioSetIEEEAddr(uint8 * pIEEEAddr);
void macRadioSetTxPower(uint8 txPower);
void macRadioSetChannel(uint8 channel);
void macRadioStartScan(uint8 scanType);
void macRadioStopScan(void);
void macRadioEnergyDetectStart(void);
uint8 macRadioEnergyDetectStop(void);

/* mac_backoff_timer.c */
void macBackoffTimerSetRollover(uint32 rolloverBackoff);
void macBackoffTimerSetCount(uint32 backoff);
uint32 macBackoffTimerCount(void);
uint32 macBackoffTimerGetTrigger(void);
void macBackoffTimerSetTrigger(uint32 triggerBackoff);
void macBackoffTimerCancelTrigger(void);
void macBackoffTimerTriggerCallback(void);
void macBackoffTimerRolloverCallback(void);
int32 macBackoffTimerRealign(macRx_t *pMsg);

/* mac_tx.c */
void macTxFrame(uint8 txType);
void macTxFrameRetransmit(void);
void macTxCompleteCallback(uint8 status);

/* mac_rx.c */
uint8 macRxCheckPendingCallback(void);
void macRxCompleteCallback(macRx_t * pMsg);
void macRxPromiscuousMode(uint8 mode);

/* mac_rx_onoff.c */
void macRxEnable(uint8 flags);
void macRxSoftEnable(uint8 flags);
void macRxDisable(uint8 flags);
void macRxHardDisable(void);

/**************************************************************************************************
 */
#endif

⌨️ 快捷键说明

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