summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/mphal.h
blob: 4e9a8b2bb8e9d452f1fc17ee7b896d03a04013b1 (plain) (blame)
1
2
3
4
5
6
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))