diff --git a/Inc/Soft_RNG.h b/Inc/Soft_RNG.h new file mode 100644 index 0000000..f1971b1 --- /dev/null +++ b/Inc/Soft_RNG.h @@ -0,0 +1,9 @@ +#ifndef SOFT_RNG_H_ +#define SOFT_RNG_H_ + +#include +#include "stm32f4xx.h" + +uint32_t GenerateRandom(void); + +#endif diff --git a/README.md b/README.md new file mode 100644 index 0000000..df4f10f --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# Software Random Number Generator +A library to Generate 32-bit Random Numbers using an onboard 32-bit Timer +and a combination of LFSR, XOR Shift and the FNV hash function on an STM32F401 +Nucleo Development Board \ No newline at end of file diff --git a/Src/Soft_RNG.c b/Src/Soft_RNG.c new file mode 100644 index 0000000..639fd99 --- /dev/null +++ b/Src/Soft_RNG.c @@ -0,0 +1,28 @@ +#include "Soft_RNG.h" + +#define SEED_CONST 0x5A5A5A5A + +static uint32_t GetTimerCounter(void) +{ + +} + +static uint16_t GetLFSR(uint16_t seed16) +{ + +} + +static uint32_t GetXORShift(uint32_t seed32) +{ + +} + +static uint32_t GetFNVHash(uint32_t val) +{ + +} + +uint32_t GenerateRandom(void) +{ + +} diff --git a/Src/main.c b/Src/main.c index b4d60e8..0e12f98 100644 --- a/Src/main.c +++ b/Src/main.c @@ -2,17 +2,11 @@ #include "LED.h" #include "UART.h" #include "W25Qxx.h" +#include "Soft_RNG.h" int main() { - uint8_t data[4096]; - W25Q_Init(); - LED_Init(); - UART2_Init(); - LED_Toggle(); - W25Q_ReadData(0, 0, data, 4096); - LED_Toggle(); while(1) {