added random number generator driver and stuff

This commit is contained in:
Thomas Klaehn
2016-08-30 17:04:22 +02:00
parent b777ab9e6f
commit d7e6f8b0ee
11 changed files with 233 additions and 6 deletions

View File

@@ -24,8 +24,35 @@
#include "gpio.h"
#include "stm32f4_gpio.h"
#include "rng.h"
#include "stm32f4_rng.h"
#include "driver.h"
// Random number generator
static RNG_HandleTypeDef stm32f4_rng_handle = {
.Instance = RNG,
};
static struct stm32f4_rng stm32f4_rng = {
.rng_handle = &stm32f4_rng_handle,
};
static struct rng __rng = {
.arch_dep_device = &stm32f4_rng,
.fp = &rng_fp,
};
#ifdef TEST_APP
static const struct driver rng = {
#else
const struct driver rng = {
#endif
.driver_type = DRIVER_TYPE_RNG,
.device_driver = &__rng,
};
// GPIO_C0
static const GPIO_InitTypeDef port_cfg_c0 = {
.Pin = GPIO_PIN_0,