Contiki-NG
Files | Functions
Hardware random number generator

Files

file  random.c
 Random number generator routines exploiting the nRF52 hardware capabilities.
 

Functions

unsigned short random_rand (void)
 Generates a new random number using the nRF52 RNG. More...
 
void random_init (unsigned short seed)
 Initialize the nRF52 random number generator. More...
 

Detailed Description

Function Documentation

◆ random_init()

void random_init ( unsigned short  seed)

Initialize the nRF52 random number generator.

Seed the cc2538 random number generator.

Parameters
seedIgnored. It's here because the function prototype is in core.

Definition at line 80 of file random.c.

◆ random_rand()

unsigned short random_rand ( void  )

Generates a new random number using the nRF52 RNG.

Generates a new random number using the cc2538 RNG.

Returns
a random number.

Definition at line 58 of file random.c.