22 #include "sys/clock.h"
28 #define PRINTF(...) printf(__VA_ARGS__)
30 #define PRINTF(...) do {} while (0)
34 #define RF_RX_LED_ON() leds_on(LEDS_RED);
35 #define RF_RX_LED_OFF() leds_off(LEDS_RED);
36 #define RF_TX_LED_ON() leds_on(LEDS_GREEN);
37 #define RF_TX_LED_OFF() leds_off(LEDS_GREEN);
39 #define RF_RX_LED_ON()
40 #define RF_RX_LED_OFF()
41 #define RF_TX_LED_ON()
42 #define RF_TX_LED_OFF()
51 PROCESS(cc2430_rf_process,
"CC2430 RF driver");
62 if(RFIF & IRQ_TXDONE) {
67 if(RFIF & IRQ_FIFOP) {
78 S1CON &= ~(RFIF_0 | RFIF_1);
103 void (* receiver_callback)(
const struct radio_driver *);
106 cc2430_rf_set_receiver(
void (* recv)(
const struct radio_driver *))
108 receiver_callback = recv;
127 cc2430_rf_send(
void *payload,
unsigned short payload_len)
129 return cc2430_rf_send_b(payload, payload_len);
133 cc2430_rf_read(
void *buf,
unsigned short bufsize)
135 return cc2430_rf_read_banked(buf, bufsize);
145 if(receiver_callback !=
NULL) {
146 PRINTF(
"cc2430_rf_process: calling receiver callback\n");
147 receiver_callback(&cc2430_rf_driver);
149 PRINTF(
"cc2430_rf_process: no receiver callback\n");