balbekova 8 жил өмнө
parent
commit
7e41e7e929

+ 16 - 0
peripheral_modules/src/rng.c

@@ -0,0 +1,16 @@
+#include <stdint.h>
+#include "rng.h"
+#include "stm32f4xx.h"
+
+
+void RNG_Init(void)
+{
+    RCC_AHB2PeriphClockCmd(RCC_AHB2Periph_RNG,ENABLE);
+    RNG_Cmd(ENABLE);
+}
+
+uint32_t GetRandomNumber(void) {
+    return RNG_GetRandomNumber();;
+}
+
+