Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
// 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 uint8_t MisoUnusedPin = -1;
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)
Expand Down Expand Up @@ -76,7 +77,7 @@ void setup()
#if (USE_DEFAULT_SPI_PORT == 1)
if (useSpiAlternatePins)
{
strip.Begin(DotClockPin, DotDataPin, DotDataPin, DotChipSelectPin);
strip.Begin(DotClockPin, MisoUnusedPin, DotDataPin, DotChipSelectPin);
}
else
{
Expand All @@ -90,7 +91,7 @@ void setup()
#if (USE_ALTERNATE_SPI_PORT == 1)
if (useSpiAlternatePins2)
{
strip2.Begin(DotClockPin2, DotDataPin2, DotDataPin2, DotChipSelectPin2);
strip2.Begin(DotClockPin2, MisoUnusedPin, DotDataPin2, DotChipSelectPin2);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// 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 uint8_t MisoUnusedPin = -1;
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)
Expand Down Expand Up @@ -89,7 +90,7 @@ void setup()
#if (USE_DEFAULT_SPI_PORT == 1)
if (useSpiAlternatePins)
{
strip.Begin(DotClockPin, DotDataPin, DotDataPin, DotChipSelectPin);
strip.Begin(DotClockPin, MisoUnusedPin, DotDataPin, DotChipSelectPin);
}
else
{
Expand All @@ -103,7 +104,7 @@ void setup()
#if (USE_ALTERNATE_SPI_PORT == 1)
if (useSpiAlternatePins2)
{
strip2.Begin(DotClockPin2, DotDataPin2, DotDataPin2, DotChipSelectPin2);
strip2.Begin(DotClockPin2, MisoUnusedPin, DotDataPin2, DotChipSelectPin2);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "git",
"url": "https://github.com/Makuna/NeoPixelBus"
},
"version": "2.8.3",
"version": "2.9.0",
"frameworks": "arduino",
"platforms": "*",
"dependencies": [
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=NeoPixelBus by Makuna
version=2.8.3
version=2.9.0
author=Michael C. Miller (makuna@live.com)
maintainer=Michael C. Miller (makuna@live.com)
sentence=A library that makes controlling NeoPixels (WS2812x and many others) and DotStars (SK6812 and many others) easy.
Expand Down
47 changes: 32 additions & 15 deletions src/internal/NeoMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,39 +50,56 @@ License along with NeoPixel. If not, see
//
#if defined(ARDUINO_ARCH_ESP8266)

#include "methods/NeoEsp8266DmaMethod.h"
#include "methods/NeoEsp8266I2sDmx512Method.h"
#include "methods/NeoEsp8266UartMethod.h"
#include "methods/NeoEspBitBangMethod.h"
#include "methods/ESP/ESP8266/NeoEsp8266DmaMethod.h"
#include "methods/ESP/ESP8266/NeoEsp8266I2sDmx512Method.h"
#include "methods/ESP/ESP8266/NeoEsp8266UartMethod.h"
#include "methods/ESP/NeoEspBitBangMethod.h"

#elif defined(ARDUINO_ARCH_ESP32)

#if !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2)
#include "methods/NeoEsp32I2sMethod.h"
#include "methods/NeoEsp32RmtMethod.h"
#include "methods/DotStarEsp32DmaSpiMethod.h"
#include "methods/NeoEsp32I2sXMethod.h"
#include "methods/NeoEsp32LcdXMethod.h"
#if ESP_IDF_VERSION_MAJOR < 5

#include "methods/ESP/ESP32/Core_2_x/NeoEsp32RmtMethod.h"

#else // ESP_IDF_VERSION_MAJOR < 5

#define NEOPIXEL_ESP32_RMT_DEFAULT // core3 will have RMT default, maybe change after an updated i2s

#if !defined(CONFIG_IDF_TARGET_ESP32C2)
#include "methods/ESP/ESP32/NeoEsp32RmtXMethod.h" // every other SOC
#else //CONFIG_IDF_TARGET_ESP32C2
#include "methods/ESP/ESP32/NeoEsp32SpiMethod.h" // ESP32C2
#endif //CONFIG_IDF_TARGET_ESP32C2

#endif // ESP_IDF_VERSION_MAJOR < 5

// once we have a core3 i2s, then fix this
#if !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32C5) && !defined(CONFIG_IDF_TARGET_ESP32H2)
#include "methods/ESP/ESP32/Core_2_x/NeoEsp32I2sMethod.h"
#include "methods/ESP/ESP32/Core_2_x/NeoEsp32I2sXMethod.h"
#endif
#include "methods/NeoEspBitBangMethod.h"

#include "methods/ESP/ESP32/DotStarEsp32DmaSpiMethod.h"
#include "methods/ESP/ESP32/NeoEsp32LcdXMethod.h"


#include "methods/ESP/NeoEspBitBangMethod.h"

#elif defined(ARDUINO_ARCH_NRF52840) // must be before __arm__

#include "methods/NeoNrf52xMethod.h"
#include "methods/ARM/NeoNrf52xMethod.h"

#elif defined(ARDUINO_ARCH_RP2040) // must be before __arm__

#include "methods/Rp2040/NeoRp2040x4Method.h"
#include "methods/RP2040/NeoRp2040x4Method.h"

#elif defined(__arm__) // must be before ARDUINO_ARCH_AVR due to Teensy incorrectly having it set

#include "methods/NeoArmMethod.h"
#include "methods/ARM/NeoArmMethod.h"

#elif defined(ARDUINO_ARCH_AVR) || defined(ARDUINO_ARCH_MEGAAVR)

#include "methods/NeoAvrMethod.h"
#include "methods/AVR/NeoAvrMethod.h"

#else
#error "Platform Currently Not Supported, please add an Issue at Github/Makuna/NeoPixelBus"
Expand Down
41 changes: 20 additions & 21 deletions src/internal/XMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ License along with NeoPixel. If not, see
#pragma once


#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2)
#if defined(ARDUINO_ARCH_ESP32)
//----------------------------------------------------------

#if defined(CONFIG_IDF_TARGET_ESP32S3)
Expand Down Expand Up @@ -68,26 +68,24 @@ typedef NeoEsp32LcdX16Ws2816Method X16Ws2816Method;
typedef NeoEsp32LcdX16Ws2812Method X16Ws2812Method;
typedef NeoEsp32LcdX16Lc8812Method X16Lc8812Method;

#elif defined(CONFIG_IDF_TARGET_ESP32C3)

#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32C5) || defined(CONFIG_IDF_TARGET_ESP32H2) || defined(CONFIG_IDF_TARGET_ESP32P4)

//----------------------------------------------------------
/* RMT doesnt have a X method yet
typedef NeoEsp32Rmtx8Ws2812xMethod X8Ws2812xMethod;
typedef NeoEsp32Rmtx8Ws2805Method X8Ws2805Method;
typedef NeoEsp32Rmtx8Sk6812Method X8Sk6812Method;
typedef NeoEsp32Rmtx8Tm1814Method X8Tm1814Method;
typedef NeoEsp32Rmtx8Tm1829Method X8Tm1829Method;
typedef NeoEsp32Rmtx8Tm1914Method X8Tm1914Method;
typedef NeoEsp32Rmtx8800KbpsMethod X8800KbpsMethod;
typedef NeoEsp32Rmtx8400KbpsMethod X8400KbpsMethod;
typedef NeoEsp32Rmtx8Apa106Method X8Apa106Method;
typedef NeoEsp32Rmtx8Ws2814Method X8Ws2814Method;
typedef NeoEsp32Rmtx8Ws2813Method X8Ws2813Method;
typedef NeoEsp32Rmtx8Ws2812dMethod X8Ws2812dMethod;
typedef NeoEsp32Rmtx8Ws2811Method X8Ws2811Method;
typedef NeoEsp32Rmtx8Ws2816Method X8Ws2816Method;
typedef NeoEsp32Rmtx8Ws2812Method X8Ws2812Method;
typedef NeoEsp32Rmtx8Lc8812Method X8Lc8812Method;
*/
typedef NeoEsp32RmtXWs2812xMethod XWs2812xMethod;
typedef NeoEsp32RmtXWs2805Method XWs2805Method;
typedef NeoEsp32RmtXSk6812Method XSk6812Method;
typedef NeoEsp32RmtXTm1814Method XTm1814Method;
typedef NeoEsp32RmtXTm1829Method XTm1829Method;
typedef NeoEsp32RmtXTm1914Method XTm1914Method;
typedef NeoEsp32RmtX800KbpsMethod X800KbpsMethod;
typedef NeoEsp32RmtX400KbpsMethod X400KbpsMethod;
typedef NeoEsp32RmtXApa106Method XApa106Method;
typedef NeoEsp32RmtXWs2814Method XWs2814Method;
typedef NeoEsp32RmtXWs2813Method XWs2813Method;
typedef NeoEsp32RmtXWs2811Method XWs2811Method;
typedef NeoEsp32RmtXWs2816Method XWs2816Method;
typedef NeoEsp32RmtXLc8812Method XLc8812Method;

#elif defined(CONFIG_IDF_TARGET_ESP32S2)
//----------------------------------------------------------
Expand Down Expand Up @@ -127,6 +125,7 @@ typedef NeoEsp32I2s0X16Ws2816Method X16Ws2816Method;
typedef NeoEsp32I2s0X16Ws2812Method X16Ws2812Method;
typedef NeoEsp32I2s0X16Lc8812Method X16Lc8812Method;


#else // plain old ESP32
//----------------------------------------------------------
#define NEO_X4_ALIAS
Expand Down Expand Up @@ -192,7 +191,7 @@ typedef Rp2040x4Pio1Ws2812xMethod X4Ws2812xMethod;
typedef Rp2040x4Pio1400KbpsMethod X4400KbpsMethod;
#endif

// some plafforms do not have a native x4, so alias it to x8
// some platforms do not have a native x4, so alias it to x8
//
#if defined(NEO_X4_ALIAS)
typedef X8Ws2812xMethod X4Ws2813Method;
Expand Down
2 changes: 1 addition & 1 deletion src/internal/methods/DotStarGenericMethod.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ typedef DotStarMethodBase<TwoWireSpiImple<SpiSpeedHz>> DotStarEsp32VspiHzMethod;

typedef DotStarSpi10MhzMethod DotStarEsp32VspiMethod;

#include "TwoWireHspiImple.h"
#include "ESP/ESP32/TwoWireHspiImple.h"
typedef DotStarMethodBase<TwoWireHspiImple<SpiSpeed40Mhz>> DotStarEsp32Hspi40MhzMethod;
typedef DotStarMethodBase<TwoWireHspiImple<SpiSpeed20Mhz>> DotStarEsp32Hspi20MhzMethod;
typedef DotStarMethodBase<TwoWireHspiImple<SpiSpeed10Mhz>> DotStarEsp32Hspi10MhzMethod;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
#include <stdio.h>
#include "stdlib.h"

// ESP32 C3, S3, C6, and H2 I2S is not supported yet due to significant changes to interface
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2)
// ESP32 C3, S3, C6, H2, and P4 I2S is not supported yet due to significant changes to interface
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32C5) && !defined(CONFIG_IDF_TARGET_ESP32H2) && !defined(CONFIG_IDF_TARGET_ESP32P4)

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "freertos/queue.h"
#include "FractionClk.h"
#include "../../../FractionClk.h"

#if ESP_IDF_VERSION_MAJOR>=4
#include "esp_intr_alloc.h"
Expand Down Expand Up @@ -516,7 +516,9 @@ void i2sInit(uint8_t bus_num,
// conf1.rx_pcm_bypass = 1;

conf1.tx_stop_en = 0;
#if SOC_I2S_SUPPORTS_PCM_BYPASS
conf1.tx_pcm_bypass = 1;
#endif
i2s->conf1.val = conf1.val;
}

Expand Down Expand Up @@ -950,6 +952,6 @@ bool i2sGetClks(uint8_t bus_num,
}
#endif

#endif // !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2)
#endif // !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32C5) && !defined(CONFIG_IDF_TARGET_ESP32H2)

#endif // defined(ARDUINO_ARCH_ESP32)
#endif // defined(ARDUINO_ARCH_ESP32)
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ License along with NeoPixel. If not, see

#pragma once

// ESP32 C3 & S3 I2S is not supported yet due to significant changes to interface
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3)
// ESP32 beyond C3 & S3 I2S is not supported yet
// due to significant changes to interface
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32C5) && !defined(CONFIG_IDF_TARGET_ESP32H2) && !defined(CONFIG_IDF_TARGET_ESP32P4)


extern "C"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ License along with NeoPixel. If not, see
<http://www.gnu.org/licenses/>.
-------------------------------------------------------------------------*/

// ESP32C3/S3 I2S is not supported yet due to significant changes to interface
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3)
// ESP32 beyond C3 & S3 I2S is not supported yet
// due to significant changes to interface
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32C5) && !defined(CONFIG_IDF_TARGET_ESP32H2) && !defined(CONFIG_IDF_TARGET_ESP32P4)

extern "C"
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,20 @@ License along with NeoPixel. If not, see

#include <Arduino.h>

#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2)
#if ESP_IDF_VERSION_MAJOR < 5

#include "../NeoSettings.h"
#include "../NeoBusChannel.h"
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32C5) && !defined(CONFIG_IDF_TARGET_ESP32H2)

#include "../../../../NeoSettings.h"
#include "../../../../NeoBusChannel.h"
#include "NeoEsp32RmtMethod.h"

// translate NeoPixelBuffer into RMT buffer
// this is done on the fly so we don't require a send buffer in raw RMT format
// which would be 32x larger than the primary buffer
//
// NOTE: This was moved from the template below to here to workaround a GCC bug
// That bug is that the IRAM_ATTR attribute (any attributes) is lost on template classes.
// That bug is that the IRAM_ATTR attribute (any attributes) is lost on template classes.
//
// Further, it was removed from the header to support current Esp32 release
// which will need to be removed when the latest GitHub branchis released
Expand Down Expand Up @@ -373,4 +375,5 @@ void NeoEsp32RmtInvertedSpeedGs1903::Translate(const void* src,
RmtBit0, RmtBit1, RmtDurationReset);
}

#endif
#endif
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ typedef NeoEsp32Rmt7Ws2805InvertedMethod NeoEsp32Rmt7Ws2814InvertedMethod;

// Normally I2s method is the default, defining NEOPIXEL_ESP32_RMT_DEFAULT
// will switch to use RMT as the default method
// The ESP32S2, ESP32S3, and ESP32C3 will always defualt to RMT
// The ESP32S2, ESP32S3, and ESP32C3 will always default to RMT

#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S3)

Expand Down Expand Up @@ -1070,4 +1070,4 @@ typedef NeoEsp32Rmt6400KbpsInvertedMethod Neo400KbpsInvertedMethod;

#endif // defined(NEOPIXEL_ESP32_RMT_DEFAULT) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3)

#endif
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ template<typename T_SPISPEED, typename T_SPIBUS> class DotStarEsp32DmaSpiMethodB
// 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) && !defined(CONFIG_IDF_TARGET_ESP32S3)
if (T_SPIBUS::SpiHostDevice == VSPI_HOST)
#if SOC_SPI_PERIPH_NUM > 2
if (T_SPIBUS::SpiHostDevice == SPI3_HOST)
{
Initialize(SCK, -1, MOSI, -1, -1, -1);
}
Expand Down Expand Up @@ -309,19 +309,20 @@ typedef DotStarEsp32DmaSpiMethodBase<SpiSpeed10Mhz, Esp32Spi28BitBus> DotStarEsp


// SPI3
#if (defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32S3))
#if SOC_SPI_PERIPH_NUM > 2

typedef Esp32SpiBus<SPI3_HOST, WIDTH1> Esp32Spi3Bus;
typedef DotStarEsp32DmaSpiMethodBase<SpiSpeed10Mhz, Esp32Spi3Bus> DotStarEsp32DmaSpi3Method;

#if !defined(CONFIG_IDF_TARGET_ESP32S2)

typedef Esp32SpiBus<SPI3_HOST, WIDTH2> Esp32Spi32BitBus;
typedef Esp32SpiBus<SPI3_HOST, WIDTH4> Esp32Spi34BitBus;

typedef DotStarEsp32DmaSpiMethodBase<SpiSpeed10Mhz, Esp32Spi3Bus> DotStarEsp32DmaSpi3Method;
typedef DotStarEsp32DmaSpiMethodBase<SpiSpeed10Mhz, Esp32Spi32BitBus> DotStarEsp32DmaSpi32BitMethod;
typedef DotStarEsp32DmaSpiMethodBase<SpiSpeed10Mhz, Esp32Spi34BitBus> DotStarEsp32DmaSpi34BitMethod;
#endif

#if defined(CONFIG_IDF_TARGET_ESP32S2)
typedef Esp32SpiBus<SPI3_HOST, WIDTH1> Esp32Spi3Bus;
typedef DotStarEsp32DmaSpiMethodBase<SpiSpeed10Mhz, Esp32Spi3Bus> DotStarEsp32DmaSpi3Method;
#endif
#endif

// Default SpiDma methods if we don't care about bus. It's nice that every single ESP32 out there
Expand Down
Loading