libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
|
Access functions for the I/O Controller More...
Functions | |
void | gpio_set (uint32_t gpioport, uint32_t gpios) |
Atomic set output. More... | |
void | gpio_clear (uint32_t gpioport, uint32_t gpios) |
Atomic clear output. More... | |
void | gpio_toggle (uint32_t gpioport, uint32_t gpios) |
Toggle output. More... | |
uint32_t | gpio_get (uint32_t gpioport, uint32_t gpios) |
Read GPIO values. More... | |
void | gpio_mode_setup (uint32_t gpioport, uint32_t mode, uint32_t pull_up_down, uint32_t gpios) |
Set GPIO Pin Mode. More... | |
void | gpio_set_options (uint32_t gpioport, uint32_t drive, uint32_t sense, uint32_t gpios) |
Configure GPIO pin input and output specifics. More... | |
void | gpio_configure_task (uint8_t task_num, uint8_t pin_num, uint8_t polarity, uint32_t init) |
Configure Task in GPIO TE Module. More... | |
void | gpio_configure_event (uint8_t event_num, uint8_t pin_num, uint8_t polarity) |
Configure Event in GPIO TE Module. More... | |
void | gpio_enable_interrupts (uint32_t mask) |
Enable GPIO interrupts. More... | |
void | gpio_disable_interrupts (uint32_t mask) |
Disable GPIO interrupts. More... | |
void | gpio_clear_interrupts (void) |
Disable all GPIO interrupts. More... | |
Access functions for the I/O Controller
LGPL License Terms libopencm3 License
void gpio_clear | ( | uint32_t | gpioport, |
uint32_t | gpios | ||
) |
Atomic clear output.
[in] | gpioport | Port identifier GPIO ports |
[in] | gpios | Pin identifiers GPIO Pin Identifiers |
Definition at line 52 of file gpio.c.
References GPIO_OUTCLR.
void gpio_clear_interrupts | ( | void | ) |
void gpio_configure_event | ( | uint8_t | event_num, |
uint8_t | pin_num, | ||
uint8_t | polarity | ||
) |
Configure Event in GPIO TE Module.
[in] | event_num | Event number (0-3) |
[in] | pin_num | GPIO Pin number (0-31) |
[in] | polarity | Operation to perform when task is triggered. |
Definition at line 175 of file gpio.c.
References GPIO_TE_CONFIG, GPIO_TE_CONFIG_MODE_SHIFT, GPIO_TE_CONFIG_POLARITY_SHIFT, GPIO_TE_CONFIG_PSEL_SHIFT, and GPIO_TE_MODE_EVENT.
void gpio_configure_task | ( | uint8_t | task_num, |
uint8_t | pin_num, | ||
uint8_t | polarity, | ||
uint32_t | init | ||
) |
Configure Task in GPIO TE Module.
[in] | task_num | uint8_t Task number (0-3) |
[in] | pin_num | uint8_t GPIO Pin number (0-31) |
[in] | polarity | uint8_t polarity Operation to perform when task is triggered. |
[in] | init | uint8_t Initial state of the pin, non-zero means initially active, zero means initially inactive |
Definition at line 155 of file gpio.c.
References GPIO_TE_CONFIG, GPIO_TE_CONFIG_MODE_SHIFT, GPIO_TE_CONFIG_OUTINIT, GPIO_TE_CONFIG_POLARITY_SHIFT, GPIO_TE_CONFIG_PSEL_SHIFT, and GPIO_TE_MODE_TASK.
void gpio_disable_interrupts | ( | uint32_t | mask | ) |
Disable GPIO interrupts.
[in] | mask | interrupts to disable. |
Definition at line 195 of file gpio.c.
References GPIO_INTENCLR.
void gpio_enable_interrupts | ( | uint32_t | mask | ) |
Enable GPIO interrupts.
[in] | mask | interrupts to enable. |
Definition at line 186 of file gpio.c.
References GPIO_INTENSET.
uint32_t gpio_get | ( | uint32_t | gpioport, |
uint32_t | gpios | ||
) |
Read GPIO values.
[in] | gpioport | Port identifier GPIO ports |
[in] | gpios | Pin identifiers GPIO Pin Identifiers |
Definition at line 76 of file gpio.c.
References GPIO_IN.
void gpio_mode_setup | ( | uint32_t | gpioport, |
uint32_t | mode, | ||
uint32_t | pull_up_down, | ||
uint32_t | gpios | ||
) |
Set GPIO Pin Mode.
Sets the mode (input/output) and configuration (analog/digitial and open drain/push pull), for a set of GPIO pins on a given GPIO port.
[in] | gpioport | Port identifier GPIO ports |
[in] | mode | Pin mode GPIO Pin Mode |
[in] | pull_up_down | Pull up / pull down configuration GPIO Output Pin Pullup |
[in] | gpios | Pin identifiers GPIO Pin Identifiers If multiple pins are to be set, use bitwise OR '|' to separate them. |
Definition at line 94 of file gpio.c.
References GPIO_CNF_MODE_MASK, GPIO_CNF_MODE_SHIFT, GPIO_CNF_PUPD_MASK, GPIO_CNF_PUPD_SHIFT, and GPIO_PIN_CNF.
void gpio_set | ( | uint32_t | gpioport, |
uint32_t | gpios | ||
) |
Atomic set output.
[in] | gpioport | Port identifier GPIO ports |
[in] | gpios | Pin identifiers GPIO Pin Identifiers |
Definition at line 41 of file gpio.c.
References GPIO_OUTSET.
void gpio_set_options | ( | uint32_t | gpioport, |
uint32_t | drive, | ||
uint32_t | sense, | ||
uint32_t | gpios | ||
) |
Configure GPIO pin input and output specifics.
Configure drive strength and input sensing for given GPIO port.
[in] | gpioport | GPIO port identifier, see GPIO ports |
[in] | drive | Drive schema used to drive pin, see GPIO drive configuration |
[in] | sense | Pin sensing mechanism, see GPIO sensing mechanism |
[in] | gpios | Pin identifiers GPIO Pin Identifiers If multiple pins are to be set, use bitwise OR '|' to separate them. |
Definition at line 125 of file gpio.c.
References GPIO_CNF_DRIVE_MASK, GPIO_CNF_DRIVE_SHIFT, GPIO_CNF_SENSE_MASK, GPIO_CNF_SENSE_SHIFT, and GPIO_PIN_CNF.
void gpio_toggle | ( | uint32_t | gpioport, |
uint32_t | gpios | ||
) |
Toggle output.
[in] | gpioport | Port identifier GPIO ports |
[in] | gpios | Pin identifiers GPIO Pin Identifiers |
Definition at line 63 of file gpio.c.
References GPIO_OUT, GPIO_OUTCLR, and GPIO_OUTSET.