aboutsummaryrefslogtreecommitdiff
path: root/include/system.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/system.h')
-rw-r--r--include/system.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/system.h b/include/system.h
new file mode 100644
index 0000000..ca29ade
--- /dev/null
+++ b/include/system.h
@@ -0,0 +1,14 @@
+#pragma once
+
+#include <stdint.h>
+
+#define SAFE_ACCESS_SIG_REG (*((volatile uint32_t*)0x40001040))
+
+#define SAFE_ACCESS_1 0x57
+#define SAFE_ACCESS_2 0xA8
+
+inline static void enter_safe_mode()
+{
+ SAFE_ACCESS_SIG_REG = SAFE_ACCESS_1;
+ SAFE_ACCESS_SIG_REG = SAFE_ACCESS_2;
+}