Random¶
Pseudo Random Number Generator (PRNG)
-
void
random_init
(uint32_t s)¶ initializes PRNG with a seed
Parameters
s: seed for the PRNG
-
void
random_init_by_array
(uint32_t init_key, int key_length)¶ initialize by an array with array-length init_key is the array for initializing keys key_length is its length slight change for C++, 2004/2/26
Parameters
init_key: array of keys (seeds) to initialize the PRNG key_length: number of lements in init_key
-
uint32_t
random_uint32
(void)¶ generates a random number on [0,0xffffffff]-interval
Return values
- a random number on [0,0xffffffff]-interval
-
void
random_bytes
(uint8_t * buf,msp430_types.h::size_t
size)¶ writes random bytes in the [0,0xff]-interval to memory
-
uint32_t
random_uint32_range
(uint32_t a, uint32_t b)¶ generates a random number r with a <= r < b.
Parameters
a: minimum for random number b: upper bound for random number Return values
- a random number on [a,b)-interval
-
RANDOM_SEED_DEFAULT
¶ Seed selected when all tries to collect seeds from a random source failed.
1
(1)
-
PRNG_FLOAT
¶ Enables support for floating point random number generation.
1
(0)