80#include "periph_cpu.h"
81#include "periph_conf.h"
91typedef unsigned int gpio_t;
99#define GPIO_PIN(x,y) ((gpio_t)((x & 0) | y))
106#define GPIO_UNDEF ((gpio_t)(UINT_MAX))
117#ifndef HAVE_GPIO_MODE_T
133#ifndef HAVE_GPIO_FLANK_T
151#ifndef HAVE_GPIO_ISR_CTX_T
173#if defined(MODULE_PERIPH_GPIO_IRQ) || defined(DOXYGEN)
271 return (gpio1 == gpio2);
#define GPIO_UNDEF
Definition of a fitting UNDEF value.
@ GPIO_OUT
select GPIO MASK as output
@ GPIO_IN
select GPIO MASK as input
gpio_mode_t
Available pin modes.
void gpio_toggle(gpio_t pin)
Toggle the value of the given pin.
void(* gpio_cb_t)(void *arg)
Signature of event callback functions triggered from interrupts.
static int gpio_is_valid(gpio_t gpio)
Test if a GPIO pin is a valid pin and not declared as undefined.
void gpio_clear(gpio_t pin)
Set the given pin to LOW.
void gpio_write(gpio_t pin, bool value)
Set the given pin to the given value.
int gpio_init_int(gpio_t pin, gpio_mode_t mode, gpio_flank_t flank, gpio_cb_t cb, void *arg)
Initialize a GPIO pin for external interrupt usage.
void gpio_set(gpio_t pin)
Set the given pin to HIGH.
void gpio_irq_disable(gpio_t pin)
Disable the pin interrupt if configured as interrupt source.
void gpio_irq_enable(gpio_t pin)
Enable pin interrupt if configured as interrupt source.
bool gpio_read(gpio_t pin)
Get the current value of the given pin.
int gpio_init(gpio_t pin, gpio_mode_t mode)
Initialize the given pin as general purpose input or output.
static int gpio_is_equal(gpio_t gpio1, gpio_t gpio2)
Test if a GPIO pin is equal to another GPIO pin.
Default interrupt context for GPIO pins.
void * arg
optional argument
gpio_cb_t cb
interrupt callback