aboutsummaryrefslogtreecommitdiff
path: root/stmhal/mphal.h
diff options
context:
space:
mode:
authorDave Hylands2015-10-29 09:03:10 -0700
committerDamien George2015-10-30 12:53:14 +0000
commitb83d0b35e9b86424b997ef1ccf50e2d2a9659fcf (patch)
treec850772e6fcb879c986ec4bc28c8412ad9f78859 /stmhal/mphal.h
parent823a961ecc4c4b3ed31c18676619e8cd595756cf (diff)
stmhal: Add define for UNIQUE_ID address (differs per MCU)
Diffstat (limited to 'stmhal/mphal.h')
-rw-r--r--stmhal/mphal.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/stmhal/mphal.h b/stmhal/mphal.h
index 83b28d8d7..bafee7b13 100644
--- a/stmhal/mphal.h
+++ b/stmhal/mphal.h
@@ -1,6 +1,16 @@
// We use the ST Cube HAL library for most hardware peripherals
#include STM32_HAL_H
+// The unique id address differs per MCU. Ideally this define should
+// go in some MCU-specific header, but for now it lives here.
+#if defined(MCU_SERIES_F4)
+#define MP_HAL_UNIQUE_ID_ADDRESS (0x1fff7a10)
+#elif defined(MCU_SERIES_F7)
+#define MP_HAL_UNIQUE_ID_ADDRESS (0x1ff0f420)
+#else
+#error mphal.h: Unrecognized MCU_SERIES
+#endif
+
// Basic GPIO functions
#define GPIO_read_pin(gpio, pin) (((gpio)->IDR >> (pin)) & 1)
#if defined(MCU_SERIES_F7)