Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

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.
 

Detailed Description

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:

Function Documentation

◆ mfd_axp192_gpio_func_ctrl()

int mfd_axp192_gpio_func_ctrl ( const struct device dev,
const struct device client_dev,
uint8_t  gpio,
enum axp192_gpio_func  func 
)

#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.

Parameters
devaxp192 mfd device
client_devclient device the gpio is used in
gpioGPIO to be configured (0..5)
funcFunction to be configured (see axp192_gpio_func for details)
Return values
0on success
-EINVALif an invalid GPIO number is passed
-ENOTSUPif the requested function is not supported by the given
-errnoin case of any bus error

◆ mfd_axp192_gpio_func_get()

int mfd_axp192_gpio_func_get ( const struct device dev,
uint8_t  gpio,
enum axp192_gpio_func func 
)

#include <zephyr/drivers/mfd/axp192.h>

Read out current configuration of a specific GPIO pin.

Parameters
devaxp192 mfd device
gpioGPIO to read configuration from
funcPointer to store current function configuration in.
Returns
0 on success
Return values
-EINVALif an invalid GPIO number is passed
-errnoin case of any bus error

◆ mfd_axp192_gpio_pd_ctrl()

int mfd_axp192_gpio_pd_ctrl ( const struct device dev,
uint8_t  gpio,
bool  enable 
)

#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 supprted.

Parameters
devaxp192 mfd device
gpioGPIO to control pull-downs
enabletrue to enable, false to disable pull-down
Return values
0on success
-EINVALif an invalid argument is given (e.g. invalid GPIO number)
-ENOTSUPif pull-down is not supported by the givenn GPIO
-errnoin case of any bus error

◆ mfd_axp192_gpio_pd_get()

int mfd_axp192_gpio_pd_get ( const struct device dev,
uint8_t  gpio,
bool enabled 
)

#include <zephyr/drivers/mfd/axp192.h>

Read out the current pull-down configuration of a specific GPIO.

Parameters
devaxp192 mfd device
gpioGPIO to control pull-downs
enabledPointer to current pull-down configuration (true: pull-down enabled/ false: pull-down disabled)
Return values
-EINVALif an invalid argument is given (e.g. invalid GPIO number)
-ENOTSUPif pull-down is not supported by the givenn GPIO
-errnoin case of any bus error

◆ mfd_axp192_gpio_read_port()

int mfd_axp192_gpio_read_port ( const struct device dev,
uint8_t value 
)

#include <zephyr/drivers/mfd/axp192.h>

Read GPIO port.

Parameters
devaxp192 mfd device
valuePointer to port value
Return values
0on success
-errnoin case of any bus error

◆ mfd_axp192_gpio_write_port()

int mfd_axp192_gpio_write_port ( const struct device dev,
uint8_t  value,
uint8_t  mask 
)

#include <zephyr/drivers/mfd/axp192.h>

Write GPIO port.

Parameters
devaxp192 mfd device
valueport value
maskpin mask within the port
Return values
0on success
-errnoin case of any bus error