Refactor Hardware RNG functions to esp/hwrand.h

As suggested by @foogod, thanks!
This commit is contained in:
Angus Gratton 2015-09-24 20:48:16 +10:00
parent 8bcab35d51
commit 8f7f246a36
3 changed files with 51 additions and 7 deletions

22
core/include/esp/hwrand.h Normal file
View file

@ -0,0 +1,22 @@
/** esp/hwrand.h
*
* Hardware Random Number Generator functions.
*
* For documentation, see http://esp8266-re.foogod.com/wiki/Random_Number_Generator
*
* Part of esp-open-rtos
* Copyright (C) 2015 Angus Gratton
* BSD Licensed as described in the file LICENSE
*/
#ifndef _ESP_RNG_H
#define _ESP_RNG_H
#include <stdint.h>
#include <sys/types.h>
/* Return a random 32-bit number */
uint32_t hwrand(void);
/* Fill a variable size buffer with data from the Hardware RNG */
void hwrand_fill(uint8_t *buf, size_t len);
#endif