/**
 * @file ws2812_spi.h
 * @author Azol
 * @brief 通过 SPI 的 MOSI 引脚驱动灯带的程序
 * @version 0.1
 * @date 2023-09-28
 *
 * @copyright Copyright (c) 2023
 *
 */

#pragma once

#include <stdio.h>
#include <stdint.h>

typedef struct ws2812_spi_led_buf ws2812_spi_led_buf_t;

void ws2812_spi_led_strip_init(uint8_t host_id, uint16_t max_led_num);

ws2812_spi_led_buf_t *ws2812_spi_led_new_buf(uint16_t leds);

void ws2812_spi_led_strip_clear(ws2812_spi_led_buf_t *buf);
void ws2812_spi_led_strip_set_pixel(ws2812_spi_led_buf_t *buf, uint32_t index, uint32_t red, uint32_t green, uint32_t blue);
int ws2812_spi_led_strip_refresh(ws2812_spi_led_buf_t *buf, uint32_t leds, uint8_t pin);
