libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
|
Go to the source code of this file.
Macros | |
#define | GPIO0 (1 << 0) |
#define | GPIO1 (1 << 1) |
#define | GPIO2 (1 << 2) |
#define | GPIO3 (1 << 3) |
#define | GPIO4 (1 << 4) |
#define | GPIO5 (1 << 5) |
#define | GPIO6 (1 << 6) |
#define | GPIO7 (1 << 7) |
#define | GPIO8 (1 << 8) |
#define | GPIO9 (1 << 9) |
#define | GPIO_ALL 0x3ff |
#define | GPIO_ADATA MMIO32(GPIO_BASE + 0x0) |
Data register. More... | |
#define | GPIO_ADIR MMIO32(GPIO_BASE + 0x4) |
Direction register. More... | |
#define | GPIO_INTEN_A MMIO32(GPIO_BASE + 0x30) |
Interrupt enable register. More... | |
#define | GPIO_INTMASK_A MMIO32(GPIO_BASE + 0x34) |
Interrupt mask register. More... | |
#define | GPIO_INTLEVEL_A MMIO32(GPIO_BASE + 0x38) |
Interrupt trigger mode register. More... | |
#define | GPIO_INTPOLARITY_A MMIO32(GPIO_BASE + 0x3c) |
Interrupt polarity register. More... | |
#define | GPIO_INTSTAT_A MMIO32(GPIO_BASE + 0x40) |
Interrupt status after masking. More... | |
#define | GPIO_RAWINTSTAT_A MMIO32(GPIO_BASE + 0x44) |
Interrupt status before masking. More... | |
#define | GPIO_INTEOI_A MMIO32(GPIO_BASE + 0x48) |
Interrupt clear register. More... | |
#define | GPIO_AEXT MMIO32(GPIO_BASE + 0x4c) |
External register (wat) More... | |
Enumerations | |
enum | gpio_dir { GPIO_INPUT , GPIO_OUTPUT } |
enum | gpio_pol { GPIO_POL_LOW , GPIO_POL_HIGH } |
enum | gpio_trig_type { GPIO_TRIG_LEVEL , GPIO_TRIG_EDGE } |
enum | gpio_int_masked { GPIO_UNMASKED , GPIO_MASKED } |
Functions | |
void | gpio_set (uint16_t gpios) |
Set a Group of Pins. More... | |
void | gpio_clear (uint16_t gpios) |
Clear a Group of Pins. More... | |
uint16_t | gpio_get (uint16_t gpios) |
Read a Group of Pins. More... | |
void | gpio_toggle (uint16_t gpios) |
Toggle a Group of Pins. More... | |
void | gpio_input (uint16_t gpios) |
Set the direction of a Group of Pins to Input. More... | |
void | gpio_output (uint16_t gpios) |
Set the direction of a Group of Pins to Output. More... | |
void | gpio_int_enable (uint16_t gpios, bool en) |
Sets the pins as external interrupts, rather than normal GPIO. More... | |
void | gpio_int_mask (uint16_t gpios, enum gpio_int_masked masked) |
Sets bits in the interrupt mask. More... | |
void | gpio_int_type (uint16_t gpios, enum gpio_trig_type type) |
Sets whether the pins are edge triggered or level triggered. More... | |
void | gpio_int_pol (uint16_t gpios, enum gpio_pol pol) |
Sets the interrupt trigger polarity. More... | |
uint16_t | gpio_int_status (void) |
Gets the masked interrupt status. More... | |
uint16_t | gpio_int_raw_status (void) |
Gets the raw unmasked interrupt status. More... | |
void | gpio_int_clear (uint16_t gpios) |
Clear the specified pin interrupts. More... | |