📄 basic_rf.h
字号:
/*
The protocol uses 802.15.4 MAC compliant data and acknowledgment packets, however it contains only
a small subset of the 802.15.4 standard:
- Association, scanning, beacons is not implemented
- No defined coordinator/device roles (peer-to-peer, all nodes are equal)
- Waits for the channel to become ready, but does not check CCA twice (802.15.4 CSMA-CA)
- Does not retransmit packets
- Can not communicate with other networks (using a different PAN identifier)
Frame formats:
Data packets:
[Preambles (4)][SFD (1)][Length (1)][Frame control field (2)][Sequence number (1)][PAN ID (2)]
[Dest. address (2)][Source address (2)][Payload (Length - 2+1+2+2+2)][Frame check sequence (2)]
Acknowledgment packets:
[Preambles (4)][SFD (1)][Length = 5 (1)][Frame control field (2)][Sequence number (1)]
[Frame check sequence (2)]
*/
#ifndef BASIC_RF_H
#define BASIC_RF_H
//General constants
#define PANID 0x2420
#define RFCHANNEL 26
// Symbol period = 16 us
#define RF_aSymbolPeriod 16
// The time it takes for the acknowledgment frame to be received after the data packet has been transmitted
#define RF_aAckPeriod (16 * 2 * ((4 + 1) + (1) + (2 + 1) + (2)))
void basicRfReceiveOn(void);
void basicRfReceiveOff(void);
void basicRfInit(UINT8 channel, WORD panId, WORD myAddr);
/*
SIGNAL(SIG_INTERRUPT0) - CC2420 FIFOP interrupt service routine
Note: When a packet has been completely received, this ISR will extract the data from the RX FIFO.
Packets are acknowledged automatically by CC2420 through the auto-acknowledgment feature.
*/
// SIGNAL(SIG_INTERRUPT0)
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -