diff --git a/src/internal/methods/ESP/ESP32/NeoEsp32RmtSpeed.h b/src/internal/methods/ESP/ESP32/NeoEsp32RmtSpeed.h index 9d9e217..7a7abe5 100644 --- a/src/internal/methods/ESP/ESP32/NeoEsp32RmtSpeed.h +++ b/src/internal/methods/ESP/ESP32/NeoEsp32RmtSpeed.h @@ -26,7 +26,7 @@ License along with NeoPixel. If not, see #pragma once -class NeoEsp32RmtSpeed +class NeoEsp32RmtSpeedBase { public: // @@ -49,21 +49,8 @@ public: { return (FromNs(nsLow) << 16) | (1 << 15) | (FromNs(nsHigh)); } - - }; -class NeoEsp32RmtSpeedBase : public NeoEsp32RmtSpeed -{ -public: - const static bool Inverted = false; -}; - -class NeoEsp32RmtInvertedSpeedBase : public NeoEsp32RmtSpeed -{ -public: - const static bool Inverted = true; -}; class NeoEsp32RmtSpeedWs2811 : public NeoEsp32RmtSpeedBase { @@ -81,6 +68,14 @@ public: const static uint16_t RmtDurationReset = FromNs(300000); // 300us }; +class NeoEsp32RmtSpeedWs2805 : public NeoEsp32RmtSpeedBase +{ +public: + const static uint32_t RmtBit0 = Item32Val(300, 790); + const static uint32_t RmtBit1 = Item32Val(790, 300); + const static uint16_t RmtDurationReset = FromNs(300000); // spec is 280, intentionally longer for compatiblity use +}; + class NeoEsp32RmtSpeedSk6812 : public NeoEsp32RmtSpeedBase { public: @@ -90,7 +85,7 @@ public: }; // normal is inverted signal -class NeoEsp32RmtSpeedTm1814 : public NeoEsp32RmtInvertedSpeedBase +class NeoEsp32RmtSpeedTm1814 : public NeoEsp32RmtSpeedBase { public: const static uint32_t RmtBit0 = Item32Val(360, 890); @@ -99,7 +94,7 @@ public: }; // normal is inverted signal -class NeoEsp32RmtSpeedTm1829 : public NeoEsp32RmtInvertedSpeedBase +class NeoEsp32RmtSpeedTm1829 : public NeoEsp32RmtSpeedBase { public: const static uint32_t RmtBit0 = Item32Val(300, 900); @@ -108,7 +103,7 @@ public: }; // normal is inverted signal -class NeoEsp32RmtSpeedTm1914 : public NeoEsp32RmtInvertedSpeedBase +class NeoEsp32RmtSpeedTm1914 : public NeoEsp32RmtSpeedBase { public: const static uint32_t RmtBit0 = Item32Val(360, 890); @@ -148,86 +143,23 @@ public: const static uint16_t RmtDurationReset = FromNs(80000); // 80us }; -class NeoEsp32RmtInvertedSpeedWs2811 : public NeoEsp32RmtInvertedSpeedBase -{ -public: - const static uint32_t RmtBit0 = Item32Val(300, 950); - const static uint32_t RmtBit1 = Item32Val(900, 350); - const static uint16_t RmtDurationReset = FromNs(300000); // 300us -}; - -class NeoEsp32RmtInvertedSpeedWs2812x : public NeoEsp32RmtInvertedSpeedBase -{ -public: - const static uint32_t RmtBit0 = Item32Val(400, 850); - const static uint32_t RmtBit1 = Item32Val(800, 450); - const static uint16_t RmtDurationReset = FromNs(300000); // 300us -}; - -class NeoEsp32RmtInvertedSpeedSk6812 : public NeoEsp32RmtInvertedSpeedBase -{ -public: - const static uint32_t RmtBit0 = Item32Val(400, 850); - const static uint32_t RmtBit1 = Item32Val(800, 450); - const static uint16_t RmtDurationReset = FromNs(80000); // 80us -}; - -// normal is inverted signal -class NeoEsp32RmtInvertedSpeedTm1814 : public NeoEsp32RmtSpeedBase -{ -public: - const static uint32_t RmtBit0 = Item32Val(360, 890); - const static uint32_t RmtBit1 = Item32Val(720, 530); - const static uint16_t RmtDurationReset = FromNs(200000); // 200us -}; - -// normal is inverted signal -class NeoEsp32RmtInvertedSpeedTm1829 : public NeoEsp32RmtSpeedBase +class NeoEsp32RmtSpeedGs1903 : public NeoEsp32RmtSpeedBase { public: const static uint32_t RmtBit0 = Item32Val(300, 900); - const static uint32_t RmtBit1 = Item32Val(800, 400); - const static uint16_t RmtDurationReset = FromNs(200000); // 200us + const static uint32_t RmtBit1 = Item32Val(900, 300); + const static uint16_t RmtDurationReset = FromNs(40000); // 40us }; -// normal is inverted signal -class NeoEsp32RmtInvertedSpeedTm1914 : public NeoEsp32RmtSpeedBase + +class NeoEsp32RmtNotInverted { public: - const static uint32_t RmtBit0 = Item32Val(360, 890); - const static uint32_t RmtBit1 = Item32Val(720, 530); - const static uint16_t RmtDurationReset = FromNs(200000); // 200us + const static bool Inverted = false; }; -class NeoEsp32RmtInvertedSpeed800Kbps : public NeoEsp32RmtInvertedSpeedBase +class NeoEsp32RmtInverted { public: - const static uint32_t RmtBit0 = Item32Val(400, 850); - const static uint32_t RmtBit1 = Item32Val(800, 450); - const static uint16_t RmtDurationReset = FromNs(50000); // 50us + const static bool Inverted = true; }; - -class NeoEsp32RmtInvertedSpeed400Kbps : public NeoEsp32RmtInvertedSpeedBase -{ -public: - const static uint32_t RmtBit0 = Item32Val(800, 1700); - const static uint32_t RmtBit1 = Item32Val(1600, 900); - const static uint16_t RmtDurationReset = FromNs(50000); // 50us -}; - -class NeoEsp32RmtInvertedSpeedApa106 : public NeoEsp32RmtInvertedSpeedBase -{ -public: - const static uint32_t RmtBit0 = Item32Val(350, 1350); - const static uint32_t RmtBit1 = Item32Val(1350, 350); - const static uint16_t RmtDurationReset = FromNs(50000); // 50us -}; - -class NeoEsp32RmtInvertedSpeedTx1812 : public NeoEsp32RmtInvertedSpeedBase -{ -public: - const static uint32_t RmtBit0 = Item32Val(300, 600); - const static uint32_t RmtBit1 = Item32Val(600, 300); - const static uint16_t RmtDurationReset = FromNs(80000); // 80us -}; - diff --git a/src/internal/methods/ESP/ESP32/NeoEsp32RmtXMethod.h b/src/internal/methods/ESP/ESP32/NeoEsp32RmtXMethod.h index da1b19e..e7459d9 100644 --- a/src/internal/methods/ESP/ESP32/NeoEsp32RmtXMethod.h +++ b/src/internal/methods/ESP/ESP32/NeoEsp32RmtXMethod.h @@ -173,7 +173,7 @@ err: #define NEOPIXELBUS_RMT_INT_FLAGS (ESP_INTR_FLAG_LOWMED) -template class NeoEsp32RmtMethodBase +template class NeoEsp32RmtMethodBase { public: typedef NeoNoSettings SettingsObject; @@ -216,7 +216,7 @@ public: config.mem_block_symbols = 192; // memory block size, 64 * 4 = 256 Bytes config.resolution_hz = T_SPEED::RmtTicksPerSecond; // 1 MHz tick resolution, i.e., 1 tick = 1 µs config.trans_queue_depth = 4; // set the number of transactions that can pend in the background - config.flags.invert_out = T_SPEED::Inverted; // do not invert output signal + config.flags.invert_out = T_INVERTED::Inverted; // do not invert output signal config.flags.with_dma = false; // do not need DMA backend ret += rmt_new_tx_channel(&config, &_channel); @@ -314,28 +314,37 @@ private: // normal typedef NeoEsp32RmtMethodBase NeoEsp32RmtXWs2811Method; typedef NeoEsp32RmtMethodBase NeoEsp32RmtXWs2812xMethod; +typedef NeoEsp32RmtXWs2812xMethod NeoEsp32RmtXWs2816Method; +typedef NeoEsp32RmtMethodBase NeoEsp32RmtXWs2805Method; +typedef NeoEsp32RmtXWs2805Method NeoEsp32RmtXWs2814Method; typedef NeoEsp32RmtMethodBase NeoEsp32RmtXSk6812Method; -typedef NeoEsp32RmtMethodBase NeoEsp32RmtXTm1814Method; -typedef NeoEsp32RmtMethodBase NeoEsp32RmtXTm1829Method; -typedef NeoEsp32RmtMethodBase NeoEsp32RmtXTm1914Method; +typedef NeoEsp32RmtXSk6812Method NeoEsp32RmtXLc8812Method; +typedef NeoEsp32RmtMethodBase NeoEsp32RmtXTm1814Method; +typedef NeoEsp32RmtMethodBase NeoEsp32RmtXTm1829Method; +typedef NeoEsp32RmtMethodBase NeoEsp32RmtXTm1914Method; typedef NeoEsp32RmtMethodBase NeoEsp32RmtXApa106Method; typedef NeoEsp32RmtMethodBase NeoEsp32RmtXTx1812Method; +typedef NeoEsp32RmtMethodBase NeoEsp32RmtXGs1903Method; typedef NeoEsp32RmtMethodBase NeoEsp32RmtX800KbpsMethod; typedef NeoEsp32RmtMethodBase NeoEsp32RmtX400KbpsMethod; // inverted -typedef NeoEsp32RmtMethodBase NeoEsp32RmtXWs2811InvertedMethod; -typedef NeoEsp32RmtMethodBase NeoEsp32RmtXWs2812xInvertedMethod; -typedef NeoEsp32RmtMethodBase NeoEsp32RmtXSk6812InvertedMethod; -typedef NeoEsp32RmtMethodBase NeoEsp32RmtXTm1814InvertedMethod; -typedef NeoEsp32RmtMethodBase NeoEsp32RmtXTm1829InvertedMethod; -typedef NeoEsp32RmtMethodBase NeoEsp32RmtXTm1914InvertedMethod; -typedef NeoEsp32RmtMethodBase NeoEsp32RmtXApa106InvertedMethod; -typedef NeoEsp32RmtMethodBase NeoEsp32RmtXTx1812InvertedMethod; -typedef NeoEsp32RmtMethodBase NeoEsp32RmtX800KbpsInvertedMethod; -typedef NeoEsp32RmtMethodBase NeoEsp32RmtX400KbpsInvertedMethod; - +typedef NeoEsp32RmtMethodBase NeoEsp32RmtXWs2811InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32RmtXWs2812xInvertedMethod; +typedef NeoEsp32RmtXWs2812xInvertedMethod NeoEsp32RmtXWs2816InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32RmtXWs2805InvertedMethod; +typedef NeoEsp32RmtXWs2805InvertedMethod NeoEsp32RmtXWs2814InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32RmtXSk6812InvertedMethod; +typedef NeoEsp32RmtXSk6812InvertedMethod NeoEsp32RmtXLc8812InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32RmtXTm1814InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32RmtXTm1829InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32RmtXTm1914InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32RmtXApa106InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32RmtXTx1812InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32RmtXGs1903InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32RmtX800KbpsInvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32RmtX400KbpsInvertedMethod; #if defined(NEOPIXEL_ESP32_RMT_DEFAULT) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32S3) @@ -343,33 +352,31 @@ typedef NeoEsp32RmtMethodBase NeoEsp32RmtX400Kb // will switch to use RMT as the default method // The ESP32S2 & ESP32C3 will always default to RMT -typedef NeoEsp32RmtXWs2812xMethod NeoWs2813Method; +typedef NeoEsp32RmtXWs2805Method NeoWs2805Method; +typedef NeoEsp32RmtXWs2811Method NeoWs2811Method; typedef NeoEsp32RmtXWs2812xMethod NeoWs2812xMethod; -typedef NeoEsp32RmtX800KbpsMethod NeoWs2812Method; -typedef NeoEsp32RmtXWs2812xMethod NeoWs2811Method; +typedef NeoEsp32RmtXWs2816Method NeoWs2816Method; typedef NeoEsp32RmtXSk6812Method NeoSk6812Method; +typedef NeoEsp32RmtXLc8812Method NeoLc8812Method; typedef NeoEsp32RmtXTm1814Method NeoTm1814Method; typedef NeoEsp32RmtXTm1829Method NeoTm1829Method; typedef NeoEsp32RmtXTm1914Method NeoTm1914Method; -typedef NeoEsp32RmtXSk6812Method NeoLc8812Method; typedef NeoEsp32RmtXApa106Method NeoApa106Method; typedef NeoEsp32RmtXTx1812Method NeoTx1812Method; - typedef NeoEsp32RmtXWs2812xMethod Neo800KbpsMethod; typedef NeoEsp32RmtX400KbpsMethod Neo400KbpsMethod; -typedef NeoEsp32RmtXWs2812xInvertedMethod NeoWs2813InvertedMethod; +typedef NeoEsp32RmtXWs2805InvertedMethod NeoWs2805InvertedMethod; +typedef NeoEsp32RmtXWs2811InvertedMethod NeoWs2811InvertedMethod; typedef NeoEsp32RmtXWs2812xInvertedMethod NeoWs2812xInvertedMethod; -typedef NeoEsp32RmtXWs2812xInvertedMethod NeoWs2811InvertedMethod; -typedef NeoEsp32RmtX800KbpsInvertedMethod NeoWs2812InvertedMethod; +typedef NeoEsp32RmtXWs2816InvertedMethod NeoWs2816InvertedMethod; typedef NeoEsp32RmtXSk6812InvertedMethod NeoSk6812InvertedMethod; +typedef NeoEsp32RmtXLc8812InvertedMethod NeoLc8812InvertedMethod; typedef NeoEsp32RmtXTm1814InvertedMethod NeoTm1814InvertedMethod; typedef NeoEsp32RmtXTm1829InvertedMethod NeoTm1829InvertedMethod; typedef NeoEsp32RmtXTm1914InvertedMethod NeoTm1914InvertedMethod; -typedef NeoEsp32RmtXSk6812InvertedMethod NeoLc8812InvertedMethod; typedef NeoEsp32RmtXApa106InvertedMethod NeoApa106InvertedMethod; typedef NeoEsp32RmtXTx1812InvertedMethod NeoTx1812InvertedMethod; - typedef NeoEsp32RmtXWs2812xInvertedMethod Neo800KbpsInvertedMethod; typedef NeoEsp32RmtX400KbpsInvertedMethod Neo400KbpsInvertedMethod;