1 /*
2  * Copyright (c) 2020 Nordic Semiconductor ASA
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef ZEPHYR_INCLUDE_DRIVERS_GPIO_GPIO_SX1509B_H_
8 #define ZEPHYR_INCLUDE_DRIVERS_GPIO_GPIO_SX1509B_H_
9 
10 #include <zephyr/device.h>
11 #include <zephyr/drivers/gpio.h>
12 
13 /**
14  * @brief Configure a pin for LED intensity.
15  *
16  * Configure a pin to be controlled by SX1509B LED driver using
17  * the LED intensity functionality.
18  * To get back normal GPIO functionality, configure the pin using
19  * the standard GPIO API.
20  *
21  * @param dev Pointer to the device structure for the driver instance.
22  * @param pin Pin number.
23  *
24  * @retval 0 If successful.
25  * @retval -EWOULDBLOCK if function is called from an ISR.
26  * @retval -ERANGE if pin number is out of range.
27  * @retval -EIO if I2C fails.
28  */
29 int sx1509b_led_intensity_pin_configure(const struct device *dev,
30 					gpio_pin_t pin);
31 
32 /**
33  * @brief Set LED intensity of selected pin.
34  *
35  * @param dev Pointer to the device structure for the driver instance.
36  * @param pin Pin number.
37  * @param intensity_val Intensity value.
38  *
39  * @retval 0 If successful.
40  * @retval -EIO if I2C fails.
41  */
42 int sx1509b_led_intensity_pin_set(const struct device *dev, gpio_pin_t pin,
43 				  uint8_t intensity_val);
44 
45 #endif /* ZEPHYR_INCLUDE_DRIVERS_GPIO_GPIO_SX1509B_H_ */
46