libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
|
VF6xx General-Purpose Input/Output (GPIO) More...
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... | |
VF6xx General-Purpose Input/Output (GPIO)
This library supports the GPIO module in the VF6xx SoC of Freescale. Access is provided by GPIO number according to the Pinmux list of the Reference Manual, similar as GPIOs are available on Linux.
LGPL License Terms libopencm3 License
void gpio_clear | ( | uint32_t | gpio | ) |
Set GPIO.
Clears GPIO by GPIO number according to MUX list
[in] | gpio | unsigned 32 bit. GPIO number |
Definition at line 65 of file gpio.c.
References GPIO, GPIO_OFFSET, and GPIO_PCOR.
bool gpio_get | ( | uint32_t | gpio | ) |
Get GPIOs logic state.
Get logic level of GPIO given by GPIO number according to MUX list. Reading a GPIO value is possible even if the port is not muxed for GPIO.
[in] | gpio | unsigned 32 bit. GPIO number |
Definition at line 81 of file gpio.c.
References GPIO, GPIO_OFFSET, and GPIO_PDIR.
uint32_t gpio_port_read | ( | uint32_t | gpioport | ) |
Read a whole GPIO Port.
Gets all 32 GPIOs of a Port.
[in] | gpioport | unsigned 32 bit. GPIO port GPIO register base addresses |
Definition at line 110 of file gpio.c.
References GPIO_PDIR.
void gpio_port_write | ( | uint32_t | gpioport, |
uint32_t | data | ||
) |
Write a whole GPIO Port.
Sets all 32 GPIOs of a Port.
[in] | gpioport | unsigned 32 bit. GPIO port GPIO register base addresses |
[in] | gpio | unsigned 32 bit. 1 for a logic 1 driven at port, 0 for a logic 0 driven at port. |
Definition at line 125 of file gpio.c.
References GPIO_PDOR.
void gpio_set | ( | uint32_t | gpio | ) |
Set GPIO.
Set GPIO by GPIO number according to MUX list
[in] | gpio | unsigned 32 bit. GPIO number |
Definition at line 51 of file gpio.c.
References GPIO, GPIO_OFFSET, and GPIO_PSOR.
void gpio_toggle | ( | uint32_t | gpio | ) |
Toggles GPIO.
Toggles GPIO by GPIO number according to MUX list
[in] | gpio | unsigned 32 bit. GPIO number |
Definition at line 95 of file gpio.c.
References GPIO, GPIO_OFFSET, and GPIO_PTOR.