micropython/stmhal/mphal.h
Damien George 5cbc9e0db0 stmhal: Reduce coupling between USB driver and readline.
This makes it easier to re-use readline.c and pyexec.c from stmhal in
other ports.
2014-11-27 16:58:31 +00:00

14 lines
559 B
C

// 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))
#define GPIO_read_output_pin(gpio, pin) (((gpio)->ODR >> (pin)) & 1)
extern const byte mp_hal_status_to_errno_table[4];
NORETURN void mp_hal_raise(HAL_StatusTypeDef status);
void mp_hal_set_interrupt_char(int c); // -1 to disable