Contiki 2.6
|
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. | |
void | random_init (unsigned short seed) |
Seed the cc253x random number generator. |
Random number generator routines exploiting the cc2530 hardware capabilities.
This file overrides core/lib/random.c.
Definition in file random.c.
void random_init | ( | unsigned short | seed | ) |
Seed the cc253x random number generator.
seed | Ignored. 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.
Referenced by main().
unsigned short random_rand | ( | void | ) |
Generates a new random number using the cc253x RNG.
Definition at line 51 of file random.c.
Referenced by ipolite_send(), polite_send(), uip_ds6_addr_add(), uip_ds6_compute_reachable_time(), and uip_ds6_init().