From 9bdbc71c455ccc11c98892f44ebc7a629ae341e2 Mon Sep 17 00:00:00 2001 From: Myles Watson Date: Fri, 9 Jan 2015 15:36:13 -0800 Subject: [PATCH] nrf51: add RNG definitions to registers.h RNG (Random Number Generator) register definitions from the datasheet TEST=buildall BRANCH=NONE BUG=None Signed-off-by: Myles Watson Change-Id: Id700564edfa8021aa5604ed53f7ccfe8c3c4f6db Reviewed-on: https://chromium-review.googlesource.com/254111 Tested-by: Myles Watson Reviewed-by: Randall Spangler Commit-Queue: Myles Watson --- chip/nrf51/registers.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/chip/nrf51/registers.h b/chip/nrf51/registers.h index 7fb4f2c041..e60252a6d2 100644 --- a/chip/nrf51/registers.h +++ b/chip/nrf51/registers.h @@ -537,6 +537,27 @@ #define NRF51_TIMER0_BITMODE_32 3 +/* + * Random Number Generator (RNG) + */ +#define NRF51_RNG_BASE 0x4000D000 +/* Tasks */ +#define NRF51_RNG_START REG32(NRF51_RNG_BASE + 0x000) +#define NRF51_RNG_STOP REG32(NRF51_RNG_BASE + 0x004) +/* Events */ +#define NRF51_RNG_VALRDY REG32(NRF51_RNG_BASE + 0x100) +/* Registers */ +#define NRF51_RNG_SHORTS REG32(NRF51_RNG_BASE + 0x200) +#define NRF51_RNG_INTENSET REG32(NRF51_RNG_BASE + 0x304) +#define NRF51_RNG_INTENCLR REG32(NRF51_RNG_BASE + 0x308) +#define NRF51_RNG_CONFIG REG32(NRF51_RNG_BASE + 0x504) +#define NRF51_RNG_VALUE REG32(NRF51_RNG_BASE + 0x508) +/* For RNG Shortcuts */ +#define NRF51_RNG_SHORTS_VALRDY_STOP (1 << 0) +/* For RNG Config */ +#define NRF51_RNG_DERCEN (1 << 0) + + /* * Watchdog Timer (WDT) */