Restructured counter and timer.
CTimer/Timer is now parent to pwm and counter.
Created PWM driver and tied to pwm and pwm-led
Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
The allocated_bytes were missing the allocation metadata. Because of that
the sum of free_bytes and allocated_bytes doesn't remain constant after
each allocation. This convention doesn't match glibc's behavior. This
commit changes the chunksz_to_bytes function to include the metadata in the
calculation. The analysis of the mallinfo2 function from glibc has been
done in #92392 Pull Request.
Signed-off-by: Krzysztof Sychla <ksychla@antmicro.com>
Fixed a bug where that was caused because the different LEDs use the
same 'dir' variable and that caused them to eventually lose
synchronization.
Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
The lp_mspm0g3507 has a red LED that can be driven by GPIO or PWM TIMA0
CH0, set maximum prescale and divider to arrive lower timer clock from
clock source. Add to the samples.
Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
Set the status of the pwm_leds node in the Raspberry Pi Pico
overlay to "okay". Without this change, the serial output shows
"PWM-based LED fade. Found 0 LEDs" and the led doesn't light up
on the Pico.
Signed-off-by: Saifan Rafiq <saifanr@gmail.com>
The WCH CH32V006EVT is an evaluation board for the RISC-V based
CH32V006K8U6 SOC.
The board is equipped with a power LED, reset button, USB port for
power, and two user LEDs.
Add the board definition, documentation, and sample overlay.
Signed-off-by: Michael Hope <michaelh@juju.nz>
Improve naming of the scheduler and call it what it is: simple. Using
'dumb' for the default scheduler algorithm in Zephyr is a bad idea.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Some boards may define LEDs but disable them by default due to conflicts
with other peripherals. In this case, the new sample code introduced in
a5fd92b ("samples: fade_led: use all available LEDs") fails to build
with a missing symbol error.
Fix this by checking if the PWM device (the parent of the LED alias) is
enabled before using it. This implicitly discards invalid aliases.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
To request heap statistics, a pointer to a heap structure is required.
This is straightforward for a user-defined heap. However, such a pointer
is not known for heaps created by other components or libraries, like
libc. Therefore, it is not possible to calculate the total heap memory.
The proposed solution is to use an array of pointers, which is filled in
on every sys_heap_init() call. One can then iterate through it to sum up
the total memory allocated for all heaps.
The array size is configurable. The default array size is zero,
which means the feature is disabled. Any other integer greater then zero
defines the array size and enables the feature.
A list of pointers instead of an array could be another approach,
but it requeres a heap, which is not always available.
Signed-off-by: Ivan Pankratov <ivan.pankratov@silabs.com>
Add Devicetree overlay for sample drivers/led/pwm and fix the one in
basic/blinky_pwm for nucleo_l4r5zi board to set appropriate to enable
pwdleds and set appropriate timer prescaler.
Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
This updates the documentation of all the STM32 boards to use
the new `zephyr:board::` directive.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This updates the documentation of all the Espressif boards to use
the new `zephyr:board::` directive.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This updates the documentation of all the BBC boards to use
the new `zephyr:board::` directive.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This commit uses the new .. zephyr:code-sample-category directive to
categorize code samples across the tree.
Updates existing legacy references to manually defined targets to now
use :zephyr:code-sample-category: role instead.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Add Devicetree overlay for samples basic/blinky_pwm and drivers/led/pwm
for frdm_mcxc242 board to set appropriate tpm clock source and
to enable pwmleds.
Signed-off-by: Michal Smola <michal.smola@nxp.com>
The button sample is really a gpio interrupt sample, one may easily miss
the debounced driver and think it's not provided.
Add a note in the basic button sample documentation to refer to the
input subsystem doc and sample.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
`checkpatch.pl` requires that dts sources are indented with tabs,
fix all the spaces that slipped in while checkpatch wasn't watching.
Signed-off-by: Jordan Yates <jordan@embeint.com>
There are several esp32-based boards that its conf and overlay
files are missing proper renaming to match cpu cluster.
This also removes all _SOC_ name from files.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
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>
Adjustments of overlay and conf files to adjust for the MERGE removal.
The revert of MERGE requires specific overlay and conf files for boards
which relied on the MERGE feature.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>