Skip to content

Commit 9770dce

Browse files
committed
Decalred static functions for intermediate computation
1 parent 8a6fde0 commit 9770dce

File tree

4 files changed

+42
-7
lines changed

4 files changed

+42
-7
lines changed

Inc/Soft_RNG.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#ifndef SOFT_RNG_H_
2+
#define SOFT_RNG_H_
3+
4+
#include <stdint.h>
5+
#include "stm32f4xx.h"
6+
7+
uint32_t GenerateRandom(void);
8+
9+
#endif

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Software Random Number Generator
2+
A library to Generate 32-bit Random Numbers using an onboard 32-bit Timer
3+
and a combination of LFSR, XOR Shift and the FNV hash function on an STM32F401
4+
Nucleo Development Board

Src/Soft_RNG.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#include "Soft_RNG.h"
2+
3+
#define SEED_CONST 0x5A5A5A5A
4+
5+
static uint32_t GetTimerCounter(void)
6+
{
7+
8+
}
9+
10+
static uint16_t GetLFSR(uint16_t seed16)
11+
{
12+
13+
}
14+
15+
static uint32_t GetXORShift(uint32_t seed32)
16+
{
17+
18+
}
19+
20+
static uint32_t GetFNVHash(uint32_t val)
21+
{
22+
23+
}
24+
25+
uint32_t GenerateRandom(void)
26+
{
27+
28+
}

Src/main.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,11 @@
22
#include "LED.h"
33
#include "UART.h"
44
#include "W25Qxx.h"
5+
#include "Soft_RNG.h"
56

67
int main()
78
{
8-
uint8_t data[4096];
9-
W25Q_Init();
10-
LED_Init();
11-
UART2_Init();
129

13-
LED_Toggle();
14-
W25Q_ReadData(0, 0, data, 4096);
15-
LED_Toggle();
1610

1711
while(1)
1812
{

0 commit comments

Comments
 (0)