stm32:rng: f4 rng peripheral is common with at least f2

Pull it up as common code immediately. Rename to v1, extract to common
with a doxygen marker stubs, add to F2 makefiles.
This commit is contained in:
Karl Palsson
2017-01-12 22:23:31 +00:00
parent ac45247f60
commit 2476099f29
9 changed files with 97 additions and 39 deletions

View File

@@ -25,8 +25,8 @@ specific memorymap.h header before including this header file.*/
/** @cond */
#ifdef LIBOPENCM3_RNG_H
/** @endcond */
#ifndef LIBOPENCM3_RNG_COMMON_F24_H
#define LIBOPENCM3_RNG_COMMON_F24_H
#ifndef LIBOPENCM3_RNG_V1_H
#define LIBOPENCM3_RNG_V1_H
/**@{*/
@@ -80,7 +80,7 @@ END_DECLS
#endif
/** @cond */
#else
#warning "rng_common_f24.h should not be included explicitly, only via rng.h"
#warning "rng_common_v1.h should not be included explicitly, only via rng.h"
#endif
/** @endcond */

View File

@@ -18,6 +18,6 @@
#ifndef LIBOPENCM3_RNG_H
#define LIBOPENCM3_RNG_H
#include <libopencm3/stm32/common/rng_common_f24.h>
#include <libopencm3/stm32/common/rng_common_v1.h>
#endif

View File

@@ -18,6 +18,6 @@
#ifndef LIBOPENCM3_RNG_H
#define LIBOPENCM3_RNG_H
#include <libopencm3/stm32/common/rng_common_f24.h>
#include <libopencm3/stm32/common/rng_common_v1.h>
#endif

View File

@@ -20,7 +20,9 @@
#include <libopencm3/cm3/common.h>
#include <libopencm3/stm32/memorymap.h>
#if defined(STM32F4)
#if defined(STM32F2)
# include <libopencm3/stm32/f2/rng.h>
#elif defined(STM32F4)
# include <libopencm3/stm32/f4/rng.h>
#else
# error "stm32 family not defined."