FastLED 3.9.7
Loading...
Searching...
No Matches
bytestreammemory.h
1#pragma once
2
3#include <stddef.h>
4#include <stdint.h>
5
6#include "fl/namespace.h"
7#include "fl/ptr.h"
8
9#include "fl/bytestream.h"
10#include "fl/circular_buffer.h"
11
12namespace fl {
13
14FASTLED_SMART_PTR(ByteStreamMemory);
15
17 public:
18 ByteStreamMemory(uint32_t size_buffer);
19 ~ByteStreamMemory() override;
20 bool available(size_t n) const override;
21 size_t read(uint8_t *dst, size_t bytesToRead) override;
22 void clear() {
23 mReadBuffer.clear();
24 }
25 const char *path() const override { return "ByteStreamMemory"; }
26 size_t write(const uint8_t* src, size_t n);
27 size_t writeCRGB(const CRGB* src, size_t n);
28
29 private:
30 CircularBuffer<uint8_t> mReadBuffer;
31};
32
33
34} // namespace fl
Implements the FastLED namespace macros.
Implements a simple red square effect for 2D LED grids.
Definition crgb.h:16
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:54