Skip to content

Commit

Permalink
Decalred static functions for intermediate computation
Browse files Browse the repository at this point in the history
  • Loading branch information
mbedsyst committed Nov 6, 2024
1 parent 8a6fde0 commit 9770dce
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 7 deletions.
9 changes: 9 additions & 0 deletions Inc/Soft_RNG.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifndef SOFT_RNG_H_
#define SOFT_RNG_H_

#include <stdint.h>
#include "stm32f4xx.h"

uint32_t GenerateRandom(void);

#endif
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
28 changes: 28 additions & 0 deletions Src/Soft_RNG.c
Original file line number Diff line number Diff line change
@@ -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)
{

}
8 changes: 1 addition & 7 deletions Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 9770dce

Please sign in to comment.