diff options
| author | Damien George | 2014-07-02 13:42:37 +0100 |
|---|---|---|
| committer | Damien George | 2014-07-02 13:42:37 +0100 |
| commit | 7a37f647a5d953a47a6147cf8302e08f27537771 (patch) | |
| tree | 5f6bdb76cac3f59334431f62a3920f39ceca8b8b /stmhal/mphal.h | |
| parent | 5fc580475f5eba8248de86a4148090e63f777372 (diff) | |
| parent | 4f1b7fec9f103c92de40875e9a06b7decc4923f4 (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.h | 7 |
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)) |
