12 if (!(SysTick->CTRL & SysTick_CTRL_ENABLE_Msk))
14 SysTick->LOAD = 0xFFFFFF;
16 SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk;
20 prng_state = SysTick->VAL ^ (SysTick->VAL << 16) ^ (SysTick->LOAD);
59 u32 range = max - min + 1;
u32 PRNG_Next(void)
Generates the next pseudo-random number.
void PRNG_Release(void)
Releases the HW entropy sources used to seed the PRNG.
u32 PRNG_Range(u32 min, u32 max)
Generates a pseudo-random number in the given range, inclusive.
void PRNG_Set(u32 seed)
Initializes the PRNG by seeding it with the given seed. Use PRNG_USE_AUTO_SEED to seed it automatical...
@ PRNG_USE_AUTO_SEED
PRNG automatically seeds itself using an hardware entropy source.