diff --git a/ion/src/device/regs/rcc.h b/ion/src/device/regs/rcc.h index f5a49d08b..805b91341 100644 --- a/ion/src/device/regs/rcc.h +++ b/ion/src/device/regs/rcc.h @@ -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); diff --git a/ion/src/device/regs/regs.h b/ion/src/device/regs/regs.h index 4b96a63a3..9375e1ed7 100644 --- a/ion/src/device/regs/regs.h +++ b/ion/src/device/regs/regs.h @@ -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" diff --git a/ion/src/device/regs/rng.h b/ion/src/device/regs/rng.h new file mode 100644 index 000000000..6aa2d6505 --- /dev/null +++ b/ion/src/device/regs/rng.h @@ -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