Removes legacy RMT, adds brightness + RGBW support#6
Open
harmon25 wants to merge 5 commits intoatomvm:masterfrom
Open
Removes legacy RMT, adds brightness + RGBW support#6harmon25 wants to merge 5 commits intoatomvm:masterfrom
harmon25 wants to merge 5 commits intoatomvm:masterfrom
Conversation
* Refactor RMT handling for ESP-IDF version compatibility and update LED strip driver initialization * Update header includes to use esp_idf_version.h for SDK version compatibility * Ensure esp_idf_version.h is included first in relevant source files for proper SDK version compatibility * Refactor LED strip driver for ESP-IDF 5.x compatibility by removing legacy RMT API code and simplifying initialization * Fix memory allocation for WS2812 LED strip by ensuring proper variable declaration
* Add brightness control functions for NeoPixel strip * Refactor brightness handling in ws2812 LED strip driver
* Add RGBW support for NeoPixel LED strips - Introduced `set_pixel_rgbw` function to handle RGBW pixel settings. - Updated NIF initialization to accept LED type (RGB/RGBW). - Enhanced LED strip configuration to include LED type. - Modified existing functions to accommodate RGBW data handling. * Refactor options type to support maps and proplists; add options normalization * log changes * Remove unnecessary logging for LED type and strip initialization in RGBW support * Enhance NeoPixel library documentation and add HSVW pixel control for SK6812 support
* Add fill and set pixel functions for RGB and RGBW strips - Implemented `fill_rgb/4` and `fill_rgbw/5` functions to fill the entire strip with a single color. - Added `set_pixels_rgb/2`, `set_pixels_rgb/3`, `set_pixels_rgbw/2`, and `set_pixels_rgbw/3` functions to set multiple pixels from a list of colors. - Updated the NIF layer to support new functionalities and ensure proper error handling. - Enhanced documentation for new functions and usage examples in the markdown files. * Add HSV and HSVW fill functions for NeoPixel strips
* Refactor to use ESP-IDF led_strip component - Replace custom RMT driver with ESP-IDF led_strip component - Add idf_component.yml with espressif/led_strip dependency - Rename types to avm_led_strip_* to avoid conflicts - New led_strip_driver.c wrapper supports: - RMT with DMA on ESP32-S3/C6 - RMT without DMA on ESP32/C3 - SPI backend fallback for reliable DMA on all chips - Remove old led_strip_rmt_ws2812.c and led_strip.h * Update led_strip dependency to ^3.0.2 * Fix led_strip v3.x API: use color_component_format instead of led_pixel_format * Improve backend selection for better WiFi coexistence - Prefer SPI backend on original ESP32 (best WiFi coexistence) - Add Kconfig options to force backend selection (Auto/SPI/RMT) - Cleaner fallback logic with informative log messages - ESP32-S3/C6/P4 still prefer RMT with DMA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds support for SK6812 RGBW LED strips to the AtomVM NeoPixel library, in addition to the existing WS2812 RGB LED support. The documentation has been extensively updated to describe the new features, color spaces, and API options for both RGB and RGBW strips. The native C code has been refactored to support the new LED type and to simplify the initialization and error handling logic, making the library compatible with ESP-IDF 5.x.
Feature additions and documentation updates:
README.mdandmarkdown/neopixel.mdto reflect these changes and document the new features and usage examples. [1] [2] [3] [4] [5] [6]set_brightness/2andget_brightness/1, with details on how brightness scaling works efficiently.API and codebase changes:
nifs/atomvm_neopixel.cto support the new RGBW LED type, including handling for theled_typeargument and removal of legacy RMT channel logic. Initialization now uses the new configuration structure compatible with ESP-IDF 5.x. [1] [2] [3] [4]