From 4f333435eaac5cd477eed330555c9ffccf0e28bd Mon Sep 17 00:00:00 2001 From: Blitblank Date: Fri, 13 Feb 2026 12:29:59 -0600 Subject: [PATCH] wsled interface skeleton --- src/WsledInterface.cpp | 21 +++++++++++++++++++++ src/WsledInterface.hpp | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 src/WsledInterface.cpp create mode 100644 src/WsledInterface.hpp diff --git a/src/WsledInterface.cpp b/src/WsledInterface.cpp new file mode 100644 index 0000000..18827b3 --- /dev/null +++ b/src/WsledInterface.cpp @@ -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; +} diff --git a/src/WsledInterface.hpp b/src/WsledInterface.hpp new file mode 100644 index 0000000..0e96fee --- /dev/null +++ b/src/WsledInterface.hpp @@ -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_]; + +};