Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FastLED/FastLED.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Guyer <sam.guyer@gmail.com>2021-07-18 19:51:52 +0300
committerSam Guyer <sam.guyer@gmail.com>2021-07-18 19:51:52 +0300
commitab74c7a5b6d0006f09f9b290bc37fb44d1958754 (patch)
tree684291df13af6aa9bd5eb9234bc8c61df2b03d01 /src/fastspi.h
parente5921775c64c2eb3428e70f9f39ebd7d76f51b5e (diff)
parentb45cc8cf654402fbef342922919636ae62432cd4 (diff)
Merge branch 'ntwallace-master'
Merging code from ntwallace to support hardware SPI on ESP32
Diffstat (limited to 'src/fastspi.h')
-rw-r--r--src/fastspi.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/fastspi.h b/src/fastspi.h
index aeb2ad01..ae084f84 100644
--- a/src/fastspi.h
+++ b/src/fastspi.h
@@ -13,7 +13,7 @@ FASTLED_NAMESPACE_BEGIN
#if defined(FASTLED_TEENSY3) && (F_CPU > 48000000)
#define DATA_RATE_MHZ(X) (((48000000L / 1000000L) / X))
#define DATA_RATE_KHZ(X) (((48000000L / 1000L) / X))
-#elif defined(FASTLED_TEENSY4) // && (ARM_HARDWARE_SPI)
+#elif defined(FASTLED_TEENSY4) || (defined(ESP32) && defined(FASTLED_ALL_PINS_HARDWARE_SPI))
// just use clocks
#define DATA_RATE_MHZ(X) (1000000 * (X))
#define DATA_RATE_KHZ(X) (1000 * (X))
@@ -54,6 +54,11 @@ template<uint8_t _DATA_PIN, uint8_t _CLOCK_PIN, uint32_t _SPI_CLOCK_DIVIDER>
class SPIOutput : public APOLLO3HardwareSPIOutput<_DATA_PIN, _CLOCK_PIN, _SPI_CLOCK_DIVIDER> {};
#endif
+#if defined(ESP32) && defined(FASTLED_ALL_PINS_HARDWARE_SPI)
+template<uint8_t _DATA_PIN, uint8_t _CLOCK_PIN, uint32_t _SPI_CLOCK_DIVIDER>
+class SPIOutput : public ESP32SPIOutput<_DATA_PIN, _CLOCK_PIN, _SPI_CLOCK_DIVIDER> {};
+#endif
+
#if defined(SPI_DATA) && defined(SPI_CLOCK)
#if defined(FASTLED_TEENSY3) && defined(ARM_HARDWARE_SPI)