FastLED 3.9.15
Loading...
Searching...
No Matches

◆ create()

template<RxDeviceType TYPE>
static fl::shared_ptr< RxDevice > fl::RxDevice::create ( int pin)
static

Template factory method to create RX device by type.

Template Parameters
TYPEDevice type from RxDeviceType enum
Parameters
pinGPIO pin number for receiving signals
Returns
Shared pointer to RxDevice

Platform-specific implementations (e.g., ESP32) provide explicit template specializations for ISR and RMT types in rx_device.cpp. On unsupported platforms, returns a DummyRxDevice.

Hardware parameters (buffer_size, hz) are passed via RxConfig in begin().

Example:

auto rx = RxDevice::create<RxDeviceType::RMT>(6); // GPIO 6
RxConfig config;
config.buffer_size = 512;
config.hz = 1000000; // Optional: 1MHz clock
rx->begin(config);
static fl::shared_ptr< RxDevice > create(int pin) FL_NOEXCEPT
Template factory method to create RX device by type.
size_t buffer_size
Buffer size in symbols/edges (default: 512)
Definition rx.h:218
fl::optional< u32 > hz
Optional clock frequency (RMT only, default: 40MHz)
Definition rx.h:219
Configuration for RX device initialization.
Definition rx.h:216

References FL_NOEXCEPT.

Referenced by ~RxDevice(), and fl::anonymous_namespace{channel.cpp.hpp}::createBackendDevice().

+ Here is the caller graph for this function: