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

◆ busName()

const char * fl::busName ( Bus b)
inline

Canonical driver-name string for a Bus value.

Each Bus::X corresponds to exactly one concrete IChannelDriver. That driver's getName() returns a stable string that ChannelManager uses as the lookup key (findDriverByName / getDriverByName). Channels read ChannelOptions::mBus (#2459) and the dispatch layer derives the lookup string via busName(mBus) — typo-prone string literals never appear at the call site.

Returns "AUTO" for Bus::AUTO — diagnostic/log paths get a stable human-readable label. mBus == Bus::AUTO means "no Bus pin; let the manager pick by priority", so this name never reaches the manager's lookup.

Spelling is normalized to match the C++ enumerator name exactly (including underscores in FLEX_IO, OBJECT_FLED, BIT_BANG). Driver getName() implementations return the same string, so callers never need a reverse mapping or special-case handling.

Lifetime. Every returned pointer is to a string literal, so it has static storage duration — safe to feed to fl::string::from_literal().

Definition at line 167 of file bus.h.

167 {
168 switch (b) {
169 case Bus::AUTO: return "AUTO";
170 case Bus::RMT: return "RMT";
171 case Bus::PARLIO: return "PARLIO";
172 case Bus::SPI: return "SPI";
173 case Bus::I2S: return "I2S";
174 case Bus::I2S_SPI: return "I2S_SPI";
175 case Bus::LCD_RGB: return "LCD_RGB";
176 case Bus::LCD_SPI: return "LCD_SPI";
177 case Bus::LCD_CLOCKLESS: return "LCD_CLOCKLESS";
178 case Bus::UART: return "UART";
179 case Bus::FLEX_IO: return "FLEX_IO";
180 case Bus::OBJECT_FLED: return "OBJECT_FLED";
181 case Bus::LPUART: return "LPUART";
182 case Bus::BIT_BANG: return "BIT_BANG";
183 case Bus::STUB: return "STUB";
184 }
185 return ""; // unreachable — silences -Wreturn-type on toolchains that miss the exhaustive switch
186}
@ LPUART
Teensy 4.x iMXRT1062 LPUART (inverted-TX + eDMA) clockless driver.
Definition bus.h:73
@ FLEX_IO
Teensy 4.x FlexIO2 driver.
Definition bus.h:71
@ I2S_SPI
Original ESP32 native I2S parallel SPI (true SPI chipsets).
Definition bus.h:66
@ SPI
Generic SPI clockless driver.
Definition bus.h:64
@ PARLIO
ESP32-P4/C6/H2/C5 parallel I/O peripheral.
Definition bus.h:63
@ OBJECT_FLED
Teensy 4.x ObjectFLED driver.
Definition bus.h:72
@ LCD_RGB
ESP32-P4 LCD RGB peripheral (parallel clockless).
Definition bus.h:67
@ LCD_CLOCKLESS
ESP32-S3 LCD_CAM clockless driver (replaces misnamed I2S).
Definition bus.h:69
@ I2S
ESP32-S3 LCD_CAM via legacy I80 bus (clockless).
Definition bus.h:65
@ BIT_BANG
Portable bit-bang fallback driver.
Definition bus.h:74
@ LCD_SPI
ESP32-S3 LCD_CAM SPI driver (true SPI chipsets).
Definition bus.h:68
@ RMT
ESP32 RMT peripheral (all ESP32 variants).
Definition bus.h:62
@ UART
ESP32 UART driver via wave8 framing.
Definition bus.h:70
@ AUTO
Sentinel: defer to DefaultBus<Chipset>::value.
Definition bus.h:61
@ STUB
Native/host/test stub driver.
Definition bus.h:75

References AUTO, BIT_BANG, FL_NOEXCEPT, FLEX_IO, I2S, I2S_SPI, LCD_CLOCKLESS, LCD_RGB, LCD_SPI, LPUART, OBJECT_FLED, PARLIO, RMT, SPI, STUB, and UART.

Referenced by fl::Channel::resolveDynamicDriver(), and fl::ChannelManager::setExclusiveDriver().

+ Here is the caller graph for this function: