ESP32 Native version of Blinky, featureful controller code for WS2811/WS2812/NeoPixels
Nelze vybrat více než 25 témat
Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
|
- #pragma once
-
- #include <driver/spi_master.h>
-
- #include "leds.hpp"
-
-
- class SPI_LEDs : public LEDStrip {
- public:
- SPI_LEDs(int gpio, int length = 0);
- void show();
- void length_changing(int len) { configure(len); }
-
- private:
- spi_host_device_t host;
- int gpio;
- spi_device_handle_t device;
- uint8_t *out_buf;
- spi_transaction_t transaction;
-
- static constexpr int reset_bytes = 30;
- static size_t tx_len(int len) { return (len * 3) * 4 + reset_bytes; }
-
- void configure(int length);
- };
|