#ifndef WS2812_LED_H #define WS2812_LED_H #include #ifdef __cplusplus extern "C" { #endif #ifndef MAX_STRIPS #define MAX_STRIPS 4 #endif /* Create strip slots (none active until ws2812_set_pin). max_leds = capacity each. */ void ws2812_init(unsigned int max_leds); /* Bind strip to gpio (creates/rebinds PIO SM). strip = 0 … MAX_STRIPS-1. */ int ws2812_set_pin(unsigned int strip, unsigned int pin); /* Free PIO SM + GPIO so another strip can take the pin. */ void ws2812_release_strip(unsigned int strip); unsigned int ws2812_get_pin(unsigned int strip); int ws2812_strip_active(unsigned int strip); void ws2812_set_rgb(unsigned int strip, const uint8_t *rgb, unsigned int count); void ws2812_fill(unsigned int strip, uint8_t r, uint8_t g, uint8_t b); void ws2812_show(unsigned int strip); void ws2812_show_all(void); #ifdef __cplusplus } #endif #endif