GPIO APIs
This topic provides details for the GPIO APIs.
gpio_request
| Synopsis |
|
| Description | Requests access to a GPIO interface. |
| Parameter |
|
| Return |
|
gpio_free
| Synopsis |
|
| Description | Releases a previously requested GPIO interface, making it available for other consumers. |
| Parameter | gpio: The GPIO index number to be released. |
| Return | None |
gpio_direction_input
| Synopsis |
|
| Description | Sets a GPIO interface as input. |
| Parameter | gpio: The GPIO index number |
| Return |
|
gpio_direction_output
| Synopsis |
|
| Description | Sets a GPIO interface as output. |
| Parameter |
|
| Return |
|
gpio_get_value
| Synopsis |
|
| Description | Gets the level from a target GPIO interface. The level is used to define whether the GPIO is an input or an output. |
| Parameter | gpio: The GPIO index number |
| Return |
|
gpio_set_value
| Synopsis |
|
| Description | Sets the level to a target GPIO interface. The level can be
used to alter the GPIO from an output to an output. Note: The GPIO has to be an output,
otherwise, this function may have no effect. |
| Parameter |
|
| Return | None |
of_get_named_gpio
| Synopsis |
|
| Description | Obtains a GPIO interface via which you can use the GPIO Application Interface (API). |
| Parameter |
|
| Return |
|
of_get_named_gpio_flags
| Synopsis |
|
| Description | Obtains a GPIO number from the DTS file and analyzes its GPIO properties. |
| Parameter |
|
| Return |
|