From e98deea633c99817a010c7b479065bf841396a21 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Wed, 9 Jun 2021 20:23:59 +0200 Subject: [PATCH] Neopixel C3 Latest NeoPixel (09062021) branch master --- .../NeoPixelBus-2.6.1.4/library.json | 19 - .../NeoPixelBus-2.6.1.4/library.properties | 9 - .../.gitattributes | 0 .../.github/FUNDING.yml | 0 .../.github/ISSUE_TEMPLATE/all-others.md | 0 .../.github/ISSUE_TEMPLATE/bug_report.md | 0 .../.github/ISSUE_TEMPLATE/feature_request.md | 0 .../.gitignore | 0 .../COPYING | 0 .../ReadMe.md | 2 +- .../examples/DotStarTest/DotStarTest.ino | 0 .../DotStarTest_Esp32Advanced.ino | 159 ++++++++ .../DotStarTest_Esp32DmaSpi.ino | 148 ++++++++ .../NeoPixelBrightness/NeoPixelBrightness.ino | 0 .../examples/NeoPixelGamma/NeoPixelGamma.ino | 0 .../examples/NeoPixelTest/NeoPixelTest.ino | 0 .../NeoPixelAnimation/NeoPixelAnimation.ino | 0 .../NeoPixelCylon/NeoPixelCylon.ino | 0 .../NeoPixelFunFadeInOut.ino | 0 .../NeoPixelFunLoop/NeoPixelFunLoop.ino | 0 .../NeoPixelFunRandomChange.ino | 0 .../NeoPixelRotateLoop/NeoPixelRotateLoop.ino | 0 .../bitmaps/NeoPixelBitmap/NeoPixelBitmap.ino | 0 .../bitmaps/NeoPixelBitmap/Strings.bmp | Bin .../bitmaps/NeoPixelBitmap/StringsW.bmp | Bin .../bitmaps/NeoPixelBufferCylon/Cylon.pdn | Bin .../bitmaps/NeoPixelBufferCylon/CylonGrb.h | 0 .../bitmaps/NeoPixelBufferCylon/CylonGrbw.h | 0 .../NeoPixelBufferCylon.ino | 0 .../NeoPixelBufferShader.ino | 0 .../NeoPixelDibTest/NeoPixelDibTest.ino | 0 .../NeoSegmentBus/NeoSegmentBus.ino | 2 +- .../NeoSegmentFade/NeoSegmentFade.ino | 4 +- .../NeoPixelMosaicDump/NeoPixelMosaicDump.ino | 0 .../NeoPixelMosaicTest/NeoPixelMosaicTest.ino | 0 .../NeoPixelRingTopologyTest.ino | 0 .../NeoPixelTilesDump/NeoPixelTilesDump.ino | 0 .../NeoPixelTilesTest/NeoPixelTilesTest.ino | 0 .../NeoPixelTopologyDump.ino | 0 .../NeoPixelTopologyTest.ino | 0 .../extras/curves/circular.png | Bin .../extras/curves/cubic.png | Bin .../extras/curves/different.png | Bin .../extras/curves/exponential.png | Bin .../extras/curves/gamma.png | Bin .../extras/curves/pronounced.png | Bin .../extras/curves/quadratic.png | Bin .../extras/curves/quintic.png | Bin .../extras/curves/sinusoidal.png | Bin .../keywords.txt | 67 ++++ lib/lib_basic/NeoPixelBus/library.json | 19 + lib/lib_basic/NeoPixelBus/library.properties | 9 + .../src/NeoPixelAnimator.h | 0 .../src/NeoPixelBrightnessBus.h | 2 +- .../src/NeoPixelBus.h | 16 +- .../src/NeoPixelSegmentBus.h | 0 .../src/internal/DotStarColorFeatures.h | 0 .../src/internal/DotStarEsp32DmaSpiMethod.h | 356 ++++++++++++++++++ .../src/internal/DotStarGenericMethod.h | 32 ++ .../src/internal/Esp32_i2s.c | 35 +- .../src/internal/Esp32_i2s.h | 3 +- .../src/internal/HsbColor.cpp | 0 .../src/internal/HsbColor.h | 0 .../src/internal/HslColor.cpp | 0 .../src/internal/HslColor.h | 0 .../src/internal/HtmlColor.cpp | 0 .../src/internal/HtmlColor.h | 2 +- .../src/internal/HtmlColorNameStrings.cpp | 0 .../src/internal/HtmlColorNameStrings.h | 0 .../src/internal/HtmlColorNames.cpp | 0 .../src/internal/HtmlColorShortNames.cpp | 0 .../src/internal/Layouts.h | 0 .../src/internal/Lpd6803ColorFeatures.h | 0 .../src/internal/Lpd6803GenericMethod.h | 11 + .../src/internal/Lpd8806ColorFeatures.h | 0 .../src/internal/Lpd8806GenericMethod.h | 11 + .../src/internal/NeoArmMethod.h | 56 ++- .../src/internal/NeoAvrMethod.h | 14 + .../src/internal/NeoBitmapFile.h | 8 +- .../src/internal/NeoBuffer.h | 4 +- .../src/internal/NeoBufferContext.h | 0 .../src/internal/NeoBufferMethods.h | 0 .../src/internal/NeoBusChannel.h | 5 +- .../src/internal/NeoColorFeatures.h | 0 .../src/internal/NeoDib.h | 0 .../src/internal/NeoEase.h | 0 .../src/internal/NeoEsp32I2sMethod.h | 42 ++- .../src/internal/NeoEsp32RmtMethod.cpp | 24 ++ .../src/internal/NeoEsp32RmtMethod.h | 134 ++++++- .../src/internal/NeoEsp8266DmaMethod.h | 44 ++- .../src/internal/NeoEsp8266UartMethod.cpp | 7 +- .../src/internal/NeoEsp8266UartMethod.h | 30 +- .../src/internal/NeoEspBitBangMethod.cpp | 93 +++-- .../src/internal/NeoEspBitBangMethod.h | 35 +- .../src/internal/NeoGamma.cpp | 0 .../src/internal/NeoGamma.h | 0 .../src/internal/NeoHueBlend.h | 0 .../src/internal/NeoMosaic.h | 0 .../src/internal/NeoNrf52xMethod.h | 82 ++++ .../src/internal/NeoPixelAnimator.cpp | 0 .../src/internal/NeoPixelAvr.c | 0 .../src/internal/NeoRingTopology.h | 0 .../src/internal/NeoSegmentFeatures.h | 92 ++++- .../src/internal/NeoSettings.h | 0 .../src/internal/NeoSpriteSheet.h | 4 +- .../src/internal/NeoTiles.h | 0 .../src/internal/NeoTm1814ColorFeatures.h | 0 .../src/internal/NeoTopology.h | 0 .../src/internal/P9813ColorFeatures.h | 0 .../src/internal/P9813GenericMethod.h | 10 + .../src/internal/Rgb16Color.h | 35 +- .../src/internal/Rgb48Color.cpp | 14 +- .../src/internal/Rgb48Color.h | 0 .../src/internal/RgbColor.cpp | 14 +- .../src/internal/RgbColor.h | 0 .../src/internal/RgbColorBase.cpp | 0 .../src/internal/RgbColorBase.h | 0 .../src/internal/RgbwColor.cpp | 2 +- .../src/internal/RgbwColor.h | 0 .../src/internal/SegmentDigit.cpp | 24 +- .../src/internal/SegmentDigit.h | 85 ++++- .../src/internal/TwoWireBitBangImple.h | 6 + .../src/internal/TwoWireBitBangImpleAvr.h | 6 + .../src/internal/TwoWireHspiImple.h | 92 +++++ .../src/internal/TwoWireSpiImple.h | 80 +++- .../src/internal/Ws2801GenericMethod.h | 11 + .../OneWire.cpp | 2 +- platformio_tasmota_cenv_sample.ini | 45 ++- tasmota/xsns_05_ds18x20_esp32.ino | 3 +- 129 files changed, 1804 insertions(+), 205 deletions(-) delete mode 100644 lib/lib_basic/NeoPixelBus-2.6.1.4/library.json delete mode 100644 lib/lib_basic/NeoPixelBus-2.6.1.4/library.properties rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/.gitattributes (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/.github/FUNDING.yml (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/.github/ISSUE_TEMPLATE/all-others.md (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/.github/ISSUE_TEMPLATE/bug_report.md (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/.github/ISSUE_TEMPLATE/feature_request.md (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/.gitignore (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/COPYING (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/ReadMe.md (96%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/DotStarTest/DotStarTest.ino (100%) create mode 100644 lib/lib_basic/NeoPixelBus/examples/ESP32/DotStarTest_Esp32Advanced/DotStarTest_Esp32Advanced.ino create mode 100644 lib/lib_basic/NeoPixelBus/examples/ESP32/DotStarTest_Esp32DmaSpi/DotStarTest_Esp32DmaSpi.ino rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/NeoPixelBrightness/NeoPixelBrightness.ino (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/NeoPixelGamma/NeoPixelGamma.ino (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/NeoPixelTest/NeoPixelTest.ino (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/animations/NeoPixelAnimation/NeoPixelAnimation.ino (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/animations/NeoPixelCylon/NeoPixelCylon.ino (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/animations/NeoPixelFunFadeInOut/NeoPixelFunFadeInOut.ino (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/animations/NeoPixelFunLoop/NeoPixelFunLoop.ino (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/animations/NeoPixelFunRandomChange/NeoPixelFunRandomChange.ino (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/animations/NeoPixelRotateLoop/NeoPixelRotateLoop.ino (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/bitmaps/NeoPixelBitmap/NeoPixelBitmap.ino (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/bitmaps/NeoPixelBitmap/Strings.bmp (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/bitmaps/NeoPixelBitmap/StringsW.bmp (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/bitmaps/NeoPixelBufferCylon/Cylon.pdn (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/bitmaps/NeoPixelBufferCylon/CylonGrb.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/bitmaps/NeoPixelBufferCylon/CylonGrbw.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/bitmaps/NeoPixelBufferCylon/NeoPixelBufferCylon.ino (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/bitmaps/NeoPixelBufferShader/NeoPixelBufferShader.ino (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/bitmaps/NeoPixelDibTest/NeoPixelDibTest.ino (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/sevensegment/NeoSegmentBus/NeoSegmentBus.ino (93%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/sevensegment/NeoSegmentFade/NeoSegmentFade.ino (95%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/topologies/NeoPixelMosaicDump/NeoPixelMosaicDump.ino (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/topologies/NeoPixelMosaicTest/NeoPixelMosaicTest.ino (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/topologies/NeoPixelRingTopologyTest/NeoPixelRingTopologyTest.ino (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/topologies/NeoPixelTilesDump/NeoPixelTilesDump.ino (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/topologies/NeoPixelTilesTest/NeoPixelTilesTest.ino (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/topologies/NeoPixelTopologyDump/NeoPixelTopologyDump.ino (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/examples/topologies/NeoPixelTopologyTest/NeoPixelTopologyTest.ino (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/extras/curves/circular.png (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/extras/curves/cubic.png (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/extras/curves/different.png (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/extras/curves/exponential.png (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/extras/curves/gamma.png (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/extras/curves/pronounced.png (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/extras/curves/quadratic.png (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/extras/curves/quintic.png (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/extras/curves/sinusoidal.png (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/keywords.txt (89%) create mode 100644 lib/lib_basic/NeoPixelBus/library.json create mode 100644 lib/lib_basic/NeoPixelBus/library.properties rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/NeoPixelAnimator.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/NeoPixelBrightnessBus.h (97%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/NeoPixelBus.h (95%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/NeoPixelSegmentBus.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/DotStarColorFeatures.h (100%) create mode 100644 lib/lib_basic/NeoPixelBus/src/internal/DotStarEsp32DmaSpiMethod.h rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/DotStarGenericMethod.h (68%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/Esp32_i2s.c (92%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/Esp32_i2s.h (87%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/HsbColor.cpp (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/HsbColor.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/HslColor.cpp (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/HslColor.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/HtmlColor.cpp (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/HtmlColor.h (99%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/HtmlColorNameStrings.cpp (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/HtmlColorNameStrings.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/HtmlColorNames.cpp (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/HtmlColorShortNames.cpp (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/Layouts.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/Lpd6803ColorFeatures.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/Lpd6803GenericMethod.h (92%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/Lpd8806ColorFeatures.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/Lpd8806GenericMethod.h (92%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoArmMethod.h (92%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoAvrMethod.h (95%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoBitmapFile.h (97%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoBuffer.h (98%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoBufferContext.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoBufferMethods.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoBusChannel.h (85%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoColorFeatures.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoDib.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoEase.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoEsp32I2sMethod.h (88%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoEsp32RmtMethod.cpp (92%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoEsp32RmtMethod.h (81%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoEsp8266DmaMethod.h (92%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoEsp8266UartMethod.cpp (96%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoEsp8266UartMethod.h (92%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoEspBitBangMethod.cpp (57%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoEspBitBangMethod.h (93%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoGamma.cpp (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoGamma.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoHueBlend.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoMosaic.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoNrf52xMethod.h (83%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoPixelAnimator.cpp (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoPixelAvr.c (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoRingTopology.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoSegmentFeatures.h (61%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoSettings.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoSpriteSheet.h (97%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoTiles.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoTm1814ColorFeatures.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/NeoTopology.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/P9813ColorFeatures.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/P9813GenericMethod.h (92%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/Rgb16Color.h (91%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/Rgb48Color.cpp (90%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/Rgb48Color.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/RgbColor.cpp (91%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/RgbColor.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/RgbColorBase.cpp (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/RgbColorBase.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/RgbwColor.cpp (97%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/RgbwColor.h (100%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/SegmentDigit.cpp (86%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/SegmentDigit.h (74%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/TwoWireBitBangImple.h (95%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/TwoWireBitBangImpleAvr.h (96%) create mode 100644 lib/lib_basic/NeoPixelBus/src/internal/TwoWireHspiImple.h rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/TwoWireSpiImple.h (63%) rename lib/lib_basic/{NeoPixelBus-2.6.1.4 => NeoPixelBus}/src/internal/Ws2801GenericMethod.h (92%) diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/library.json b/lib/lib_basic/NeoPixelBus-2.6.1.4/library.json deleted file mode 100644 index 6fa9a6e6f..000000000 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/library.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "NeoPixelBus", - "keywords": "NeoPixel, WS2811, WS2812, WS2813, SK6812, DotStar, APA102, SK9822, APA106, LPD8806, P9813, WS2801 RGB, RGBW", - "description": "A library that makes controlling NeoPixels (APA106, WS2811, WS2812, WS2813 & SK6812) and DotStars (APA102, LPD8806, SK9822, WS2801, P9813) easy. Supports most Arduino platforms, including async hardware support for Esp8266, Esp32, and Nrf52 (Nano 33 BLE). Support for RGBW pixels. Includes seperate RgbColor, RgbwColor, HslColor, and HsbColor objects. Includes an animator class that helps create asyncronous animations. For Esp8266 it has three methods of sending NeoPixel data, DMA, UART, and Bit Bang. For Esp32 it has two base methods of sending NeoPixel data, i2s and RMT. For all platforms, there are two methods of sending DotStar data, hardware SPI and software SPI.", - "homepage": "https://github.com/Makuna/NeoPixelBus/wiki", - "repository": { - "type": "git", - "url": "https://github.com/Makuna/NeoPixelBus" - }, - "version": "2.6.1", - "frameworks": "arduino", - "platforms": "*", - "dependencies": [ - { - "name": "SPI" - } - ] -} - diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/library.properties b/lib/lib_basic/NeoPixelBus-2.6.1.4/library.properties deleted file mode 100644 index df7a60866..000000000 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=NeoPixelBus by Makuna -version=2.6.1 -author=Michael C. Miller (makuna@live.com) -maintainer=Michael C. Miller (makuna@live.com) -sentence=A library that makes controlling NeoPixels (APA106, WS2811, WS2812, WS2813 & SK6812) and DotStars (APA102, LPD8806, SK9822, WS2801, P9813) easy. -paragraph=Supports most Arduino platforms, including async hardware support for Esp8266, Esp32, and Nrf52 (Nano 33 BLE). Support for RGBW pixels. Includes seperate RgbColor, RgbwColor, HslColor, and HsbColor objects. Includes an animator class that helps create asyncronous animations. Supports Matrix layout of pixels. Includes Gamma corretion object. For Esp8266 it has three methods of sending NeoPixel data, DMA, UART, and Bit Bang. For Esp32 it has two base methods of sending NeoPixel data, i2s and RMT. For all platforms, there are two methods of sending DotStar data, hardware SPI and software SPI. -category=Display -url=https://github.com/Makuna/NeoPixelBus/wiki -architectures=* \ No newline at end of file diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/.gitattributes b/lib/lib_basic/NeoPixelBus/.gitattributes similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/.gitattributes rename to lib/lib_basic/NeoPixelBus/.gitattributes diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/.github/FUNDING.yml b/lib/lib_basic/NeoPixelBus/.github/FUNDING.yml similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/.github/FUNDING.yml rename to lib/lib_basic/NeoPixelBus/.github/FUNDING.yml diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/.github/ISSUE_TEMPLATE/all-others.md b/lib/lib_basic/NeoPixelBus/.github/ISSUE_TEMPLATE/all-others.md similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/.github/ISSUE_TEMPLATE/all-others.md rename to lib/lib_basic/NeoPixelBus/.github/ISSUE_TEMPLATE/all-others.md diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/.github/ISSUE_TEMPLATE/bug_report.md b/lib/lib_basic/NeoPixelBus/.github/ISSUE_TEMPLATE/bug_report.md similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/.github/ISSUE_TEMPLATE/bug_report.md rename to lib/lib_basic/NeoPixelBus/.github/ISSUE_TEMPLATE/bug_report.md diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/.github/ISSUE_TEMPLATE/feature_request.md b/lib/lib_basic/NeoPixelBus/.github/ISSUE_TEMPLATE/feature_request.md similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/.github/ISSUE_TEMPLATE/feature_request.md rename to lib/lib_basic/NeoPixelBus/.github/ISSUE_TEMPLATE/feature_request.md diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/.gitignore b/lib/lib_basic/NeoPixelBus/.gitignore similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/.gitignore rename to lib/lib_basic/NeoPixelBus/.gitignore diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/COPYING b/lib/lib_basic/NeoPixelBus/COPYING similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/COPYING rename to lib/lib_basic/NeoPixelBus/COPYING diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/ReadMe.md b/lib/lib_basic/NeoPixelBus/ReadMe.md similarity index 96% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/ReadMe.md rename to lib/lib_basic/NeoPixelBus/ReadMe.md index ab8d6fd42..aa61e1ce6 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/ReadMe.md +++ b/lib/lib_basic/NeoPixelBus/ReadMe.md @@ -24,7 +24,7 @@ See [Why this Library in the Wiki](https://github.com/Makuna/NeoPixelBus/wiki/Li ## Documentation [See Wiki](https://github.com/Makuna/NeoPixelBus/wiki) -## Installing This Library (prefered, you just want to use it) +## Installing This Library (preferred, you just want to use it) Open the Library Manager and search for "NeoPixelBus by Makuna" and install ## Installing This Library From GitHub (advanced, you want to contribute) diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/DotStarTest/DotStarTest.ino b/lib/lib_basic/NeoPixelBus/examples/DotStarTest/DotStarTest.ino similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/DotStarTest/DotStarTest.ino rename to lib/lib_basic/NeoPixelBus/examples/DotStarTest/DotStarTest.ino diff --git a/lib/lib_basic/NeoPixelBus/examples/ESP32/DotStarTest_Esp32Advanced/DotStarTest_Esp32Advanced.ino b/lib/lib_basic/NeoPixelBus/examples/ESP32/DotStarTest_Esp32Advanced/DotStarTest_Esp32Advanced.ino new file mode 100644 index 000000000..cd31da2b7 --- /dev/null +++ b/lib/lib_basic/NeoPixelBus/examples/ESP32/DotStarTest_Esp32Advanced/DotStarTest_Esp32Advanced.ino @@ -0,0 +1,159 @@ +// DotStarTest_Esp32Advanced - This example only works on the ESP32 +// This example will cycle between showing four pixels as Red, Green, Blue, White +// and then showing those pixels as Black. This example uses Hardware SPI on the ESP32 +// with options to use alternate pins for SPI and drive two SPI ports using the alternate +// additional SPI hardware available on the ESP32. +// +// There is serial output of the current state so you can confirm and follow along +// + +#include + +#define USE_DEFAULT_SPI_PORT 1 +#define USE_ALTERNATE_SPI_PORT 1 + +#if (USE_DEFAULT_SPI_PORT == 1) + const uint16_t PixelCount = 4; // this example assumes 4 pixels, making it smaller will cause a failure + + // It's usually better to use alternate pins. If set to false, strip will use GPIO 18 for Clock, GPIO 23 for Data, and pin 5 will output a chip select signal + const bool useSpiAlternatePins = true; + + // If you set useSpiAlternatePins true, then these pins will be used instead. Any output-capable GPIO can be used. + const uint8_t DotClockPin = 18; + const uint8_t DotDataPin = 23; + const int8_t DotChipSelectPin = -1; // -1 means the chip select signal won't be output, freeing up one pin compared to useSpiAlternatePins=false + + // for software bit bang (only use if neither SPI peripheral is available) + //NeoPixelBus strip(PixelCount, DotClockPin, DotDataPin); + + // for hardware SPI (best performance) with default SPI peripheral + NeoPixelBus strip(PixelCount); + + // DotStarSpiMethod defaults to 10MHz clock speed. For other speeds, replace "DotStarSpiMethod" with another method specifying speed, e.g. "DotStarSpi2MhzMethod" (see wiki for more details) + + // to change the SPI clock speed during runtime, use the "Hz" clock setting, e.g. DotStarSpiHzMethod, which default to 10MHz but supports updating during runtime + //NeoPixelBus strip(PixelCount); + //#define SET_CLOCK_SPEED_DURING_RUNTIME // only define if using "Hz" clock method + +#endif + +#if (USE_ALTERNATE_SPI_PORT == 1) + const uint16_t PixelCount2 = 4; // this example assumes 4 pixels, making it smaller will cause a failure + + // It's usually better to use alternate pins. If set to false, strip2 will use GPIO 14 for Clock, GPIO 13 for Data, and pin 15 will output a chip select signal + const bool useSpiAlternatePins2 = true; + + // If you set useSpiAlternatePins2 true, then these pins will be used instead. Any output-capable GPIO can be used. + const uint8_t DotClockPin2 = 14; + const uint8_t DotDataPin2 = 13; + const int8_t DotChipSelectPin2 = -1; // -1 means the chip select signal won't be output, freeing up one pin compared to useSpiAlternatePins2=false + + // for hardware SPI (best performance) with alternate SPI peripheral + NeoPixelBus strip2(PixelCount2); + + // DotStarHspiMethod defaults to 10MHz clock speed. For other speeds, replace "DotStarSpiMethod" with another method specifying speed, e.g. "DotStarHspi2MhzMethod" (see wiki for more details) +#endif + +#define colorSaturation 128 + +// Note that both DotStarSpiMethod and DotStarHspiMethod can be used with DotStarLbgrFeature and DotStarWbgrFeature but to keep things simple those are excluded from this example, see DotStarTest for more details + +RgbColor red(colorSaturation, 0, 0); +RgbColor green(0, colorSaturation, 0); +RgbColor blue(0, 0, colorSaturation); +RgbColor white(colorSaturation); +RgbColor black(0); + +void setup() +{ + Serial.begin(115200); + while (!Serial); // wait for serial attach + + Serial.println(); + Serial.println("Initializing..."); + Serial.flush(); + +#if (USE_DEFAULT_SPI_PORT == 1) + if (useSpiAlternatePins) + { + strip.Begin(DotClockPin, DotDataPin, DotDataPin, DotChipSelectPin); + } + else + { + strip.Begin(); + } + + strip.ClearTo(black); // this resets all the DotStars to an off state + strip.Show(); +#endif + +#if (USE_ALTERNATE_SPI_PORT == 1) + if (useSpiAlternatePins2) + { + strip2.Begin(DotClockPin2, DotDataPin2, DotDataPin2, DotChipSelectPin2); + } + else + { + strip2.Begin(); + } + + strip2.ClearTo(black); // this resets all the DotStars to an off state + strip2.Show(); +#endif + + Serial.println(); + Serial.println("Running..."); +} + + +void loop() +{ + delay(5000); + +#if (USE_DEFAULT_SPI_PORT == 1) + Serial.println("Default SPI Colors R, G, B, W..."); + // set the colors, + strip.SetPixelColor(0, red); + strip.SetPixelColor(1, green); + strip.SetPixelColor(2, blue); + strip.SetPixelColor(3, white); + strip.Show(); +#endif + +#if (USE_ALTERNATE_SPI_PORT == 1) + Serial.println("Alt SPI Colors W, B, G, R..."); + // set the colors, + strip2.SetPixelColor(0, white); + strip2.SetPixelColor(1, blue); + strip2.SetPixelColor(2, green); + strip2.SetPixelColor(3, red); + strip2.Show(); +#endif + + delay(5000); + + Serial.println("Off ..."); + +#if (USE_DEFAULT_SPI_PORT == 1) + #ifdef SET_CLOCK_SPEED_DURING_RUNTIME + uint32_t clockspeed = 5000000UL; + strip.SetMethodSettings(NeoSpiSettings(clockspeed)); + #endif + + // turn off the pixels + strip.SetPixelColor(0, black); + strip.SetPixelColor(1, black); + strip.SetPixelColor(2, black); + strip.SetPixelColor(3, black); + strip.Show(); +#endif + +#if (USE_ALTERNATE_SPI_PORT == 1) + // turn off the pixels + strip2.SetPixelColor(0, black); + strip2.SetPixelColor(1, black); + strip2.SetPixelColor(2, black); + strip2.SetPixelColor(3, black); + strip2.Show(); +#endif +} diff --git a/lib/lib_basic/NeoPixelBus/examples/ESP32/DotStarTest_Esp32DmaSpi/DotStarTest_Esp32DmaSpi.ino b/lib/lib_basic/NeoPixelBus/examples/ESP32/DotStarTest_Esp32DmaSpi/DotStarTest_Esp32DmaSpi.ino new file mode 100644 index 000000000..9805ac451 --- /dev/null +++ b/lib/lib_basic/NeoPixelBus/examples/ESP32/DotStarTest_Esp32DmaSpi/DotStarTest_Esp32DmaSpi.ino @@ -0,0 +1,148 @@ +// DotStarTest_Esp32Advanced - This example only works on the ESP32 +// This example will cycle between showing four pixels as Red, Green, Blue, White +// and then showing those pixels as Black. This example uses DMA to drive Hardware SPI on the ESP32 +// with options to use alternate pins for SPI and drive two SPI ports +// +// There is serial output of the current state so you can confirm and follow along +// + +#include + +#define USE_DEFAULT_SPI_PORT 1 +#define USE_ALTERNATE_SPI_PORT 1 + +#if (USE_DEFAULT_SPI_PORT == 1) + const uint16_t PixelCount = 4; // this example assumes 4 pixels, making it smaller will cause a failure + + // It's usually better to use alternate pins. If set to false, strip will use GPIO 18 for Clock, GPIO 23 for Data, and pin 5 will output a chip select signal + const bool useSpiAlternatePins = true; + + // If you set useSpiAlternatePins true, then these pins will be used instead. Any output-capable GPIO can be used. + const uint8_t DotClockPin = 18; + const uint8_t DotDataPin = 23; + const int8_t DotChipSelectPin = -1; // -1 means the chip select signal won't be output, freeing up one pin compared to useSpiAlternatePins=false + + // for software bit bang (only use if neither SPI peripheral is available) + //NeoPixelBus strip(PixelCount, DotClockPin, DotDataPin); + + // for hardware SPI (best performance) with default SPI peripheral + NeoPixelBus strip(PixelCount); + + // DotStarEsp32DmaVspiMethod defaults to 10MHz clock speed. For other speeds, replace "DotStarSpiMethod" with another method specifying speed, e.g. "DotStarSpi2MhzMethod" (see wiki for more details) + // See DotStarTest_Esp32Advanced example for how to set clock speed at runtime +#endif + +#if (USE_ALTERNATE_SPI_PORT == 1) + const uint16_t PixelCount2 = 4; // this example assumes 4 pixels, making it smaller will cause a failure + + // It's usually better to use alternate pins. If set to false, strip2 will use GPIO 14 for Clock, GPIO 13 for Data, and pin 15 will output a chip select signal + const bool useSpiAlternatePins2 = true; + + // If you set useSpiAlternatePins2 true, then these pins will be used instead. Any output-capable GPIO can be used. + const uint8_t DotClockPin2 = 14; + const uint8_t DotDataPin2 = 13; + const int8_t DotChipSelectPin2 = -1; // -1 means the chip select signal won't be output, freeing up one pin compared to useSpiAlternatePins2=false + + // for hardware SPI (best performance) with alternate SPI peripheral + NeoPixelBus strip2(PixelCount2); + + // DotStarEsp32DmaHspiMethod defaults to 10MHz clock speed. For other speeds, replace "DotStarSpiMethod" with another method specifying speed, e.g. "DotStarHspi2MhzMethod" (see wiki for more details) +#endif + +#define colorSaturation 128 + +// Note that both DotStarEsp32DmaVspiMethod and DotStarEsp32DmaHspiMethod can be used with DotStarLbgrFeature and DotStarWbgrFeature but to keep things simple those are excluded from this example, see DotStarTest for more details + +RgbColor red(colorSaturation, 0, 0); +RgbColor green(0, colorSaturation, 0); +RgbColor blue(0, 0, colorSaturation); +RgbColor white(colorSaturation); +RgbColor black(0); + +void setup() +{ + Serial.begin(115200); + while (!Serial); // wait for serial attach + + Serial.println(); + Serial.println("Initializing..."); + Serial.flush(); + +#if (USE_DEFAULT_SPI_PORT == 1) + if (useSpiAlternatePins) + { + strip.Begin(DotClockPin, DotDataPin, DotDataPin, DotChipSelectPin); + } + else + { + strip.Begin(); + } + + strip.ClearTo(black); // this resets all the DotStars to an off state + strip.Show(); +#endif + +#if (USE_ALTERNATE_SPI_PORT == 1) + if (useSpiAlternatePins2) + { + strip2.Begin(DotClockPin2, DotDataPin2, DotDataPin2, DotChipSelectPin2); + } + else + { + strip2.Begin(); + } + + strip2.ClearTo(black); // this resets all the DotStars to an off state + strip2.Show(); +#endif + + Serial.println(); + Serial.println("Running..."); +} + +void loop() +{ + delay(500); + +#if (USE_DEFAULT_SPI_PORT == 1) + Serial.println("Default SPI Colors R, G, B, W..."); + // set the colors, + strip.SetPixelColor(0, red); + strip.SetPixelColor(1, green); + strip.SetPixelColor(2, blue); + strip.SetPixelColor(3, white); + strip.Show(); +#endif + +#if (USE_ALTERNATE_SPI_PORT == 1) + Serial.println("Alt SPI Colors W, B, G, R..."); + // set the colors, + strip2.SetPixelColor(0, white); + strip2.SetPixelColor(1, blue); + strip2.SetPixelColor(2, green); + strip2.SetPixelColor(3, red); + strip2.Show(); +#endif + + delay(500); + + Serial.println("Off ..."); + +#if (USE_DEFAULT_SPI_PORT == 1) + // turn off the pixels + strip.SetPixelColor(0, black); + strip.SetPixelColor(1, black); + strip.SetPixelColor(2, black); + strip.SetPixelColor(3, black); + strip.Show(); +#endif + +#if (USE_ALTERNATE_SPI_PORT == 1) + // turn off the pixels + strip2.SetPixelColor(0, black); + strip2.SetPixelColor(1, black); + strip2.SetPixelColor(2, black); + strip2.SetPixelColor(3, black); + strip2.Show(); +#endif +} diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/NeoPixelBrightness/NeoPixelBrightness.ino b/lib/lib_basic/NeoPixelBus/examples/NeoPixelBrightness/NeoPixelBrightness.ino similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/NeoPixelBrightness/NeoPixelBrightness.ino rename to lib/lib_basic/NeoPixelBus/examples/NeoPixelBrightness/NeoPixelBrightness.ino diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/NeoPixelGamma/NeoPixelGamma.ino b/lib/lib_basic/NeoPixelBus/examples/NeoPixelGamma/NeoPixelGamma.ino similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/NeoPixelGamma/NeoPixelGamma.ino rename to lib/lib_basic/NeoPixelBus/examples/NeoPixelGamma/NeoPixelGamma.ino diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/NeoPixelTest/NeoPixelTest.ino b/lib/lib_basic/NeoPixelBus/examples/NeoPixelTest/NeoPixelTest.ino similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/NeoPixelTest/NeoPixelTest.ino rename to lib/lib_basic/NeoPixelBus/examples/NeoPixelTest/NeoPixelTest.ino diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/animations/NeoPixelAnimation/NeoPixelAnimation.ino b/lib/lib_basic/NeoPixelBus/examples/animations/NeoPixelAnimation/NeoPixelAnimation.ino similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/animations/NeoPixelAnimation/NeoPixelAnimation.ino rename to lib/lib_basic/NeoPixelBus/examples/animations/NeoPixelAnimation/NeoPixelAnimation.ino diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/animations/NeoPixelCylon/NeoPixelCylon.ino b/lib/lib_basic/NeoPixelBus/examples/animations/NeoPixelCylon/NeoPixelCylon.ino similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/animations/NeoPixelCylon/NeoPixelCylon.ino rename to lib/lib_basic/NeoPixelBus/examples/animations/NeoPixelCylon/NeoPixelCylon.ino diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/animations/NeoPixelFunFadeInOut/NeoPixelFunFadeInOut.ino b/lib/lib_basic/NeoPixelBus/examples/animations/NeoPixelFunFadeInOut/NeoPixelFunFadeInOut.ino similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/animations/NeoPixelFunFadeInOut/NeoPixelFunFadeInOut.ino rename to lib/lib_basic/NeoPixelBus/examples/animations/NeoPixelFunFadeInOut/NeoPixelFunFadeInOut.ino diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/animations/NeoPixelFunLoop/NeoPixelFunLoop.ino b/lib/lib_basic/NeoPixelBus/examples/animations/NeoPixelFunLoop/NeoPixelFunLoop.ino similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/animations/NeoPixelFunLoop/NeoPixelFunLoop.ino rename to lib/lib_basic/NeoPixelBus/examples/animations/NeoPixelFunLoop/NeoPixelFunLoop.ino diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/animations/NeoPixelFunRandomChange/NeoPixelFunRandomChange.ino b/lib/lib_basic/NeoPixelBus/examples/animations/NeoPixelFunRandomChange/NeoPixelFunRandomChange.ino similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/animations/NeoPixelFunRandomChange/NeoPixelFunRandomChange.ino rename to lib/lib_basic/NeoPixelBus/examples/animations/NeoPixelFunRandomChange/NeoPixelFunRandomChange.ino diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/animations/NeoPixelRotateLoop/NeoPixelRotateLoop.ino b/lib/lib_basic/NeoPixelBus/examples/animations/NeoPixelRotateLoop/NeoPixelRotateLoop.ino similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/animations/NeoPixelRotateLoop/NeoPixelRotateLoop.ino rename to lib/lib_basic/NeoPixelBus/examples/animations/NeoPixelRotateLoop/NeoPixelRotateLoop.ino diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/bitmaps/NeoPixelBitmap/NeoPixelBitmap.ino b/lib/lib_basic/NeoPixelBus/examples/bitmaps/NeoPixelBitmap/NeoPixelBitmap.ino similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/bitmaps/NeoPixelBitmap/NeoPixelBitmap.ino rename to lib/lib_basic/NeoPixelBus/examples/bitmaps/NeoPixelBitmap/NeoPixelBitmap.ino diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/bitmaps/NeoPixelBitmap/Strings.bmp b/lib/lib_basic/NeoPixelBus/examples/bitmaps/NeoPixelBitmap/Strings.bmp similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/bitmaps/NeoPixelBitmap/Strings.bmp rename to lib/lib_basic/NeoPixelBus/examples/bitmaps/NeoPixelBitmap/Strings.bmp diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/bitmaps/NeoPixelBitmap/StringsW.bmp b/lib/lib_basic/NeoPixelBus/examples/bitmaps/NeoPixelBitmap/StringsW.bmp similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/bitmaps/NeoPixelBitmap/StringsW.bmp rename to lib/lib_basic/NeoPixelBus/examples/bitmaps/NeoPixelBitmap/StringsW.bmp diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/bitmaps/NeoPixelBufferCylon/Cylon.pdn b/lib/lib_basic/NeoPixelBus/examples/bitmaps/NeoPixelBufferCylon/Cylon.pdn similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/bitmaps/NeoPixelBufferCylon/Cylon.pdn rename to lib/lib_basic/NeoPixelBus/examples/bitmaps/NeoPixelBufferCylon/Cylon.pdn diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/bitmaps/NeoPixelBufferCylon/CylonGrb.h b/lib/lib_basic/NeoPixelBus/examples/bitmaps/NeoPixelBufferCylon/CylonGrb.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/bitmaps/NeoPixelBufferCylon/CylonGrb.h rename to lib/lib_basic/NeoPixelBus/examples/bitmaps/NeoPixelBufferCylon/CylonGrb.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/bitmaps/NeoPixelBufferCylon/CylonGrbw.h b/lib/lib_basic/NeoPixelBus/examples/bitmaps/NeoPixelBufferCylon/CylonGrbw.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/bitmaps/NeoPixelBufferCylon/CylonGrbw.h rename to lib/lib_basic/NeoPixelBus/examples/bitmaps/NeoPixelBufferCylon/CylonGrbw.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/bitmaps/NeoPixelBufferCylon/NeoPixelBufferCylon.ino b/lib/lib_basic/NeoPixelBus/examples/bitmaps/NeoPixelBufferCylon/NeoPixelBufferCylon.ino similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/bitmaps/NeoPixelBufferCylon/NeoPixelBufferCylon.ino rename to lib/lib_basic/NeoPixelBus/examples/bitmaps/NeoPixelBufferCylon/NeoPixelBufferCylon.ino diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/bitmaps/NeoPixelBufferShader/NeoPixelBufferShader.ino b/lib/lib_basic/NeoPixelBus/examples/bitmaps/NeoPixelBufferShader/NeoPixelBufferShader.ino similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/bitmaps/NeoPixelBufferShader/NeoPixelBufferShader.ino rename to lib/lib_basic/NeoPixelBus/examples/bitmaps/NeoPixelBufferShader/NeoPixelBufferShader.ino diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/bitmaps/NeoPixelDibTest/NeoPixelDibTest.ino b/lib/lib_basic/NeoPixelBus/examples/bitmaps/NeoPixelDibTest/NeoPixelDibTest.ino similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/bitmaps/NeoPixelDibTest/NeoPixelDibTest.ino rename to lib/lib_basic/NeoPixelBus/examples/bitmaps/NeoPixelDibTest/NeoPixelDibTest.ino diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/sevensegment/NeoSegmentBus/NeoSegmentBus.ino b/lib/lib_basic/NeoPixelBus/examples/sevensegment/NeoSegmentBus/NeoSegmentBus.ino similarity index 93% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/sevensegment/NeoSegmentBus/NeoSegmentBus.ino rename to lib/lib_basic/NeoPixelBus/examples/sevensegment/NeoSegmentBus/NeoSegmentBus.ino index 7ee1beb25..05a160c04 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/sevensegment/NeoSegmentBus/NeoSegmentBus.ino +++ b/lib/lib_basic/NeoPixelBus/examples/sevensegment/NeoSegmentBus/NeoSegmentBus.ino @@ -30,7 +30,7 @@ void loop() { delay(2000); - strip.RotateLeft(1); + strip.RotateRight(1); // reads right to left, so it is reversed strip.Show(); } diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/sevensegment/NeoSegmentFade/NeoSegmentFade.ino b/lib/lib_basic/NeoPixelBus/examples/sevensegment/NeoSegmentFade/NeoSegmentFade.ino similarity index 95% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/sevensegment/NeoSegmentFade/NeoSegmentFade.ino rename to lib/lib_basic/NeoPixelBus/examples/sevensegment/NeoSegmentFade/NeoSegmentFade.ino index 98d9e591a..fd74cad35 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/sevensegment/NeoSegmentFade/NeoSegmentFade.ino +++ b/lib/lib_basic/NeoPixelBus/examples/sevensegment/NeoSegmentFade/NeoSegmentFade.ino @@ -32,7 +32,7 @@ NeoPixelAnimator animations(Animation_COUNT); void CycleAnimation(const AnimationParam& param) { // calculate which segment should be on using the animation progress - uint8_t bitfield = 1 << (uint8_t)(param.progress * LedSegment_F); + uint8_t bitfield = 1 << ( static_cast(param.progress * LedSegment_G) % LedSegment_G); // instant a digit with that segment on SevenSegDigit digit(bitfield, brightness); // apply it to the strip @@ -126,7 +126,7 @@ void loop() brightness); // start the seconds fade animation - animations.StartAnimation(Animation_Fade, 1000, FadeAnimation); + animations.StartAnimation(Animation_Fade, 500, FadeAnimation); // start the cycle animation for the next second animations.StartAnimation(Animation_Cycle, 1000, CycleAnimation); diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/topologies/NeoPixelMosaicDump/NeoPixelMosaicDump.ino b/lib/lib_basic/NeoPixelBus/examples/topologies/NeoPixelMosaicDump/NeoPixelMosaicDump.ino similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/topologies/NeoPixelMosaicDump/NeoPixelMosaicDump.ino rename to lib/lib_basic/NeoPixelBus/examples/topologies/NeoPixelMosaicDump/NeoPixelMosaicDump.ino diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/topologies/NeoPixelMosaicTest/NeoPixelMosaicTest.ino b/lib/lib_basic/NeoPixelBus/examples/topologies/NeoPixelMosaicTest/NeoPixelMosaicTest.ino similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/topologies/NeoPixelMosaicTest/NeoPixelMosaicTest.ino rename to lib/lib_basic/NeoPixelBus/examples/topologies/NeoPixelMosaicTest/NeoPixelMosaicTest.ino diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/topologies/NeoPixelRingTopologyTest/NeoPixelRingTopologyTest.ino b/lib/lib_basic/NeoPixelBus/examples/topologies/NeoPixelRingTopologyTest/NeoPixelRingTopologyTest.ino similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/topologies/NeoPixelRingTopologyTest/NeoPixelRingTopologyTest.ino rename to lib/lib_basic/NeoPixelBus/examples/topologies/NeoPixelRingTopologyTest/NeoPixelRingTopologyTest.ino diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/topologies/NeoPixelTilesDump/NeoPixelTilesDump.ino b/lib/lib_basic/NeoPixelBus/examples/topologies/NeoPixelTilesDump/NeoPixelTilesDump.ino similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/topologies/NeoPixelTilesDump/NeoPixelTilesDump.ino rename to lib/lib_basic/NeoPixelBus/examples/topologies/NeoPixelTilesDump/NeoPixelTilesDump.ino diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/topologies/NeoPixelTilesTest/NeoPixelTilesTest.ino b/lib/lib_basic/NeoPixelBus/examples/topologies/NeoPixelTilesTest/NeoPixelTilesTest.ino similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/topologies/NeoPixelTilesTest/NeoPixelTilesTest.ino rename to lib/lib_basic/NeoPixelBus/examples/topologies/NeoPixelTilesTest/NeoPixelTilesTest.ino diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/topologies/NeoPixelTopologyDump/NeoPixelTopologyDump.ino b/lib/lib_basic/NeoPixelBus/examples/topologies/NeoPixelTopologyDump/NeoPixelTopologyDump.ino similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/topologies/NeoPixelTopologyDump/NeoPixelTopologyDump.ino rename to lib/lib_basic/NeoPixelBus/examples/topologies/NeoPixelTopologyDump/NeoPixelTopologyDump.ino diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/examples/topologies/NeoPixelTopologyTest/NeoPixelTopologyTest.ino b/lib/lib_basic/NeoPixelBus/examples/topologies/NeoPixelTopologyTest/NeoPixelTopologyTest.ino similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/examples/topologies/NeoPixelTopologyTest/NeoPixelTopologyTest.ino rename to lib/lib_basic/NeoPixelBus/examples/topologies/NeoPixelTopologyTest/NeoPixelTopologyTest.ino diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/extras/curves/circular.png b/lib/lib_basic/NeoPixelBus/extras/curves/circular.png similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/extras/curves/circular.png rename to lib/lib_basic/NeoPixelBus/extras/curves/circular.png diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/extras/curves/cubic.png b/lib/lib_basic/NeoPixelBus/extras/curves/cubic.png similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/extras/curves/cubic.png rename to lib/lib_basic/NeoPixelBus/extras/curves/cubic.png diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/extras/curves/different.png b/lib/lib_basic/NeoPixelBus/extras/curves/different.png similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/extras/curves/different.png rename to lib/lib_basic/NeoPixelBus/extras/curves/different.png diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/extras/curves/exponential.png b/lib/lib_basic/NeoPixelBus/extras/curves/exponential.png similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/extras/curves/exponential.png rename to lib/lib_basic/NeoPixelBus/extras/curves/exponential.png diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/extras/curves/gamma.png b/lib/lib_basic/NeoPixelBus/extras/curves/gamma.png similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/extras/curves/gamma.png rename to lib/lib_basic/NeoPixelBus/extras/curves/gamma.png diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/extras/curves/pronounced.png b/lib/lib_basic/NeoPixelBus/extras/curves/pronounced.png similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/extras/curves/pronounced.png rename to lib/lib_basic/NeoPixelBus/extras/curves/pronounced.png diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/extras/curves/quadratic.png b/lib/lib_basic/NeoPixelBus/extras/curves/quadratic.png similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/extras/curves/quadratic.png rename to lib/lib_basic/NeoPixelBus/extras/curves/quadratic.png diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/extras/curves/quintic.png b/lib/lib_basic/NeoPixelBus/extras/curves/quintic.png similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/extras/curves/quintic.png rename to lib/lib_basic/NeoPixelBus/extras/curves/quintic.png diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/extras/curves/sinusoidal.png b/lib/lib_basic/NeoPixelBus/extras/curves/sinusoidal.png similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/extras/curves/sinusoidal.png rename to lib/lib_basic/NeoPixelBus/extras/curves/sinusoidal.png diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/keywords.txt b/lib/lib_basic/NeoPixelBus/keywords.txt similarity index 89% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/keywords.txt rename to lib/lib_basic/NeoPixelBus/keywords.txt index f7e2f6832..71280f07b 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/keywords.txt +++ b/lib/lib_basic/NeoPixelBus/keywords.txt @@ -17,6 +17,7 @@ HsbColor KEYWORD1 HtmlColor KEYWORD1 NeoNoSettings KEYWORD1 NeoTm1814Settings KEYWORD1 +NeoSpiSettings KEYWORD1 NeoGrbFeature KEYWORD1 NeoGrbwFeature KEYWORD1 NeoRgbwFeature KEYWORD1 @@ -42,6 +43,8 @@ NeoWs2812Method KEYWORD1 NeoWs2811Method KEYWORD1 NeoSk6812Method KEYWORD1 NeoTm1814Method KEYWORD1 +NeoTm1829Method KEYWORD1 +NeoTx1812Method KEYWORD1 NeoLc8812Method KEYWORD1 NeoApa106Method KEYWORD1 Neo800KbpsInvertedMethod KEYWORD1 @@ -52,17 +55,21 @@ NeoWs2812InvertedMethod KEYWORD1 NeoWs2811InvertedMethod KEYWORD1 NeoSk6812InvertedMethod KEYWORD1 NeoTm1814InvertedMethod KEYWORD1 +NeoTm1829InvertedMethod KEYWORD1 +NeoTx1812InvertedMethod KEYWORD1 NeoLc8812InvertedMethod KEYWORD1 NeoApa106InvertedMethod KEYWORD1 NeoEsp8266DmaWs2812xMethod KEYWORD1 NeoEsp8266DmaSk6812Method KEYWORD1 NeoEsp8266DmaTm1814Method KEYWORD1 +NeoEsp8266DmaTm1829Method KEYWORD1 NeoEsp8266DmaApa106Method KEYWORD1 NeoEsp8266Dma800KbpsMethod KEYWORD1 NeoEsp8266Dma400KbpsMethod KEYWORD1 NeoEsp8266DmaInvertedWs2812xMethod KEYWORD1 NeoEsp8266DmaInvertedSk6812Method KEYWORD1 NeoEsp8266DmaInvertedTm1814Method KEYWORD1 +NeoEsp8266DmaInvertedTm1829Method KEYWORD1 NeoEsp8266DmaInvertedApa106Method KEYWORD1 NeoEsp8266DmaInverted800KbpsMethod KEYWORD1 NeoEsp8266DmaInverted400KbpsMethod KEYWORD1 @@ -72,6 +79,7 @@ NeoEsp8266Uart0Ws2812Method KEYWORD1 NeoEsp8266Uart0Ws2811Method KEYWORD1 NeoEsp8266Uart0Sk6812Method KEYWORD1 NeoEsp8266Uart0Tm1814Method KEYWORD1 +NeoEsp8266Uart0Tm1829Method KEYWORD1 NeoEsp8266Uart0Lc8812Method KEYWORD1 NeoEsp8266Uart0Apa106Method KEYWORD1 NeoEsp8266Uart0800KbpsMethod KEYWORD1 @@ -82,6 +90,7 @@ NeoEsp8266AsyncUart0Ws2812Method KEYWORD1 NeoEsp8266AsyncUart0Ws2811Method KEYWORD1 NeoEsp8266AsyncUart0Sk6812Method KEYWORD1 NeoEsp8266AsyncUart0Tm1814Method KEYWORD1 +NeoEsp8266AsyncUart0Tm1829Method KEYWORD1 NeoEsp8266AsyncUart0Lc8812Method KEYWORD1 NeoEsp8266AsyncUart0Apa106Method KEYWORD1 NeoEsp8266AsyncUart0800KbpsMethod KEYWORD1 @@ -92,6 +101,7 @@ NeoEsp8266Uart1Ws2812Method KEYWORD1 NeoEsp8266Uart1Ws2811Method KEYWORD1 NeoEsp8266Uart1Sk6812Method KEYWORD1 NeoEsp8266Uart1Tm1814 KEYWORD1 +NeoEsp8266Uart1Tm1829 KEYWORD1 NeoEsp8266Uart1Lc8812Method KEYWORD1 NeoEsp8266Uart1Apa106Method KEYWORD1 NeoEsp8266Uart1800KbpsMethod KEYWORD1 @@ -102,6 +112,7 @@ NeoEsp8266AsyncUart1Ws2812Method KEYWORD1 NeoEsp8266AsyncUart1Ws2811Method KEYWORD1 NeoEsp8266AsyncUart1Sk6812Method KEYWORD1 NeoEsp8266AsyncUart1Tm1814 KEYWORD1 +NeoEsp8266AsyncUart1Tm1829 KEYWORD1 NeoEsp8266AsyncUart1Lc8812Method KEYWORD1 NeoEsp8266AsyncUart1Apa106Method KEYWORD1 NeoEsp8266AsyncUart1800KbpsMethod KEYWORD1 @@ -112,6 +123,7 @@ NeoEsp8266Uart0Ws2812InvertedMethod KEYWORD1 NeoEsp8266Uart0Ws2811InvertedMethod KEYWORD1 NeoEsp8266Uart0Sk6812InvertedMethod KEYWORD1 NeoEsp8266Uart0Tm1814InvertedMethod KEYWORD1 +NeoEsp8266Uart0Tm1829InvertedMethod KEYWORD1 NeoEsp8266Uart0Lc8812InvertedMethod KEYWORD1 NeoEsp8266Uart0Apa106InvertedMethod KEYWORD1 NeoEsp8266Uart0800KbpsInvertedMethod KEYWORD1 @@ -122,6 +134,7 @@ NeoEsp8266AsyncUart0Ws2812InvertedMethod KEYWORD1 NeoEsp8266AsyncUart0Ws2811InvertedMethod KEYWORD1 NeoEsp8266AsyncUart0Sk6812InvertedMethod KEYWORD1 NeoEsp8266AsyncUart0Tm1814InvertedMethod KEYWORD1 +NeoEsp8266AsyncUart0Tm1829InvertedMethod KEYWORD1 NeoEsp8266AsyncUart0Lc8812InvertedMethod KEYWORD1 NeoEsp8266AsyncUart0Apa106InvertedMethod KEYWORD1 NeoEsp8266AsyncUart0800KbpsInvertedMethod KEYWORD1 @@ -132,6 +145,7 @@ NeoEsp8266Uart1Ws2812InvertedMethod KEYWORD1 NeoEsp8266Uart1Ws2811InvertedMethod KEYWORD1 NeoEsp8266Uart1Sk6812InvertedMethod KEYWORD1 NeoEsp8266Uart1Tm1814InvertedMethod KEYWORD1 +NeoEsp8266Uart1Tm1829InvertedMethod KEYWORD1 NeoEsp8266Uart1Lc8812InvertedMethod KEYWORD1 NeoEsp8266Uart1Apa106InvertedMethod KEYWORD1 NeoEsp8266Uart1800KbpsInvertedMethod KEYWORD1 @@ -142,6 +156,7 @@ NeoEsp8266AsyncUart1Ws2812InvertedMethod KEYWORD1 NeoEsp8266AsyncUart1Ws2811InvertedMethod KEYWORD1 NeoEsp8266AsyncUart1Sk6812InvertedMethod KEYWORD1 NeoEsp8266AsyncUart1Tm1814InvertedMethod KEYWORD1 +NeoEsp8266AsyncUart1Tm1829InvertedMethod KEYWORD1 NeoEsp8266AsyncUart1Lc8812InvertedMethod KEYWORD1 NeoEsp8266AsyncUart1Apa106InvertedMethod KEYWORD1 NeoEsp8266AsyncUart1800KbpsInvertedMethod KEYWORD1 @@ -152,6 +167,7 @@ NeoEsp8266BitBangWs2812Method KEYWORD1 NeoEsp8266BitBangWs2811Method KEYWORD1 NeoEsp8266BitBangSk6812Method KEYWORD1 NeoEsp8266BitBangTm1814Method KEYWORD1 +NeoEsp8266BitBangTm1829Method KEYWORD1 NeoEsp8266BitBangLc8812Method KEYWORD1 NeoEsp8266BitBangApa106Method KEYWORD1 NeoEsp8266BitBang800KbpsMethod KEYWORD1 @@ -162,6 +178,7 @@ NeoEsp8266BitBangWs2812InvertedMethod KEYWORD1 NeoEsp8266BitBangWs2811InvertedMethod KEYWORD1 NeoEsp8266BitBangSk6812InvertedMethod KEYWORD1 NeoEsp8266BitBangTm1814InvertedMethod KEYWORD1 +NeoEsp8266BitBangTm1829InvertedMethod KEYWORD1 NeoEsp8266BitBangLc8812InvertedMethod KEYWORD1 NeoEsp8266BitBangApa106InvertedMethod KEYWORD1 NeoEsp8266BitBang800KbpsInvertedMethod KEYWORD1 @@ -175,12 +192,14 @@ NeoEsp32I2sNApa106Method KEYWORD1 NeoEsp32I2s0Ws2812xMethod KEYWORD1 NeoEsp32I2s0Sk6812Method KEYWORD1 NeoEsp32I2s0Tm1814Method KEYWORD1 +NeoEsp32I2s0Tm1829Method KEYWORD1 NeoEsp32I2s0800KbpsMethod KEYWORD1 NeoEsp32I2s0400KbpsMethod KEYWORD1 NeoEsp32I2s0Apa106Method KEYWORD1 NeoEsp32I2s1Ws2812xMethod KEYWORD1 NeoEsp32I2s1Sk6812Method KEYWORD1 NeoEsp32I2s1Tm1814Method KEYWORD1 +NeoEsp32I2s1Tm1829Method KEYWORD1 NeoEsp32I2s1800KbpsMethod KEYWORD1 NeoEsp32I2s1400KbpsMethod KEYWORD1 NeoEsp32I2s1Apa106Method KEYWORD1 @@ -193,12 +212,14 @@ NeoEsp32I2sNApa106InvertedMethod KEYWORD1 NeoEsp32I2s0Ws2812xInvertedMethod KEYWORD1 NeoEsp32I2s0Sk6812InvertedMethod KEYWORD1 NeoEsp32I2s0Tm1814InvertedMethod KEYWORD1 +NeoEsp32I2s0Tm1829InvertedMethod KEYWORD1 NeoEsp32I2s0800KbpsInvertedMethod KEYWORD1 NeoEsp32I2s0400KbpsInvertedMethod KEYWORD1 NeoEsp32I2s0Apa106InvertedMethod KEYWORD1 NeoEsp32I2s1Ws2812xInvertedMethod KEYWORD1 NeoEsp32I2s1Sk6812InvertedMethod KEYWORD1 NeoEsp32I2s1Tm1814InvertedMethod KEYWORD1 +NeoEsp32I2s1Tm1829InvertedMethod KEYWORD1 NeoEsp32I2s1800KbpsInvertedMethod KEYWORD1 NeoEsp32I2s1400KbpsInvertedMethod KEYWORD1 NeoEsp32I2s1Apa106InvertedMethod KEYWORD1 @@ -213,6 +234,7 @@ NeoEsp32Rmt0Ws2811Method KEYWORD1 NeoEsp32Rmt0Ws2812xMethod KEYWORD1 NeoEsp32Rmt0Sk6812Method KEYWORD1 NeoEsp32Rmt0Tm1814Method KEYWORD1 +NeoEsp32Rmt0Tm1829Method KEYWORD1 NeoEsp32Rmt0Apa106Method KEYWORD1 NeoEsp32Rmt0800KbpsMethod KEYWORD1 NeoEsp32Rmt0400KbpsMethod KEYWORD1 @@ -220,6 +242,7 @@ NeoEsp32Rmt1Ws2811Method KEYWORD1 NeoEsp32Rmt1Ws2812xMethod KEYWORD1 NeoEsp32Rmt1Sk6812Method KEYWORD1 NeoEsp32Rmt1Tm1814Method KEYWORD1 +NeoEsp32Rmt1Tm1814Method KEYWORD1 NeoEsp32Rmt1Apa106Method KEYWORD1 NeoEsp32Rmt1800KbpsMethod KEYWORD1 NeoEsp32Rmt1400KbpsMethod KEYWORD1 @@ -227,6 +250,7 @@ NeoEsp32Rmt2Ws2811Method KEYWORD1 NeoEsp32Rmt2Ws2812xMethod KEYWORD1 NeoEsp32Rmt2Sk6812Method KEYWORD1 NeoEsp32Rmt2Tm1814Method KEYWORD1 +NeoEsp32Rmt2Tm1829Method KEYWORD1 NeoEsp32Rmt2Apa106Method KEYWORD1 NeoEsp32Rmt2800KbpsMethod KEYWORD1 NeoEsp32Rmt2400KbpsMethod KEYWORD1 @@ -234,6 +258,7 @@ NeoEsp32Rmt3Ws2811Method KEYWORD1 NeoEsp32Rmt3Ws2812xMethod KEYWORD1 NeoEsp32Rmt3Sk6812Method KEYWORD1 NeoEsp32Rmt3Tm1814Method KEYWORD1 +NeoEsp32Rmt3Tm1829Method KEYWORD1 NeoEsp32Rmt3Apa106Method KEYWORD1 NeoEsp32Rmt3800KbpsMethod KEYWORD1 NeoEsp32Rmt3400KbpsMethod KEYWORD1 @@ -241,6 +266,7 @@ NeoEsp32Rmt4Ws2811Method KEYWORD1 NeoEsp32Rmt4Ws2812xMethod KEYWORD1 NeoEsp32Rmt4Sk6812Method KEYWORD1 NeoEsp32Rmt4Tm1814Method KEYWORD1 +NeoEsp32Rmt4Tm1829Method KEYWORD1 NeoEsp32Rmt4Apa106Method KEYWORD1 NeoEsp32Rmt4800KbpsMethod KEYWORD1 NeoEsp32Rmt4400KbpsMethod KEYWORD1 @@ -248,6 +274,7 @@ NeoEsp32Rmt5Ws2811Method KEYWORD1 NeoEsp32Rmt5Ws2812xMethod KEYWORD1 NeoEsp32Rmt5Sk6812Method KEYWORD1 NeoEsp32Rmt5Tm1814Method KEYWORD1 +NeoEsp32Rmt5Tm1829Method KEYWORD1 NeoEsp32Rmt5Apa106Method KEYWORD1 NeoEsp32Rmt5800KbpsMethod KEYWORD1 NeoEsp32Rmt5400KbpsMethod KEYWORD1 @@ -255,6 +282,7 @@ NeoEsp32Rmt6Ws2811Method KEYWORD1 NeoEsp32Rmt6Ws2812xMethod KEYWORD1 NeoEsp32Rmt6Sk6812Method KEYWORD1 NeoEsp32Rmt6Tm1814Method KEYWORD1 +NeoEsp32Rmt6Tm1829Method KEYWORD1 NeoEsp32Rmt6Apa106Method KEYWORD1 NeoEsp32Rmt6800KbpsMethod KEYWORD1 NeoEsp32Rmt6400KbpsMethod KEYWORD1 @@ -262,6 +290,7 @@ NeoEsp32Rmt7Ws2811Method KEYWORD1 NeoEsp32Rmt7Ws2812xMethod KEYWORD1 NeoEsp32Rmt7Sk6812Method KEYWORD1 NeoEsp32Rmt7Tm1814Method KEYWORD1 +NeoEsp32Rmt7Tm1829Method KEYWORD1 NeoEsp32Rmt7Apa106Method KEYWORD1 NeoEsp32Rmt7800KbpsMethod KEYWORD1 NeoEsp32Rmt7400KbpsMethod KEYWORD1 @@ -276,6 +305,7 @@ NeoEsp32Rmt0Ws2811InvertedMethod KEYWORD1 NeoEsp32Rmt0Ws2812xInvertedMethod KEYWORD1 NeoEsp32Rmt0Sk6812InvertedMethod KEYWORD1 NeoEsp32Rmt0Tm1814InvertedMethod KEYWORD1 +NeoEsp32Rmt0Tm1829InvertedMethod KEYWORD1 NeoEsp32Rmt0Apa106InvertedMethod KEYWORD1 NeoEsp32Rmt0800KbpsInvertedMethod KEYWORD1 NeoEsp32Rmt0400KbpsInvertedMethod KEYWORD1 @@ -283,6 +313,7 @@ NeoEsp32Rmt1Ws2811InvertedMethod KEYWORD1 NeoEsp32Rmt1Ws2812xInvertedMethod KEYWORD1 NeoEsp32Rmt1Sk6812InvertedMethod KEYWORD1 NeoEsp32Rmt1Tm1814InvertedMethod KEYWORD1 +NeoEsp32Rmt1Tm1829InvertedMethod KEYWORD1 NeoEsp32Rmt1Apa106InvertedMethod KEYWORD1 NeoEsp32Rmt1800KbpsInvertedMethod KEYWORD1 NeoEsp32Rmt1400KbpsInvertedMethod KEYWORD1 @@ -290,6 +321,7 @@ NeoEsp32Rmt2Ws2811InvertedMethod KEYWORD1 NeoEsp32Rmt2Ws2812xInvertedMethod KEYWORD1 NeoEsp32Rmt2Sk6812InvertedMethod KEYWORD1 NeoEsp32Rmt2Tm1814InvertedMethod KEYWORD1 +NeoEsp32Rmt2Tm1829InvertedMethod KEYWORD1 NeoEsp32Rmt2Apa106InvertedMethod KEYWORD1 NeoEsp32Rmt2800KbpsInvertedMethod KEYWORD1 NeoEsp32Rmt2400KbpsInvertedMethod KEYWORD1 @@ -297,6 +329,7 @@ NeoEsp32Rmt3Ws2811InvertedMethod KEYWORD1 NeoEsp32Rmt3Ws2812xInvertedMethod KEYWORD1 NeoEsp32Rmt3Sk6812InvertedMethod KEYWORD1 NeoEsp32Rmt3Tm1814InvertedMethod KEYWORD1 +NeoEsp32Rmt3Tm1829InvertedMethod KEYWORD1 NeoEsp32Rmt3Apa106InvertedMethod KEYWORD1 NeoEsp32Rmt3800KbpsInvertedMethod KEYWORD1 NeoEsp32Rmt3400KbpsInvertedMethod KEYWORD1 @@ -304,6 +337,7 @@ NeoEsp32Rmt4Ws2811InvertedMethod KEYWORD1 NeoEsp32Rmt4Ws2812xInvertedMethod KEYWORD1 NeoEsp32Rmt4Sk6812InvertedMethod KEYWORD1 NeoEsp32Rmt4Tm1814InvertedMethod KEYWORD1 +NeoEsp32Rmt4Tm1829InvertedMethod KEYWORD1 NeoEsp32Rmt4Apa106InvertedMethod KEYWORD1 NeoEsp32Rmt4800KbpsInvertedMethod KEYWORD1 NeoEsp32Rmt4400KbpsInvertedMethod KEYWORD1 @@ -311,6 +345,7 @@ NeoEsp32Rmt5Ws2811InvertedMethod KEYWORD1 NeoEsp32Rmt5Ws2812xInvertedMethod KEYWORD1 NeoEsp32Rmt5Sk6812InvertedMethod KEYWORD1 NeoEsp32Rmt5Tm1814InvertedMethod KEYWORD1 +NeoEsp32Rmt5Tm1829InvertedMethod KEYWORD1 NeoEsp32Rmt5Apa106InvertedMethod KEYWORD1 NeoEsp32Rmt5800KbpsInvertedMethod KEYWORD1 NeoEsp32Rmt5400KbpsInvertedMethod KEYWORD1 @@ -318,6 +353,7 @@ NeoEsp32Rmt6Ws2811InvertedMethod KEYWORD1 NeoEsp32Rmt6Ws2812xInvertedMethod KEYWORD1 NeoEsp32Rmt6Sk6812InvertedMethod KEYWORD1 NeoEsp32Rmt6Tm1814InvertedMethod KEYWORD1 +NeoEsp32Rmt6Tm1829InvertedMethod KEYWORD1 NeoEsp32Rmt6Apa106InvertedMethod KEYWORD1 NeoEsp32Rmt6800KbpsInvertedMethod KEYWORD1 NeoEsp32Rmt6400KbpsInvertedMethod KEYWORD1 @@ -325,6 +361,7 @@ NeoEsp32Rmt7Ws2811InvertedMethod KEYWORD1 NeoEsp32Rmt7Ws2812xInvertedMethod KEYWORD1 NeoEsp32Rmt7Sk6812InvertedMethod KEYWORD1 NeoEsp32Rmt7Tm1814InvertedMethod KEYWORD1 +NeoEsp32Rmt7Tm1829InvertedMethod KEYWORD1 NeoEsp32Rmt7Apa106InvertedMethod KEYWORD1 NeoEsp32Rmt7800KbpsInvertedMethod KEYWORD1 NeoEsp32Rmt7400KbpsInvertedMethod KEYWORD1 @@ -334,6 +371,7 @@ NeoEsp32BitBangWs2812Method KEYWORD1 NeoEsp32BitBangWs2811Method KEYWORD1 NeoEsp32BitBangSk6812Method KEYWORD1 NeoEsp32BitBangTm1814Method KEYWORD1 +NeoEsp32BitBangTm1829Method KEYWORD1 NeoEsp32BitBangLc8812Method KEYWORD1 NeoEsp32BitBangApa106Method KEYWORD1 NeoEsp32BitBang800KbpsMethod KEYWORD1 @@ -344,6 +382,7 @@ NeoEsp32BitBangWs2812InvertedMethod KEYWORD1 NeoEsp32BitBangWs2811InvertedMethod KEYWORD1 NeoEsp32BitBangSk6812InvertedMethod KEYWORD1 NeoEsp32BitBangTm1814InvertedMethod KEYWORD1 +NeoEsp32BitBangTm1829InvertedMethod KEYWORD1 NeoEsp32BitBangLc8812InvertedMethod KEYWORD1 NeoEsp32BitBangApa106InvertedMethod KEYWORD1 NeoEsp32BitBang800KbpsInvertedMethod KEYWORD1 @@ -351,60 +390,80 @@ NeoEsp32BitBang400KbpsInvertedMethod KEYWORD1 NeoNrf52xPwmNWs2812xMethod KEYWORD1 NeoNrf52xPwmNSk6812Method KEYWORD1 NeoNrf52xPwmNTm1814Method KEYWORD1 +NeoNrf52xPwmNTm1829Method KEYWORD1 +NeoNrf52xPwmNTx1812Method KEYWORD1 NeoNrf52xPwmN800KbpsMethod KEYWORD1 NeoNrf52xPwmN400KbpsMethod KEYWORD1 NeoNrf52xPwmNApa106Method KEYWORD1 NeoNrf52xPwm0Ws2812xMethod KEYWORD1 NeoNrf52xPwm0Sk6812Method KEYWORD1 NeoNrf52xPwm0Tm1814Method KEYWORD1 +NeoNrf52xPwm0Tm1829Method KEYWORD1 +NeoNrf52xPwm0Tx1812Method KEYWORD1 NeoNrf52xPwm0800KbpsMethod KEYWORD1 NeoNrf52xPwm0400KbpsMethod KEYWORD1 NeoNrf52xPwm0Apa106Method KEYWORD1 NeoNrf52xPwm1Ws2812xMethod KEYWORD1 NeoNrf52xPwm1Sk6812Method KEYWORD1 NeoNrf52xPwm1Tm1814Method KEYWORD1 +NeoNrf52xPwm1Tm1829Method KEYWORD1 +NeoNrf52xPwm1Tx1812Method KEYWORD1 NeoNrf52xPwm1800KbpsMethod KEYWORD1 NeoNrf52xPwm1400KbpsMethod KEYWORD1 NeoNrf52xPwm1Apa106Method KEYWORD1 NeoNrf52xPwm2Ws2812xMethod KEYWORD1 NeoNrf52xPwm2Sk6812Method KEYWORD1 NeoNrf52xPwm2Tm1814Method KEYWORD1 +NeoNrf52xPwm2Tm1829Method KEYWORD1 +NeoNrf52xPwm2Tx1812Method KEYWORD1 NeoNrf52xPwm2800KbpsMethod KEYWORD1 NeoNrf52xPwm2400KbpsMethod KEYWORD1 NeoNrf52xPwm2Apa106Method KEYWORD1 NeoNrf52xPwm3Ws2812xMethod KEYWORD1 NeoNrf52xPwm3Sk6812Method KEYWORD1 NeoNrf52xPwm3Tm1814Method KEYWORD1 +NeoNrf52xPwm3Tm1829Method KEYWORD1 +NeoNrf52xPwm3Tx1812Method KEYWORD1 NeoNrf52xPwm3800KbpsMethod KEYWORD1 NeoNrf52xPwm3400KbpsMethod KEYWORD1 NeoNrf52xPwm3Apa106Method KEYWORD1 NeoNrf52xPwmNWs2812xInvertedMethod KEYWORD1 NeoNrf52xPwmNSk6812InvertedMethod KEYWORD1 NeoNrf52xPwmNTm1814InvertedMethod KEYWORD1 +NeoNrf52xPwmNTm1829InvertedMethod KEYWORD1 +NeoNrf52xPwmNTx1812InvertedMethod KEYWORD1 NeoNrf52xPwmN800KbpsInvertedMethod KEYWORD1 NeoNrf52xPwmN400KbpsInvertedMethod KEYWORD1 NeoNrf52xPwmNApa106InvertedMethod KEYWORD1 NeoNrf52xPwm0Ws2812xInvertedMethod KEYWORD1 NeoNrf52xPwm0Sk6812InvertedMethod KEYWORD1 NeoNrf52xPwm0Tm1814InvertedMethod KEYWORD1 +NeoNrf52xPwm0Tm1829InvertedMethod KEYWORD1 +NeoNrf52xPwm0Tx1812InvertedMethod KEYWORD1 NeoNrf52xPwm0800KbpsInvertedMethod KEYWORD1 NeoNrf52xPwm0400KbpsInvertedMethod KEYWORD1 NeoNrf52xPwm0Apa106InvertedMethod KEYWORD1 NeoNrf52xPwm1Ws2812xInvertedMethod KEYWORD1 NeoNrf52xPwm1Sk6812InvertedMethod KEYWORD1 NeoNrf52xPwm1Tm1814InvertedMethod KEYWORD1 +NeoNrf52xPwm1Tm1829InvertedMethod KEYWORD1 +NeoNrf52xPwm1Tx1812InvertedMethod KEYWORD1 NeoNrf52xPwm1800KbpsInvertedMethod KEYWORD1 NeoNrf52xPwm1400KbpsInvertedMethod KEYWORD1 NeoNrf52xPwm1Apa106InvertedMethod KEYWORD1 NeoNrf52xPwm2Ws2812xInvertedMethod KEYWORD1 NeoNrf52xPwm2Sk6812InvertedMethod KEYWORD1 NeoNrf52xPwm2Tm1814InvertedMethod KEYWORD1 +NeoNrf52xPwm2Tm1829InvertedMethod KEYWORD1 +NeoNrf52xPwm2Tx1812InvertedMethod KEYWORD1 NeoNrf52xPwm2800KbpsInvertedMethod KEYWORD1 NeoNrf52xPwm2400KbpsInvertedMethod KEYWORD1 NeoNrf52xPwm2Apa106InvertedMethod KEYWORD1 NeoNrf52xPwm3Ws2812xInvertedMethod KEYWORD1 NeoNrf52xPwm3Sk6812InvertedMethod KEYWORD1 NeoNrf52xPwm3Tm1814InvertedMethod KEYWORD1 +NeoNrf52xPwm3Tm1829InvertedMethod KEYWORD1 +NeoNrf52xPwm3Tx1812InvertedMethod KEYWORD1 NeoNrf52xPwm3800KbpsInvertedMethod KEYWORD1 NeoNrf52xPwm3400KbpsInvertedMethod KEYWORD1 NeoNrf52xPwm3Apa106InvertedMethod KEYWORD1 @@ -415,6 +474,7 @@ DotStarSpi10MhzMethod KEYWORD1 DotStarSpi2MhzMethod KEYWORD1 DotStarSpi1MhzMethod KEYWORD1 DotStarSpi500KhzMethod KEYWORD1 +DotStarSpiHzMethod KEYWORD1 NeoWs2801Method KEYWORD1 NeoWs2801SpiMethod KEYWORD1 NeoWs2801Spi20MhzMethod KEYWORD1 @@ -422,6 +482,7 @@ NeoWs2801Spi10MhzMethod KEYWORD1 NeoWs2801Spi2MhzMethod KEYWORD1 NeoWs2801Spi1MhzMethod KEYWORD1 NeoWs2801Spi500KhzMethod KEYWORD1 +NeoWs2801SpiHzMethod KEYWORD1 Lpd6803SpiMethod KEYWORD1 Lpd6803Method KEYWORD1 Lpd6803Spi20MhzMethod KEYWORD1 @@ -429,6 +490,7 @@ Lpd6803Spi10MhzMethod KEYWORD1 Lpd6803Spi2MhzMethod KEYWORD1 Lpd6803Spi1MhzMethod KEYWORD1 Lpd6803Spi500KhzMethod KEYWORD1 +Lpd6803SpiHzMethod KEYWORD1 Lpd8806Method KEYWORD1 Lpd8806SpiMethod KEYWORD1 Lpd8806Spi20MhzMethod KEYWORD1 @@ -436,6 +498,7 @@ Lpd8806Spi10MhzMethod KEYWORD1 Lpd8806Spi2MhzMethod KEYWORD1 Lpd8806Spi1MhzMethod KEYWORD1 Lpd8806Spi500KhzMethod KEYWORD1 +Lpd8806SpiHzMethod KEYWORD1 P9813Method KEYWORD1 P9813SpiMethod KEYWORD1 P9813Spi20MhzMethod KEYWORD1 @@ -443,6 +506,7 @@ P9813Spi10MhzMethod KEYWORD1 P9813Spi2MhzMethod KEYWORD1 P9813Spi1MhzMethod KEYWORD1 P9813Spi500KhzMethod KEYWORD1 +P9813SpiHzMethod KEYWORD1 NeoPixelAnimator KEYWORD1 AnimUpdateCallback KEYWORD1 AnimationParam KEYWORD1 @@ -507,12 +571,14 @@ PixelCount KEYWORD2 SetPixelColor KEYWORD2 GetPixelColor KEYWORD2 SwapPixelColor KEYWORD2 +SetString KEYWORD2 CalculateBrightness KEYWORD2 Dim KEYWORD2 Brighten KEYWORD2 Darken KEYWORD2 Lighten KEYWORD2 SetPixelSettings KEYWORD2 +SetMethodSettings KEYWORD2 LinearBlend KEYWORD2 BilinearBlend KEYWORD2 IsAnimating KEYWORD2 @@ -605,3 +671,4 @@ NeoBusChannel_4 LITERAL1 NeoBusChannel_5 LITERAL1 NeoBusChannel_6 LITERAL1 NeoBusChannel_7 LITERAL1 + diff --git a/lib/lib_basic/NeoPixelBus/library.json b/lib/lib_basic/NeoPixelBus/library.json new file mode 100644 index 000000000..c684dfdee --- /dev/null +++ b/lib/lib_basic/NeoPixelBus/library.json @@ -0,0 +1,19 @@ +{ + "name": "NeoPixelBus", + "keywords": "NeoPixel, WS2811, WS2812, WS2813, SK6812, DotStar, APA102, SK9822, APA106, LPD8806, LPD6803, P9813, TM1829, TM1814, TX1812, WS2801 RGB, RGBW", + "description": "A library that makes controlling NeoPixels (APA106, WS2811, WS2812, WS2813, SK6812, TM1829, TM1814, TX1812) and DotStars (APA102, LPD8806, LPD6803, SK9822, WS2801, P9813) easy. Supports most Arduino platforms, including async hardware support for Esp8266, Esp32, and Nrf52 (Nano 33 BLE). Support for RGBW pixels and 7 Segment LED direct driven. Includes seperate RgbColor, RgbwColor, Rgb16Color, Rgb48Color, HslColor, and HsbColor objects. Includes an animator class that helps create asyncronous animations. For all platforms; there are two methods of sending DotStar data, hardware SPI and software SPI.", + "homepage": "https://github.com/Makuna/NeoPixelBus/wiki", + "repository": { + "type": "git", + "url": "https://github.com/Makuna/NeoPixelBus" + }, + "version": "2.6.3", + "frameworks": "arduino", + "platforms": "*", + "dependencies": [ + { + "name": "SPI" + } + ] +} + diff --git a/lib/lib_basic/NeoPixelBus/library.properties b/lib/lib_basic/NeoPixelBus/library.properties new file mode 100644 index 000000000..d3fea5120 --- /dev/null +++ b/lib/lib_basic/NeoPixelBus/library.properties @@ -0,0 +1,9 @@ +name=NeoPixelBus by Makuna +version=2.6.3 +author=Michael C. Miller (makuna@live.com) +maintainer=Michael C. Miller (makuna@live.com) +sentence=A library that makes controlling NeoPixels (APA106, WS2811, WS2812, WS2813, SK6812, TM1829, TM1814, TX1812) and DotStars (APA102, LPD8806, LPD6803, SK9822, WS2801, P9813) easy. +paragraph=Supports most Arduino platforms, including async hardware support for Esp8266, Esp32, and Nrf52 (Nano 33 BLE). Support for RGBW pixels and 7 Segment LED direct driven. Includes seperate RgbColor, RgbwColor, Rgb16Color, Rgb48Color, HslColor, and HsbColor objects. Includes an animator class that helps create asyncronous animations. Supports Matrix layout of pixels. Includes Gamma corretion object. For all platforms; there are two methods of sending DotStar data, hardware SPI and software SPI. +category=Display +url=https://github.com/Makuna/NeoPixelBus/wiki +architectures=* \ No newline at end of file diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/NeoPixelAnimator.h b/lib/lib_basic/NeoPixelBus/src/NeoPixelAnimator.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/NeoPixelAnimator.h rename to lib/lib_basic/NeoPixelBus/src/NeoPixelAnimator.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/NeoPixelBrightnessBus.h b/lib/lib_basic/NeoPixelBus/src/NeoPixelBrightnessBus.h similarity index 97% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/NeoPixelBrightnessBus.h rename to lib/lib_basic/NeoPixelBus/src/NeoPixelBrightnessBus.h index 3bea54bdf..6b93a6547 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/NeoPixelBrightnessBus.h +++ b/lib/lib_basic/NeoPixelBus/src/NeoPixelBrightnessBus.h @@ -88,7 +88,7 @@ public: // Only update if there is a change if (brightness != _brightness) { - uint16_t scale = (((uint16_t)brightness + 1) << 8) / ((uint16_t)_brightness + 1); + uint16_t scale = ((static_cast(brightness) + 1) << 8) / (static_cast(_brightness) + 1); // scale existing pixels // diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/NeoPixelBus.h b/lib/lib_basic/NeoPixelBus/src/NeoPixelBus.h similarity index 95% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/NeoPixelBus.h rename to lib/lib_basic/NeoPixelBus/src/NeoPixelBus.h index 597c288f1..2151567f0 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/NeoPixelBus.h +++ b/lib/lib_basic/NeoPixelBus/src/NeoPixelBus.h @@ -104,6 +104,7 @@ License along with NeoPixel. If not, see #include "internal/NeoEsp32I2sMethod.h" #include "internal/NeoEsp32RmtMethod.h" #include "internal/NeoEspBitBangMethod.h" +#include "internal/DotStarEsp32DmaSpiMethod.h" #elif defined(ARDUINO_ARCH_NRF52840) // must be before __arm__ @@ -172,13 +173,20 @@ public: ClearTo(0); } - // used by DotStartSpiMethod if pins can be configured + // used by DotStarSpiMethod/DotStarEsp32DmaSpiMethod if pins can be configured void Begin(int8_t sck, int8_t miso, int8_t mosi, int8_t ss) { _method.Initialize(sck, miso, mosi, ss); ClearTo(0); } + // used by DotStarEsp32DmaSpiMethod if pins can be configured - reordered and extended version supporting quad SPI + void Begin(int8_t sck, int8_t dat0, int8_t dat1, int8_t dat2, int8_t dat3, int8_t ss) + { + _method.Initialize(sck, dat0, dat1, dat2, dat3, ss); + ClearTo(0); + } + void Show(bool maintainBufferConsistency = true) { if (!IsDirty()) @@ -378,6 +386,12 @@ public: T_COLOR_FEATURE::applySettings(_method.getData(), settings); Dirty(); }; + + void SetMethodSettings(const typename T_METHOD::SettingsObject& settings) + { + _method.applySettings(settings); + Dirty(); + }; uint32_t CalcTotalMilliAmpere(const typename T_COLOR_FEATURE::ColorObject::SettingsObject& settings) { diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/NeoPixelSegmentBus.h b/lib/lib_basic/NeoPixelBus/src/NeoPixelSegmentBus.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/NeoPixelSegmentBus.h rename to lib/lib_basic/NeoPixelBus/src/NeoPixelSegmentBus.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/DotStarColorFeatures.h b/lib/lib_basic/NeoPixelBus/src/internal/DotStarColorFeatures.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/DotStarColorFeatures.h rename to lib/lib_basic/NeoPixelBus/src/internal/DotStarColorFeatures.h diff --git a/lib/lib_basic/NeoPixelBus/src/internal/DotStarEsp32DmaSpiMethod.h b/lib/lib_basic/NeoPixelBus/src/internal/DotStarEsp32DmaSpiMethod.h new file mode 100644 index 000000000..d71cf79d8 --- /dev/null +++ b/lib/lib_basic/NeoPixelBus/src/internal/DotStarEsp32DmaSpiMethod.h @@ -0,0 +1,356 @@ +/*------------------------------------------------------------------------- +NeoPixel library helper functions for DotStars using Esp32, DMA and SPI (APA102). + +Written by Michael C. Miller. +DotStarEsp32DmaSpiMethod written by Louis Beaudoin (Pixelvation) + +I invest time and resources providing this open source code, +please support me by dontating (see https://github.com/Makuna/NeoPixelBus) + +------------------------------------------------------------------------- +This file is part of the Makuna/NeoPixelBus library. + +NeoPixelBus is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as +published by the Free Software Foundation, either version 3 of +the License, or (at your option) any later version. + +NeoPixelBus is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with NeoPixel. If not, see +. +-------------------------------------------------------------------------*/ + +#pragma once + +#include "driver/spi_master.h" + +#if defined(CONFIG_IDF_TARGET_ESP32C3) +// HSPI_HOST depreciated in C3 +#define HSPI_HOST SPI3_HOST +#endif + +#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) +class Esp32VspiBus +{ +public: + const static spi_host_device_t SpiHostDevice = VSPI_HOST; + const static int DmaChannel = 1; // arbitrary assignment, but based on the fact there are only two DMA channels and two available SPI ports, we need to split them somehow + const static int ParallelBits = 1; +}; +#endif + +class Esp32HspiBus +{ +public: + const static spi_host_device_t SpiHostDevice = HSPI_HOST; + const static int DmaChannel = 2; // arbitrary assignment, but based on the fact there are only two DMA channels and two available SPI ports, we need to split them somehow + const static int ParallelBits = 1; +}; + +#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) +class Esp32Vspi2BitBus +{ +public: + const static spi_host_device_t SpiHostDevice = VSPI_HOST; + const static int DmaChannel = 1; // arbitrary assignment, but based on the fact there are only two DMA channels and two available SPI ports, we need to split them somehow + const static int ParallelBits = 2; +}; +#endif + +class Esp32Hspi2BitBus +{ +public: + const static spi_host_device_t SpiHostDevice = HSPI_HOST; + const static int DmaChannel = 2; // arbitrary assignment, but based on the fact there are only two DMA channels and two available SPI ports, we need to split them somehow + const static int ParallelBits = 2; +}; + +#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) +class Esp32Vspi4BitBus +{ +public: + const static spi_host_device_t SpiHostDevice = VSPI_HOST; + const static int DmaChannel = 1; // arbitrary assignment, but based on the fact there are only two DMA channels and two available SPI ports, we need to split them somehow + const static int ParallelBits = 4; +}; +#endif + +class Esp32Hspi4BitBus +{ +public: + const static spi_host_device_t SpiHostDevice = HSPI_HOST; + const static int DmaChannel = 2; // arbitrary assignment, but based on the fact there are only two DMA channels and two available SPI ports, we need to split them somehow + const static int ParallelBits = 4; +}; + +template class DotStarEsp32DmaSpiMethod +{ +public: + typedef typename T_SPISPEED::SettingsObject SettingsObject; + + DotStarEsp32DmaSpiMethod(uint16_t pixelCount, size_t elementSize, size_t settingsSize) : + _sizePixelData(pixelCount * elementSize + settingsSize), + _sizeEndFrame((pixelCount + 15) / 16) // 16 = div 2 (bit for every two pixels) div 8 (bits to bytes) + { + _spiBufferSize = _sizeStartFrame + _sizePixelData + _sizeEndFrame; + + // must have a 4 byte aligned buffer for i2s + uint32_t alignment = _spiBufferSize % 4; + if (alignment) + { + _spiBufferSize += 4 - alignment; + } + + _data = static_cast(malloc(_spiBufferSize)); + _dmadata = static_cast(heap_caps_malloc(_spiBufferSize, MALLOC_CAP_DMA)); + + // data cleared later in NeoPixelBus::Begin() + } + + // Support constructor specifying pins by ignoring pins + DotStarEsp32DmaSpiMethod(uint8_t, uint8_t, uint16_t pixelCount, size_t elementSize, size_t settingsSize) : + DotStarEsp32DmaSpiMethod(pixelCount, elementSize, settingsSize) + { + } + + ~DotStarEsp32DmaSpiMethod() + { + if (_spiHandle) + { + deinitSpiDevice(); + esp_err_t ret = spi_bus_free(T_SPIBUS::SpiHostDevice); + ESP_ERROR_CHECK(ret); + } + free(_data); + free(_dmadata); + _spiHandle = NULL; + } + + bool IsReadyToUpdate() const + { + spi_transaction_t t; + spi_transaction_t * tptr = &t; + esp_err_t ret = spi_device_get_trans_result(_spiHandle, &tptr, 0); + + // We know the previous transaction completed if we got ESP_OK, and we know there's no transactions queued if tptr is unmodified + return (ret == ESP_OK || tptr == &t); + } + + void Initialize(int8_t sck, int8_t dat0, int8_t dat1, int8_t dat2, int8_t dat3, int8_t ss) + { + memset(_data, 0x00, _sizeStartFrame); + memset(_data + _sizeStartFrame + _sizePixelData, 0x00, _spiBufferSize - (_sizeStartFrame + _sizePixelData)); + + _ssPin = ss; + + esp_err_t ret; + spi_bus_config_t buscfg; + memset(&buscfg, 0x00, sizeof(buscfg)); + + buscfg.miso_io_num = dat1; + buscfg.mosi_io_num = dat0; + buscfg.sclk_io_num = sck; + buscfg.quadwp_io_num = dat2; + buscfg.quadhd_io_num = dat3; + buscfg.max_transfer_sz = _spiBufferSize; + + //Initialize the SPI bus + ret = spi_bus_initialize(T_SPIBUS::SpiHostDevice, &buscfg, T_SPIBUS::DmaChannel); + ESP_ERROR_CHECK(ret); + + initSpiDevice(); + } + + void Initialize(int8_t sck, int8_t miso, int8_t mosi, int8_t ss) + { + Initialize(sck, mosi, miso, -1, -1, ss); + } + + // If pins aren't specified, initialize bus with just the default SCK and MOSI pins for the SPI peripheral (no SS, no >1-bit pins) + void Initialize() + { +#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) + if (T_SPIBUS::SpiHostDevice == VSPI_HOST) + { + Initialize(SCK, -1, MOSI, -1, -1, -1); + } + else + { + Initialize(14, -1, 13, -1, -1, -1); + } +#else + Initialize(SCK, -1, MOSI, -1, -1, -1); +#endif + } + + void Update(bool) + { + while(!IsReadyToUpdate()); + + memcpy(_dmadata, _data, _spiBufferSize); + + memset(&_spiTransaction, 0, sizeof(spi_transaction_t)); + _spiTransaction.length = (_spiBufferSize) * 8; // in bits not bytes! + if (T_SPIBUS::ParallelBits == 1) + { + _spiTransaction.flags = 0; + } + if (T_SPIBUS::ParallelBits == 2) + { + _spiTransaction.flags = SPI_TRANS_MODE_DIO; + } + if (T_SPIBUS::ParallelBits == 4) + { + _spiTransaction.flags = SPI_TRANS_MODE_QIO; + } + _spiTransaction.tx_buffer = _dmadata; + + esp_err_t ret = spi_device_queue_trans(_spiHandle, &_spiTransaction, 0); //Transmit! + assert(ret == ESP_OK); //Should have had no issues. + } + + uint8_t* getData() const + { + return _data + _sizeStartFrame; + }; + + size_t getDataSize() const + { + return _sizePixelData; + }; + + void applySettings(const SettingsObject& settings) + { + _speed.applySettings(settings); + if (_spiHandle) + { + deinitSpiDevice(); + initSpiDevice(); + } + } + +private: + void initSpiDevice() + { + spi_device_interface_config_t devcfg = {}; + + devcfg.clock_speed_hz = _speed.Clock; + devcfg.mode = 0; //SPI mode 0 + devcfg.spics_io_num = _ssPin; //CS pin + devcfg.queue_size = 1; + if (T_SPIBUS::ParallelBits == 1) + { + devcfg.flags = 0; + } + if (T_SPIBUS::ParallelBits >= 2) + { + devcfg.flags = SPI_DEVICE_HALFDUPLEX; + } + + //Allocate the LEDs on the SPI bus + esp_err_t ret = spi_bus_add_device(T_SPIBUS::SpiHostDevice, &devcfg, &_spiHandle); + ESP_ERROR_CHECK(ret); + } + + void deinitSpiDevice() + { + while(!IsReadyToUpdate()); + esp_err_t ret = spi_bus_remove_device(_spiHandle); + ESP_ERROR_CHECK(ret); + } + + const size_t _sizeStartFrame = 4; + const size_t _sizePixelData; // Size of '_data' buffer below, minus (_sizeStartFrame + _sizeEndFrame) + const size_t _sizeEndFrame; + + size_t _spiBufferSize; + uint8_t* _data; // Holds start/end frames and LED color values + uint8_t* _dmadata; // Holds start/end frames and LED color values + spi_device_handle_t _spiHandle = NULL; + spi_transaction_t _spiTransaction; + T_SPISPEED _speed; + int8_t _ssPin; +}; + +#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) +// Clock Speed and Default Definitions for DotStarEsp32DmaVspi +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaVspi40MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaVspi20MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaVspi10MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaVspi5MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaVspi2MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaVspi1MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaVspi500KhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaVspiHzMethod; + +typedef DotStarEsp32DmaVspi10MhzMethod DotStarEsp32DmaVspiMethod; +#endif + +// Clock Speed and Default Definitions for DotStarEsp32DmaHspi +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaHspi40MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaHspi20MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaHspi10MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaHspi5MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaHspi2MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaHspi1MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaHspi500KhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaHspiHzMethod; + +typedef DotStarEsp32DmaHspi10MhzMethod DotStarEsp32DmaHspiMethod; + +#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) +// Clock Speed and Default Definitions for DotStarEsp32DmaVspi2Bit +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaVspi2Bit40MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaVspi2Bit20MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaVspi2Bit10MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaVspi2Bit5MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaVspi2Bit2MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaVspi2Bit1MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaVspi2Bit500KhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaVspi2BitHzMethod; + +typedef DotStarEsp32DmaVspi2Bit10MhzMethod DotStarEsp32DmaVspi2BitMethod; +#endif + +// Clock Speed and Default Definitions for DotStarEsp32DmaHspi2Bit +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaHspi2Bit40MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaHspi2Bit20MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaHspi2Bit10MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaHspi2Bit5MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaHspi2Bit2MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaHspi2Bit1MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaHspi2Bit500KhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaHspi2BitHzMethod; + +typedef DotStarEsp32DmaHspi2Bit10MhzMethod DotStarEsp32DmaHspi2BitMethod; + +#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) +// Clock Speed and Default Definitions for DotStarEsp32DmaVspi4Bit +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaVspi4Bit40MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaVspi4Bit20MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaVspi4Bit10MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaVspi4Bit5MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaVspi4Bit2MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaVspi4Bit1MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaVspi4Bit500KhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaVspi4BitHzMethod; + +typedef DotStarEsp32DmaVspi4Bit10MhzMethod DotStarEsp32DmaVspi4BitMethod; +#endif + +// Clock Speed and Default Definitions for DotStarEsp32DmaHspi4Bit +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaHspi4Bit40MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaHspi4Bit20MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaHspi4Bit10MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaHspi4Bit5MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaHspi4Bit2MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaHspi4Bit1MhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaHspi4Bit500KhzMethod; +typedef DotStarEsp32DmaSpiMethod DotStarEsp32DmaHspi4BitHzMethod; + +typedef DotStarEsp32DmaHspi4Bit10MhzMethod DotStarEsp32DmaHspi4BitMethod; diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/DotStarGenericMethod.h b/lib/lib_basic/NeoPixelBus/src/internal/DotStarGenericMethod.h similarity index 68% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/DotStarGenericMethod.h rename to lib/lib_basic/NeoPixelBus/src/internal/DotStarGenericMethod.h index 1804c32fd..81a4527ec 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/DotStarGenericMethod.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/DotStarGenericMethod.h @@ -37,6 +37,8 @@ License along with NeoPixel. If not, see template class DotStarMethodBase { public: + typedef typename T_TWOWIRE::SettingsObject SettingsObject; + DotStarMethodBase(uint8_t pinClock, uint8_t pinData, uint16_t pixelCount, size_t elementSize, size_t settingsSize) : _sizeData(pixelCount * elementSize + settingsSize), _sizeEndFrame((pixelCount + 15) / 16), // 16 = div 2 (bit for every two pixels) div 8 (bits to bytes) @@ -112,6 +114,11 @@ public: return _sizeData; }; + void applySettings(const SettingsObject& settings) + { + _wire.applySettings(settings); + } + private: const size_t _sizeData; // Size of '_data' buffer below const size_t _sizeEndFrame; @@ -127,12 +134,37 @@ typedef DotStarMethodBase DotStarMethod; typedef DotStarMethodBase> DotStarSpi40MhzMethod; typedef DotStarMethodBase> DotStarSpi20MhzMethod; typedef DotStarMethodBase> DotStarSpi10MhzMethod; +typedef DotStarMethodBase> DotStarSpi5MhzMethod; typedef DotStarMethodBase> DotStarSpi2MhzMethod; typedef DotStarMethodBase> DotStarSpi1MhzMethod; typedef DotStarMethodBase> DotStarSpi500KhzMethod; +typedef DotStarMethodBase> DotStarSpiHzMethod; typedef DotStarSpi10MhzMethod DotStarSpiMethod; #endif +#if defined(ARDUINO_ARCH_ESP32) +// Give option to use Vspi alias of Spi class if wanting to specify which SPI peripheral is used on the ESP32 +typedef DotStarMethodBase> DotStarVspi40MhzMethod; +typedef DotStarMethodBase> DotStarVspi20MhzMethod; +typedef DotStarMethodBase> DotStarVspi10MhzMethod; +typedef DotStarMethodBase> DotStarVspi5MhzMethod; +typedef DotStarMethodBase> DotStarVspi2MhzMethod; +typedef DotStarMethodBase> DotStarVspi1MhzMethod; +typedef DotStarMethodBase> DotStarVspi500KhzMethod; +typedef DotStarMethodBase> DotStarVspiHzMethod; +typedef DotStarSpi10MhzMethod DotStarVspiMethod; +#include "TwoWireHspiImple.h" +typedef DotStarMethodBase> DotStarHspi40MhzMethod; +typedef DotStarMethodBase> DotStarHspi20MhzMethod; +typedef DotStarMethodBase> DotStarHspi10MhzMethod; +typedef DotStarMethodBase> DotStarHspi5MhzMethod; +typedef DotStarMethodBase> DotStarHspi2MhzMethod; +typedef DotStarMethodBase> DotStarHspi1MhzMethod; +typedef DotStarMethodBase> DotStarHspi500KhzMethod; +typedef DotStarMethodBase> DotStarHspiHzMethod; + +typedef DotStarHspi10MhzMethod DotStarHspiMethod; +#endif diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Esp32_i2s.c b/lib/lib_basic/NeoPixelBus/src/internal/Esp32_i2s.c similarity index 92% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Esp32_i2s.c rename to lib/lib_basic/NeoPixelBus/src/internal/Esp32_i2s.c index 032f0fe73..d25856a2e 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Esp32_i2s.c +++ b/lib/lib_basic/NeoPixelBus/src/internal/Esp32_i2s.c @@ -15,7 +15,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if defined(ARDUINO_ARCH_ESP32) +#if defined(ARDUINO_ARCH_ESP32) + +#include "sdkconfig.h" // this sets useful config symbols, like CONFIG_IDF_TARGET_ESP32C3 + +// ESP32C3 I2S is not supported yet due to significant changes to interface +#if !defined(CONFIG_IDF_TARGET_ESP32C3) #include #include @@ -38,7 +43,10 @@ #include "soc/io_mux_reg.h" #include "soc/rtc_cntl_reg.h" #include "soc/i2s_struct.h" +#if defined(CONFIG_IDF_TARGET_ESP32) +/* included here for ESP-IDF v4.x compatibility */ #include "soc/dport_reg.h" +#endif #include "soc/sens_reg.h" #include "driver/gpio.h" #include "driver/i2s.h" @@ -104,7 +112,7 @@ typedef struct { static uint8_t i2s_silence_buf[I2S_DMA_SILENCE_SIZE] = { 0 }; -#if !defined(CONFIG_IDF_TARGET_ESP32S2) +#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) // (I2S_NUM_MAX == 2) static i2s_bus_t I2S[I2S_NUM_MAX] = { {&I2S0, -1, -1, -1, -1, 0, NULL, NULL, i2s_silence_buf, I2S_DMA_SILENCE_SIZE, NULL, I2S_DMA_BLOCK_COUNT_DEFAULT, 0, 0, I2s_Is_Idle}, @@ -129,16 +137,16 @@ bool i2sInitDmaItems(uint8_t bus_num) { size_t dmaCount = I2S[bus_num].dma_count; if (I2S[bus_num].dma_items == NULL) { - I2S[bus_num].dma_items = (i2s_dma_item_t*)(malloc(dmaCount * sizeof(i2s_dma_item_t))); + I2S[bus_num].dma_items = (i2s_dma_item_t*)heap_caps_malloc(dmaCount * sizeof(i2s_dma_item_t), MALLOC_CAP_DMA); if (I2S[bus_num].dma_items == NULL) { log_e("MEM ERROR!"); return false; } } - int i, i2, a; + int i, i2; i2s_dma_item_t* item = NULL; - i2s_dma_item_t* itemPrev; + i2s_dma_item_t* itemPrev = NULL; for(i=0; i< dmaCount; i++) { itemPrev = item; @@ -178,7 +186,7 @@ esp_err_t i2sSetClock(uint8_t bus_num, uint8_t div_num, uint8_t div_b, uint8_t d typeof(i2s->clkm_conf) clkm_conf; clkm_conf.val = 0; -#if !defined(CONFIG_IDF_TARGET_ESP32S2) +#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) clkm_conf.clka_en = 0; #else clkm_conf.clk_sel = 2; @@ -213,7 +221,7 @@ void i2sSetPins(uint8_t bus_num, int8_t out, bool invert) { pinMode(out, OUTPUT); int i2sSignal; -#if !defined(CONFIG_IDF_TARGET_ESP32S2) +#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) // (I2S_NUM_MAX == 2) if (bus_num == 1) { i2sSignal = I2S1O_DATA_OUT23_IDX; @@ -259,7 +267,7 @@ void i2sInit(uint8_t bus_num, return; } -#if !defined(CONFIG_IDF_TARGET_ESP32S2) +#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) // (I2S_NUM_MAX == 2) if (bus_num) { periph_module_enable(PERIPH_I2S1_MODULE); @@ -301,7 +309,7 @@ void i2sInit(uint8_t bus_num, lc_conf.out_eof_mode = 1; i2s->lc_conf.val = lc_conf.val; -#if !defined(CONFIG_IDF_TARGET_ESP32S2) +#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) i2s->pdm_conf.pcm2pdm_conv_en = 0; i2s->pdm_conf.pdm2pcm_conv_en = 0; #endif @@ -332,7 +340,7 @@ void i2sInit(uint8_t bus_num, i2s->fifo_conf.tx_fifo_mod_force_en = 1; -#if !defined(CONFIG_IDF_TARGET_ESP32S2) +#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) i2s->pdm_conf.rx_pdm_en = 0; i2s->pdm_conf.tx_pdm_en = 0; #endif @@ -342,7 +350,7 @@ void i2sInit(uint8_t bus_num, // enable intr in cpu // int i2sIntSource; -#if !defined(CONFIG_IDF_TARGET_ESP32S2) +#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) // (I2S_NUM_MAX == 2) if (bus_num == 1) { i2sIntSource = ETS_I2S1_INTR_SOURCE; @@ -448,7 +456,6 @@ size_t i2sWrite(uint8_t bus_num, uint8_t* data, size_t len, bool copy, bool free } size_t blockSize = len; - i2s_dma_item_t* itemPrev = NULL; i2s_dma_item_t* item = &I2S[bus_num].dma_items[0]; size_t dataLeft = len; uint8_t* pos = data; @@ -469,7 +476,6 @@ size_t i2sWrite(uint8_t bus_num, uint8_t* data, size_t len, bool copy, bool free item->blocksize = blockSize; item->datalen = blockSize; - itemPrev = item; item++; pos += blockSize; @@ -488,5 +494,6 @@ size_t i2sWrite(uint8_t bus_num, uint8_t* data, size_t len, bool copy, bool free return len; } +#endif // !defined(CONFIG_IDF_TARGET_ESP32C3) +#endif // defined(ARDUINO_ARCH_ESP32) -#endif diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Esp32_i2s.h b/lib/lib_basic/NeoPixelBus/src/internal/Esp32_i2s.h similarity index 87% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Esp32_i2s.h rename to lib/lib_basic/NeoPixelBus/src/internal/Esp32_i2s.h index d31c51eea..1249d2e11 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Esp32_i2s.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/Esp32_i2s.h @@ -1,6 +1,7 @@ #pragma once -#if defined(ARDUINO_ARCH_ESP32) +// ESP32C3 I2S is not supported yet due to significant changes to interface +#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C3) #ifdef __cplusplus extern "C" { diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/HsbColor.cpp b/lib/lib_basic/NeoPixelBus/src/internal/HsbColor.cpp similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/HsbColor.cpp rename to lib/lib_basic/NeoPixelBus/src/internal/HsbColor.cpp diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/HsbColor.h b/lib/lib_basic/NeoPixelBus/src/internal/HsbColor.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/HsbColor.h rename to lib/lib_basic/NeoPixelBus/src/internal/HsbColor.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/HslColor.cpp b/lib/lib_basic/NeoPixelBus/src/internal/HslColor.cpp similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/HslColor.cpp rename to lib/lib_basic/NeoPixelBus/src/internal/HslColor.cpp diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/HslColor.h b/lib/lib_basic/NeoPixelBus/src/internal/HslColor.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/HslColor.h rename to lib/lib_basic/NeoPixelBus/src/internal/HslColor.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/HtmlColor.cpp b/lib/lib_basic/NeoPixelBus/src/internal/HtmlColor.cpp similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/HtmlColor.cpp rename to lib/lib_basic/NeoPixelBus/src/internal/HtmlColor.cpp diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/HtmlColor.h b/lib/lib_basic/NeoPixelBus/src/internal/HtmlColor.h similarity index 99% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/HtmlColor.h rename to lib/lib_basic/NeoPixelBus/src/internal/HtmlColor.h index 238d4acdb..25329eb6e 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/HtmlColor.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/HtmlColor.h @@ -90,7 +90,7 @@ struct HtmlColor // ------------------------------------------------------------------------ HtmlColor(const RgbColor& color) { - Color = (uint32_t)color.R << 16 | (uint32_t)color.G << 8 | (uint32_t)color.B; + Color = static_cast(color.R) << 16 | static_cast(color.G) << 8 | static_cast(color.B); } // ------------------------------------------------------------------------ diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/HtmlColorNameStrings.cpp b/lib/lib_basic/NeoPixelBus/src/internal/HtmlColorNameStrings.cpp similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/HtmlColorNameStrings.cpp rename to lib/lib_basic/NeoPixelBus/src/internal/HtmlColorNameStrings.cpp diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/HtmlColorNameStrings.h b/lib/lib_basic/NeoPixelBus/src/internal/HtmlColorNameStrings.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/HtmlColorNameStrings.h rename to lib/lib_basic/NeoPixelBus/src/internal/HtmlColorNameStrings.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/HtmlColorNames.cpp b/lib/lib_basic/NeoPixelBus/src/internal/HtmlColorNames.cpp similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/HtmlColorNames.cpp rename to lib/lib_basic/NeoPixelBus/src/internal/HtmlColorNames.cpp diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/HtmlColorShortNames.cpp b/lib/lib_basic/NeoPixelBus/src/internal/HtmlColorShortNames.cpp similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/HtmlColorShortNames.cpp rename to lib/lib_basic/NeoPixelBus/src/internal/HtmlColorShortNames.cpp diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Layouts.h b/lib/lib_basic/NeoPixelBus/src/internal/Layouts.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Layouts.h rename to lib/lib_basic/NeoPixelBus/src/internal/Layouts.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Lpd6803ColorFeatures.h b/lib/lib_basic/NeoPixelBus/src/internal/Lpd6803ColorFeatures.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Lpd6803ColorFeatures.h rename to lib/lib_basic/NeoPixelBus/src/internal/Lpd6803ColorFeatures.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Lpd6803GenericMethod.h b/lib/lib_basic/NeoPixelBus/src/internal/Lpd6803GenericMethod.h similarity index 92% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Lpd6803GenericMethod.h rename to lib/lib_basic/NeoPixelBus/src/internal/Lpd6803GenericMethod.h index 8db4d3367..ecb7e4973 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Lpd6803GenericMethod.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/Lpd6803GenericMethod.h @@ -37,6 +37,8 @@ License along with NeoPixel. If not, see template class Lpd6803MethodBase { public: + typedef typename T_TWOWIRE::SettingsObject SettingsObject; + Lpd6803MethodBase(uint8_t pinClock, uint8_t pinData, uint16_t pixelCount, size_t elementSize, size_t settingsSize) : _sizeData(pixelCount * elementSize + settingsSize), _sizeFrame((pixelCount + 7) / 8), // bit for every pixel at least @@ -108,6 +110,11 @@ public: return _sizeData; }; + void applySettings(const SettingsObject& settings) + { + _wire.applySettings(settings); + } + private: const size_t _sizeData; // Size of '_data' buffer below const size_t _sizeFrame; @@ -122,9 +129,13 @@ typedef Lpd6803MethodBase Lpd6803Method; #include "TwoWireSpiImple.h" typedef Lpd6803MethodBase> Lpd6803Spi20MhzMethod; typedef Lpd6803MethodBase> Lpd6803Spi10MhzMethod; +typedef Lpd6803MethodBase> Lpd6803Spi5MhzMethod; typedef Lpd6803MethodBase> Lpd6803Spi2MhzMethod; typedef Lpd6803MethodBase> Lpd6803Spi1MhzMethod; typedef Lpd6803MethodBase> Lpd6803Spi500KhzMethod; + +typedef Lpd6803MethodBase> Lpd6803SpiHzMethod; + typedef Lpd6803Spi10MhzMethod Lpd6803SpiMethod; #endif diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Lpd8806ColorFeatures.h b/lib/lib_basic/NeoPixelBus/src/internal/Lpd8806ColorFeatures.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Lpd8806ColorFeatures.h rename to lib/lib_basic/NeoPixelBus/src/internal/Lpd8806ColorFeatures.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Lpd8806GenericMethod.h b/lib/lib_basic/NeoPixelBus/src/internal/Lpd8806GenericMethod.h similarity index 92% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Lpd8806GenericMethod.h rename to lib/lib_basic/NeoPixelBus/src/internal/Lpd8806GenericMethod.h index a3b07cc5b..c2372f21a 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Lpd8806GenericMethod.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/Lpd8806GenericMethod.h @@ -37,6 +37,8 @@ License along with NeoPixel. If not, see template class Lpd8806MethodBase { public: + typedef typename T_TWOWIRE::SettingsObject SettingsObject; + Lpd8806MethodBase(uint8_t pinClock, uint8_t pinData, uint16_t pixelCount, size_t elementSize, size_t settingsSize) : _sizeData(pixelCount * elementSize + settingsSize), _sizeFrame((pixelCount + 31) / 32), @@ -108,6 +110,11 @@ public: return _sizeData; }; + void applySettings(const SettingsObject& settings) + { + _wire.applySettings(settings); + } + private: const size_t _sizeData; // Size of '_data' buffer below const size_t _sizeFrame; @@ -122,9 +129,13 @@ typedef Lpd8806MethodBase Lpd8806Method; #include "TwoWireSpiImple.h" typedef Lpd8806MethodBase> Lpd8806Spi20MhzMethod; typedef Lpd8806MethodBase> Lpd8806Spi10MhzMethod; +typedef Lpd8806MethodBase> Lpd8806Spi5MhzMethod; typedef Lpd8806MethodBase> Lpd8806Spi2MhzMethod; typedef Lpd8806MethodBase> Lpd8806Spi1MhzMethod; typedef Lpd8806MethodBase> Lpd8806Spi500KhzMethod; + +typedef Lpd8806MethodBase> Lpd8806SpiHzMethod; + typedef Lpd8806Spi10MhzMethod Lpd8806SpiMethod; #endif diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoArmMethod.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoArmMethod.h similarity index 92% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoArmMethod.h rename to lib/lib_basic/NeoPixelBus/src/internal/NeoArmMethod.h index 048d5ee38..b0199ae1b 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoArmMethod.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoArmMethod.h @@ -35,6 +35,8 @@ License along with NeoPixel. If not, see template class NeoArmMethodBase { public: + typedef NeoNoSettings SettingsObject; + NeoArmMethodBase(uint8_t pin, uint16_t pixelCount, size_t elementSize, size_t settingsSize) : _sizeData(pixelCount * elementSize + settingsSize), _pin(pin) @@ -99,6 +101,10 @@ public: return _sizeData; }; + void applySettings(const SettingsObject& settings) + { + } + private: const size_t _sizeData; // Size of '_data' buffer below @@ -136,6 +142,12 @@ public: static const uint32_t ResetTimeUs = 200; }; +class NeoArmMk20dxSpeedPropsTm1829 : public NeoArmMk20dxSpeedProps800KbpsBase +{ +public: + static const uint32_t ResetTimeUs = 200; +}; + class NeoArmMk20dxSpeedProps800Kbps : public NeoArmMk20dxSpeedProps800KbpsBase { public: @@ -207,6 +219,7 @@ public: typedef NeoArmMethodBase> NeoArmWs2812xMethod; typedef NeoArmMethodBase> NeoArmSk6812Method; typedef NeoArmMethodBase> NeoArmTm1814InvertedMethod; +typedef NeoArmMethodBase> NeoArmTm1829InvertedMethod; typedef NeoArmMethodBase> NeoArmApa106Method; typedef NeoArmMethodBase> NeoArm800KbpsMethod; typedef NeoArmMethodBase> NeoArm400KbpsMethod; @@ -324,6 +337,12 @@ public: const static uint32_t ResetTimeUs = 200; }; +class NeoArmMk26z64SpeedTm1829 : public NeoArmMk26z64Speed800KbpsBase +{ +public: + const static uint32_t ResetTimeUs = 200; +}; + class NeoArmMk26z64Speed800Kbps : public NeoArmMk26z64Speed800KbpsBase { public: @@ -333,6 +352,7 @@ public: typedef NeoArmMethodBase NeoArmWs2812xMethod; typedef NeoArmMethodBase NeoArmSk6812Method; typedef NeoArmMethodBase NeoArmTm1814InvertedMethod; +typedef NeoArmMethodBase NeoArmTm1829InvertedMethod; typedef NeoArmMethodBase NeoArm800KbpsMethod; typedef NeoArm800KbpsMethod NeoArmApa106Method; @@ -386,6 +406,12 @@ public: static const uint32_t ResetTimeUs = 200; }; +class NeoArmSamd21g18aSpeedPropsTm1829 : public NeoArmSamd21g18aSpeedProps800KbpsBase +{ +public: + static const uint32_t ResetTimeUs = 200; +}; + class NeoArmSamd21g18aSpeedProps800Kbps : public NeoArmSamd21g18aSpeedProps800KbpsBase { public: @@ -475,6 +501,7 @@ public: typedef NeoArmMethodBase> NeoArmWs2812xMethod; typedef NeoArmMethodBase> NeoArmSk6812Method; typedef NeoArmMethodBase> NeoArmTm1814InvertedMethod; +typedef NeoArmMethodBase> NeoArmTm1829InvertedMethod; typedef NeoArmMethodBase> NeoArm800KbpsMethod; typedef NeoArmMethodBase> NeoArm400KbpsMethod; typedef NeoArm400KbpsMethod NeoArmApa106Method; @@ -551,6 +578,12 @@ public: static const uint32_t ResetTimeUs = 200; }; +class NeoArmStm32SpeedPropsTm1829 : public NeoArmStm32SpeedProps800KbpsBase +{ +public: + static const uint32_t ResetTimeUs = 200; +}; + class NeoArmStm32SpeedProps800Kbps : public NeoArmStm32SpeedProps800KbpsBase { public: @@ -663,6 +696,7 @@ public: typedef NeoArmMethodBase> NeoArmWs2812xMethod; typedef NeoArmMethodBase> NeoArmSk6812Method; typedef NeoArmMethodBase> NeoArmTm1814InvertedMethod; +typedef NeoArmMethodBase> NeoArmTm1829InvertedMethod; typedef NeoArmMethodBase> NeoArm800KbpsMethod; typedef NeoArm800KbpsMethod NeoArmApa106Method; @@ -675,9 +709,9 @@ typedef NeoArm800KbpsMethod NeoArmApa106Method; class NeoArmOtherSpeedProps800KbpsBase { public: - static const uint32_t CyclesT0h = ((uint32_t)(0.40 * ARM_OTHER_SCALE + 0.5) - (5 * ARM_OTHER_INST)); - static const uint32_t CyclesT1h = ((uint32_t)(0.80 * ARM_OTHER_SCALE + 0.5) - (5 * ARM_OTHER_INST)); - static const uint32_t Cycles = ((uint32_t)(1.25 * ARM_OTHER_SCALE + 0.5) - (5 * ARM_OTHER_INST)); + static const uint32_t CyclesT0h = static_cast((0.40 * ARM_OTHER_SCALE + 0.5) - (5 * ARM_OTHER_INST)); + static const uint32_t CyclesT1h = static_cast((0.80 * ARM_OTHER_SCALE + 0.5) - (5 * ARM_OTHER_INST)); + static const uint32_t Cycles = static_cast((1.25 * ARM_OTHER_SCALE + 0.5) - (5 * ARM_OTHER_INST)); }; class NeoArmOtherSpeedPropsWs2812x : public NeoArmOtherSpeedProps800KbpsBase @@ -698,6 +732,12 @@ public: static const uint32_t ResetTimeUs = 200; }; +class NeoArmOtherSpeedPropsTm1829 : public NeoArmOtherSpeedProps800KbpsBase +{ +public: + static const uint32_t ResetTimeUs = 200; +}; + class NeoArmOtherSpeedProps800Kbps : public NeoArmOtherSpeedProps800KbpsBase { public: @@ -707,9 +747,9 @@ public: class NeoArmOtherSpeedProps400Kbps { public: - static const uint32_t CyclesT0h = ((uint32_t)(0.50 * ARM_OTHER_SCALE + 0.5) - (5 * ARM_OTHER_INST)); - static const uint32_t CyclesT1h = ((uint32_t)(1.20 * ARM_OTHER_SCALE + 0.5) - (5 * ARM_OTHER_INST)); - static const uint32_t Cycles = ((uint32_t)(2.50 * ARM_OTHER_SCALE + 0.5) - (5 * ARM_OTHER_INST)); + static const uint32_t CyclesT0h = static_cast((0.50 * ARM_OTHER_SCALE + 0.5) - (5 * ARM_OTHER_INST)); + static const uint32_t CyclesT1h = static_cast((1.20 * ARM_OTHER_SCALE + 0.5) - (5 * ARM_OTHER_INST)); + static const uint32_t Cycles = static_cast((2.50 * ARM_OTHER_SCALE + 0.5) - (5 * ARM_OTHER_INST)); static const uint32_t ResetTimeUs = 50; }; @@ -733,7 +773,7 @@ public: uint8_t mask; pmc_set_writeprotect(false); - pmc_enable_periph_clk((uint32_t)TC3_IRQn); + pmc_enable_periph_clk(static_cast(TC3_IRQn)); TC_Configure(TC1, 0, TC_CMR_WAVE | TC_CMR_WAVSEL_UP | TC_CMR_TCCLKS_TIMER_CLOCK1); @@ -792,6 +832,7 @@ public: typedef NeoArmMethodBase> NeoArmWs2812xMethod; typedef NeoArmMethodBase> NeoArmSk6812Method; typedef NeoArmMethodBase> NeoArmTm1814InvertedMethod; +typedef NeoArmMethodBase> NeoArmTm1829InvertedMethod; typedef NeoArmMethodBase> NeoArm800KbpsMethod; typedef NeoArmMethodBase> NeoArm400KbpsMethod; typedef NeoArm400KbpsMethod NeoArmApa106Method; @@ -813,6 +854,7 @@ typedef NeoArm400KbpsMethod Neo400KbpsMethod; #endif // there is no invert methods for arm, but the norm for TM1814 is inverted, so typedef NeoArmTm1814InvertedMethod NeoTm1814InvertedMethod; +typedef NeoArmTm1829InvertedMethod NeoTm1829InvertedMethod; #endif // defined(__arm__) diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoAvrMethod.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoAvrMethod.h similarity index 95% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoAvrMethod.h rename to lib/lib_basic/NeoPixelBus/src/internal/NeoAvrMethod.h index aa5b0a83c..673ba8eca 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoAvrMethod.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoAvrMethod.h @@ -89,6 +89,12 @@ public: static const uint32_t ResetTimeUs = 200; }; +class NeoAvrSpeedTm1829 : public NeoAvrSpeed800KbpsBase +{ +public: + static const uint32_t ResetTimeUs = 200; +}; + class NeoAvrSpeed800Kbps: public NeoAvrSpeed800KbpsBase { public: @@ -118,6 +124,8 @@ public: template class NeoAvrMethodBase { public: + typedef NeoNoSettings SettingsObject; + NeoAvrMethodBase(uint8_t pin, uint16_t pixelCount, size_t elementSize, size_t settingsSize) : _sizeData(pixelCount * elementSize + settingsSize), _pin(pin), @@ -189,6 +197,10 @@ public: return _sizeData; }; + void applySettings(const SettingsObject& settings) + { + } + private: const size_t _sizeData; // size of _data below const uint8_t _pin; // output pin number @@ -204,6 +216,7 @@ private: typedef NeoAvrMethodBase NeoAvrWs2812xMethod; typedef NeoAvrMethodBase NeoAvrSk6812Method; typedef NeoAvrMethodBase NeoAvrTm1814InvertedMethod; +typedef NeoAvrMethodBase NeoAvrTm1829InvertedMethod; typedef NeoAvrMethodBase NeoAvr800KbpsMethod; typedef NeoAvrMethodBase NeoAvr400KbpsMethod; @@ -220,5 +233,6 @@ typedef NeoAvrWs2812xMethod Neo800KbpsMethod; typedef NeoAvr400KbpsMethod Neo400KbpsMethod; typedef NeoAvrTm1814InvertedMethod NeoTm1814InvertedMethod; +typedef NeoAvrTm1829InvertedMethod NeoTm1829InvertedMethod; #endif diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoBitmapFile.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoBitmapFile.h similarity index 97% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoBitmapFile.h rename to lib/lib_basic/NeoPixelBus/src/internal/NeoBitmapFile.h index 2f0718e19..467d55d1c 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoBitmapFile.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoBitmapFile.h @@ -206,7 +206,7 @@ public: { for (int16_t x = 0; x < wSrc && indexPixel < destPixelCount; x++, indexPixel++) { - if ((uint16_t)xSrc < _width) + if (static_cast(xSrc) < _width) { if (readPixel(&color)) { @@ -255,7 +255,7 @@ public: { uint16_t indexDest = layoutMap(xDest + x, yDest + y); - if ((uint16_t)xFile < _width) + if (static_cast(xFile) < _width) { if (readPixel(&color)) { @@ -311,7 +311,7 @@ private: { x = 0; } - else if ((uint16_t)x >= _width) + else if (static_cast(x) >= _width) { x = _width - 1; } @@ -324,7 +324,7 @@ private: { y = 0; } - else if ((uint16_t)y >= _height) + else if (static_cast(y) >= _height) { y = _height - 1; } diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoBuffer.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoBuffer.h similarity index 98% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoBuffer.h rename to lib/lib_basic/NeoPixelBus/src/internal/NeoBuffer.h index 996a77820..d904e8714 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoBuffer.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoBuffer.h @@ -162,9 +162,9 @@ private: uint16_t result = PixelIndex_OutOfBounds; if (x >= 0 && - (uint16_t)x < Width() && + static_cast(x) < Width() && y >= 0 && - (uint16_t)y < Height()) + static_cast(y) < Height()) { result = x + y * Width(); } diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoBufferContext.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoBufferContext.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoBufferContext.h rename to lib/lib_basic/NeoPixelBus/src/internal/NeoBufferContext.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoBufferMethods.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoBufferMethods.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoBufferMethods.h rename to lib/lib_basic/NeoPixelBus/src/internal/NeoBufferMethods.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoBusChannel.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoBusChannel.h similarity index 85% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoBusChannel.h rename to lib/lib_basic/NeoPixelBus/src/internal/NeoBusChannel.h index 2743bff03..9fc374d33 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoBusChannel.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoBusChannel.h @@ -19,11 +19,12 @@ enum NeoBusChannel NeoBusChannel_3, -#if !defined(CONFIG_IDF_TARGET_ESP32S2) +#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) NeoBusChannel_4, NeoBusChannel_5, NeoBusChannel_6, NeoBusChannel_7, -#endif // CONFIG_IDF_TARGET_ESP32S2 +#endif + #endif // ARDUINO_ARCH_ESP32 }; \ No newline at end of file diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoColorFeatures.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoColorFeatures.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoColorFeatures.h rename to lib/lib_basic/NeoPixelBus/src/internal/NeoColorFeatures.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoDib.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoDib.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoDib.h rename to lib/lib_basic/NeoPixelBus/src/internal/NeoDib.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoEase.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoEase.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoEase.h rename to lib/lib_basic/NeoPixelBus/src/internal/NeoEase.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoEsp32I2sMethod.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32I2sMethod.h similarity index 88% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoEsp32I2sMethod.h rename to lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32I2sMethod.h index 32411c2bb..8d1d9dbee 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoEsp32I2sMethod.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32I2sMethod.h @@ -26,7 +26,8 @@ License along with NeoPixel. If not, see #pragma once -#ifdef ARDUINO_ARCH_ESP32 +// ESP32C3 I2S is not supported yet due to significant changes to interface +#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C3) extern "C" { @@ -60,6 +61,14 @@ public: const static uint16_t ResetTimeUs = 200; }; +class NeoEsp32I2sSpeedTm1829 +{ +public: + const static uint32_t I2sSampleRate = 100000; + const static uint16_t ByteSendTimeUs = 10; + const static uint16_t ResetTimeUs = 200; +}; + class NeoEsp32I2sSpeed800Kbps { public: @@ -128,6 +137,8 @@ public: template class NeoEsp32I2sMethodBase { public: + typedef NeoNoSettings SettingsObject; + NeoEsp32I2sMethodBase(uint8_t pin, uint16_t pixelCount, size_t elementSize, size_t settingsSize) : _sizeData(pixelCount * elementSize + settingsSize), _pin(pin) @@ -198,6 +209,10 @@ public: return _sizeData; } + void applySettings(const SettingsObject& settings) + { + } + private: const size_t _sizeData; // Size of '_data' buffer const uint8_t _pin; // output pin number @@ -210,7 +225,11 @@ private: void construct(uint16_t pixelCount, size_t elementSize, size_t settingsSize) { - ESP_ERROR_CHECK(pixelCount >= 2 ? ESP_OK : ESP_ERR_INVALID_ARG); + // DMA is too fast to support a single pixel and maintain consistency + if (pixelCount < 2) + { + pixelCount = 2; + } uint16_t dmaSettingsSize = c_dmaBytesPerPixelBytes * settingsSize; uint16_t dmaPixelSize = c_dmaBytesPerPixelBytes * elementSize; @@ -228,7 +247,7 @@ private: _data = static_cast(malloc(_sizeData)); // data cleared later in Begin() - _i2sBuffer = static_cast(malloc(_i2sBufferSize)); + _i2sBuffer = static_cast(heap_caps_malloc(_i2sBufferSize, MALLOC_CAP_DMA)); // no need to initialize all of it, but since it contains // "reset" bits that don't latter get overwritten we just clear it all memset(_i2sBuffer, 0x00, _i2sBufferSize); @@ -257,6 +276,7 @@ private: typedef NeoEsp32I2sMethodBase NeoEsp32I2s0Ws2812xMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s0Sk6812Method; typedef NeoEsp32I2sMethodBase NeoEsp32I2s0Tm1814Method; +typedef NeoEsp32I2sMethodBase NeoEsp32I2s0Tm1829Method; typedef NeoEsp32I2sMethodBase NeoEsp32I2s0800KbpsMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s0400KbpsMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s0Apa106Method; @@ -265,16 +285,18 @@ typedef NeoEsp32I2sMethodBase NeoEsp32I2s0Ws2812xInvertedMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s0Sk6812InvertedMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s0Tm1814InvertedMethod; +typedef NeoEsp32I2sMethodBase NeoEsp32I2s0Tm1829InvertedMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s0800KbpsInvertedMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s0400KbpsInvertedMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s0Apa106InvertedMethod; -#if !defined(CONFIG_IDF_TARGET_ESP32S2) +#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) // (I2S_NUM_MAX == 2) typedef NeoEsp32I2sMethodBase NeoEsp32I2s1Ws2812xMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s1Sk6812Method; typedef NeoEsp32I2sMethodBase NeoEsp32I2s1Tm1814Method; +typedef NeoEsp32I2sMethodBase NeoEsp32I2s1Tm1829Method; typedef NeoEsp32I2sMethodBase NeoEsp32I2s1800KbpsMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s1400KbpsMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s1Apa106Method; @@ -282,6 +304,7 @@ typedef NeoEsp32I2sMethodBase NeoEsp32I2s1Ws2812xInvertedMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s1Sk6812InvertedMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s1Tm1814InvertedMethod; +typedef NeoEsp32I2sMethodBase NeoEsp32I2s1Tm1829InvertedMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s1800KbpsInvertedMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s1400KbpsInvertedMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s1Apa106InvertedMethod; @@ -303,14 +326,17 @@ typedef NeoEsp32I2sMethodBase. -------------------------------------------------------------------------*/ +#include +#include "NeoSettings.h" #include "NeoBusChannel.h" #include "NeoEsp32RmtMethod.h" @@ -184,6 +186,17 @@ void NeoEsp32RmtSpeedApa106::Translate(const void* src, RmtBit0, RmtBit1, RmtDurationReset); } +void NeoEsp32RmtSpeedTx1812::Translate(const void* src, + rmt_item32_t* dest, + size_t src_size, + size_t wanted_num, + size_t* translated_size, + size_t* item_num) +{ + _translate(src, dest, src_size, wanted_num, translated_size, item_num, + RmtBit0, RmtBit1, RmtDurationReset); +} + void NeoEsp32RmtInvertedSpeedWs2811::Translate(const void* src, rmt_item32_t* dest, size_t src_size, @@ -260,4 +273,15 @@ void NeoEsp32RmtInvertedSpeedApa106::Translate(const void* src, _translate(src, dest, src_size, wanted_num, translated_size, item_num, RmtBit0, RmtBit1, RmtDurationReset); } + +void NeoEsp32RmtInvertedSpeedTx1812::Translate(const void* src, + rmt_item32_t* dest, + size_t src_size, + size_t wanted_num, + size_t* translated_size, + size_t* item_num) +{ + _translate(src, dest, src_size, wanted_num, translated_size, item_num, + RmtBit0, RmtBit1, RmtDurationReset); +} #endif \ No newline at end of file diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoEsp32RmtMethod.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32RmtMethod.h similarity index 81% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoEsp32RmtMethod.h rename to lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32RmtMethod.h index 8dae5f3d4..66cd7c2d7 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoEsp32RmtMethod.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32RmtMethod.h @@ -168,6 +168,22 @@ public: size_t* item_num); }; +// normal is inverted signal +class NeoEsp32RmtSpeedTm1829 : public NeoEsp32RmtInvertedSpeedBase +{ +public: + const static DRAM_ATTR uint32_t RmtBit0 = Item32Val(300, 900); + const static DRAM_ATTR uint32_t RmtBit1 = Item32Val(800, 400); + const static DRAM_ATTR uint16_t RmtDurationReset = FromNs(200000); // 200us + + static void IRAM_ATTR Translate(const void* src, + rmt_item32_t* dest, + size_t src_size, + size_t wanted_num, + size_t* translated_size, + size_t* item_num); +}; + class NeoEsp32RmtSpeed800Kbps : public NeoEsp32RmtSpeedBase { public: @@ -213,6 +229,21 @@ public: size_t* item_num); }; +class NeoEsp32RmtSpeedTx1812 : public NeoEsp32RmtSpeedBase +{ +public: + const static DRAM_ATTR uint32_t RmtBit0 = Item32Val(300, 600); + const static DRAM_ATTR uint32_t RmtBit1 = Item32Val(600, 300); + const static DRAM_ATTR uint16_t RmtDurationReset = FromNs(80000); // 80us + + static void IRAM_ATTR Translate(const void* src, + rmt_item32_t* dest, + size_t src_size, + size_t wanted_num, + size_t* translated_size, + size_t* item_num); +}; + class NeoEsp32RmtInvertedSpeedWs2811 : public NeoEsp32RmtInvertedSpeedBase { public: @@ -274,6 +305,22 @@ public: size_t* item_num); }; +// normal is inverted signal +class NeoEsp32RmtInvertedSpeedTm1829 : public NeoEsp32RmtSpeedBase +{ +public: + const static DRAM_ATTR uint32_t RmtBit0 = Item32Val(300, 900); + const static DRAM_ATTR uint32_t RmtBit1 = Item32Val(800, 400); + const static DRAM_ATTR uint16_t RmtDurationReset = FromNs(200000); // 200us + + static void IRAM_ATTR Translate(const void* src, + rmt_item32_t* dest, + size_t src_size, + size_t wanted_num, + size_t* translated_size, + size_t* item_num); +}; + class NeoEsp32RmtInvertedSpeed800Kbps : public NeoEsp32RmtInvertedSpeedBase { public: @@ -319,6 +366,21 @@ public: size_t* item_num); }; +class NeoEsp32RmtInvertedSpeedTx1812 : public NeoEsp32RmtInvertedSpeedBase +{ +public: + const static DRAM_ATTR uint32_t RmtBit0 = Item32Val(300, 600); + const static DRAM_ATTR uint32_t RmtBit1 = Item32Val(600, 300); + const static DRAM_ATTR uint16_t RmtDurationReset = FromNs(80000); // 80us + + static void IRAM_ATTR Translate(const void* src, + rmt_item32_t* dest, + size_t src_size, + size_t wanted_num, + size_t* translated_size, + size_t* item_num); +}; + class NeoEsp32RmtChannel0 { public: @@ -351,7 +413,7 @@ public: const static rmt_channel_t RmtChannelNumber = RMT_CHANNEL_3; }; -#if !defined(CONFIG_IDF_TARGET_ESP32S2) +#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) class NeoEsp32RmtChannel4 { @@ -403,6 +465,8 @@ public: template class NeoEsp32RmtMethodBase { public: + typedef NeoNoSettings SettingsObject; + NeoEsp32RmtMethodBase(uint8_t pin, uint16_t pixelCount, size_t elementSize, size_t settingsSize) : _sizeData(pixelCount * elementSize + settingsSize), _pin(pin) @@ -492,6 +556,10 @@ public: return _sizeData; } + void applySettings(const SettingsObject& settings) + { + } + private: const size_t _sizeData; // Size of '_data*' buffers const uint8_t _pin; // output pin number @@ -518,6 +586,7 @@ typedef NeoEsp32RmtMethodBase NeoE typedef NeoEsp32RmtMethodBase NeoEsp32RmtNSk6812Method; typedef NeoEsp32RmtMethodBase NeoEsp32RmtNTm1814Method; typedef NeoEsp32RmtMethodBase NeoEsp32RmtNApa106Method; +typedef NeoEsp32RmtMethodBase NeoEsp32RmtNTx1812Method; typedef NeoEsp32RmtMethodBase NeoEsp32RmtN800KbpsMethod; typedef NeoEsp32RmtMethodBase NeoEsp32RmtN400KbpsMethod; @@ -525,7 +594,9 @@ typedef NeoEsp32RmtMethodBase NeoEs typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0Ws2812xMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0Sk6812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0Tm1814Method; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0Tm1829Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0Apa106Method; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0Tx1812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0800KbpsMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0400KbpsMethod; @@ -533,7 +604,9 @@ typedef NeoEsp32RmtMethodBase NeoEs typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1Ws2812xMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1Sk6812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1Tm1814Method; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1Tm1829Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1Apa106Method; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1Tx1812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1800KbpsMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1400KbpsMethod; @@ -541,7 +614,9 @@ typedef NeoEsp32RmtMethodBase NeoEs typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Ws2812xMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Sk6812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Tm1814Method; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Tm1829Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Apa106Method; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Tx1812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2800KbpsMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2400KbpsMethod; @@ -549,18 +624,22 @@ typedef NeoEsp32RmtMethodBase NeoEs typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3Ws2812xMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3Sk6812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3Tm1814Method; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3Tm1829Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3Apa106Method; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3Tx1812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3800KbpsMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3400KbpsMethod; -#if !defined(CONFIG_IDF_TARGET_ESP32S2) +#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) // (RMT_CHANNEL_MAX == 8) typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Ws2811Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Ws2812xMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Sk6812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Tm1814Method; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Tm1829Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Apa106Method; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Tx1812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4800KbpsMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4400KbpsMethod; @@ -568,7 +647,9 @@ typedef NeoEsp32RmtMethodBase NeoEs typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5Ws2812xMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5Sk6812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5Tm1814Method; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5Tm1829Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5Apa106Method; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5Tx1812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5800KbpsMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5400KbpsMethod; @@ -576,7 +657,9 @@ typedef NeoEsp32RmtMethodBase NeoEs typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6Ws2812xMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6Sk6812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6Tm1814Method; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6Tm1829Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6Apa106Method; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6Tx1812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6800KbpsMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6400KbpsMethod; @@ -584,7 +667,9 @@ typedef NeoEsp32RmtMethodBase NeoEs typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7Ws2812xMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7Sk6812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7Tm1814Method; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7Tm1829Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7Apa106Method; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7Tx1812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7800KbpsMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7400KbpsMethod; @@ -596,6 +681,7 @@ typedef NeoEsp32RmtMethodBase NeoEsp32RmtNSk6812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32RmtNTm1814InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32RmtNApa106InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32RmtNTx1812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32RmtN800KbpsInvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32RmtN400KbpsInvertedMethod; @@ -603,7 +689,9 @@ typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0Ws2812xInvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0Sk6812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0Tm1814InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0Tm1829InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0Apa106InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0Tx1812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0800KbpsInvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0400KbpsInvertedMethod; @@ -611,7 +699,9 @@ typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1Ws2812xInvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1Sk6812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1Tm1814InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1Tm1829InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1Apa106InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1Tx1812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1800KbpsInvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1400KbpsInvertedMethod; @@ -619,7 +709,9 @@ typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Ws2812xInvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Sk6812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Tm1814InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Tm1829InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Apa106InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Tx1812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2800KbpsInvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2400KbpsInvertedMethod; @@ -627,18 +719,22 @@ typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3Ws2812xInvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3Sk6812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3Tm1814InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3Tm1829InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3Apa106InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3Tx1812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3800KbpsInvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3400KbpsInvertedMethod; -#if !defined(CONFIG_IDF_TARGET_ESP32S2) +#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) // (RMT_CHANNEL_MAX == 8) typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Ws2811InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Ws2812xInvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Sk6812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Tm1814InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Tm1829InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Apa106InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Tx1812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4800KbpsInvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4400KbpsInvertedMethod; @@ -646,7 +742,9 @@ typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5Ws2812xInvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5Sk6812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5Tm1814InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5Tm1829InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5Apa106InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5Tx1812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5800KbpsInvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5400KbpsInvertedMethod; @@ -654,7 +752,9 @@ typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6Ws2812xInvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6Sk6812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6Tm1814InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6Tm1829InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6Apa106InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6Tx1812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6800KbpsInvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6400KbpsInvertedMethod; @@ -662,15 +762,22 @@ typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7Ws2812xInvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7Sk6812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7Tm1814InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7Tm1829InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7Apa106InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7Tx1812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7800KbpsInvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7400KbpsInvertedMethod; #endif -#if !defined(CONFIG_IDF_TARGET_ESP32S2) + +#if defined(NEOPIXEL_ESP32_RMT_DEFAULT) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3) +// Normally I2s method is the default, defining NEOPIXEL_ESP32_RMT_DEFAULT +// will switch to use RMT as the default method +// The ESP32S2 & ESP32C3 will always defualt to RMT + +#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) // (RMT_CHANNEL_MAX == 8) -// due to a core issue where requests to send aren't consistent with I2s, RMT ch6 is temporarily the default // RMT channel 6 method is the default method for Esp32 typedef NeoEsp32Rmt6Ws2812xMethod NeoWs2813Method; typedef NeoEsp32Rmt6Ws2812xMethod NeoWs2812xMethod; @@ -678,8 +785,10 @@ typedef NeoEsp32Rmt6800KbpsMethod NeoWs2812Method; typedef NeoEsp32Rmt6Ws2812xMethod NeoWs2811Method; typedef NeoEsp32Rmt6Sk6812Method NeoSk6812Method; typedef NeoEsp32Rmt6Tm1814Method NeoTm1814Method; +typedef NeoEsp32Rmt6Tm1829Method NeoTm1829Method; typedef NeoEsp32Rmt6Sk6812Method NeoLc8812Method; typedef NeoEsp32Rmt6Apa106Method NeoApa106Method; +typedef NeoEsp32Rmt6Tx1812Method NeoTx1812Method; typedef NeoEsp32Rmt6Ws2812xMethod Neo800KbpsMethod; typedef NeoEsp32Rmt6400KbpsMethod Neo400KbpsMethod; @@ -690,23 +799,26 @@ typedef NeoEsp32Rmt6Ws2812xInvertedMethod NeoWs2811InvertedMethod; typedef NeoEsp32Rmt6800KbpsInvertedMethod NeoWs2812InvertedMethod; typedef NeoEsp32Rmt6Sk6812InvertedMethod NeoSk6812InvertedMethod; typedef NeoEsp32Rmt6Tm1814InvertedMethod NeoTm1814InvertedMethod; +typedef NeoEsp32Rmt6Tm1829InvertedMethod NeoTm1829InvertedMethod; typedef NeoEsp32Rmt6Sk6812InvertedMethod NeoLc8812InvertedMethod; typedef NeoEsp32Rmt6Apa106InvertedMethod NeoApa106InvertedMethod; +typedef NeoEsp32Rmt6Tx1812InvertedMethod NeoTx1812InvertedMethod; typedef NeoEsp32Rmt6Ws2812xInvertedMethod Neo800KbpsInvertedMethod; typedef NeoEsp32Rmt6400KbpsInvertedMethod Neo400KbpsInvertedMethod; -#else +#else // !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) -// due to a core issue where requests to send aren't consistent with I2s, RMT ch3 is temporarily the default -// RMT channel 3 method is the default method for Esp32S2 +// RMT channel 3 method is the default method for Esp32S2 & Esp32C3 typedef NeoEsp32Rmt3Ws2812xMethod NeoWs2813Method; typedef NeoEsp32Rmt3Ws2812xMethod NeoWs2812xMethod; typedef NeoEsp32Rmt3800KbpsMethod NeoWs2812Method; typedef NeoEsp32Rmt3Ws2812xMethod NeoWs2811Method; typedef NeoEsp32Rmt3Sk6812Method NeoSk6812Method; typedef NeoEsp32Rmt3Tm1814Method NeoTm1814Method; +typedef NeoEsp32Rmt3Tm1829Method NeoTm1829Method; typedef NeoEsp32Rmt3Sk6812Method NeoLc8812Method; typedef NeoEsp32Rmt3Apa106Method NeoApa106Method; +typedef NeoEsp32Rmt3Tx1812Method NeoTx1812Method; typedef NeoEsp32Rmt3Ws2812xMethod Neo800KbpsMethod; typedef NeoEsp32Rmt3400KbpsMethod Neo400KbpsMethod; @@ -717,12 +829,16 @@ typedef NeoEsp32Rmt3Ws2812xInvertedMethod NeoWs2811InvertedMethod; typedef NeoEsp32Rmt3800KbpsInvertedMethod NeoWs2812InvertedMethod; typedef NeoEsp32Rmt3Sk6812InvertedMethod NeoSk6812InvertedMethod; typedef NeoEsp32Rmt3Tm1814InvertedMethod NeoTm1814InvertedMethod; +typedef NeoEsp32Rmt3Tm1829InvertedMethod NeoTm1829InvertedMethod; typedef NeoEsp32Rmt3Sk6812InvertedMethod NeoLc8812InvertedMethod; typedef NeoEsp32Rmt3Apa106InvertedMethod NeoApa106InvertedMethod; +typedef NeoEsp32Rmt3Tx1812InvertedMethod NeoTx1812InvertedMethod; typedef NeoEsp32Rmt3Ws2812xInvertedMethod Neo800KbpsInvertedMethod; typedef NeoEsp32Rmt3400KbpsInvertedMethod Neo400KbpsInvertedMethod; -#endif +#endif // !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) + +#endif // defined(NEOPIXEL_ESP32_RMT_DEFAULT) #endif diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoEsp8266DmaMethod.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp8266DmaMethod.h similarity index 92% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoEsp8266DmaMethod.h rename to lib/lib_basic/NeoPixelBus/src/internal/NeoEsp8266DmaMethod.h index 4a25f61e5..f867ac8db 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoEsp8266DmaMethod.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp8266DmaMethod.h @@ -61,8 +61,8 @@ struct slc_queue_item uint32 sub_sof : 1; uint32 eof : 1; uint32 owner : 1; - uint32 buf_ptr; - uint32 next_link_ptr; + uint8* buf_ptr; + struct slc_queue_item* next_link_ptr; }; class NeoEsp8266DmaSpeedBase @@ -127,6 +127,12 @@ public: const static uint32_t ResetTimeUs = 200; }; +class NeoEsp8266DmaInvertedSpeedTm1829 : public NeoEsp8266DmaSpeed800KbpsBase +{ +public: + const static uint32_t ResetTimeUs = 200; +}; + class NeoEsp8266DmaSpeed800Kbps : public NeoEsp8266DmaSpeed800KbpsBase { public: @@ -179,6 +185,12 @@ public: const static uint32_t ResetTimeUs = 200; }; +class NeoEsp8266DmaSpeedTm1829 : public NeoEsp8266DmaInvertedSpeed800KbpsBase +{ +public: + const static uint32_t ResetTimeUs = 200; +}; + class NeoEsp8266DmaInvertedSpeed800Kbps : public NeoEsp8266DmaInvertedSpeed800KbpsBase { public: @@ -217,6 +229,8 @@ const uint8_t c_I2sPin = 3; // due to I2S hardware, the pin used is restricted t template class NeoEsp8266DmaMethodBase { public: + typedef NeoNoSettings SettingsObject; + NeoEsp8266DmaMethodBase(uint16_t pixelCount, size_t elementSize, size_t settingsSize) : _sizeData(pixelCount * elementSize + settingsSize) { @@ -300,9 +314,9 @@ public: _i2sBufDesc[indexDesc].sub_sof = 0; _i2sBufDesc[indexDesc].datalen = blockSize; _i2sBufDesc[indexDesc].blocksize = blockSize; - _i2sBufDesc[indexDesc].buf_ptr = (uint32_t)is2Buffer; + _i2sBufDesc[indexDesc].buf_ptr = is2Buffer; _i2sBufDesc[indexDesc].unused = 0; - _i2sBufDesc[indexDesc].next_link_ptr = (uint32_t)&(_i2sBufDesc[indexDesc + 1]); + _i2sBufDesc[indexDesc].next_link_ptr = reinterpret_cast(&(_i2sBufDesc[indexDesc + 1])); is2Buffer += blockSize; is2BufferSize -= blockSize; @@ -316,15 +330,15 @@ public: _i2sBufDesc[indexDesc].sub_sof = 0; _i2sBufDesc[indexDesc].datalen = sizeof(_i2sZeroes); _i2sBufDesc[indexDesc].blocksize = sizeof(_i2sZeroes); - _i2sBufDesc[indexDesc].buf_ptr = (uint32_t)_i2sZeroes; + _i2sBufDesc[indexDesc].buf_ptr = _i2sZeroes; _i2sBufDesc[indexDesc].unused = 0; - _i2sBufDesc[indexDesc].next_link_ptr = (uint32_t)&(_i2sBufDesc[indexDesc + 1]); + _i2sBufDesc[indexDesc].next_link_ptr = reinterpret_cast(&(_i2sBufDesc[indexDesc + 1])); } // the first state block will trigger the interrupt _i2sBufDesc[indexDesc - 2].eof = 1; // the last state block will loop to the first state block by defualt - _i2sBufDesc[indexDesc - 1].next_link_ptr = (uint32_t)&(_i2sBufDesc[indexDesc - 2]); + _i2sBufDesc[indexDesc - 1].next_link_ptr = reinterpret_cast(&(_i2sBufDesc[indexDesc - 2])); // setup the rest of i2s DMA // @@ -390,7 +404,7 @@ public: I2SC |= I2STXS; // Start transmission } - void ICACHE_RAM_ATTR Update(bool) + void IRAM_ATTR Update(bool) { // wait for not actively sending data while (!IsReadyToUpdate()) @@ -413,6 +427,10 @@ public: return _sizeData; } + void applySettings(const SettingsObject& settings) + { + } + private: static NeoEsp8266DmaMethodBase* s_this; // for the ISR @@ -437,7 +455,7 @@ private: // handle here is the RX_EOF_INT status, which indicate the DMA has sent a buffer whose // descriptor has the 'EOF' field set to 1. // in the case of this code, the second to last state descriptor - static void ICACHE_RAM_ATTR i2s_slc_isr(void) + static void IRAM_ATTR i2s_slc_isr(void) { ETS_SLC_INTR_DISABLE(); @@ -458,7 +476,7 @@ private: // data block has pending data waiting to send, prepare it // point last state block to top - (finished_item + 1)->next_link_ptr = (uint32_t)(s_this->_i2sBufDesc); + (finished_item + 1)->next_link_ptr = s_this->_i2sBufDesc; s_this->_dmaState = NeoDmaState_Sending; } @@ -471,7 +489,7 @@ private: // the data block had actual data sent // point last state block to first state block thus // just looping and not sending the data blocks - (finished_item + 1)->next_link_ptr = (uint32_t)(finished_item); + (finished_item + 1)->next_link_ptr = finished_item; s_this->_dmaState = NeoDmaState_Zeroing; } @@ -533,6 +551,7 @@ NeoEsp8266DmaMethodBase* NeoEsp8266DmaMethodBase::s_this; typedef NeoEsp8266DmaMethodBase NeoEsp8266DmaWs2812xMethod; typedef NeoEsp8266DmaMethodBase NeoEsp8266DmaSk6812Method; typedef NeoEsp8266DmaMethodBase NeoEsp8266DmaTm1814Method; +typedef NeoEsp8266DmaMethodBase NeoEsp8266DmaTm1829Method; typedef NeoEsp8266DmaMethodBase NeoEsp8266Dma800KbpsMethod; typedef NeoEsp8266DmaMethodBase NeoEsp8266Dma400KbpsMethod; typedef NeoEsp8266DmaMethodBase NeoEsp8266DmaApa106Method; @@ -541,6 +560,7 @@ typedef NeoEsp8266DmaMethodBase NeoEsp8266DmaApa106Met typedef NeoEsp8266DmaMethodBase NeoEsp8266DmaInvertedWs2812xMethod; typedef NeoEsp8266DmaMethodBase NeoEsp8266DmaInvertedSk6812Method; typedef NeoEsp8266DmaMethodBase NeoEsp8266DmaInvertedTm1814Method; +typedef NeoEsp8266DmaMethodBase NeoEsp8266DmaInvertedTm1829Method; typedef NeoEsp8266DmaMethodBase NeoEsp8266DmaInverted800KbpsMethod; typedef NeoEsp8266DmaMethodBase NeoEsp8266DmaInverted400KbpsMethod; typedef NeoEsp8266DmaMethodBase NeoEsp8266DmaInvertedApa106Method; @@ -552,6 +572,7 @@ typedef NeoEsp8266Dma800KbpsMethod NeoWs2812Method; typedef NeoEsp8266DmaWs2812xMethod NeoWs2811Method; typedef NeoEsp8266DmaSk6812Method NeoSk6812Method; typedef NeoEsp8266DmaTm1814Method NeoTm1814Method; +typedef NeoEsp8266DmaTm1829Method NeoTm1829Method; typedef NeoEsp8266DmaSk6812Method NeoLc8812Method; typedef NeoEsp8266DmaApa106Method NeoApa106Method; @@ -565,6 +586,7 @@ typedef NeoEsp8266DmaInverted800KbpsMethod NeoWs2812InvertedMethod; typedef NeoEsp8266DmaInvertedWs2812xMethod NeoWs2811InvertedMethod; typedef NeoEsp8266DmaInvertedSk6812Method NeoSk6812InvertedMethod; typedef NeoEsp8266DmaInvertedTm1814Method NeoTm1814InvertedMethod; +typedef NeoEsp8266DmaInvertedTm1829Method NeoTm1829InvertedMethod; typedef NeoEsp8266DmaInvertedSk6812Method NeoLc8812InvertedMethod; typedef NeoEsp8266DmaInvertedApa106Method NeoApa106InvertedMethod; diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoEsp8266UartMethod.cpp b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp8266UartMethod.cpp similarity index 96% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoEsp8266UartMethod.cpp rename to lib/lib_basic/NeoPixelBus/src/internal/NeoEsp8266UartMethod.cpp index dab9a57d0..66324b9d5 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoEsp8266UartMethod.cpp +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp8266UartMethod.cpp @@ -25,6 +25,9 @@ License along with NeoPixel. If not, see -------------------------------------------------------------------------*/ #ifdef ARDUINO_ARCH_ESP8266 + +#include +#include "NeoSettings.h" #include "NeoEsp8266UartMethod.h" #include extern "C" @@ -32,7 +35,7 @@ extern "C" #include } -const volatile uint8_t* ICACHE_RAM_ATTR NeoEsp8266UartContext::FillUartFifo(uint8_t uartNum, +const volatile uint8_t* IRAM_ATTR NeoEsp8266UartContext::FillUartFifo(uint8_t uartNum, const volatile uint8_t* start, const volatile uint8_t* end) { @@ -136,7 +139,7 @@ void NeoEsp8266UartInterruptContext::Detach(uint8_t uartNum) ETS_UART_INTR_ENABLE(); } -void ICACHE_RAM_ATTR NeoEsp8266UartInterruptContext::Isr(void* param) +void IRAM_ATTR NeoEsp8266UartInterruptContext::Isr(void* param) { // make sure this is for us if (param == s_uartInteruptContext) diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoEsp8266UartMethod.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp8266UartMethod.h similarity index 92% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoEsp8266UartMethod.h rename to lib/lib_basic/NeoPixelBus/src/internal/NeoEsp8266UartMethod.h index c7d45b2ca..3d57d7cdd 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoEsp8266UartMethod.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp8266UartMethod.h @@ -37,17 +37,17 @@ class NeoEsp8266UartContext { public: // Gets the number of bytes waiting in the TX FIFO - static inline uint8_t ICACHE_RAM_ATTR GetTxFifoLength(uint8_t uartNum) + static inline uint8_t IRAM_ATTR GetTxFifoLength(uint8_t uartNum) { return (USS(uartNum) >> USTXC) & 0xff; } // Append a byte to the TX FIFO - static inline void ICACHE_RAM_ATTR Enqueue(uint8_t uartNum, uint8_t value) + static inline void IRAM_ATTR Enqueue(uint8_t uartNum, uint8_t value) { USF(uartNum) = value; } - static const volatile uint8_t* ICACHE_RAM_ATTR FillUartFifo(uint8_t uartNum, + static const volatile uint8_t* IRAM_ATTR FillUartFifo(uint8_t uartNum, const volatile uint8_t* start, const volatile uint8_t* end); }; @@ -79,7 +79,7 @@ private: volatile const uint8_t* _asyncBuffEnd; volatile static NeoEsp8266UartInterruptContext* s_uartInteruptContext[2]; - static void ICACHE_RAM_ATTR Isr(void* param); + static void IRAM_ATTR Isr(void* param); }; // this template feature class is used a base for all others and contains @@ -241,7 +241,7 @@ protected: free(_dataSending); } - void ICACHE_RAM_ATTR InitializeUart(uint32_t uartBaud, bool invert) + void IRAM_ATTR InitializeUart(uint32_t uartBaud, bool invert) { T_UARTFEATURE::Init(uartBaud, invert); @@ -303,6 +303,12 @@ public: static const uint32_t ResetTimeUs = 200; // us between data send bursts to reset for next update }; +class NeoEsp8266UartSpeedTm1829 : public NeoEsp8266UartSpeed800KbpsBase +{ +public: + static const uint32_t ResetTimeUs = 200; // us between data send bursts to reset for next update +}; + // NeoEsp8266UartSpeed800Kbps contains the timing constant used to get NeoPixelBus running at 800Khz class NeoEsp8266UartSpeed800Kbps : public NeoEsp8266UartSpeed800KbpsBase { @@ -347,6 +353,8 @@ template class NeoEsp8266UartMethodBase: public T_BASE { public: + typedef NeoNoSettings SettingsObject; + NeoEsp8266UartMethodBase(uint16_t pixelCount, size_t elementSize, size_t settingsSize) : T_BASE(pixelCount, elementSize, settingsSize) { @@ -398,6 +406,10 @@ public: return this->_sizeData; }; + void applySettings(const SettingsObject& settings) + { + } + private: uint32_t getPixelTime() const { @@ -409,6 +421,7 @@ private: typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266Uart0Ws2812xMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266Uart0Sk6812Method; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266Uart0Tm1814Method; +typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266Uart0Tm1829Method; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266Uart0Apa106Method; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266Uart0800KbpsMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266Uart0400KbpsMethod; @@ -422,6 +435,7 @@ typedef NeoEsp8266Uart0Sk6812Method NeoEsp8266Uart0Lc8812Method; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266Uart1Ws2812xMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266Uart1Sk6812Method; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266Uart1Tm1814Method; +typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266Uart1Tm1829Method; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266Uart1Apa106Method; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266Uart1800KbpsMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266Uart1400KbpsMethod; @@ -435,6 +449,7 @@ typedef NeoEsp8266Uart1Sk6812Method NeoEsp8266Uart1Lc8812Method; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266AsyncUart0Ws2812xMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266AsyncUart0Sk6812Method; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266AsyncUart0Tm1814Method; +typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266AsyncUart0Tm1829Method; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266AsyncUart0Apa106Method; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266AsyncUart0800KbpsMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266AsyncUart0400KbpsMethod; @@ -448,6 +463,7 @@ typedef NeoEsp8266AsyncUart0Sk6812Method NeoEsp8266AsyncUart0Lc8812Method; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266AsyncUart1Ws2812xMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266AsyncUart1Sk6812Method; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266AsyncUart1Tm1814Method; +typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266AsyncUart1Tm1829Method; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266AsyncUart1Apa106Method; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266AsyncUart1800KbpsMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266AsyncUart1400KbpsMethod; @@ -463,6 +479,7 @@ typedef NeoEsp8266AsyncUart1Sk6812Method NeoEsp8266AsyncUart1Lc8812Method; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266Uart0Ws2812xInvertedMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266Uart0Sk6812InvertedMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266Uart0Tm1814InvertedMethod; +typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266Uart0Tm1829InvertedMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266Uart0Apa106InvertedMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266Uart0800KbpsInvertedMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266Uart0400KbpsInvertedMethod; @@ -476,6 +493,7 @@ typedef NeoEsp8266Uart0Sk6812InvertedMethod NeoEsp8266Uart0Lc8812InvertedMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266Uart1Ws2812xInvertedMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266Uart1Sk6812InvertedMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266Uart1Tm1814InvertedMethod; +typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266Uart1Tm1829InvertedMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266Uart1Apa106InvertedMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266Uart1800KbpsInvertedMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266Uart1400KbpsInvertedMethod; @@ -489,6 +507,7 @@ typedef NeoEsp8266Uart1Sk6812InvertedMethod NeoEsp8266Uart1Lc8812InvertedMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266AsyncUart0Ws2812xInvertedMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266AsyncUart0Sk6812InvertedMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266AsyncUart0Tm1814InvertedMethod; +typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266AsyncUart0Tm1829InvertedMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266AsyncUart0Apa106InvertedMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266AsyncUart0800KbpsInvertedMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266AsyncUart0400KbpsInvertedMethod; @@ -502,6 +521,7 @@ typedef NeoEsp8266AsyncUart0Sk6812InvertedMethod NeoEsp8266AsyncUart0Lc8812Inver typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266AsyncUart1Ws2812xInvertedMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266AsyncUart1Sk6812InvertedMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266AsyncUart1Tm1814InvertedMethod; +typedef NeoEsp8266UartMethodBase, NeoEsp8266UartNotInverted> NeoEsp8266AsyncUart1Tm1829InvertedMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266AsyncUart1Apa106InvertedMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266AsyncUart1800KbpsInvertedMethod; typedef NeoEsp8266UartMethodBase, NeoEsp8266UartInverted> NeoEsp8266AsyncUart1400KbpsInvertedMethod; diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoEspBitBangMethod.cpp b/lib/lib_basic/NeoPixelBus/src/internal/NeoEspBitBangMethod.cpp similarity index 57% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoEspBitBangMethod.cpp rename to lib/lib_basic/NeoPixelBus/src/internal/NeoEspBitBangMethod.cpp index 637fef0c5..32c069f3d 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoEspBitBangMethod.cpp +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoEspBitBangMethod.cpp @@ -27,7 +27,9 @@ License along with NeoPixel. If not, see #if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) #include -#include "NeoEspBitBangMethod.h" + +// ESP32C3 I2S is not supported yet +#if !defined(CONFIG_IDF_TARGET_ESP32C3) static inline uint32_t getCycleCount(void) { @@ -36,7 +38,7 @@ static inline uint32_t getCycleCount(void) return ccount; } -void ICACHE_RAM_ATTR NeoEspBitBangBase_send_pixels(uint8_t* pixels, uint8_t* end, uint8_t pin, uint32_t t0h, uint32_t t1h, uint32_t period, uint8_t IdleLevel) +void IRAM_ATTR NeoEspBitBangBase_send_pixels(uint8_t* pixels, uint8_t* end, uint8_t pin, uint32_t t0h, uint32_t t1h, uint32_t period) { const uint32_t pinRegister = _BV(pin); uint8_t mask = 0x80; @@ -58,39 +60,21 @@ void ICACHE_RAM_ATTR NeoEspBitBangBase_send_pixels(uint8_t* pixels, uint8_t* end while (((cyclesStart = getCycleCount()) - cyclesNext) < period); // set pin state - if (IdleLevel == LOW) { #if defined(ARDUINO_ARCH_ESP32) - GPIO.out_w1ts = pinRegister; + GPIO.out_w1ts = pinRegister; #else - GPIO_REG_WRITE(GPIO_OUT_W1TS_ADDRESS, pinRegister); + GPIO_REG_WRITE(GPIO_OUT_W1TS_ADDRESS, pinRegister); #endif - } else { -#if defined(ARDUINO_ARCH_ESP32) - GPIO.out_w1tc = pinRegister; -#else - GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, pinRegister); -#endif - } - // T_PINSET::setPin(pinRegister); // wait for the LOW while ((getCycleCount() - cyclesStart) < cyclesBit); // reset pin start - if (IdleLevel == LOW) { #if defined(ARDUINO_ARCH_ESP32) - GPIO.out_w1tc = pinRegister; + GPIO.out_w1tc = pinRegister; #else - GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, pinRegister); + GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, pinRegister); #endif - } else { -#if defined(ARDUINO_ARCH_ESP32) - GPIO.out_w1ts = pinRegister; -#else - GPIO_REG_WRITE(GPIO_OUT_W1TS_ADDRESS, pinRegister); -#endif - } - // T_PINSET::resetPin(pinRegister); cyclesNext = cyclesStart; @@ -112,4 +96,63 @@ void ICACHE_RAM_ATTR NeoEspBitBangBase_send_pixels(uint8_t* pixels, uint8_t* end } } -#endif \ No newline at end of file +void IRAM_ATTR NeoEspBitBangBase_send_pixels_inv(uint8_t* pixels, uint8_t* end, uint8_t pin, uint32_t t0h, uint32_t t1h, uint32_t period) +{ + const uint32_t pinRegister = _BV(pin); + uint8_t mask = 0x80; + uint8_t subpix = *pixels++; + uint32_t cyclesStart = 0; // trigger emediately + uint32_t cyclesNext = 0; + + for (;;) + { + // do the checks here while we are waiting on time to pass + uint32_t cyclesBit = t0h; + if (subpix & mask) + { + cyclesBit = t1h; + } + + // after we have done as much work as needed for this next bit + // now wait for the HIGH + while (((cyclesStart = getCycleCount()) - cyclesNext) < period); + + // set pin state +#if defined(ARDUINO_ARCH_ESP32) + GPIO.out_w1tc = pinRegister; +#else + GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, pinRegister); +#endif + + // wait for the LOW + while ((getCycleCount() - cyclesStart) < cyclesBit); + + // reset pin start +#if defined(ARDUINO_ARCH_ESP32) + GPIO.out_w1ts = pinRegister; +#else + GPIO_REG_WRITE(GPIO_OUT_W1TS_ADDRESS, pinRegister); +#endif + + cyclesNext = cyclesStart; + + // next bit + mask >>= 1; + if (mask == 0) + { + // no more bits to send in this byte + // check for another byte + if (pixels >= end) + { + // no more bytes to send so stop + break; + } + // reset mask to first bit and get the next byte + mask = 0x80; + subpix = *pixels++; + } + } +} + +#endif // !defined(CONFIG_IDF_TARGET_ESP32C3) +#endif // defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoEspBitBangMethod.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoEspBitBangMethod.h similarity index 93% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoEspBitBangMethod.h rename to lib/lib_basic/NeoPixelBus/src/internal/NeoEspBitBangMethod.h index abbb4a685..d7e8d7365 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoEspBitBangMethod.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoEspBitBangMethod.h @@ -28,15 +28,13 @@ License along with NeoPixel. If not, see #if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) +// ESP32C3 I2S is not supported yet +#if !defined(CONFIG_IDF_TARGET_ESP32C3) + #if defined(ARDUINO_ARCH_ESP8266) #include #endif -// ESP32 doesn't define ICACHE_RAM_ATTR -#ifndef ICACHE_RAM_ATTR -#define ICACHE_RAM_ATTR IRAM_ATTR -#endif - #define CYCLES_LOOPTEST (4) // adjustment due to loop exit test instruction cycles class NeoEspSpeedWs2811 @@ -87,26 +85,37 @@ public: const static uint32_t Period = (F_CPU / 606061 - CYCLES_LOOPTEST); // 1.65us }; +extern void NeoEspBitBangBase_send_pixels(uint8_t* pixels, uint8_t* end, uint8_t pin, uint32_t t0h, uint32_t t1h, uint32_t period); +extern void NeoEspBitBangBase_send_pixels_inv(uint8_t* pixels, uint8_t* end, uint8_t pin, uint32_t t0h, uint32_t t1h, uint32_t period); + class NeoEspPinset { public: const static uint8_t IdleLevel = LOW; + + inline static void send_pixels_impl(uint8_t* pixels, uint8_t* end, uint8_t pin, uint32_t t0h, uint32_t t1h, uint32_t period) + { + NeoEspBitBangBase_send_pixels(pixels, end, pin, t0h, t1h, period); + } }; class NeoEspPinsetInverted { public: const static uint8_t IdleLevel = HIGH; -}; -extern void NeoEspBitBangBase_send_pixels(uint8_t* pixels, uint8_t* end, uint8_t pin, uint32_t t0h, uint32_t t1h, uint32_t period, uint8_t IdleLevel); + inline static void send_pixels_impl(uint8_t* pixels, uint8_t* end, uint8_t pin, uint32_t t0h, uint32_t t1h, uint32_t period) + { + NeoEspBitBangBase_send_pixels_inv(pixels, end, pin, t0h, t1h, period); + } +}; template class NeoEspBitBangBase { public: static void send_pixels(uint8_t* pixels, uint8_t* end, uint8_t pin) { - NeoEspBitBangBase_send_pixels(pixels, end, pin, T_SPEED::T0H, T_SPEED::T1H, T_SPEED::Period, T_PINSET::IdleLevel); + T_PINSET::send_pixels_impl(pixels, end, pin, T_SPEED::T0H, T_SPEED::T1H, T_SPEED::Period); } }; @@ -213,6 +222,8 @@ public: template class NeoEspBitBangMethodBase { public: + typedef NeoNoSettings SettingsObject; + NeoEspBitBangMethodBase(uint8_t pin, uint16_t pixelCount, size_t elementSize, size_t settingsSize) : _sizeData(pixelCount * elementSize + settingsSize), _pin(pin) @@ -289,6 +300,10 @@ public: return _sizeData; }; + void applySettings(const SettingsObject& settings) + { + } + private: const size_t _sizeData; // Size of '_data' buffer below const uint8_t _pin; // output pin number @@ -357,4 +372,6 @@ typedef NeoEsp8266BitBangSk6812InvertedMethod NeoEsp8266BitBangLc8812InvertedMet #endif // ESP bitbang doesn't have defaults and should avoided except for testing -#endif + +#endif // !defined(CONFIG_IDF_TARGET_ESP32C3) +#endif // defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoGamma.cpp b/lib/lib_basic/NeoPixelBus/src/internal/NeoGamma.cpp similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoGamma.cpp rename to lib/lib_basic/NeoPixelBus/src/internal/NeoGamma.cpp diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoGamma.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoGamma.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoGamma.h rename to lib/lib_basic/NeoPixelBus/src/internal/NeoGamma.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoHueBlend.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoHueBlend.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoHueBlend.h rename to lib/lib_basic/NeoPixelBus/src/internal/NeoHueBlend.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoMosaic.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoMosaic.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoMosaic.h rename to lib/lib_basic/NeoPixelBus/src/internal/NeoMosaic.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoNrf52xMethod.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoNrf52xMethod.h similarity index 83% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoNrf52xMethod.h rename to lib/lib_basic/NeoPixelBus/src/internal/NeoNrf52xMethod.h index 975bc10ee..05f82b51d 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoNrf52xMethod.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoNrf52xMethod.h @@ -80,6 +80,17 @@ public: const static PinStatus IdleLevel = HIGH; }; +class NeoNrf52xPwmSpeedTm1829 +{ +public: + const static uint32_t CountTop = 20UL; // 1.25us + const static nrf_pwm_values_common_t Bit0 = 5; // ~0.3us + const static nrf_pwm_values_common_t Bit1 = 13 | 0x8000; // ~0.8us + const static nrf_pwm_values_common_t BitReset = 0x0000; // HIGH + const static uint32_t CountReset = 160; // 200us / 1.25us pulse width + const static PinStatus IdleLevel = HIGH; +}; + class NeoNrf52xPwmSpeed800Kbps { public: @@ -114,6 +125,17 @@ public: const static PinStatus IdleLevel = LOW; }; +class NeoNrf52xPwmSpeedTx1812 +{ +public: + const static uint32_t CountTop = 14UL; // ~0.875us (target is 0.9us) + const static nrf_pwm_values_common_t Bit0 = 5 | 0x8000; // ~0.3125us (target is 0.3) + const static nrf_pwm_values_common_t Bit1 = 10 | 0x8000; // ~0.625us (target is 0.6) + const static nrf_pwm_values_common_t BitReset = 0x8000; // LOW + const static uint32_t CountReset = 228; // 200us / 0.875us pulse width + const static PinStatus IdleLevel = LOW; +}; + class NeoNrf52xPwmInvertedSpeedWs2811 { public: @@ -158,6 +180,17 @@ public: const static PinStatus IdleLevel = LOW; }; +class NeoNrf52xPwmInvertedSpeedTm1829 +{ +public: + const static uint32_t CountTop = 20UL; // 1.25us + const static nrf_pwm_values_common_t Bit0 = 5 | 0x8000; // ~0.3us + const static nrf_pwm_values_common_t Bit1 = 13; // ~0.8us + const static nrf_pwm_values_common_t BitReset = 0x8000; // LOW + const static uint32_t CountReset = 160; // 200us / 1.25us pulse width + const static PinStatus IdleLevel = LOW; +}; + class NeoNrf52xPwmInvertedSpeed800Kbps { public: @@ -191,9 +224,22 @@ public: const static PinStatus IdleLevel = HIGH; }; +class NeoNrf52xPwmInvertedSpeedTx1812 +{ +public: + const static uint32_t CountTop = 14UL; // ~0.875us (target is 0.9us) + const static nrf_pwm_values_common_t Bit0 = 5; // ~0.3125us (target is 0.3) + const static nrf_pwm_values_common_t Bit1 = 10; // ~0.625us (target is 0.6) + const static nrf_pwm_values_common_t BitReset = 0x0000; // HIGH + const static uint32_t CountReset = 228; // 200us / 0.875us pulse width + const static PinStatus IdleLevel = HIGH; +}; + class NeoNrf52xPwm0 { public: + NeoNrf52xPwm0() {}; + inline static NRF_PWM_Type* Pwm() { return NRF_PWM0; @@ -203,6 +249,8 @@ public: class NeoNrf52xPwm1 { public: + NeoNrf52xPwm1() {}; + inline static NRF_PWM_Type* Pwm() { return NRF_PWM1; @@ -212,6 +260,8 @@ public: class NeoNrf52xPwm2 { public: + NeoNrf52xPwm2() {}; + inline static NRF_PWM_Type* Pwm() { return NRF_PWM2; @@ -222,6 +272,8 @@ public: class NeoNrf52xPwm3 { public: + NeoNrf52xPwm3() {}; + inline static NRF_PWM_Type* Pwm() { return NRF_PWM3; @@ -260,6 +312,8 @@ protected: template class NeoNrf52xMethodBase { public: + typedef NeoNoSettings SettingsObject; + NeoNrf52xMethodBase(uint8_t pin, uint16_t pixelCount, size_t elementSize, size_t settingsSize) : _sizeData(pixelCount * elementSize + settingsSize), _pin(pin) @@ -334,6 +388,10 @@ public: return _sizeData; }; + void applySettings(const SettingsObject& settings) + { + } + private: const size_t _sizeData; // Size of '_data' buffer below const uint8_t _pin; // output pin number @@ -440,6 +498,8 @@ typedef NeoNrf52xMethodBase NeoNrf52xPwm typedef NeoNrf52xMethodBase NeoNrf52xPwmNWs2812xMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwmNSk6812Method; typedef NeoNrf52xMethodBase NeoNrf52xPwmNTm1814Method; +typedef NeoNrf52xMethodBase NeoNrf52xPwmNTm1829Method; +typedef NeoNrf52xMethodBase NeoNrf52xPwmNTx1812Method; typedef NeoNrf52xMethodBase NeoNrf52xPwmNApa106Method; typedef NeoNrf52xMethodBase NeoNrf52xPwmN800KbpsMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwmN400KbpsMethod; @@ -448,6 +508,8 @@ typedef NeoNrf52xMethodBase NeoNrf52xPwm typedef NeoNrf52xMethodBase NeoNrf52xPwm0Ws2812xMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm0Sk6812Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm0Tm1814Method; +typedef NeoNrf52xMethodBase NeoNrf52xPwm0Tm1829Method; +typedef NeoNrf52xMethodBase NeoNrf52xPwm0Tx1812Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm0Apa106Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm0800KbpsMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm0400KbpsMethod; @@ -456,6 +518,8 @@ typedef NeoNrf52xMethodBase NeoNrf52xPwm typedef NeoNrf52xMethodBase NeoNrf52xPwm1Ws2812xMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm1Sk6812Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm1Tm1814Method; +typedef NeoNrf52xMethodBase NeoNrf52xPwm1Tm1829Method; +typedef NeoNrf52xMethodBase NeoNrf52xPwm1Tx1812Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm1Apa106Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm1800KbpsMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm1400KbpsMethod; @@ -464,6 +528,8 @@ typedef NeoNrf52xMethodBase NeoNrf52xPwm typedef NeoNrf52xMethodBase NeoNrf52xPwm2Ws2812xMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm2Sk6812Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm2Tm1814Method; +typedef NeoNrf52xMethodBase NeoNrf52xPwm2Tm1829Method; +typedef NeoNrf52xMethodBase NeoNrf52xPwm2Tx1812Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm2Apa106Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm2800KbpsMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm2400KbpsMethod; @@ -473,6 +539,8 @@ typedef NeoNrf52xMethodBase NeoNrf52xPwm typedef NeoNrf52xMethodBase NeoNrf52xPwm3Ws2812xMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm3Sk6812Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm3Tm1814Method; +typedef NeoNrf52xMethodBase NeoNrf52xPwm3Tm1829Method; +typedef NeoNrf52xMethodBase NeoNrf52xPwm3Tx1812Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm3Apa106Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm3800KbpsMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm3400KbpsMethod; @@ -483,6 +551,8 @@ typedef NeoNrf52xMethodBase NeoN typedef NeoNrf52xMethodBase NeoNrf52xPwmNWs2812xInvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwmNSk6812InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwmNTm1814InvertedMethod; +typedef NeoNrf52xMethodBase NeoNrf52xPwmNTm1829InvertedMethod; +typedef NeoNrf52xMethodBase NeoNrf52xPwmNTx1812InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwmNApa106InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwmN800KbpsInvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwmN400KbpsInvertedMethod; @@ -491,6 +561,8 @@ typedef NeoNrf52xMethodBase NeoN typedef NeoNrf52xMethodBase NeoNrf52xPwm0Ws2812xInvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm0Sk6812InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm0Tm1814InvertedMethod; +typedef NeoNrf52xMethodBase NeoNrf52xPwm0Tm1829InvertedMethod; +typedef NeoNrf52xMethodBase NeoNrf52xPwm0Tx1812InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm0Apa106InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm0800KbpsInvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm0400KbpsInvertedMethod; @@ -499,6 +571,8 @@ typedef NeoNrf52xMethodBase NeoN typedef NeoNrf52xMethodBase NeoNrf52xPwm1Ws2812xInvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm1Sk6812InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm1Tm1814InvertedMethod; +typedef NeoNrf52xMethodBase NeoNrf52xPwm1Tm1829InvertedMethod; +typedef NeoNrf52xMethodBase NeoNrf52xPwm1Tx1812InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm1Apa106InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm1800KbpsInvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm1400KbpsInvertedMethod; @@ -507,6 +581,8 @@ typedef NeoNrf52xMethodBase NeoN typedef NeoNrf52xMethodBase NeoNrf52xPwm2Ws2812xInvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm2Sk6812InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm2Tm1814InvertedMethod; +typedef NeoNrf52xMethodBase NeoNrf52xPwm2Tm1829InvertedMethod; +typedef NeoNrf52xMethodBase NeoNrf52xPwm2Tx1812InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm2Apa106InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm2800KbpsInvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm2400KbpsInvertedMethod; @@ -516,6 +592,8 @@ typedef NeoNrf52xMethodBase NeoN typedef NeoNrf52xMethodBase NeoNrf52xPwm3Ws2812xInvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm3Sk6812InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm3Tm1814InvertedMethod; +typedef NeoNrf52xMethodBase NeoNrf52xPwm3Tm1829InvertedMethod; +typedef NeoNrf52xMethodBase NeoNrf52xPwm3Tx1812InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm3Apa106InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm3800KbpsInvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm3400KbpsInvertedMethod; @@ -528,6 +606,8 @@ typedef NeoNrf52xPwm2800KbpsMethod NeoWs2812Method; typedef NeoNrf52xPwm2Ws2812xMethod NeoWs2811Method; typedef NeoNrf52xPwm2Sk6812Method NeoSk6812Method; typedef NeoNrf52xPwm2Tm1814Method NeoTm1814Method; +typedef NeoNrf52xPwm2Tm1829Method NeoTm1829Method; +typedef NeoNrf52xPwm2Tx1812Method NeoTx1812Method; typedef NeoNrf52xPwm2Sk6812Method NeoLc8812Method; typedef NeoNrf52xPwm2Apa106Method NeoApa106Method; @@ -540,6 +620,8 @@ typedef NeoNrf52xPwm2Ws2812xInvertedMethod NeoWs2811InvertedMethod; typedef NeoNrf52xPwm2800KbpsInvertedMethod NeoWs2812InvertedMethod; typedef NeoNrf52xPwm2Sk6812InvertedMethod NeoSk6812InvertedMethod; typedef NeoNrf52xPwm2Tm1814InvertedMethod NeoTm1814InvertedMethod; +typedef NeoNrf52xPwm2Tm1829InvertedMethod NeoTm1829InvertedMethod; +typedef NeoNrf52xPwm2Tx1812InvertedMethod NeoTx1812InvertedMethod; typedef NeoNrf52xPwm2Sk6812InvertedMethod NeoLc8812InvertedMethod; typedef NeoNrf52xPwm2Apa106InvertedMethod NeoApa106InvertedMethod; diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoPixelAnimator.cpp b/lib/lib_basic/NeoPixelBus/src/internal/NeoPixelAnimator.cpp similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoPixelAnimator.cpp rename to lib/lib_basic/NeoPixelBus/src/internal/NeoPixelAnimator.cpp diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoPixelAvr.c b/lib/lib_basic/NeoPixelBus/src/internal/NeoPixelAvr.c similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoPixelAvr.c rename to lib/lib_basic/NeoPixelBus/src/internal/NeoPixelAvr.c diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoRingTopology.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoRingTopology.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoRingTopology.h rename to lib/lib_basic/NeoPixelBus/src/internal/NeoRingTopology.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoSegmentFeatures.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoSegmentFeatures.h similarity index 61% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoSegmentFeatures.h rename to lib/lib_basic/NeoPixelBus/src/internal/NeoSegmentFeatures.h index f0118f624..0198a838d 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoSegmentFeatures.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoSegmentFeatures.h @@ -84,8 +84,29 @@ public: typedef SevenSegDigit ColorObject; }; -// Abcdefg byte order -class NeoAbcdefgSegmentFeature : public Neo9Elements +class Neo9ElementsNoSettings : public Neo9Elements +{ +public: + typedef NeoNoSettings SettingsObject; + static const size_t SettingsSize = 0; + + static void applySettings(uint8_t*, const SettingsObject&) + { + } + + static uint8_t* pixels(uint8_t* pData) + { + return pData; + } + + static const uint8_t* pixels(const uint8_t* pData) + { + return pData; + } +}; + +// Abcdefgps byte order +class NeoAbcdefgSegmentFeature : public Neo9ElementsNoSettings { public: static void applyPixelColor(uint8_t* pPixels, uint16_t indexPixel, ColorObject color) @@ -127,4 +148,69 @@ public: }; -typedef NeoAbcdefgSegmentFeature SevenSegmentFeature; // Abcdefg order is default \ No newline at end of file + +// BACEDF.G+ byte order +class NeoBacedfpgsSegmentFeature : public Neo9ElementsNoSettings +{ +public: + static void applyPixelColor(uint8_t* pPixels, uint16_t indexPixel, ColorObject color) + { + uint8_t* p = getPixelAddress(pPixels, indexPixel); + + // Segment Digit is Abcdefgps order + *p++ = color.Segment[LedSegment_B]; + *p++ = color.Segment[LedSegment_A]; + *p++ = color.Segment[LedSegment_C]; + + *p++ = color.Segment[LedSegment_E]; + *p++ = color.Segment[LedSegment_D]; + *p++ = color.Segment[LedSegment_F]; + + *p++ = color.Segment[LedSegment_Decimal]; + *p++ = color.Segment[LedSegment_G]; + *p++ = color.Segment[LedSegment_Custom]; + } + + static ColorObject retrievePixelColor(const uint8_t* pPixels, uint16_t indexPixel) + { + ColorObject color; + const uint8_t* p = getPixelAddress(pPixels, indexPixel); + + color.Segment[LedSegment_B] = *p++; + color.Segment[LedSegment_A] = *p++; + color.Segment[LedSegment_C] = *p++; + + color.Segment[LedSegment_E] = *p++; + color.Segment[LedSegment_D] = *p++; + color.Segment[LedSegment_F] = *p++; + + color.Segment[LedSegment_Decimal] = *p++; + color.Segment[LedSegment_G] = *p++; + color.Segment[LedSegment_Custom] = *p++; + + return color; + } + + static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) + { + ColorObject color; + const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel); + + color.Segment[LedSegment_B] = pgm_read_byte(p++); + color.Segment[LedSegment_A] = pgm_read_byte(p++); + color.Segment[LedSegment_C] = pgm_read_byte(p++); + + color.Segment[LedSegment_E] = pgm_read_byte(p++); + color.Segment[LedSegment_D] = pgm_read_byte(p++); + color.Segment[LedSegment_F] = pgm_read_byte(p++); + + color.Segment[LedSegment_Decimal] = pgm_read_byte(p++); + color.Segment[LedSegment_G] = pgm_read_byte(p++); + color.Segment[LedSegment_Custom] = pgm_read_byte(p++); + + return color; + } + +}; + +typedef NeoBacedfpgsSegmentFeature SevenSegmentFeature; // Abcdefg order is default \ No newline at end of file diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoSettings.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoSettings.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoSettings.h rename to lib/lib_basic/NeoPixelBus/src/internal/NeoSettings.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoSpriteSheet.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoSpriteSheet.h similarity index 97% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoSpriteSheet.h rename to lib/lib_basic/NeoPixelBus/src/internal/NeoSpriteSheet.h index 83fb978d3..73fdde3d6 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoSpriteSheet.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoSpriteSheet.h @@ -152,9 +152,9 @@ private: if (indexSprite < _spriteCount && x >= 0 && - (uint16_t)x < SpriteWidth() && + static_cast(x) < SpriteWidth() && y >= 0 && - (uint16_t)y < SpriteHeight()) + static_cast(y) < SpriteHeight()) { result = x + y * SpriteWidth() + indexSprite * _spriteHeight * SpriteWidth(); } diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoTiles.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoTiles.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoTiles.h rename to lib/lib_basic/NeoPixelBus/src/internal/NeoTiles.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoTm1814ColorFeatures.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoTm1814ColorFeatures.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoTm1814ColorFeatures.h rename to lib/lib_basic/NeoPixelBus/src/internal/NeoTm1814ColorFeatures.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoTopology.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoTopology.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/NeoTopology.h rename to lib/lib_basic/NeoPixelBus/src/internal/NeoTopology.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/P9813ColorFeatures.h b/lib/lib_basic/NeoPixelBus/src/internal/P9813ColorFeatures.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/P9813ColorFeatures.h rename to lib/lib_basic/NeoPixelBus/src/internal/P9813ColorFeatures.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/P9813GenericMethod.h b/lib/lib_basic/NeoPixelBus/src/internal/P9813GenericMethod.h similarity index 92% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/P9813GenericMethod.h rename to lib/lib_basic/NeoPixelBus/src/internal/P9813GenericMethod.h index f72c31703..2fd1d4b5a 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/P9813GenericMethod.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/P9813GenericMethod.h @@ -37,6 +37,8 @@ License along with NeoPixel. If not, see template class P9813MethodBase { public: + typedef typename T_TWOWIRE::SettingsObject SettingsObject; + P9813MethodBase(uint8_t pinClock, uint8_t pinData, uint16_t pixelCount, size_t elementSize, size_t settingsSize) : _sizeData(pixelCount * elementSize + settingsSize), _sizeEndFrame((pixelCount + 15) / 16), // 16 = div 2 (bit for every two pixels) div 8 (bits to bytes) @@ -104,6 +106,11 @@ public: return _sizeData; }; + void applySettings(const SettingsObject& settings) + { + _wire.applySettings(settings); + } + private: const size_t _sizeData; // Size of '_data' buffer below const size_t _sizeEndFrame; @@ -118,10 +125,13 @@ typedef P9813MethodBase P9813Method; #include "TwoWireSpiImple.h" typedef P9813MethodBase> P9813Spi20MhzMethod; typedef P9813MethodBase> P9813Spi10MhzMethod; +typedef P9813MethodBase> P9813Spi5MhzMethod; typedef P9813MethodBase> P9813Spi2MhzMethod; typedef P9813MethodBase> P9813Spi1MhzMethod; typedef P9813MethodBase> P9813Spi500KhzMethod; +typedef P9813MethodBase> P9813SpiHzMethod; + typedef P9813Spi10MhzMethod P9813SpiMethod; #endif diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Rgb16Color.h b/lib/lib_basic/NeoPixelBus/src/internal/Rgb16Color.h similarity index 91% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Rgb16Color.h rename to lib/lib_basic/NeoPixelBus/src/internal/Rgb16Color.h index c038c4cce..d2fdd8cd5 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Rgb16Color.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/Rgb16Color.h @@ -61,6 +61,16 @@ struct Rgb16Color : RgbColorBase setB(brightness); }; + // ------------------------------------------------------------------------ + // Construct a Rgb16Color using a single 16bit encoded value + // CAUTION: the color value must follow a 5/6/5 encoding model otherwise an + // incorrect color will be generated + // ------------------------------------------------------------------------ + Rgb16Color(uint16_t color) : + Color565(color) + { + }; + // ------------------------------------------------------------------------ // Construct a Rgb16Color using HtmlColor // ------------------------------------------------------------------------ @@ -99,7 +109,7 @@ struct Rgb16Color : RgbColorBase // ------------------------------------------------------------------------ // Construct a Rgb16Color that will have its values set in latter operations - // CAUTION: The _c members are not initialized and may not be consistent + // CAUTION: The Color565 member is not initialized and may not be consistent // ------------------------------------------------------------------------ Rgb16Color() { @@ -110,32 +120,32 @@ struct Rgb16Color : RgbColorBase // ------------------------------------------------------------------------ void setR(uint8_t r) { - _c &= 0x07ff; - _c |= ((r & 0xf8) << 8); + Color565 &= 0x07ff; + Color565 |= ((r & 0xf8) << 8); }; uint8_t getR() const { - return (_c & 0xf800) >> 8; + return (Color565 & 0xf800) >> 8; }; void setG(uint8_t g) { - _c &= 0xf81f; - _c |= ((g & 0xfe) << 3); + Color565 &= 0xf81f; + Color565 |= ((g & 0xfe) << 3); }; uint8_t getG() const { - return (_c & 0x07e0) >> 3; + return (Color565 & 0x07e0) >> 3; }; void setB(uint8_t b) { - _c &= 0xffe0; - _c |= ((b & 0xf8) >> 3); + Color565 &= 0xffe0; + Color565 |= ((b & 0xf8) >> 3); }; uint8_t getB() const { - return (_c & 0x001f) << 3; + return (Color565 & 0x001f) << 3; }; @@ -144,7 +154,7 @@ struct Rgb16Color : RgbColorBase // ------------------------------------------------------------------------ bool operator==(const Rgb16Color& other) const { - return (_c == other._c); + return (Color565 == other.Color565); }; bool operator!=(const Rgb16Color& other) const @@ -266,7 +276,6 @@ struct Rgb16Color : RgbColorBase return total; }; -protected: - uint16_t _c; + uint16_t Color565; }; diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Rgb48Color.cpp b/lib/lib_basic/NeoPixelBus/src/internal/Rgb48Color.cpp similarity index 90% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Rgb48Color.cpp rename to lib/lib_basic/NeoPixelBus/src/internal/Rgb48Color.cpp index 3743ac588..ea03f9222 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Rgb48Color.cpp +++ b/lib/lib_basic/NeoPixelBus/src/internal/Rgb48Color.cpp @@ -49,9 +49,9 @@ Rgb48Color::Rgb48Color(const HslColor& color) _HslToRgb(color, &r, &g, &b); - R = (uint16_t)(r * Max); - G = (uint16_t)(g * Max); - B = (uint16_t)(b * Max); + R = static_cast(r * Max); + G = static_cast(g * Max); + B = static_cast(b * Max); } Rgb48Color::Rgb48Color(const HsbColor& color) @@ -62,14 +62,14 @@ Rgb48Color::Rgb48Color(const HsbColor& color) _HsbToRgb(color, &r, &g, &b); - R = (uint16_t)(r * Max); - G = (uint16_t)(g * Max); - B = (uint16_t)(b * Max); + R = static_cast(r * Max); + G = static_cast(g * Max); + B = static_cast(b * Max); } uint16_t Rgb48Color::CalculateBrightness() const { - return (uint16_t)(((uint32_t)R + (uint32_t)G + (uint32_t)B) / 3); + return static_cast((static_cast(R) + static_cast(G) + static_cast(B)) / 3); } Rgb48Color Rgb48Color::Dim(uint16_t ratio) const diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Rgb48Color.h b/lib/lib_basic/NeoPixelBus/src/internal/Rgb48Color.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Rgb48Color.h rename to lib/lib_basic/NeoPixelBus/src/internal/Rgb48Color.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/RgbColor.cpp b/lib/lib_basic/NeoPixelBus/src/internal/RgbColor.cpp similarity index 91% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/RgbColor.cpp rename to lib/lib_basic/NeoPixelBus/src/internal/RgbColor.cpp index 99f4e94b0..406d78e12 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/RgbColor.cpp +++ b/lib/lib_basic/NeoPixelBus/src/internal/RgbColor.cpp @@ -65,9 +65,9 @@ RgbColor::RgbColor(const HslColor& color) _HslToRgb(color, &r, &g, &b); - R = (uint8_t)(r * Max); - G = (uint8_t)(g * Max); - B = (uint8_t)(b * Max); + R = static_cast(r * Max); + G = static_cast(g * Max); + B = static_cast(b * Max); } RgbColor::RgbColor(const HsbColor& color) @@ -78,14 +78,14 @@ RgbColor::RgbColor(const HsbColor& color) _HsbToRgb(color, &r, &g, &b); - R = (uint8_t)(r * Max); - G = (uint8_t)(g * Max); - B = (uint8_t)(b * Max); + R = static_cast(r * Max); + G = static_cast(g * Max); + B = static_cast(b * Max); } uint8_t RgbColor::CalculateBrightness() const { - return (uint8_t)(((uint16_t)R + (uint16_t)G + (uint16_t)B) / 3); + return static_cast((static_cast(R) + static_cast(G) + static_cast(B)) / 3); } RgbColor RgbColor::Dim(uint8_t ratio) const diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/RgbColor.h b/lib/lib_basic/NeoPixelBus/src/internal/RgbColor.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/RgbColor.h rename to lib/lib_basic/NeoPixelBus/src/internal/RgbColor.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/RgbColorBase.cpp b/lib/lib_basic/NeoPixelBus/src/internal/RgbColorBase.cpp similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/RgbColorBase.cpp rename to lib/lib_basic/NeoPixelBus/src/internal/RgbColorBase.cpp diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/RgbColorBase.h b/lib/lib_basic/NeoPixelBus/src/internal/RgbColorBase.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/RgbColorBase.h rename to lib/lib_basic/NeoPixelBus/src/internal/RgbColorBase.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/RgbwColor.cpp b/lib/lib_basic/NeoPixelBus/src/internal/RgbwColor.cpp similarity index 97% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/RgbwColor.cpp rename to lib/lib_basic/NeoPixelBus/src/internal/RgbwColor.cpp index d73c7c9de..10b372784 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/RgbwColor.cpp +++ b/lib/lib_basic/NeoPixelBus/src/internal/RgbwColor.cpp @@ -57,7 +57,7 @@ RgbwColor::RgbwColor(const HsbColor& color) uint8_t RgbwColor::CalculateBrightness() const { - uint8_t colorB = (uint8_t)(((uint16_t)R + (uint16_t)G + (uint16_t)B) / 3); + uint8_t colorB = static_cast((static_cast(R) + static_cast(G) + static_cast(B)) / 3); if (W > colorB) { return W; diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/RgbwColor.h b/lib/lib_basic/NeoPixelBus/src/internal/RgbwColor.h similarity index 100% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/RgbwColor.h rename to lib/lib_basic/NeoPixelBus/src/internal/RgbwColor.h diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/SegmentDigit.cpp b/lib/lib_basic/NeoPixelBus/src/internal/SegmentDigit.cpp similarity index 86% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/SegmentDigit.cpp rename to lib/lib_basic/NeoPixelBus/src/internal/SegmentDigit.cpp index 91495978a..b310f5903 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/SegmentDigit.cpp +++ b/lib/lib_basic/NeoPixelBus/src/internal/SegmentDigit.cpp @@ -35,13 +35,13 @@ const uint8_t SevenSegDigit::DecodeNumbers[] = { const uint8_t SevenSegDigit::DecodeAlphaCaps[] = { // A B C D E F G - 0x77, 0x00, 0x39, 0x00, 0x79, 0x71, 0x3D, + 0x77, 0x7F, 0x39, 0x00, 0x79, 0x71, 0x3D, // H I J K L M N 0x76, 0x30, 0x1E, 0x00, 0x38, 0x00, 0x00, // O P Q R S 0x3F, 0x73, 0x00, 0x00, 0x6D, // T U V W X Y Z - 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00 }; + 0x00, 0x3E, 0x00, 0x00, 0x76, 0x00, 0x00 }; const uint8_t SevenSegDigit::DecodeAlpha[] = { // a b c d e f g @@ -71,7 +71,7 @@ SevenSegDigit::SevenSegDigit(uint8_t bitmask, uint8_t brightness, uint8_t defaul init(bitmask, brightness, defaultBrightness); }; -SevenSegDigit::SevenSegDigit(char letter, uint8_t brightness, uint8_t defaultBrightness) +SevenSegDigit::SevenSegDigit(char letter, uint8_t brightness, uint8_t defaultBrightness, bool maintainCase) { if (letter >= '0' && letter <= '9') { @@ -79,11 +79,23 @@ SevenSegDigit::SevenSegDigit(char letter, uint8_t brightness, uint8_t defaultBri } else if (letter >= 'a' && letter <= 'z') { - init(DecodeAlpha[letter - 'a'], brightness, defaultBrightness); + uint8_t index = letter - 'a'; + uint8_t bitmask = DecodeAlpha[index]; + if (!bitmask && !maintainCase) + { + bitmask = DecodeAlphaCaps[index]; + } + init(bitmask, brightness, defaultBrightness); } else if (letter >= 'A' && letter <= 'Z') { - init(DecodeAlphaCaps[letter - 'A'], brightness, defaultBrightness); + uint8_t index = letter - 'A'; + uint8_t bitmask = DecodeAlphaCaps[index]; + if (!bitmask && !maintainCase) + { + bitmask = DecodeAlpha[index]; + } + init(bitmask, brightness, defaultBrightness); } else if (letter >= ',' && letter <= '/') { @@ -104,7 +116,7 @@ uint8_t SevenSegDigit::CalculateBrightness() const sum += Segment[iSegment]; } - return (uint8_t)(sum / SegmentCount); + return static_cast(sum / SegmentCount); } void SevenSegDigit::Darken(uint8_t delta) diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/SegmentDigit.h b/lib/lib_basic/NeoPixelBus/src/internal/SegmentDigit.h similarity index 74% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/SegmentDigit.h rename to lib/lib_basic/NeoPixelBus/src/internal/SegmentDigit.h index 826044c41..a7fe452e8 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/SegmentDigit.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/SegmentDigit.h @@ -36,10 +36,26 @@ enum LedSegment LedSegment_E, LedSegment_F, LedSegment_G, - LedSegment_Decimal, + LedSegment_Decimal, // maybe jumpered to alternate custom segment + LedSegment_Custom, // generally not used but maybe connected to a custom segment LedSegment_COUNT }; +class NeoSevenSegCurrentSettings +{ +public: + NeoSevenSegCurrentSettings(uint16_t segments, uint16_t decimal, uint16_t special = 0) : + SegmentTenthMilliAmpere(segments), + DecimalTenthMilliAmpere(decimal), + SpecialTenthMilliAmpere(special) + { + } + + uint16_t SegmentTenthMilliAmpere; // in 1/10th ma + uint16_t DecimalTenthMilliAmpere; // in 1/10th ma + uint16_t SpecialTenthMilliAmpere; // in 1/10th ma +}; + // ------------------------------------------------------------------------ // SevenSegDigit represents a color object that is represented by the segments // of a 7 segment LED display digit. It contains helpful routines to manipulate @@ -51,6 +67,8 @@ enum LedSegment // ------------------------------------------------------------------------ struct SevenSegDigit { + typedef NeoSevenSegCurrentSettings SettingsObject; + // ------------------------------------------------------------------------ // Construct a SevenSegDigit using // the default brightness to apply to all segments @@ -74,7 +92,7 @@ struct SevenSegDigit // the brightness to apply to them, (0-255) // the default brightness to apply to those not set in the bitmask (0-255) // ------------------------------------------------------------------------ - SevenSegDigit(char letter, uint8_t brightness, uint8_t defaultBrightness = 0); + SevenSegDigit(char letter, uint8_t brightness, uint8_t defaultBrightness = 0, bool maintainCase = false); // ------------------------------------------------------------------------ // Construct a SevenSegDigit that will have its values set in latter operations @@ -134,8 +152,28 @@ struct SevenSegDigit // ------------------------------------------------------------------------ static SevenSegDigit LinearBlend(const SevenSegDigit& left, const SevenSegDigit& right, float progress); + + uint32_t CalcTotalTenthMilliAmpere(const SettingsObject& settings) + { + auto total = 0; + + for (uint8_t segment = LedSegment_A; segment < SegmentCount - 2; segment++) + { + total += Segment[segment] * settings.SegmentTenthMilliAmpere / Max; + } + + total += Segment[SegmentCount - 2] * settings.DecimalTenthMilliAmpere / Max; + total += Segment[SegmentCount - 1] * settings.SpecialTenthMilliAmpere / Max; + + return total; + } + template - static void SetString(T_SET_TARGET& target, uint16_t indexDigit, const char* str, uint8_t brightness, uint8_t defaultBrightness = 0) + static void SetString(T_SET_TARGET& target, + uint16_t indexDigit, + const char* str, + uint8_t brightness, + uint8_t defaultBrightness = 0) { if (str == nullptr) { @@ -146,7 +184,7 @@ struct SevenSegDigit const char* pIter = str; // digits are right to left - // so find the end + // so find the end and start there while (*pIter != '\0') { pIter++; @@ -157,25 +195,51 @@ struct SevenSegDigit while (pIter >= pFirst) { bool decimal = false; - char value = *pIter; + bool special = false; + char value = *pIter--; - // check if merging a decimal is required - if (pIter > pFirst && (*pIter == '.' || *pIter == ',')) + // must always be merged by previous char + // (the one to the right) + // so if repeated ignore it + // + if (value == ':' || value == ';') + { + continue; + } + + // check if merging a decimal with the next char is required + // (the one to the left) + // + if (pIter >= pFirst && (value == '.' || value == ',')) { // merge a decimal as long as they aren't the same - if (*(pIter - 1) != *pIter) + if (*(pIter) != value) { decimal = true; - pIter--; - value = *pIter; // use the next char + value = *pIter--; // use the next char } } + // check next char for colon + // + if (pIter >= pFirst && (*pIter == ':' || *pIter == ';')) + { + // the colon is custom extension using the decimal AND the special + // channels + special = true; + decimal = true; + pIter--; // skip colon + } + SevenSegDigit digit(value, brightness, defaultBrightness); if (decimal) { digit.Segment[LedSegment_Decimal] = brightness; } + if (special) + { + digit.Segment[LedSegment_Custom] = brightness; + } target.SetPixelColor(indexDigit, digit); indexDigit++; } @@ -188,6 +252,7 @@ struct SevenSegDigit static const uint8_t SegmentCount = 9; uint8_t Segment[SegmentCount]; + const static uint8_t Max = 255; // segment decode maps from ascii relative first char in map to a bitmask of segments // diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/TwoWireBitBangImple.h b/lib/lib_basic/NeoPixelBus/src/internal/TwoWireBitBangImple.h similarity index 95% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/TwoWireBitBangImple.h rename to lib/lib_basic/NeoPixelBus/src/internal/TwoWireBitBangImple.h index 4a784aeab..eede5f9cc 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/TwoWireBitBangImple.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/TwoWireBitBangImple.h @@ -30,6 +30,8 @@ License along with NeoPixel. If not, see class TwoWireBitBangImple { public: + typedef NeoNoSettings SettingsObject; + TwoWireBitBangImple(uint8_t pinClock, uint8_t pinData) : _pinClock(pinClock), _pinData(pinData) @@ -86,6 +88,10 @@ public: } } + void applySettings(const SettingsObject& settings) + { + } + private: const uint8_t _pinClock; // output pin number for clock line const uint8_t _pinData; // output pin number for data line diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/TwoWireBitBangImpleAvr.h b/lib/lib_basic/NeoPixelBus/src/internal/TwoWireBitBangImpleAvr.h similarity index 96% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/TwoWireBitBangImpleAvr.h rename to lib/lib_basic/NeoPixelBus/src/internal/TwoWireBitBangImpleAvr.h index 8c0be740d..5b475ac5f 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/TwoWireBitBangImpleAvr.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/TwoWireBitBangImpleAvr.h @@ -30,6 +30,8 @@ License along with NeoPixel. If not, see class TwoWireBitBangImple { public: + typedef NeoNoSettings SettingsObject; + TwoWireBitBangImple(uint8_t pinClock, uint8_t pinData) : _pinClock(pinClock), _pinData(pinData) @@ -101,6 +103,10 @@ public: } } + void applySettings(const SettingsObject& settings) + { + } + private: const uint8_t _pinClock; // output pin number for clock line const uint8_t _pinData; // output pin number for data line diff --git a/lib/lib_basic/NeoPixelBus/src/internal/TwoWireHspiImple.h b/lib/lib_basic/NeoPixelBus/src/internal/TwoWireHspiImple.h new file mode 100644 index 000000000..5a96bd5a9 --- /dev/null +++ b/lib/lib_basic/NeoPixelBus/src/internal/TwoWireHspiImple.h @@ -0,0 +1,92 @@ +/*------------------------------------------------------------------------- +NeoPixel library helper functions for DotStars using ESP32's alternate SPI (HSPI) (APA102/LPD8806). + +Written by Michael C. Miller. +Minor changes adapting TwoWireSpiImple to support HSPI by Louis Beaudoin (Pixelvation) + +I invest time and resources providing this open source code, +please support me by dontating (see https://github.com/Makuna/NeoPixelBus) + +------------------------------------------------------------------------- +This file is part of the Makuna/NeoPixelBus library. + +NeoPixelBus is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as +published by the Free Software Foundation, either version 3 of +the License, or (at your option) any later version. + +NeoPixelBus is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with NeoPixel. If not, see +. +-------------------------------------------------------------------------*/ + +#pragma once + +#include + +template class TwoWireHspiImple +{ +public: + typedef typename T_SPISPEED::SettingsObject SettingsObject; + + TwoWireHspiImple(uint8_t, uint8_t) // clock and data pins ignored for hardware SPI + { + _hspi = new SPIClass(HSPI); + } + + ~TwoWireHspiImple() + { + _hspi->end(); + delete _hspi; + } + +#if defined(ARDUINO_ARCH_ESP32) + // for cases where hardware SPI can have pins changed + void begin(int8_t sck, int8_t miso, int8_t mosi, int8_t ss) + { + _hspi->begin(sck, miso, mosi, ss); + } +#endif + + void begin() + { + _hspi->begin(); + } + + void beginTransaction() + { + _hspi->beginTransaction(SPISettings(_speed.Clock, MSBFIRST, SPI_MODE0)); + } + + void endTransaction() + { + _hspi->endTransaction(); + } + + void transmitByte(uint8_t data) + { + _hspi->transfer(data); + } + + void transmitBytes(const uint8_t* data, size_t dataSize) + { + // ESPs have a method to write without inplace overwriting the send buffer + // since we don't care what gets received, use it for performance + // FIX: but for what ever reason on Esp32, its not const + _hspi->writeBytes(const_cast(data), dataSize); + } + + void applySettings(const SettingsObject& settings) + { + _speed.applySettings(settings); + } + +private: + SPIClass * _hspi = NULL; + T_SPISPEED _speed; +}; diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/TwoWireSpiImple.h b/lib/lib_basic/NeoPixelBus/src/internal/TwoWireSpiImple.h similarity index 63% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/TwoWireSpiImple.h rename to lib/lib_basic/NeoPixelBus/src/internal/TwoWireSpiImple.h index ce07ee722..906d86b8f 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/TwoWireSpiImple.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/TwoWireSpiImple.h @@ -1,5 +1,5 @@ /*------------------------------------------------------------------------- -NeoPixel library helper functions for DotStars using general Pins (APA102/LPD8806). +NeoPixel library helper functions for DotStars using SPI (APA102/LPD8806). Written by Michael C. Miller. @@ -31,42 +31,112 @@ License along with NeoPixel. If not, see class SpiSpeed40Mhz { public: + typedef NeoNoSettings SettingsObject; + SpiSpeed40Mhz() {}; + + static void applySettings(const SettingsObject& settings) {} + static const uint32_t Clock = 40000000L; }; class SpiSpeed20Mhz { public: + typedef NeoNoSettings SettingsObject; + SpiSpeed20Mhz() {}; + + static void applySettings(const SettingsObject& settings) {} + static const uint32_t Clock = 20000000L; }; class SpiSpeed10Mhz { public: + typedef NeoNoSettings SettingsObject; + SpiSpeed10Mhz() {}; + + static void applySettings(const SettingsObject& settings) {} + static const uint32_t Clock = 10000000L; }; +class SpiSpeed5Mhz +{ +public: + typedef NeoNoSettings SettingsObject; + SpiSpeed5Mhz() {}; + + static void applySettings(const SettingsObject& settings) {} + + static const uint32_t Clock = 5000000L; +}; + class SpiSpeed2Mhz { public: + typedef NeoNoSettings SettingsObject; + SpiSpeed2Mhz() {}; + + static void applySettings(const SettingsObject& settings) {} + static const uint32_t Clock = 2000000L; }; class SpiSpeed1Mhz { public: + typedef NeoNoSettings SettingsObject; + SpiSpeed1Mhz() {}; + + static void applySettings(const SettingsObject& settings) {} + static const uint32_t Clock = 1000000L; }; class SpiSpeed500Khz { public: + typedef NeoNoSettings SettingsObject; + SpiSpeed500Khz() {}; + + static void applySettings(const SettingsObject& settings) {} + static const uint32_t Clock = 500000L; }; +class NeoSpiSettings +{ +public: + NeoSpiSettings(uint32_t clock) : + Clock(clock) + { + } + uint32_t Clock; +}; + +class SpiSpeedHz +{ +public: + typedef NeoSpiSettings SettingsObject; + + SpiSpeedHz() : + Clock(10000000) + {}; + + void applySettings(const SettingsObject& settings) + { + Clock = settings.Clock; + } + + uint32_t Clock; +}; + template class TwoWireSpiImple { public: + typedef typename T_SPISPEED::SettingsObject SettingsObject; + TwoWireSpiImple(uint8_t, uint8_t) // clock and data pins ignored for hardware SPI { } @@ -91,7 +161,7 @@ public: void beginTransaction() { - SPI.beginTransaction(SPISettings(T_SPISPEED::Clock, MSBFIRST, SPI_MODE0)); + SPI.beginTransaction(SPISettings(_speed.Clock, MSBFIRST, SPI_MODE0)); } void endTransaction() @@ -123,5 +193,11 @@ public: #endif } + void applySettings(const SettingsObject& settings) + { + _speed.applySettings(settings); + } + private: + T_SPISPEED _speed; }; \ No newline at end of file diff --git a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Ws2801GenericMethod.h b/lib/lib_basic/NeoPixelBus/src/internal/Ws2801GenericMethod.h similarity index 92% rename from lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Ws2801GenericMethod.h rename to lib/lib_basic/NeoPixelBus/src/internal/Ws2801GenericMethod.h index b3b3ea1c1..24521c6f6 100644 --- a/lib/lib_basic/NeoPixelBus-2.6.1.4/src/internal/Ws2801GenericMethod.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/Ws2801GenericMethod.h @@ -37,6 +37,8 @@ License along with NeoPixel. If not, see template class Ws2801MethodBase { public: + typedef typename T_TWOWIRE::SettingsObject SettingsObject; + Ws2801MethodBase(uint8_t pinClock, uint8_t pinData, uint16_t pixelCount, size_t elementSize, size_t settingsSize) : _sizeData(pixelCount * elementSize + settingsSize), _wire(pinClock, pinData) @@ -110,6 +112,11 @@ public: return _sizeData; }; + void applySettings(const SettingsObject& settings) + { + _wire.applySettings(settings); + } + private: const size_t _sizeData; // Size of '_data' buffer below @@ -124,9 +131,13 @@ typedef Ws2801MethodBase NeoWs2801Method; #include "TwoWireSpiImple.h" typedef Ws2801MethodBase> NeoWs2801Spi20MhzMethod; typedef Ws2801MethodBase> NeoWs2801Spi10MhzMethod; +typedef Ws2801MethodBase> NeoWs2801Spi5MhzMethod; typedef Ws2801MethodBase> NeoWs2801Spi2MhzMethod; typedef Ws2801MethodBase> NeoWs2801Spi1MhzMethod; typedef Ws2801MethodBase> NeoWs2801Spi500KhzMethod; + +typedef Ws2801MethodBase> NeoWs2801SpiHzMethod; + typedef NeoWs2801Spi10MhzMethod NeoWs2801SpiMethod; #endif diff --git a/lib/lib_basic/OneWire-Stickbreaker-20190506-1.1/OneWire.cpp b/lib/lib_basic/OneWire-Stickbreaker-20190506-1.1/OneWire.cpp index 8a7309865..404e8b272 100644 --- a/lib/lib_basic/OneWire-Stickbreaker-20190506-1.1/OneWire.cpp +++ b/lib/lib_basic/OneWire-Stickbreaker-20190506-1.1/OneWire.cpp @@ -618,4 +618,4 @@ uint16_t OneWire::crc16(const uint8_t* input, uint16_t len, uint16_t crc) return crc; } #endif -#endif \ No newline at end of file +#endif diff --git a/platformio_tasmota_cenv_sample.ini b/platformio_tasmota_cenv_sample.ini index f5cb18776..75d29552a 100644 --- a/platformio_tasmota_cenv_sample.ini +++ b/platformio_tasmota_cenv_sample.ini @@ -53,25 +53,32 @@ lib_ignore = ; *** EXPERIMENTAL Tasmota version for ESP32-C3 [env:tasmota32c3] -extends = env:tasmota32_base -board = esp32c3 -platform = https://github.com/Jason2866/platform-espressif32.git#feature/arduino-c3 -platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/277/framework-arduinoespressif32-master-1d7068e4b.tar.gz - tasmota/toolchain-riscv32 - platformio/tool-mklittlefs @ ~1.203.200522 -build_unflags = ${esp32_defaults.build_unflags} -mtarget-align -build_flags = ${esp32_defaults.build_flags} - -DFIRMWARE_LITE - -I$PROJECT_DIR/include - -include "fix_esp32c3.h" - ;-DESP32_STAGE=true -lib_extra_dirs = lib/libesp32 -lib_ignore = - NeoPixelBus - rc-switch - OneWire - NimBLE-Arduino - Micro-RTSP +extends = env:tasmota32_base +board = esp32c3 +platform = https://github.com/Jason2866/platform-espressif32.git#feature/arduino-c3 +platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/277/framework-arduinoespressif32-master-1d7068e4b.tar.gz + tasmota/toolchain-riscv32 + platformio/tool-mklittlefs @ ~1.203.200522 +build_unflags = ${esp32_defaults.build_unflags} + -Wswitch-unreachable + -mtarget-align +build_flags = ${esp32_defaults.build_flags} + -Wno-switch-unreachable + -I$PROJECT_DIR/include + -include "fix_esp32c3.h" + -include "sdkconfig.h" + ;-DESP32_STAGE=true +lib_extra_dirs = lib/libesp32 + lib/libesp32_lvgl + lib/lib_basic + lib/lib_i2c + lib/lib_ssl + lib/lib_display +lib_ignore = + rc-switch + OneWire + NimBLE-Arduino + Micro-RTSP ; *** EXPERIMENTAL Tasmota version for ESP32 IDF4.4. [env:tasmota32idf4] diff --git a/tasmota/xsns_05_ds18x20_esp32.ino b/tasmota/xsns_05_ds18x20_esp32.ino index 4c501dde7..30d903364 100644 --- a/tasmota/xsns_05_ds18x20_esp32.ino +++ b/tasmota/xsns_05_ds18x20_esp32.ino @@ -17,7 +17,8 @@ along with this program. If not, see . */ -#ifdef ESP32 +// ESP32C3 I2S is not supported yet +#if defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32S2) #ifdef USE_DS18x20 /*********************************************************************************************\ * DS18B20 - Temperature - Multiple sensors