更新模板到最新状态
This commit is contained in:
32
app/drivers/ws2812_spi/ws2812_spi.h
Executable file
32
app/drivers/ws2812_spi/ws2812_spi.h
Executable file
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* @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_strip_s
|
||||
{
|
||||
uint8_t *led_dma_buffer;
|
||||
uint32_t buffer_size;
|
||||
uint8_t spi_host;
|
||||
int16_t spi_pin;
|
||||
void *spi_handle;
|
||||
uint32_t max_led_num;
|
||||
uint16_t pow_tbl[0x100];
|
||||
} ws2812_spi_led_strip_t;
|
||||
|
||||
void ws2812_spi_led_strip_init(ws2812_spi_led_strip_t *led_strip, uint8_t spi_host, uint16_t max_led_num);
|
||||
|
||||
void ws2812_spi_led_strip_clear(ws2812_spi_led_strip_t *led_strip);
|
||||
void ws2812_spi_led_strip_set_pixel(ws2812_spi_led_strip_t *led_strip, uint32_t index, uint32_t red, uint32_t green, uint32_t blue);
|
||||
int ws2812_spi_led_strip_refresh(ws2812_spi_led_strip_t *led_strip, uint32_t leds, uint8_t pin);
|
||||
Reference in New Issue
Block a user