Zephyr Project API 4.0.0
A Scalable Open Source RTOS
|
Pins of AXP192 support several different functions. More...
Functions | |
int | mfd_axp192_gpio_func_ctrl (const struct device *dev, const struct device *client_dev, uint8_t gpio, enum axp192_gpio_func func) |
Request a GPIO pin to be configured to a specific function. | |
int | mfd_axp192_gpio_func_get (const struct device *dev, uint8_t gpio, enum axp192_gpio_func *func) |
Read out current configuration of a specific GPIO pin. | |
int | mfd_axp192_gpio_pd_ctrl (const struct device *dev, uint8_t gpio, bool enable) |
Enable pull-down on specified GPIO pin. | |
int | mfd_axp192_gpio_pd_get (const struct device *dev, uint8_t gpio, bool *enabled) |
Read out the current pull-down configuration of a specific GPIO. | |
int | mfd_axp192_gpio_read_port (const struct device *dev, uint8_t *value) |
Read GPIO port. | |
int | mfd_axp192_gpio_write_port (const struct device *dev, uint8_t value, uint8_t mask) |
Write GPIO port. | |
Pins of AXP192 support several different functions.
The mfd interface offers an API to configure and control these different functions.
The 6 GPIOS are mapped as follows:
int mfd_axp192_gpio_func_ctrl | ( | const struct device * | dev, |
const struct device * | client_dev, | ||
uint8_t | gpio, | ||
enum axp192_gpio_func | func | ||
) |
#include <include/zephyr/drivers/mfd/axp192.h>
Request a GPIO pin to be configured to a specific function.
GPIO0..5 of AXP192 feature various functions (see axp192_gpio_func for details). A GPIO can only be used by one driver instance. Subsequential calls on the same GPIO will overwrite according function.
dev | axp192 mfd device |
client_dev | client device the gpio is used in |
gpio | GPIO to be configured (0..5) |
func | Function to be configured (see axp192_gpio_func for details) |
0 | on success |
-EINVAL | if an invalid GPIO number is passed |
-ENOTSUP | if the requested function is not supported by the given |
-errno | in case of any bus error |
int mfd_axp192_gpio_func_get | ( | const struct device * | dev, |
uint8_t | gpio, | ||
enum axp192_gpio_func * | func | ||
) |
#include <include/zephyr/drivers/mfd/axp192.h>
Read out current configuration of a specific GPIO pin.
dev | axp192 mfd device |
gpio | GPIO to read configuration from |
func | Pointer to store current function configuration in. |
-EINVAL | if an invalid GPIO number is passed |
-errno | in case of any bus error |
#include <include/zephyr/drivers/mfd/axp192.h>
Enable pull-down on specified GPIO pin.
AXP192 only supports pull-down on GPIO3..5. Pull-ups are not supported.
dev | axp192 mfd device |
gpio | GPIO to control pull-downs |
enable | true to enable, false to disable pull-down |
0 | on success |
-EINVAL | if an invalid argument is given (e.g. invalid GPIO number) |
-ENOTSUP | if pull-down is not supported by the givenn GPIO |
-errno | in case of any bus error |
#include <include/zephyr/drivers/mfd/axp192.h>
Read out the current pull-down configuration of a specific GPIO.
dev | axp192 mfd device |
gpio | GPIO to control pull-downs |
enabled | Pointer to current pull-down configuration (true: pull-down enabled/ false: pull-down disabled) |
-EINVAL | if an invalid argument is given (e.g. invalid GPIO number) |
-ENOTSUP | if pull-down is not supported by the givenn GPIO |
-errno | in case of any bus error |
#include <include/zephyr/drivers/mfd/axp192.h>
Read GPIO port.
dev | axp192 mfd device |
value | Pointer to port value |
0 | on success |
-errno | in case of any bus error |
#include <include/zephyr/drivers/mfd/axp192.h>
Write GPIO port.
dev | axp192 mfd device |
value | port value |
mask | pin mask within the port |
0 | on success |
-errno | in case of any bus error |