libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
gpio.h File Reference
Include dependency graph for gpio.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define GPIO(port)   (GPIO_BASE + (0x040 * (port)))
 
#define GPIO0   (GPIO_BASE + 0x000)
 
#define GPIO1   (GPIO_BASE + 0x040)
 
#define GPIO2   (GPIO_BASE + 0x080)
 
#define GPIO3   (GPIO_BASE + 0x0C0)
 
#define GPIO4   (GPIO_BASE + 0x100)
 
#define GPIO_OFFSET(gpio)   (0x1 << ((gpio) % 32))
 
#define GPIO_PDOR(gpio_base)   MMIO32((gpio_base) + 0x00)
 
#define GPIO_PSOR(gpio_base)   MMIO32((gpio_base) + 0x04)
 
#define GPIO_PCOR(gpio_base)   MMIO32((gpio_base) + 0x08)
 
#define GPIO_PTOR(gpio_base)   MMIO32((gpio_base) + 0x0C)
 
#define GPIO_PDIR(gpio_base)   MMIO32((gpio_base) + 0x10)
 

Functions

void gpio_set (uint32_t gpio)
 Set GPIO. More...
 
void gpio_clear (uint32_t gpio)
 Set GPIO. More...
 
bool gpio_get (uint32_t gpio)
 Get GPIOs logic state. More...
 
void gpio_toggle (uint32_t gpio)
 Toggles GPIO. More...
 
uint32_t gpio_port_read (uint32_t gpioport)
 Read a whole GPIO Port. More...
 
void gpio_port_write (uint32_t gpioport, uint32_t data)
 Write a whole GPIO Port. More...