wsled interface skeleton

This commit is contained in:
2026-02-13 12:29:59 -06:00
parent 9f884b41e7
commit 4f333435ea
2 changed files with 59 additions and 0 deletions

21
src/WsledInterface.cpp Normal file
View File

@@ -0,0 +1,21 @@
#include "WsledInterface.hpp"
WsledInterface::WsledInterface(const wsled_t* device) {
}
STATUS WsledInterface::writePixel(CRGB pixel, size_t index) {
return OKAY;
}
STATUS WsledInterface::get(CRGB* pixel, size_t index) {
return OKAY;
}
STATUS WsledInterface::flush() {
return OKAY;
}

38
src/WsledInterface.hpp Normal file
View File

@@ -0,0 +1,38 @@
#pragma once
#include "stdint.h"
#include "drivers/wsled.h"
#include "common.h"
class WsledInterface {
public:
WsledInterface(const wsled_t* device);
~WsledInterface() = default;
// Sets a pixel in the leds buffer to a particular color
// index: the order in the strip of the pixel
// Returns: execution status
STATUS writePixel(CRGB pixel, size_t index);
// Copies the color currently in a pixel to the pointer
// index: the order in the strip of the pixel
// Returns: execution status
STATUS get(CRGB* pixel, size_t index);
// Writes all the data in the leds buffer to hardware
// Returns: execution status
STATUS flush();
private:
const wsled_t* device_;
static constexpr size_t numLeds_ = 4;
CRGB leds_[numLeds_];
};