rng 2.0.0.0
|
RNG Click is a random number generator (RNG) is a device that generates a sequence of numbers or symbols that cannot be reasonably predicted better than by a random chance. This Click boardâ„¢ is true hardware random-number generator (HRNG), which generate genuinely random numbers.
We provide a library for the Rng Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.
This library contains API for Rng Click driver.
- Initialization function.void rng_cfg_setup ( rng_cfg_t *cfg );
void rng_default_cfg ( rng_t *ctx );
- This function sets configuration.float rng_get_voltage ( rng_t *ctx );
void rng_set_config ( rng_t *ctx, uint16_t conf_data );
void rng_set_vref ( rng_t *ctx, uint16_t vref_mv );
This click is a random number generator. The device contain potentiometer which control voltage so it generates a sequence of numbers or symbols that cannot be reasonably predicted better by a random chance. Random number generators have applications in gambling, statistical sampling, computer simulation, cryptography, completely randomized design, and various other areas.
The demo application is composed of two sections :
Initializes driver, then sets configuration and voltage reference.
It reads ADC value from AIN0 channel then converts it to voltage and displays the result on USB UART each second.
The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.
Other mikroE Libraries used in the example:
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.