FTM internal counter can be clocked by one of three clock sources
independent of the module bus clock. This patch introduces a DT property
to perform the clock selection from DT.
DT sources are updated to keep the current clock selection for all boards,
with exception of ucans32k1sic board which is migrated to use system
clock by default, as this seems to be a better choice for most cases.
Some PWM LED samples require slower clock so overlays are added for
those cases.
Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
In this board, there are eight PWM channels from
EMIOS 0 CH0 --> EMIOS 0 CH7 that can be used to
generate PWM pulse to outside of the board.
Moreover, there are three RGB leds that can use
PWM pins for blinking, faded leds
Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
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>
Adds REQUIRED to samples and tests for finding the zephyr package
to align all samples and tests with the same call and parameters.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Add the overlay file to run the samples/drivers/led_pwm
on the nucelo_u575zi_q board.
Two green leds are used on pc7 and pb7 corresponding to pwm
channels of timers3 and timers4.
The leds node has to be disabled to let the pin for the pwm nodes.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Add the overlay file to run the samples/drivers/led_pwm
on the disco_l475_iot1 board. Two green leds are used on pa5 and pb14
corresponding on 2 pwm channels of timers2 and timers15.
The leds node has to be disabled to let the pin for the pwm nodes.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Configure the overlay file to run the samples/drivers/led_pwm
on the nucleo_l073rz and nucleo_f091rc board.
The green led is used on pa5 for pwm channels of timers2 channel
The leds node has to be disabled to let the pin for the pwm nodes.
The spi1 is disabled in that sample to avoid conflict on pa5 pin.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
led0 and pwm_led0 are both referring to the same LED. The usage is
mutualy exclusive, as only one pin muxing can be applied.
Disabling child nodes is currently neither supported by gpio-leds device
nor by pwm-leds device. We need to disable either of the devices
completely for correct operation.
Please note that even if disabling of child nodes would be supported, the
devices would be empty anyway, as both have only one singe LED defined at
the moment. Therefore we can completely disable one of the devices in any
case.
Fixes: b876ad9d6f ("boards: arm: rpi_pico: add pwm bindings to
devictree")
Signed-off-by: Oliver Barta <o.barta89@gmail.com>
The fractional part of the divider value is a 4 bit value.
Fixes: 91f659d70a ("samples: led_pwm: add overlay for rpi_pico board")
Signed-off-by: Oliver Barta <o.barta89@gmail.com>
The default deferred logging mode is not appropriate here. The LOG_INF
messages "Turned on", "Turned off", ... indicate the current state and
should be printed immediately to keep log output in sync with actual
LED state.
Signed-off-by: Oliver Barta <o.barta89@gmail.com>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.
The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.
NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Having the LED device enabled in devicetree will now get the driver
enabled by default when CONFIG_LED=y is set. So we can remove
setting driver enabling Kconfig values in various .conf files.
Signed-off-by: Kumar Gala <galak@kernel.org>
Add an overlay for rpi_pico board to the led_pwm sample.
This board only supports fairly high pwm frequencies so
the blinking of the LED is not supported. Turning it on/off
and fading is.
Signed-off-by: Joep Buruma <burumaj50@gmail.com>
This commit moves the hardware configuration for ledc
peripheral to the device-tree instead of Kconfig.
Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
On the stm32l073rz nucleo and stm32f091rc nucleo
boards, the DTS pwm-leds node is disabled, because
the output pin might conflict with SPI1.
It is necessary to enable the node in the overlay
to compile and run the sample.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
In order to bring consistency in-tree, migrate all samples to the use
the new prefix <zephyr/...>. Note that the conversion has been scripted:
```python
from pathlib import Path
import re
EXTENSIONS = ("c", "h", "cpp", "rst")
for p in Path(".").glob("samples/**/*"):
if not p.is_file() or p.suffix and p.suffix[1:] not in EXTENSIONS:
continue
content = ""
with open(p) as f:
for line in f:
m = re.match(r"^(.*)#include <(.*)>(.*)$", line)
if (m and
not m.group(2).startswith("zephyr/") and
(Path(".") / "include" / "zephyr" / m.group(2)).exists()):
content += (
m.group(1) +
"#include <zephyr/" + m.group(2) +">" +
m.group(3) + "\n"
)
else:
content += line
with open(p, "w") as f:
f.write(content)
```
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The overlay are defined to run the samples application with PWM
feature on the nucleo_l073rz,nucleo_f091rc, nucleo_g474re
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Move to CMake 3.20.0.
At the Toolchain WG it was decided to move to CMake 3.20.0.
The main reason for increasing CMake version is better toolchain
support.
Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The PR fixes the pwm_led sample:
- now test doesn't rely on any specific device name
- Logs which are scanned with regex in the test are printed
only after a command passes (before failures were not
affecting the test verdict)
- If 1 sec cycle is not supported appropriate info is printed
and won't cause the test to failed
- Changed second "Turned off" msg so regex doesn't mix it with the
the first one.
Fixes#35524
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
If the label property is missing in a "pwm-leds" compatible DT node
(which is almost always the case), then the device name is now set to
DT_NODE_FULL_NAME instead of "LED_PWM_$inst" previously.
This allows applications to use the DEVICE_DT_NAME macro to retrieve
the device name instead of gessing an arbitrary string.
Signed-off-by: Simon Guinot <simon.guinot@seagate.com>
Modify led_pwm sample in order to make it usable in device testing:
- Remove parenthesis from the logs as they prevent use of regex
- Add a harness_config multiline regex in order to enable verdict
generation
- Update README
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
The sanity check on this sample gives timeout failure
on reel board because of bad filtering. Because the
sample does not adopt ztest framework, sanitycheck in
our daily test will report this as failure, which lowers
our passrate but this is not a sample with errors.
Signed-off-by: Shihao Shen <shihao.shen@intel.com>
This sample allows to test the led-pwm driver. The first "pwm-leds"
compatible device instance found in DT is used. For each LEDs attached
to this device (child nodes) the same test pattern (described below) is
executed. The LED API functions are used to control the LEDs.
Test pattern:
For each PWM LEDs (one after the other):
- turn on
- turn off
- increase the brightness gradually up to the maximum level
- blink (0.1 sec on, 0.1 sec off)
- blink (1 sec on, 1 sec off)
- turn off
Signed-off-by: Simon Guinot <simon.guinot@seagate.com>