26#include "soc/gpio_reg.h"
42 if (GPIO_PORT_NUMOF == 1) {
51 static_assert(GPIO_PORT_NUMOF < 3);
52 volatile uword_t *in = (uint32_t *)GPIO_IN_REG;
56 in = (uint32_t *)GPIO_IN1_REG;
65 static_assert(GPIO_PORT_NUMOF < 3);
66 volatile uword_t *out = (uint32_t *)GPIO_OUT_REG;
69 out = (uint32_t *)GPIO_OUT1_REG;
78 static_assert(GPIO_PORT_NUMOF < 3);
79 volatile uword_t *out_w1ts = (uint32_t *)GPIO_OUT_W1TS_REG;
82 out_w1ts = (uint32_t)GPIO_OUT1_W1TS;
91 static_assert(GPIO_PORT_NUMOF < 3);
92 volatile uword_t *out_w1tc = (uint32_t *)GPIO_OUT_W1TC_REG;
95 out_w1tc = (uint32_t)GPIO_OUT1_W1TC;
104 static_assert(GPIO_PORT_NUMOF < 3);
105 volatile uword_t *out = (uint32_t *)GPIO_OUT_REG;
108 out = (uint32_t *)GPIO_OUT1_REG;
118 static_assert(GPIO_PORT_NUMOF < 3);
119 volatile uword_t *out = (uint32_t *)GPIO_OUT_REG;
122 out = (uint32_t *)GPIO_OUT1_REG;
154 return (num < GPIO_PORT_NUMOF);
Architecture specific GPIO functions for ESP8266.
MAYBE_INLINE void irq_restore(unsigned state)
This function restores the IRQ disable bit in the status register to the value contained within passe...
MAYBE_INLINE unsigned irq_disable(void)
This function sets the IRQ disable bit in the status register.
static uint8_t gpio_get_pin_num(gpio_t pin)
Extract the pin number from a gpio_t
static void gpio_ll_set(gpio_port_t port, uword_t mask)
Perform an reg |= mask operation on the I/O register of the port.
gpio_port_t gpio_port(uword_t num)
Get the gpio_port_t value of the port number num.
static gpio_port_t gpio_port_pack_addr(void *addr)
Pack a pointer into a gpio_port_t.
static uword_t gpio_ll_read(gpio_port_t port)
Get the current input value of all GPIO pins of the given port as bitmask.
static gpio_port_t gpio_get_port(gpio_t pin)
Extract the gpio_port_t from a gpio_t
uword_t gpio_port_num(gpio_port_t port)
Get the number of the GPIO port port refers to.
static void * gpio_port_unpack_addr(gpio_port_t port)
Extract a data pointer that was packed by gpio_port_pack_addr.
static bool is_gpio_port_num_valid(uint_fast8_t num)
Check if the given number is a valid argument for gpio_port.
static uword_t gpio_ll_read_output(gpio_port_t port)
Get the current output value of all GPIO pins of the given port as bitmask.
static void gpio_ll_clear(gpio_port_t port, uword_t mask)
Perform an reg &= ~mask operation on the I/O register of the port.
static void gpio_ll_toggle(gpio_port_t port, uword_t mask)
Perform an reg ^= mask operation on the I/O register of the port.
static void gpio_ll_write(gpio_port_t port, uword_t state)
Perform a masked write operation on the I/O register of the port.
uintptr_t gpio_port_t
GPIO port type.
uint< NUM > _t uword_t
Word sized unsigned integer.