aboutsummaryrefslogtreecommitdiff
path: root/stmhal/mphal.h
diff options
context:
space:
mode:
authorDamien George2014-07-02 13:42:37 +0100
committerDamien George2014-07-02 13:42:37 +0100
commit7a37f647a5d953a47a6147cf8302e08f27537771 (patch)
tree5f6bdb76cac3f59334431f62a3920f39ceca8b8b /stmhal/mphal.h
parent5fc580475f5eba8248de86a4148090e63f777372 (diff)
parent4f1b7fec9f103c92de40875e9a06b7decc4923f4 (diff)
Merge branch 'teensy-new' of github.com:dhylands/micropython into dhylands-teensy-new
Conflicts: stmhal/pin_named_pins.c stmhal/readline.c Renamed HAL_H to MICROPY_HAL_H. Made stmhal/mphal.h which intends to define the generic Micro Python HAL, which in stmhal sits above the ST HAL.
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 000000000..4e9a8b2bb
--- /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))