12 #include <hardware/dma.h> 13 #include <hardware/pio.h> 14 #include <hardware/structs/pio.h> 15 #include <pico/stdio.h> 20 namespace rp2040_pio_led_strip {
59 using init_fn = void (*)(PIO pio, uint sm, uint offset, uint pin,
float freq);
63 void setup()
override;
71 : traits.set_supported_color_modes({light::ColorMode::RGB});
80 void set_pio(
int pio_num) { pio_num ? this->
pio_ = pio1 : this->pio_ = pio0; }
87 for (
int i = 0; i < this->
size(); i++) {
123 inline static int num_instance_[2];
124 inline static std::map<Chipset, bool> conf_count_;
125 inline static std::map<Chipset, int> chipset_offsets_;
126 inline static bool dma_chan_active_[12];
127 inline static struct semaphore dma_write_complete_sem_[12];
void clear_effect_data() override
void set_max_refresh_rate(float interval_us)
void set_rgb_order(RGBOrder rgb_order)
This class represents the communication layer between the front-end MQTT layer and the hardware outpu...
void set_init_function(init_fn init)
light::LightTraits get_traits() override
void write_state(light::LightState *state) override
static void dma_write_complete_handler_()
RGB color output and a separate white output.
void dump_config() override
const char * rgb_order_to_string(RGBOrder order)
void set_chipset(Chipset chipset)
dma_channel_config dma_config_
void set_pio(int pio_num)
const pio_program_t * program_
void set_pin(uint8_t pin)
light::ESPColorView get_view_internal(int32_t index) const override
float get_setup_priority() const override
void set_num_leds(uint32_t num_leds)
size_t get_buffer_size_() const
void set_is_rgbw(bool is_rgbw)
White output only (use only if the light also has another color mode such as RGB).
void set_program(const pio_program_t *program)
This class is used to represent the capabilities of a light.
int32_t size() const override
void(*)(PIO pio, uint sm, uint offset, uint pin, float freq) init_fn
Implementation of SPI Controller mode.