summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/mphal.h
diff options
context:
space:
mode:
Diffstat (limited to 'stmhal/mphal.h')
-rw-r--r--stmhal/mphal.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/stmhal/mphal.h b/stmhal/mphal.h
new file mode 100644
index 0000000000..4e9a8b2bb8
--- /dev/null
+++ b/stmhal/mphal.h
@@ -0,0 +1,7 @@
+// We use the ST Cube HAL library for most hardware peripherals
+#include <stm32f4xx_hal.h>
+
+// Basic GPIO functions
+#define GPIO_read_pin(gpio, pin) (((gpio)->IDR >> (pin)) & 1)
+#define GPIO_set_pin(gpio, pin_mask) (((gpio)->BSRRL) = (pin_mask))
+#define GPIO_clear_pin(gpio, pin_mask) (((gpio)->BSRRH) = (pin_mask))