openthread/nrf802154: add support for NRF802154 radios
This commit is contained in:
parent
48a65d2617
commit
383e1b1aaf
@ -19,6 +19,9 @@ BOARD_WHITELIST := \
|
|||||||
remote-revb \
|
remote-revb \
|
||||||
omote \
|
omote \
|
||||||
openmote-cc2538 \
|
openmote-cc2538 \
|
||||||
|
nrf52840dk \
|
||||||
|
nrf52840-mdk \
|
||||||
|
reel \
|
||||||
#
|
#
|
||||||
|
|
||||||
# This has to be the absolute path to the RIOT base directory:
|
# This has to be the absolute path to the RIOT base directory:
|
||||||
|
|||||||
@ -5,7 +5,7 @@ USEMODULE += l2util
|
|||||||
USEMODULE += xtimer
|
USEMODULE += xtimer
|
||||||
USEMODULE += event
|
USEMODULE += event
|
||||||
|
|
||||||
ifneq (,$(filter cc2538_rf,$(USEMODULE)))
|
ifneq (,$(filter cc2538_rf nrf802154,$(USEMODULE)))
|
||||||
USEMODULE += netdev_ieee802154_submac
|
USEMODULE += netdev_ieee802154_submac
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@ -38,6 +38,10 @@
|
|||||||
#include "cc2538_rf.h"
|
#include "cc2538_rf.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MODULE_NRF802154
|
||||||
|
#include "nrf802154.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define ENABLE_DEBUG (0)
|
#define ENABLE_DEBUG (0)
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
@ -61,6 +65,10 @@ static at86rf2xx_t at86rf2xx_dev;
|
|||||||
static kw41zrf_t kw41z_dev;
|
static kw41zrf_t kw41z_dev;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MODULE_NRF802154
|
||||||
|
static nrf802154_t nrf802154_dev;
|
||||||
|
#endif
|
||||||
|
|
||||||
static uint8_t rx_buf[OPENTHREAD_NETDEV_BUFLEN];
|
static uint8_t rx_buf[OPENTHREAD_NETDEV_BUFLEN];
|
||||||
static uint8_t tx_buf[OPENTHREAD_NETDEV_BUFLEN];
|
static uint8_t tx_buf[OPENTHREAD_NETDEV_BUFLEN];
|
||||||
static char ot_thread_stack[2 * THREAD_STACKSIZE_MAIN];
|
static char ot_thread_stack[2 * THREAD_STACKSIZE_MAIN];
|
||||||
@ -83,6 +91,10 @@ void openthread_bootstrap(void)
|
|||||||
cc2538_setup(&cc2538_rf_dev);
|
cc2538_setup(&cc2538_rf_dev);
|
||||||
netdev_t *netdev = (netdev_t*) &cc2538_rf_dev;
|
netdev_t *netdev = (netdev_t*) &cc2538_rf_dev;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef MODULE_NRF802154
|
||||||
|
nrf802154_setup(&nrf802154_dev);
|
||||||
|
netdev_t *netdev = (netdev_t*) &nrf802154_dev;
|
||||||
|
#endif
|
||||||
|
|
||||||
openthread_radio_init(netdev, tx_buf, rx_buf);
|
openthread_radio_init(netdev, tx_buf, rx_buf);
|
||||||
openthread_netdev_init(ot_thread_stack, sizeof(ot_thread_stack), THREAD_PRIORITY_MAIN - 5, "openthread", netdev);
|
openthread_netdev_init(ot_thread_stack, sizeof(ot_thread_stack), THREAD_PRIORITY_MAIN - 5, "openthread", netdev);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user