31 #define MAX_LATENCY_OF_STROBE 10
41 static void radioMacEvent(
uint8 event);
44 static volatile BIT strobe = 0;
51 #define RADIO_MAC_STATE_OFF 0
52 #define RADIO_MAC_STATE_IDLE 1
53 #define RADIO_MAC_STATE_RX 2
54 #define RADIO_MAC_STATE_TX 3
55 volatile uint8 DATA radioMacState = RADIO_MAC_STATE_OFF;
63 if (radioMacState == RADIO_MAC_STATE_TX)
68 else if (radioMacState == RADIO_MAC_STATE_RX)
87 if (radioMacState == RADIO_MAC_STATE_TX)
94 if (radioMacState == RADIO_MAC_STATE_RX && MARCSTATE == 0x0D)
96 if (PKTSTATUS & (1<<3))
104 if ((MCSM2&7) != 7 && WOREVT1 < MAX_LATENCY_OF_STROBE)
120 if (MARCSTATE != 0x0D)
155 void radioMacEvent(
uint8 event)
163 if (MARCSTATE != 0x12 && MARCSTATE != 0x01 && MARCSTATE != 0x00 && MARCSTATE != 0x15)
174 radioMacState = RADIO_MAC_STATE_RX;
185 switch(radioMacState)
187 case RADIO_MAC_STATE_RX:
191 case RADIO_MAC_STATE_TX:
249 radioMacState = RADIO_MAC_STATE_RX;
265 radioMacState = RADIO_MAC_STATE_TX;
void radioMacStrobe(void)
#define DMA_CHANNEL_RADIO
volatile BIT radioRxOverflowOccurred
volatile BIT radioTxUnderflowOccurred
void radioRegistersInit()
void radioMacTx(uint8 XDATA *packet)
#define RADIO_MAC_EVENT_RX
#define RADIO_MAC_EVENT_STROBE
#define RADIO_MAC_EVENT_RX_TIMEOUT
void radioMacEventHandler(uint8 event)
DMA14_CONFIG XDATA dmaConfig
#define ISR(source, bank)
#define XDATA_SFR_ADDRESS(sfr)
void radioMacRx(uint8 XDATA *packet, uint8 timeout)
#define RADIO_MAC_EVENT_TX
volatile DMA_CONFIG radio