Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev_random: initial import of a high-level hwnrg API #5153

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions boards/airfy-beacon/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,19 @@
#define BOARD_H_

#include "cpu.h"
#include "dev_random_src.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief @ref sys_dev_random configuration
* @{
*/
#define DEV_RANDOM_SRC DEV_RANDOM_SRC_PERIPH_HWRNG
/** @} */

/**
* @brief Xtimer configuration
* @{
Expand Down
8 changes: 8 additions & 0 deletions boards/arduino-due/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,20 @@
#define BOARD_H_

#include "cpu.h"
#include "dev_random_src.h"
#include "arduino_pinmap.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief @ref sys_dev_random configuration
* @{
*/
#define DEV_RANDOM_SRC DEV_RANDOM_SRC_PERIPH_HWRNG
/** @} */

/**
* @name LED pin definitions
* @{
Expand Down
8 changes: 8 additions & 0 deletions boards/cc2538dk/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,20 @@
#define BOARD_H_

#include "cpu.h"
#include "dev_random_src.h"
#include "periph/gpio.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief @ref sys_dev_random configuration
* @{
*/
#define DEV_RANDOM_SRC DEV_RANDOM_SRC_PERIPH_HWRNG
/** @} */

/**
* @brief LED pin definitions and handlers
* @{
Expand Down
12 changes: 12 additions & 0 deletions boards/ek-lm4f120xl/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,25 @@
#define BOARD_H

#include "cpu.h"
#include "dev_random_src.h"
#include "periph/adc.h"
#include "periph/uart.h"
#include "periph/timer.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief @ref sys_dev_random configuration
* @{
*/
#ifndef DEV_RANDOM_ADC
#define DEV_RANDOM_ADC ADC_LINE(ADC_NUMOF - 1)
#endif
#define DEV_RANDOM_SRC DEV_RANDOM_SRC_PERIPH_ADC
/** @} */

/**
* @brief LED pin definitions and handlers
* @{
Expand Down
10 changes: 10 additions & 0 deletions boards/fox/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <stdint.h>

#include "cpu.h"
#include "dev_random_src.h"
#include "periph_conf.h"

#ifdef __cplusplus
Expand All @@ -50,6 +51,15 @@ extern "C" {
.sleep_pin = GPIO_PIN(PORT_A, 0), \
.reset_pin = GPIO_PIN(PORT_C, 1)}

/**
* @brief @ref sys_dev_random configuration
* @{
*/
#ifdef MODULE_AT86RF231
#define DEV_RANDOM_SRC DEV_RANDOM_SRC_AT86RF2XX
#endif
/** @} */

/**
* @name Define the interface to the LPS331AP pressure sensor
* @{
Expand Down
8 changes: 8 additions & 0 deletions boards/frdm-k64f/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,21 @@
#define BOARD_H

#include "cpu.h"
#include "dev_random_src.h"
#include "periph_conf.h"

#ifdef __cplusplus
extern "C"
{
#endif

/**
* @brief @ref sys_dev_random configuration
* @{
*/
#define DEV_RANDOM_SRC DEV_RANDOM_SRC_PERIPH_HWRNG
/** @} */

/**
* @brief LED pin definitions and handlers
* @{
Expand Down
10 changes: 10 additions & 0 deletions boards/iotlab-common/include/board_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <stdint.h>

#include "cpu.h"
#include "dev_random_src.h"
#include "periph_conf.h"
#include "periph_conf_common.h"

Expand Down Expand Up @@ -60,6 +61,15 @@ extern "C" {
.sleep_pin = GPIO_PIN(PORT_A, 2), \
.reset_pin = GPIO_PIN(PORT_C, 1)}

/**
* @brief @ref sys_dev_random configuration
* @{
*/
#ifdef MODULE_AT86RF231
#define DEV_RANDOM_SRC DEV_RANDOM_SRC_AT86RF2XX
#endif
/** @} */

/**
* @brief LED pin definitions and handlers
* @{
Expand Down
8 changes: 8 additions & 0 deletions boards/msbiot/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#define BOARD_H_

#include "cpu.h"
#include "dev_random_src.h"
#include "periph_conf.h"

#ifdef __cplusplus
Expand All @@ -39,6 +40,13 @@ extern "C" {
#define CC110X_GDO2 GPIO_PIN(PORT_C, 5)
/** @} */

/**
* @brief @ref sys_dev_random configuration
* @{
*/
#define DEV_RANDOM_SRC DEV_RANDOM_SRC_PERIPH_HWRNG
/** @} */

/**
* @name Configure connected MPU-9150 device
* @{
Expand Down
8 changes: 8 additions & 0 deletions boards/mulle/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#define BOARD_H_

#include "cpu.h"
#include "dev_random_src.h"
#include "periph_conf.h"
#include "mulle-nvram.h"

Expand All @@ -33,6 +34,13 @@
/** Disable hardware watchdog, for debugging purposes, don't use this on production builds. */
#define DISABLE_WDOG 1

/**
* @brief @ref sys_dev_random configuration
* @{
*/
#define DEV_RANDOM_SRC DEV_RANDOM_SRC_PERIPH_HWRNG
/** @} */

/**
* @brief xtimer configuration
* @{
Expand Down
9 changes: 9 additions & 0 deletions boards/native/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

#include <stdint.h>

#include "dev_random_src.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand All @@ -41,6 +43,13 @@ void _native_LED_RED_OFF(void);
void _native_LED_RED_ON(void);
void _native_LED_RED_TOGGLE(void);

/**
* @brief @ref sys_dev_random configuration
* @{
*/
#define DEV_RANDOM_SRC DEV_RANDOM_SRC_PERIPH_HWRNG
/** @} */

#define LED0_ON (_native_LED_RED_ON())
#define LED0_OFF (_native_LED_RED_OFF())
#define LED0_TOGGLE (_native_LED_RED_TOGGLE())
Expand Down
8 changes: 8 additions & 0 deletions boards/nrf51dongle/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#define BOARD_H

#include "cpu.h"
#include "dev_random_src.h"
#include "periph_conf.h"

#ifdef __cplusplus
Expand All @@ -38,6 +39,13 @@ extern "C" {
#define XTIMER_BACKOFF (40)
/** @} */

/**
* @brief @ref sys_dev_random configuration
* @{
*/
#define DEV_RANDOM_SRC DEV_RANDOM_SRC_PERIPH_HWRNG
/** @} */

/**
* @brief LED pin definitions and handlers
* @{
Expand Down
8 changes: 8 additions & 0 deletions boards/nrf52dk/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,19 @@
#define BOARD_H

#include "cpu.h"
#include "dev_random_src.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief @ref sys_dev_random configuration
* @{
*/
#define DEV_RANDOM_SRC DEV_RANDOM_SRC_PERIPH_HWRNG
/** @} */

/**
* @brief LED pin configuration
* @{
Expand Down
8 changes: 8 additions & 0 deletions boards/nrf6310/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,19 @@
#define BOARD_H

#include "cpu.h"
#include "dev_random_src.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief @ref sys_dev_random configuration
* @{
*/
#define DEV_RANDOM_SRC DEV_RANDOM_SRC_PERIPH_HWRNG
/** @} */

/**
* @brief LED pin definitions and handlers
* @{
Expand Down
8 changes: 8 additions & 0 deletions boards/openmote-cc2538/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,20 @@
#define BOARD_H_

#include "cpu.h"
#include "dev_random_src.h"
#include "periph/gpio.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief @ref sys_dev_random configuration
* @{
*/
#define DEV_RANDOM_SRC DEV_RANDOM_SRC_PERIPH_HWRNG
/** @} */

/**
* @brief LED pin definitions and handlers
* @{
Expand Down
8 changes: 8 additions & 0 deletions boards/pba-d-01-kw2x/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,21 @@
#define BOARD_H_

#include "cpu.h"
#include "dev_random_src.h"
#include "periph_conf.h"

#ifdef __cplusplus
extern "C"
{
#endif

/**
* @brief @ref sys_dev_random configuration
* @{
*/
#define DEV_RANDOM_SRC DEV_RANDOM_SRC_PERIPH_HWRNG
/** @} */

/**
* @brief LED pin definitions and handlers
* @{
Expand Down
8 changes: 8 additions & 0 deletions boards/pca10000/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#define BOARD_H

#include "cpu.h"
#include "dev_random_src.h"

#ifdef __cplusplus
extern "C" {
Expand All @@ -38,6 +39,13 @@ extern "C" {
#define XTIMER_BACKOFF (40)
/** @} */

/**
* @brief @ref sys_dev_random configuration
* @{
*/
#define DEV_RANDOM_SRC DEV_RANDOM_SRC_PERIPH_HWRNG
/** @} */

/**
* @brief LED pin definitions and handlers
* @{
Expand Down
8 changes: 8 additions & 0 deletions boards/pca10005/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,19 @@
#define BOARD_H_

#include "cpu.h"
#include "dev_random_src.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief @ref sys_dev_random configuration
* @{
*/
#define DEV_RANDOM_SRC DEV_RANDOM_SRC_PERIPH_HWRNG
/** @} */

/**
* @brief Xtimer configuration
* @{
Expand Down
8 changes: 8 additions & 0 deletions boards/remote-pa/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,21 @@
#define BOARD_H_

#include "cpu.h"
#include "dev_random_src.h"
#include "periph/gpio.h"
#include "board_common.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief @ref sys_dev_random configuration
* @{
*/
#define DEV_RANDOM_SRC DEV_RANDOM_SRC_PERIPH_HWRNG
/** @} */

/**
* @brief LED pin definitions and handlers
* @{
Expand Down
Loading