From b0dd4aa716526f04c35a0bbfb179c7634ab2e191 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Thu, 10 Dec 2020 22:31:17 +0100 Subject: [PATCH] boards/derfmega256: move EUI provider config to eui_provider_params.h --- boards/derfmega256/include/board.h | 35 ---------- .../derfmega256/include/eui_provider_params.h | 65 +++++++++++++++++++ 2 files changed, 65 insertions(+), 35 deletions(-) create mode 100644 boards/derfmega256/include/eui_provider_params.h diff --git a/boards/derfmega256/include/board.h b/boards/derfmega256/include/board.h index 3d0d4d9138..a28921631f 100644 --- a/boards/derfmega256/include/board.h +++ b/boards/derfmega256/include/board.h @@ -21,45 +21,10 @@ #include "cpu.h" -#include "periph/eeprom.h" -#include "net/eui_provider.h" - #ifdef __cplusplus extern "C" { #endif -/** - * @name MAC configuration - * Offset of the MAC address in the EEPROM - */ -#define EEPROM_MAC_ADDR (0x1fe4) - -/** - * @brief Constant in EEPROM provides a EUI-64, this is also printed on the board - */ -static inline int _eeprom_mac_get_eui64(const void *arg, eui64_t *addr, uint8_t index) -{ - (void) arg; - (void) index; - - if (eeprom_read(EEPROM_MAC_ADDR, addr, sizeof(eui64_t)) != sizeof(eui64_t)) { - return -1; - } - - addr->uint64.u64 = byteorder_htonll(addr->uint64.u64).u64; - - return 0; -} - -/** - * @name EUI-64 sources on the board - * @{ - */ -#define EUI64_PROVIDER_FUNC _eeprom_mac_get_eui64 -#define EUI64_PROVIDER_TYPE NETDEV_AT86RF2XX -#define EUI64_PROVIDER_INDEX 0 -/** @} */ - /** * @name xtimer configuration values * @{ diff --git a/boards/derfmega256/include/eui_provider_params.h b/boards/derfmega256/include/eui_provider_params.h new file mode 100644 index 0000000000..cb01d1f02f --- /dev/null +++ b/boards/derfmega256/include/eui_provider_params.h @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2020 ML!PA Consulting GmbH + * + * 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 boards_deRFmega256 + * @{ + * + * @file + * @brief EUI providers found on the board + * + * @author Alexander Chudov + */ +#ifndef EUI_PROVIDER_PARAMS_H +#define EUI_PROVIDER_PARAMS_H + +#include "net/eui64.h" +#include "periph/eeprom.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @name MAC configuration + * Offset of the MAC address in the EEPROM + */ +#define EEPROM_MAC_ADDR (0x1fe4) + +/** + * @brief Constant in EEPROM provides a EUI-64, this is also printed on the board + */ +static inline int _eeprom_mac_get_eui64(const void *arg, eui64_t *addr, uint8_t index) +{ + (void) arg; + (void) index; + + if (eeprom_read(EEPROM_MAC_ADDR, addr, sizeof(eui64_t)) != sizeof(eui64_t)) { + return -1; + } + + addr->uint64.u64 = byteorder_htonll(addr->uint64.u64).u64; + + return 0; +} + +/** + * @name EUI-64 sources on the board + * @{ + */ +#define EUI64_PROVIDER_FUNC _eeprom_mac_get_eui64 +#define EUI64_PROVIDER_TYPE NETDEV_AT86RF2XX +#define EUI64_PROVIDER_INDEX 0 +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* EUI_PROVIDER_PARAMS_H */ +/** @} */