29 lines
610 B
C
29 lines
610 B
C
#ifndef SK6812_H
|
|
#define SK6812_H
|
|
|
|
#include <stdint.h>
|
|
|
|
struct hat_spi_ctx;
|
|
|
|
struct sk6812_memory
|
|
{
|
|
uint32_t num_leds;
|
|
uint32_t led_data[];
|
|
};
|
|
|
|
struct sk6812_ctx
|
|
{
|
|
uint8_t *pixeldata;
|
|
uint32_t num_modules;
|
|
uint8_t strip_id;
|
|
|
|
struct hat_spi_ctx *hat_ctx;
|
|
};
|
|
|
|
int sk6812_init(struct sk6812_ctx *ctx, struct hat_spi_ctx *hat_ctx, uint8_t strip_id, uint32_t num_modules);
|
|
void sk6812_shutdown(struct sk6812_ctx *ctx);
|
|
void sk6812_set_colour(struct sk6812_ctx *ctx, uint32_t module, uint8_t red, uint8_t green, uint8_t blue, uint8_t white);
|
|
int sk6812_send_update(struct sk6812_ctx *ctx);
|
|
|
|
#endif // SK6812_H
|