Files
portal/firmware/pico/ws2812_led.h
Jimmy 5094c7bcee Add portal web simulator, SPI bridges, and Pico firmware updates.
Bring the five-panel hex portal online with a browser 3D/schematic preview, Pi SPI backends, and renamed multi-panel Pico UDP firmware.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-30 14:54:51 +12:00

34 lines
875 B
C

#ifndef WS2812_LED_H
#define WS2812_LED_H
#include <stdint.h>
#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