Contiki-NG
Loading...
Searching...
No Matches
Pseudo Random Number Generator (PRNG) for CC13xx/CC26xx.

Files

 

Functions

unsigned short random_rand (void)
 Generates a new random number using the PRNG.
 
void random_init (unsigned short seed)
 Initialize the PRNG.
 

Detailed Description

Implementation based on Bob Jenkins' small noncryptographic PRNG.

This file overrides os/lib/random.c. Note that the file name must match the original file for the override to work.

Function Documentation

◆ random_init()

void random_init ( unsigned short seed)

Initialize the PRNG.

Seed the cc2538 random number generator.

Parameters
seedSeed for the PRNG.

Definition at line 87 of file random.c.

References random_rand().

◆ random_rand()

unsigned short random_rand ( void )

Generates a new random number using the PRNG.

Generates a new random number using the cc2538 RNG.

Returns
The random number.

Definition at line 69 of file random.c.