FastLED 3.9.15
Loading...
Searching...
No Matches
bus_priorities.h
Go to the documentation of this file.
1#pragma once
2
14
15#include "fl/channels/bus.h"
16#include "fl/stl/stdint.h"
17
18// Platform CMSIS/Arduino headers may define SPI / UART / I2S as register
19// pointer macros (e.g. Sam3X8E: `#define UART ((Uart*)0x400E0800U)`).
20// Those macros expand inside qualified names like `Bus::SPI` below and
21// produce a syntax error. bus.h itself uses push_macro/pop_macro around
22// its enum definition; once bus.h pops the macros are restored. So we
23// must apply the same guard locally here. See fl/channels/bus.h.
24#pragma push_macro("UART")
25#pragma push_macro("SPI")
26#pragma push_macro("I2S")
27#undef UART
28#undef SPI
29#undef I2S
30
31namespace fl {
32
39 // FORCE-style overrides (FASTLED_ESP32_FORCE_*) are intentionally not
40 // applied here -- the legacy initChannelDrivers() retains its own
41 // priority-bumping logic for backward compatibility. This table is the
42 // baseline used by the new enableDrivers<>() opt-in API.
43 return
44 b == Bus::I2S_SPI ? 10 :
45 b == Bus::LCD_SPI ? 10 :
46 b == Bus::PARLIO ? 4 :
47 b == Bus::LCD_RGB ? 3 :
48 b == Bus::RMT ? 2 :
49 b == Bus::LCD_CLOCKLESS ? 2 :
50 b == Bus::I2S ? 1 :
51 b == Bus::FLEX_IO ? 1 :
52 b == Bus::OBJECT_FLED ? 1 :
53 b == Bus::SPI ? 0 :
54 b == Bus::BIT_BANG ? 0 :
55 b == Bus::STUB ? 0 :
56 b == Bus::UART ? -1 :
57 0;
58}
59
60} // namespace fl
61
62#pragma pop_macro("I2S")
63#pragma pop_macro("SPI")
64#pragma pop_macro("UART")
Compile-time identifier for an LED channel transmission bus.
Bus
Driver identifier for compile-time bus selection.
Definition bus.h:60
@ 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
@ STUB
Native/host/test stub driver.
Definition bus.h:75
constexpr int default_bus_priority(Bus b) FL_NOEXCEPT
Default priority assigned to a Bus when registered with the manager.
Base definition for an LED controller.
Definition crgb.hpp:179
#define FL_NOEXCEPT