2025-02-13 17:17:07 +08:00
|
|
|
/**
|
|
|
|
|
* @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>
|
|
|
|
|
|
2025-02-19 19:58:59 +08:00
|
|
|
typedef struct ws2812_spi_led_buf ws2812_spi_led_buf_t;
|
2025-02-13 17:17:07 +08:00
|
|
|
|
2025-02-19 19:58:59 +08:00
|
|
|
void ws2812_spi_led_strip_init(uint8_t host_id, uint16_t max_led_num);
|
2025-02-13 17:17:07 +08:00
|
|
|
|
2025-02-19 19:58:59 +08:00
|
|
|
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);
|