📄 zigbee.def
字号:
#ifndef _ZIGBEE_DEF
#define _ZIGBEE_DEF
/*
* Clock frequency value.
* This value is used to calculate Tick Counter value
*/
#define CLOCK_FREQ (16000000) // Hz
// For debug output.
#define BAUD_RATE (19200)
#if defined(WIN32)
#define TICKS_PER_SECOND (CLOCKS_PER_SEC)
#define TICK_PRESCALE_VALUE (2)
#else
#define TICKS_PER_SECOND (50)
#define TICK_PRESCALE_VALUE (2)
#endif
// Uncomment only one of the following as per hardware.
#define USE_CC2420
// ZMD is not supported yet.
//#define USE_ZMD44101
//#define ENABLE_DEBUG
// Uncomment one of the below to describe this node's functionality.
// #define I_AM_COORDINATOR
//#define I_AM_ROUTER
#define I_AM_END_DEVICE
// Uncomment one of the below to specifiy frequency band of operation.
//#define MY_FREQ_BAND_IS_868_MHZ
//#define MY_FREQ_BAND_IS_900_MHZ
#define MY_FREQ_BAND_IS_2400_MHZ
// Uncomment below if this node is a FFD and wants to be alternate PAN
// coordinator - note that only FFD can be alternate PAN coordinator
//#define I_AM_ALT_PAN_COORD
// Uncomment one of the below to specify the power source
#define I_AM_MAINS_POWERED
//#define I_AM_RECHARGEABLE_BATTERY_POWERED
//#define I_AM_DISPOSABLE_BATTERY_POWERED
// Uncomment one of the below to specify security capability.
// In current version security capability is not implemented.
//#define I_AM_SECURITY_CAPABLE
// Uncomment one of the below to specify how receiver on/off is managed.
// Current version only implements non-beacon-enabled network,
// meaning, either you may have receiver always on, periodically or
// stimulated ON.
//#define MY_RX_IS_ALWAYS_ON_OR_SYNCED_WITH_BEACON
#define MY_RX_IS_PERIODICALLY_ON
//#define MY_RX_IS_ON_WHEN_STIMULATED
// All node must have unique extended address to begin with.
#define MAC_LONG_ADDR_BYTE0 (0x01) // BYTE0:3 are user defined
#define MAC_LONG_ADDR_BYTE1 (0x00)
#define MAC_LONG_ADDR_BYTE2 (0x00)
#define MAC_LONG_ADDR_BYTE3 (0x00)
#define MAC_LONG_ADDR_BYTE4 (0x00) // BYTE4:7 are OUI bytes.
#define MAC_LONG_ADDR_BYTE5 (0xa3)
#define MAC_LONG_ADDR_BYTE6 (0x04)
#define MAC_LONG_ADDR_BYTE7 (0x00)
// Increase this count as per your application requirement.
// These are the number of endpoints we will support.
#define MAX_EP_COUNT (4)
// Uncomment following to use MAC RF test code.
#define MAC_USE_RF_TEST_CODE
// Uncomment following if this node is not a coordinator
// and wants coordinator to assign a short address to it.
#if defined(I_AM_END_DEVICE)
#define MAC_USE_SHORT_ADDR
#endif
// RF RSSI energy threshold after which a channel is said to be
// occupied.
#define MAC_CHANNEL_ENERGY_THRESHOLD (0x20)
// Number of times a frame should be retried before declaring error
#define MAC_MAX_FRAME_RETRIES (3)
// Amount of time we should wait for ACK from remote node.
#define MAC_ACK_WAIT_DURATION (TICK_SECOND/2)
// Amount of time we should wait for response from remote node.
#define MAC_RESPONSE_WAIT_TIME (TICK_SECOND)
// Amount of time we should wait for RF energy measurement.
#define MAC_ED_SCAN_PERIOD (TICK_SECOND/4)
// Amount of time we should do active scan.
#define MAC_ACTIVE_SCAN_PERIOD (TICK_SECOND/2)
// Amount of time a staged frame should be kept in buffer and within
// which intended receipt must request that frame.
#define MAC_MAX_DATA_REQ_PERIOD (TICK_SECOND*2)
// Staging transmit buffer size - used by coordinator devices only.
#define MAX_HEAP_SIZE 128
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -