Line data Source code
1 1 : /*
2 : * Copyright (c) 2020 Nordic Semiconductor ASA
3 : *
4 : * SPDX-License-Identifier: Apache-2.0
5 : */
6 :
7 : /**
8 : * @file
9 : * @brief Header file for SX1509B GPIO driver
10 : * @ingroup gpio_sx1509b_interface
11 : */
12 :
13 : #ifndef ZEPHYR_INCLUDE_DRIVERS_GPIO_GPIO_SX1509B_H_
14 : #define ZEPHYR_INCLUDE_DRIVERS_GPIO_GPIO_SX1509B_H_
15 :
16 : /**
17 : * @defgroup gpio_sx1509b_interface SX1509B
18 : * @ingroup gpio_interface_ext
19 : * @brief Semtech SX1509B low-voltage level-shifting GPIO controller
20 : * @{
21 : */
22 :
23 : #include <zephyr/device.h>
24 : #include <zephyr/drivers/gpio.h>
25 :
26 : #ifdef __cplusplus
27 : extern "C" {
28 : #endif
29 :
30 : /**
31 : * @brief Configure a pin for LED intensity.
32 : *
33 : * Configure a pin to be controlled by SX1509B LED driver using
34 : * the LED intensity functionality.
35 : * To get back normal GPIO functionality, configure the pin using
36 : * the standard GPIO API.
37 : *
38 : * @param dev Pointer to the device structure for the driver instance.
39 : * @param pin Pin number.
40 : *
41 : * @retval 0 If successful.
42 : * @retval -EWOULDBLOCK if function is called from an ISR.
43 : * @retval -ERANGE if pin number is out of range.
44 : * @retval -EIO if I2C fails.
45 : */
46 1 : int sx1509b_led_intensity_pin_configure(const struct device *dev,
47 : gpio_pin_t pin);
48 :
49 : /**
50 : * @brief Set LED intensity of selected pin.
51 : *
52 : * @param dev Pointer to the device structure for the driver instance.
53 : * @param pin Pin number.
54 : * @param intensity_val Intensity value.
55 : *
56 : * @retval 0 If successful.
57 : * @retval -EIO if I2C fails.
58 : */
59 1 : int sx1509b_led_intensity_pin_set(const struct device *dev, gpio_pin_t pin,
60 : uint8_t intensity_val);
61 :
62 : #ifdef __cplusplus
63 : }
64 : #endif
65 :
66 : /**
67 : * @}
68 : */
69 :
70 : #endif /* ZEPHYR_INCLUDE_DRIVERS_GPIO_GPIO_SX1509B_H_ */
|