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 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 /**
18  * @brief Configure a pin for LED intensity.
19  *
20  * Configure a pin to be controlled by SX1509B LED driver using
21  * the LED intensity functionality.
22  * To get back normal GPIO functionality, configure the pin using
23  * the standard GPIO API.
24  *
25  * @param dev Pointer to the device structure for the driver instance.
26  * @param pin Pin number.
27  *
28  * @retval 0 If successful.
29  * @retval -EWOULDBLOCK if function is called from an ISR.
30  * @retval -ERANGE if pin number is out of range.
31  * @retval -EIO if I2C fails.
32  */
33 int sx1509b_led_intensity_pin_configure(const struct device *dev,
34 					gpio_pin_t pin);
35 
36 /**
37  * @brief Set LED intensity of selected pin.
38  *
39  * @param dev Pointer to the device structure for the driver instance.
40  * @param pin Pin number.
41  * @param intensity_val Intensity value.
42  *
43  * @retval 0 If successful.
44  * @retval -EIO if I2C fails.
45  */
46 int sx1509b_led_intensity_pin_set(const struct device *dev, gpio_pin_t pin,
47 				  uint8_t intensity_val);
48 
49 #ifdef __cplusplus
50 }
51 #endif
52 
53 #endif /* ZEPHYR_INCLUDE_DRIVERS_GPIO_GPIO_SX1509B_H_ */
54