36#include "periph_cpu.h"
44#define PORT_BIT (1 << 5)
45#define PIN_MASK (0x1f)
46#define NRF5X_IO_AREA_START (0x40000000UL)
50#define NRF_P0 NRF_P0_S
53#if defined(CPU_FAM_NRF51)
54# define GPIO_PORT_0 ((gpio_port_t)NRF_GPIO)
57# define GPIO_PORT_1 ((gpio_port_t)NRF_P1)
59# define GPIO_PORT_0 ((gpio_port_t)NRF_P0)
78 if (port == GPIO_PORT_1) {
87 NRF_GPIO_Type *p = (NRF_GPIO_Type *)port;
93 NRF_GPIO_Type *p = (NRF_GPIO_Type *)port;
99 NRF_GPIO_Type *p = (NRF_GPIO_Type *)port;
105 NRF_GPIO_Type *p = (NRF_GPIO_Type *)port;
111 NRF_GPIO_Type *p = (NRF_GPIO_Type *)port;
119 NRF_GPIO_Type *p = (NRF_GPIO_Type *)port;
152 if (port >= NRF5X_IO_AREA_START) {
POSIX.1-2008 compliant version of the assert macro.
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.
#define PIN_MASK(n)
Generate a bit mask in which only the specified bit is high.
#define GPIO_PORT_0
Get the gpio_port_t value of the port labeled 0.
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.