diff --git a/boards/samr21-xpro/Makefile.dep b/boards/samr21-xpro/Makefile.dep index 14ab7ebea3..9f5544d1d7 100644 --- a/boards/samr21-xpro/Makefile.dep +++ b/boards/samr21-xpro/Makefile.dep @@ -2,6 +2,10 @@ ifneq (,$(filter netdev_default,$(USEMODULE))) USEMODULE += at86rf233 endif +ifneq (,$(filter eui_provider,$(USEMODULE))) + USEMODULE += edbg_eui +endif + ifneq (,$(filter saul_default,$(USEMODULE))) USEMODULE += saul_gpio endif diff --git a/boards/samr21-xpro/include/board.h b/boards/samr21-xpro/include/board.h index 649aace5d4..a5b558f998 100644 --- a/boards/samr21-xpro/include/board.h +++ b/boards/samr21-xpro/include/board.h @@ -25,6 +25,8 @@ #include "periph_conf.h" #include "periph_cpu.h" +#include "edbg_eui.h" + #ifdef __cplusplus extern "C" { #endif @@ -57,6 +59,25 @@ extern "C" { #define AT86RF2XX_PARAM_SLEEP GPIO_PIN(PA, 20) #define AT86RF2XX_PARAM_RESET GPIO_PIN(PB, 15) +/** + * @brief EDBG provides a EUI-64, the same that is printed on the board + */ +static inline int _edbg_get_eui64(const void *arg, eui64_t *addr) +{ + (void) arg; + return edbg_get_eui64(addr); +} + +/** + * @name EUI sources on the board + * EUI-64 inside EDBG for the internal radio + * @{ + */ +#define EUI64_PROVIDER_FUNC _edbg_get_eui64 +#define EUI64_PROVIDER_TYPE NETDEV_AT86RF2XX +#define EUI64_PROVIDER_INDEX 0 +/** @} */ + /** * @name OpenWSN timing constants *