README.rst
1.. zephyr:code-sample:: lp50xx
2 :name: LP50XX RGB LED
3 :relevant-api: led_interface
4
5 Control up to 12 RGB LEDs connected to an LP50xx driver chip.
6
7Overview
8********
9
10This sample controls up to 12 LEDs connected to a LP50xx driver.
11
12First, for each LED information is retrieved using the led_get_info syscall
13and printed in the log messages. Next, from an infinite loop, a test pattern
14(described below) is applied to all the LEDs simultaneously (using the
15:c:func:`led_write_channels` syscall) and then to each LED one by one (using the
16:c:func:`led_set_brightness` and :c:func:`led_set_color` syscalls).
17
18Test pattern
19============
20
21For all the LEDs first (using channel API) and then for each LED one by one:
22
23For each color in red green blue white yellow purple cyan orange:
24
25- set the color
26- turn on
27- turn off
28- set the brightness gradually to the maximum level
29- turn off
30
31Building and Running
32********************
33
34This sample can be built and executed on boards with an I2C LP5009, LP5012,
35LP5018, LP5024, LP5030 or LP5036 LED driver connected. A node matching the
36the device type binding should be defined in the board DTS files.
37
38As an example this sample provides a DTS overlay for the :zephyr:board:`lpcxpresso11u68`
39board (:file:`boards/lpcxpresso11u68.overlay`). It assumes that a I2C LP5030
40LED driver (with 10 LEDs wired) is connected to the I2C0 bus at address 0x30.
41
42References
43**********
44
45- LP5009/LP5012: https://www.ti.com/lit/ds/symlink/lp5012.pdf
46- LP5018/LP5024: https://www.ti.com/lit/ds/symlink/lp5024.pdf
47- LP5030/LP5036: https://www.ti.com/lit/ds/symlink/lp5036.pdf
48