src/platforms/arm/rp/rp2350/README.md
Raspberry Pi Pico 2 (RP2350) support.
fastled_arm_rp2350.h: Aggregator; includes pin and clockless.fastpin_arm_rp2350.h: Pin helpers (48 GPIO pins: 0-47).clockless_arm_rp2350.h: Clockless driver using PIO (wrapper for common implementation).led_sysdefs_arm_rp2350.h: System defines for RP2350 (150 MHz default clock).../rpcommon/)clockless_rp_pio.h: Common PIO-based clockless implementation for all RP2xxx platforms.pio_asm.h, pio_gen.h: PIO assembly and program generator for T1/T2/T3‑tuned clockless output.spi_hw_2_rp.cpp: Dual-lane (2-bit) parallel SPI driver using PIO + DMA.spi_hw_4_rp.cpp: Quad-lane (4-bit) parallel SPI driver using PIO + DMA.spi_hw_8_rp.cpp: Octal-lane (8-bit) parallel SPI driver using PIO + DMA.led_sysdefs_rp_common.h: Common system defines for all RP2xxx platforms.Notes:
clockless_rp_pio.h configures wrap targets and delays via pio_gen.h; changes to timing require regenerating the program.| Feature | RP2350 | RP2040 |
|---|---|---|
| GPIO Pins | Up to 48 pins (0-47 on RP2350B) | 30 pins (0-29) |
| PIO Instances | 3 (pio0, pio1, pio2) | 2 (pio0, pio1) |
| CPU Cores | Dual Cortex-M33 or dual Hazard3 RISC-V | Dual Cortex-M0+ |
| Clock Speed | 150 MHz default | 125 MHz default |
| Memory | 520 KB SRAM | 264 KB SRAM |
The RP2350B variant supports up to 48 GPIO pins (0-47), compared to 30 pins (0-29) on RP2040. All 48 pins are defined in fastpin_arm_rp2350.h.
Note: The RP2350A variant only exposes 30 GPIO pins like RP2040, but the platform code supports all 48 for compatibility with RP2350B.
The RP2350 includes a third PIO instance (pio2), providing:
The RP2350 platform supports parallel SPI output for controlling multiple LED strips simultaneously using the Programmable I/O (PIO) subsystem combined with DMA transfers.
The RP2350 implementations use PIO state machines to achieve multi-lane parallel output:
Each active SPI controller allocates:
#include <FastLED.h>
// Configure dual-lane SPI for 2 LED strips
SpiHw2::Config config;
config.bus_num = 0; // Use SPI0 (PIO state machine 0)
config.clock_speed_hz = 4000000; // 4 MHz
config.sck_pin = 2; // Clock pin
config.data_pins[0] = 3; // First strip data pin
config.data_pins[1] = 4; // Second strip data pin
auto controllers = SpiHw2::getAll();
if (!controllers.empty()) {
controllers[0]->begin(config);
// Ready to transmit data
}
PICO_RP2350 macroFASTLED_ALLOW_INTERRUPTS: Allow ISRs during show. Default 1.FASTLED_ACCURATE_CLOCK: Enabled when interrupts are allowed to maintain timing math accuracy.FASTLED_USE_PROGMEM: Default 0 (flat memory model).FASTLED_RP2040_CLOCKLESS_PIO: Use PIO driver for clockless. Default 1.FASTLED_RP2040_CLOCKLESS_IRQ_SHARED: Share IRQ usage between PIO and other subsystems. Default 1.FASTLED_RP2040_CLOCKLESS_M0_FALLBACK: Fallback to a Cortex‑M0 timing loop if PIO is disabled/unavailable. Default 0.Define these before including FastLED.h in your sketch.
The RP2350 defaults to 150 MHz system clock. You can override this by:
Using the VARIANT_MCK macro (if provided by your board definition):
// Automatically uses VARIANT_MCK if defined
#include <FastLED.h>
Defining F_CPU before including FastLED:
#define F_CPU 200000000 // 200 MHz overclock
#include <FastLED.h>
Note: The timing calculations for clockless LEDs depend on F_CPU being accurate. If you change the system clock at runtime using set_sys_clock_khz(), LED timing may be affected.