Zephyr API Documentation 3.7.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
axp192.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Martin Kiepfer
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_DRIVERS_MFD_AXP192_H_
8#define ZEPHYR_INCLUDE_DRIVERS_MFD_AXP192_H_
9
10#include <stddef.h>
11#include <stdint.h>
12
13#include <zephyr/device.h>
14#include <zephyr/drivers/gpio.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
34
38#define AXP192_GPIO_FUNC_VALID(func) (func < AXP192_GPIO_FUNC_INVALID)
39
43#define AXP192_GPIO_MAX_NUM 6U
44
78int mfd_axp192_gpio_func_ctrl(const struct device *dev, const struct device *client_dev,
79 uint8_t gpio, enum axp192_gpio_func func);
80
91int mfd_axp192_gpio_func_get(const struct device *dev, uint8_t gpio, enum axp192_gpio_func *func);
92
105int mfd_axp192_gpio_pd_ctrl(const struct device *dev, uint8_t gpio, bool enable);
106
118int mfd_axp192_gpio_pd_get(const struct device *dev, uint8_t gpio, bool *enabled);
119
128int mfd_axp192_gpio_read_port(const struct device *dev, uint8_t *value);
129
139int mfd_axp192_gpio_write_port(const struct device *dev, uint8_t value, uint8_t mask);
140
145#ifdef __cplusplus
146}
147#endif
148
149#endif /* ZEPHYR_INCLUDE_DRIVERS_MFD_AXP192_H_ */
Public APIs for GPIO drivers.
axp192_gpio_func
GPIO function type.
Definition axp192.h:23
@ AXP192_GPIO_FUNC_PWM
Definition axp192.h:29
@ AXP192_GPIO_FUNC_CHARGE_CTL
Definition axp192.h:31
@ AXP192_GPIO_FUNC_FLOAT
Definition axp192.h:30
@ AXP192_GPIO_FUNC_OUTPUT_LOW
Definition axp192.h:26
@ AXP192_GPIO_FUNC_ADC
Definition axp192.h:28
@ AXP192_GPIO_FUNC_INPUT
Definition axp192.h:24
@ AXP192_GPIO_FUNC_INVALID
Definition axp192.h:32
@ AXP192_GPIO_FUNC_LDO
Definition axp192.h:27
@ AXP192_GPIO_FUNC_OUTPUT_OD
Definition axp192.h:25
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_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_write_port(const struct device *dev, uint8_t value, uint8_t mask)
Write GPIO port.
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_read_port(const struct device *dev, uint8_t *value)
Read GPIO port.
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.
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition util_macro.h:44
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Runtime device structure (in ROM) per driver instance.
Definition device.h:403