32 #include "periph_cpu.h" 
   40 #define PORT_BIT            (1 << 5) 
   41 #define PIN_MASK            (0x1f) 
   42 #define NRF5X_IO_AREA_START (0x40000000UL) 
   46 #define NRF_P0 NRF_P0_S 
   49 #if defined(CPU_FAM_NRF51) 
   50 #  define GPIO_PORT_0       ((gpio_port_t)NRF_GPIO) 
   53 #    define GPIO_PORT_1     ((gpio_port_t)NRF_P1) 
   55 #  define GPIO_PORT_0       ((gpio_port_t)NRF_P0) 
   74     if (port == GPIO_PORT_1) {
 
   83     NRF_GPIO_Type *p = (NRF_GPIO_Type *)port;
 
   89     NRF_GPIO_Type *p = (NRF_GPIO_Type *)port;
 
   95     NRF_GPIO_Type *p = (NRF_GPIO_Type *)port;
 
  101     NRF_GPIO_Type *p = (NRF_GPIO_Type *)port;
 
  107     NRF_GPIO_Type *p = (NRF_GPIO_Type *)port;
 
  115     NRF_GPIO_Type *p = (NRF_GPIO_Type *)port;
 
  148     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_port_unpack_addr(gpio_port_t port)
Extract a data pointer that was packed by gpio_port_pack_addr.
 
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 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.