Merge branch 'master' into CoreShaderBeta

This commit is contained in:
Michael Miller
2024-04-24 11:14:51 -07:00
5 changed files with 69 additions and 13 deletions

View File

@ -54,15 +54,15 @@ License along with NeoPixel. If not, see
#elif defined(ARDUINO_ARCH_ESP32)
#if !defined(ARDUINO_ESP32C6_DEV) && !defined(ARDUINO_ESP32H2_DEV)
#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/NeoEspBitBangMethod.h"
#endif
#endif
#include "methods/NeoEspBitBangMethod.h"
#elif defined(ARDUINO_ARCH_NRF52840) // must be before __arm__

View File

@ -14,11 +14,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// 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) && !defined(ARDUINO_ESP32C3_DEV) && !defined(ARDUINO_ESP32S3_DEV) && !defined(ARDUINO_ESP32C6_DEV) && !defined(ARDUINO_ESP32H2_DEV)
#if defined(ARDUINO_ARCH_ESP32)
#include "sdkconfig.h" // this sets useful config symbols, like CONFIG_IDF_TARGET_ESP32C3
// 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)
#include <string.h>
#include <stdio.h>
#include "stdlib.h"
@ -47,7 +49,6 @@
#include "soc/dport_reg.h"
#endif
#include "soc/sens_reg.h"
#include "driver/gpio.h"
#include "driver/i2s.h"
@ -1046,5 +1047,6 @@ bool i2sGetClks(uint8_t bus_num,
}
#endif
#endif // defined(ARDUINO_ARCH_ESP32) ** !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3)
#endif // !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2)
#endif // defined(ARDUINO_ARCH_ESP32)

View File

@ -27,9 +27,9 @@ License along with NeoPixel. If not, see
<http://www.gnu.org/licenses/>.
-------------------------------------------------------------------------*/
#if defined(ARDUINO_ARCH_ESP32) && !defined(ARDUINO_ESP32C6_DEV) && !defined(ARDUINO_ESP32H2_DEV)
#include <Arduino.h>
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2)
#include "../NeoUtil.h"
#include "../NeoSettings.h"
#include "../NeoBusChannel.h"

View File

@ -24,16 +24,29 @@ License along with NeoPixel. If not, see
<http://www.gnu.org/licenses/>.
-------------------------------------------------------------------------*/
#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) && !defined(ARDUINO_ESP32C6_DEV) && !defined(ARDUINO_ESP32H2_DEV)
#include <Arduino.h>
#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
#include "..\NeoUtil.h"
#if ESP_IDF_VERSION_MAJOR>=5
#include <soc/gpio_struct.h>
#endif
static inline uint32_t getCycleCount(void)
{
uint32_t ccount;
#if defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32H2)
__asm__ __volatile__("csrr %0,0x7e2":"=r" (ccount));
//ccount = esp_cpu_get_ccount();
#else
__asm__ __volatile__("rsr %0,ccount":"=a" (ccount));
#endif
return ccount;
}
// Interrupt lock class, used for RAII interrupt disabling
class InterruptLock
{
@ -101,7 +114,7 @@ uint32_t IRAM_ATTR neoEspBitBangWriteSpacingPixels(const uint8_t* data,
uint32_t cyclesNext = 0;
#if defined(ARDUINO_ARCH_ESP32)
#if defined(CONFIG_IDF_TARGET_ESP32C3)
#if defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32H2)
volatile uint32_t* setRegister = &GPIO.out_w1ts.val;
volatile uint32_t* clearRegister = &GPIO.out_w1tc.val;
setValue = _BV(pin);
@ -109,7 +122,7 @@ uint32_t IRAM_ATTR neoEspBitBangWriteSpacingPixels(const uint8_t* data,
#else
volatile uint32_t* setRegister = &GPIO.out_w1ts;
volatile uint32_t* clearRegister = &GPIO.out_w1tc;
#endif // defined(CONFIG_IDF_TARGET_ESP32C3)
#endif // defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32H2)
#else
uint32_t setRegister = PERIPHS_GPIO_BASEADDR + GPIO_OUT_W1TS_ADDRESS;
uint32_t clearRegister = PERIPHS_GPIO_BASEADDR + GPIO_OUT_W1TC_ADDRESS;

View File

@ -410,6 +410,45 @@ typedef NeoEsp32BitBangWs2805InvertedMethod NeoEsp32BitBangWs2814InvertedNoIntrM
typedef NeoEsp32BitBangTm1814InvertedMethod NeoEsp32BitBangTm1914InvertedNoIntrMethod;
typedef NeoEsp32BitBangSk6812InvertedMethod NeoEsp32BitBangLc8812InvertedNoIntrMethod;
#if defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32H2)
//
// Esp32 C6 && H2 currently use BitBang as the default until other support
// is created, as they are not compatible with older generation chips
typedef NeoEsp32BitBangWs2812xMethod NeoWs2813Method;
typedef NeoEsp32BitBangWs2812xMethod NeoWs2812xMethod;
typedef NeoEsp32BitBang800KbpsMethod NeoWs2812Method;
typedef NeoEsp32BitBangWs2812xMethod NeoWs2811Method;
typedef NeoEsp32BitBangWs2812xMethod NeoWs2816Method;
typedef NeoEsp32BitBangWs2805Method NeoWs2805Method;
typedef NeoEsp32BitBangWs2814Method NeoWs2814Method;
typedef NeoEsp32BitBangSk6812Method NeoSk6812Method;
typedef NeoEsp32BitBangTm1814Method NeoTm1814Method;
typedef NeoEsp32BitBangTm1829Method NeoTm1829Method;
typedef NeoEsp32BitBangTm1914Method NeoTm1914Method;
typedef NeoEsp32BitBangSk6812Method NeoLc8812Method;
typedef NeoEsp32BitBangApa106Method NeoApa106Method;
typedef NeoEsp32BitBangWs2812xMethod Neo800KbpsMethod;
typedef NeoEsp32BitBang400KbpsMethod Neo400KbpsMethod;
typedef NeoEsp32BitBangWs2812xInvertedMethod NeoWs2813InvertedMethod;
typedef NeoEsp32BitBangWs2812xInvertedMethod NeoWs2812xInvertedMethod;
typedef NeoEsp32BitBangWs2812xInvertedMethod NeoWs2811InvertedMethod;
typedef NeoEsp32BitBangWs2812xInvertedMethod NeoWs2816InvertedMethod;
typedef NeoEsp32BitBangWs2805InvertedMethod NeoWs2805InvertedMethod;
typedef NeoEsp32BitBangWs2814InvertedMethod NeoWs2814InvertedMethod;
typedef NeoEsp32BitBang800KbpsInvertedMethod NeoWs2812InvertedMethod;
typedef NeoEsp32BitBangSk6812InvertedMethod NeoSk6812InvertedMethod;
typedef NeoEsp32BitBangTm1814InvertedMethod NeoTm1814InvertedMethod;
typedef NeoEsp32BitBangTm1829InvertedMethod NeoTm1829InvertedMethod;
typedef NeoEsp32BitBangTm1914InvertedMethod NeoTm1914InvertedMethod;
typedef NeoEsp32BitBangSk6812InvertedMethod NeoLc8812InvertedMethod;
typedef NeoEsp32BitBangApa106InvertedMethod NeoApa106InvertedMethod;
typedef NeoEsp32BitBangWs2812xInvertedMethod Neo800KbpsInvertedMethod;
typedef NeoEsp32BitBang400KbpsInvertedMethod Neo400KbpsInvertedMethod;
#endif
#else // defined(ARDUINO_ARCH_ESP8266)
typedef NeoEspBitBangMethodBase<NeoEspBitBangSpeedWs2811, NeoEspNotInverted, true> NeoEsp8266BitBangWs2811Method;
@ -484,6 +523,8 @@ typedef NeoEsp8266BitBangWs2805InvertedMethod NeoEsp8266BitBangWs2814InvertedNoI
typedef NeoEsp8266BitBangTm1814InvertedMethod NeoEsp8266BitBangTm1914InvertedNoIntrMethod;
typedef NeoEsp8266BitBangSk6812InvertedMethod NeoEsp8266BitBangLc8812InvertedNoIntrMethod;
#endif // defined(ARDUINO_ARCH_ESP32)
// ESP bitbang doesn't have defaults and should avoided except for testing