[ion/device] Enable RNG register

Change-Id: If252378cec2709d22acf0b3b3046bbd88a306551
This commit is contained in:
Romain Goyet
2017-02-16 09:33:08 +01:00
parent ff7df4e750
commit 1da13c5b91
3 changed files with 40 additions and 0 deletions

View File

@@ -60,6 +60,11 @@ public:
REGS_BOOL_FIELD(DMA2EN, 22);
};
class AHB2ENR : Register32 {
public:
REGS_BOOL_FIELD(RNGEN, 6);
};
class AHB3ENR : Register32 {
public:
REGS_BOOL_FIELD(FSMCEN, 0);
@@ -92,6 +97,7 @@ public:
REGS_REGISTER_AT(PLLCFGR, 0x04);
REGS_REGISTER_AT(CFGR, 0x08);
REGS_REGISTER_AT(AHB1ENR, 0x30);
REGS_REGISTER_AT(AHB2ENR, 0x34);
REGS_REGISTER_AT(AHB3ENR, 0x38);
REGS_REGISTER_AT(APB1ENR, 0x40);
REGS_REGISTER_AT(APB2ENR, 0x44);

View File

@@ -11,6 +11,7 @@
#include "itm.h"
#include "pwr.h"
#include "rcc.h"
#include "rng.h"
#include "sdio.h"
#include "syscfg.h"
#include "tim.h"

33
ion/src/device/regs/rng.h Normal file
View File

@@ -0,0 +1,33 @@
#ifndef REGS_RNG_H
#define REGS_RNG_H
#include "register.h"
class RNG {
public:
class CR : Register32 {
public:
REGS_BOOL_FIELD(RNGEN, 2);
};
class SR : Register32 {
public:
REGS_BOOL_FIELD(DRDY, 0);
};
class DR : public Register32 {
};
constexpr RNG() {};
REGS_REGISTER_AT(CR, 0x00);
REGS_REGISTER_AT(SR, 0x04);
REGS_REGISTER_AT(DR, 0x08);
private:
constexpr uint32_t Base() const {
return 0x50060800;
}
};
constexpr RNG RNG;
#endif