mirror of
https://github.com/Dasharo/zephyr.git
synced 2026-03-06 14:57:20 -08:00
As both C and C++ standards require applications running under an OS to
return 'int', adapt that for Zephyr to align with those standard. This also
eliminates errors when building with clang when not using -ffreestanding,
and reduces the need for compiler flags to silence warnings for both clang
and gcc.
Most of these changes were automated using coccinelle with the following
script:
@@
@@
- void
+ int
main(...) {
...
- return;
+ return 0;
...
}
Approximately 40 files had to be edited by hand as coccinelle was unable to
fix them.
Signed-off-by: Keith Packard <keithp@keithp.com>
.. _lp503x:
LP5030/6: 10 or 12 RGB channels
###############################
Overview
********
This sample controls up to 12 LEDs connected to a LP503x driver.
First, for each LED information is retrieved using the led_get_info syscall
and printed in the log messages. Next, from an infinite loop, a test pattern
(described below) is applied to all the LEDs simultaneously (using the
led_write_channels syscall) and then to each LED one by one (using the
led_set_{brightness,color} syscalls).
Test pattern
============
For all the LEDs first (using channel API) and then for each LED one by one:
For each color in red green blue white yellow purple cyan orange:
- set the color
- turn on
- turn off
- set the brightness gradually to the maximum level
- turn off
Building and Running
********************
This sample can be built and executed on boards with an I2C LP5030/6 LED driver
connected. A node matching the "ti,lp503x" binding should be defined in the
board DTS files.
As an example this sample provides a DTS overlay for the :ref:`lpcxpresso11u68`
board (:file:`boards/lpcxpresso11u68.overlay`). It assumes that a I2C LP5030
LED driver (with 10 LEDs wired) is connected to the I2C0 bus at address 0x30.
References
**********
- LP503x: https://www.ti.com/lit/ds/symlink/lp5036.pdf