Minor changes in the GPIO HAL

This commit is contained in:
Xenofon (Fontas) Fafoutis 2018-02-28 10:41:05 +00:00
parent 91882209bf
commit cf291c22f0
2 changed files with 8 additions and 0 deletions

View File

@ -53,6 +53,7 @@
#include <stdint.h>
/*---------------------------------------------------------------------------*/
#define PIN_TO_PORT(pin) (pin >> 3)
#define PIN_TO_NUM(pin) (pin % 8)
#define PIN_TO_PORT_BASE(pin) GPIO_PORT_TO_BASE(PIN_TO_PORT(pin))
/*---------------------------------------------------------------------------*/
#define gpio_hal_arch_interrupt_enable(p) do { \

View File

@ -130,6 +130,13 @@ typedef struct gpio_hal_event_handler_s {
gpio_hal_pin_mask_t pin_mask;
} gpio_hal_event_handler_t;
/*---------------------------------------------------------------------------*/
/**
* \brief Unknown GPIO
*
* A default GPIO value for unknown GPIO
*/
#define GPIO_HAL_PIN_UNKNOWN 0xFF
/*---------------------------------------------------------------------------*/
/**
* \name Core GPIO functions
*