sys/auto_init: add auto_init for nrf52 ieee802.15.4 driver
This commit is contained in:
parent
91787dcb5c
commit
20728c2528
@ -286,6 +286,11 @@ void auto_init(void)
|
||||
auto_init_sx127x();
|
||||
#endif
|
||||
|
||||
#ifdef MODULE_NRF802154
|
||||
extern void auto_init_nrf802154(void);
|
||||
auto_init_nrf802154();
|
||||
#endif
|
||||
|
||||
#endif /* MODULE_AUTO_INIT_GNRC_NETIF */
|
||||
|
||||
#ifdef MODULE_GNRC_UHCPC
|
||||
|
||||
55
sys/auto_init/netif/auto_init_nrf802154.c
Normal file
55
sys/auto_init/netif/auto_init_nrf802154.c
Normal file
@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Freie Universität Berlin
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU Lesser
|
||||
* General Public License v2.1. See the file LICENSE in the top level
|
||||
* directory for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* @ingroup sys_auto_init_gnrc_netif
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Auto initialization the nRF52840 radio in IEEE802.15.4 mode
|
||||
*
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
*/
|
||||
|
||||
#ifdef MODULE_NRF802154
|
||||
|
||||
|
||||
#include "log.h"
|
||||
#include "board.h"
|
||||
#include "nrf802154.h"
|
||||
#include "net/gnrc/netif/ieee802154.h"
|
||||
|
||||
/**
|
||||
* @brief Define stack parameters for the MAC layer thread
|
||||
* @{
|
||||
*/
|
||||
#ifndef NRF802154_MAC_STACKSIZE
|
||||
#define NRF802154_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
|
||||
#endif
|
||||
#ifndef NRF802154_MAC_PRIO
|
||||
#define NRF802154_MAC_PRIO (GNRC_NETIF_PRIO)
|
||||
#endif
|
||||
/** @} */
|
||||
|
||||
static char _stack[NRF802154_MAC_STACKSIZE];
|
||||
|
||||
void auto_init_nrf802154(void)
|
||||
{
|
||||
LOG_DEBUG("[auto_init_netif] initializing nrf802154\n");
|
||||
|
||||
gnrc_netif_ieee802154_create(_stack,
|
||||
NRF802154_MAC_STACKSIZE,
|
||||
NRF802154_MAC_PRIO, "nrf802154",
|
||||
(netdev_t *)&nrf802154_dev);
|
||||
}
|
||||
#else
|
||||
typedef int dont_be_pedantic;
|
||||
#endif /* MODULE_NRF802154 */
|
||||
|
||||
/** @} */
|
||||
Loading…
x
Reference in New Issue
Block a user