Contiki-Inga 3.x
Functions
random.c File Reference

    Random number generator routines exploiting the cc2530 hardware
    capabilities.
More...

#include "cc253x.h"
#include "sfr-bits.h"
#include "dev/cc2530-rf.h"

Go to the source code of this file.

Functions

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

Detailed Description

    Random number generator routines exploiting the cc2530 hardware
    capabilities.
    This file overrides core/lib/random.c.
Author
George Oikonomou - oikon.nosp@m.omou.nosp@m.@user.nosp@m.s.so.nosp@m.urcef.nosp@m.orge.nosp@m..net

Definition in file random.c.

Function Documentation

void random_init ( unsigned short  seed)

Seed the cc253x random number generator.

Parameters
seedIgnored. It's here because the function prototype is in core.
        We form a seed for the RNG by sampling IF_ADC as
        discussed in the user guide.
        Seeding with this method should not be done during
        normal radio operation. Thus, use this function before
        initialising the network.

Definition at line 70 of file random.c.

unsigned short random_rand ( void  )

Generates a new random number using the cc253x RNG.

Returns
The random number.

Definition at line 51 of file random.c.