-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #229 from eduazocar/eui_provider_to_m4a-24g
boards: eui_provider_integration to m4a-24g
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* 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_m4a-24g | ||
* @{ | ||
* | ||
* @file | ||
* @brief EUI providers found on the board | ||
* | ||
* @author Benjamin Valentin <[email protected]> | ||
*/ | ||
#ifndef EUI_PROVIDER_PARAMS_H | ||
#define EUI_PROVIDER_PARAMS_H | ||
|
||
#include "edbg_eui.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* @brief EDBG provides a EUI-64, the same that is printed on the board | ||
*/ | ||
static inline int _edbg_get_eui64(uint8_t index, eui64_t *addr) | ||
{ | ||
(void)index; | ||
|
||
/* EDBG can take a while to respond on cold boot */ | ||
unsigned tries = 10000; | ||
while (--tries && edbg_get_eui64(addr)) {} | ||
return tries ? 0 : -1; | ||
} | ||
|
||
/** | ||
* @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 | ||
/** @} */ | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* EUI_PROVIDER_PARAMS_H */ | ||
/** @} */ |