FastLED 3.9.15
Loading...
Searching...
No Matches
channel.h
Go to the documentation of this file.
1#pragma once
2
4#include "fl/channels/rx.h"
6#include "fl/stl/noexcept.h"
7#include "fl/stl/shared_ptr.h"
8#include "fl/stl/stdint.h"
9#include "fl/stl/string.h"
10
11namespace fl {
12
13class RxChannel;
15
16class RxChannel {
17public:
18 static RxChannelPtr create(const RxChannelConfig& config) FL_NOEXCEPT;
19
21
22 i32 id() const FL_NOEXCEPT { return mId; }
23 const fl::string& name() const FL_NOEXCEPT { return mName; }
24 int getPin() const FL_NOEXCEPT;
25 fl::string getEngineName() const FL_NOEXCEPT;
26
29 bool finished() const FL_NOEXCEPT;
30 RxWaitResult wait(u32 timeout_ms) FL_NOEXCEPT;
31
32 fl::result<u32, DecodeError> decode(const ChipsetTiming4Phase& timing,
33 fl::span<u8> out) FL_NOEXCEPT;
34 size_t getRawEdgeTimes(fl::span<EdgeTime> out, size_t offset = 0) FL_NOEXCEPT;
35 bool injectEdges(fl::span<const EdgeTime> edges) FL_NOEXCEPT;
36
37 const RxChannelConfig& config() const FL_NOEXCEPT { return mConfig; }
38
39private:
40 template<typename T, typename... Args>
42
44
45 static i32 nextId() FL_NOEXCEPT;
46 static fl::string makeName(i32 id, const fl::string& config_name) FL_NOEXCEPT;
47
49 RxChannel& operator=(const RxChannel&) FL_NOEXCEPT = delete;
51 RxChannel& operator=(RxChannel&&) FL_NOEXCEPT = delete;
52
53 const i32 mId;
54 fl::string mName;
57};
58
59} // namespace fl
void setConfig(const RxChannelConfig &config) FL_NOEXCEPT
fl::shared_ptr< RxDevice > mDevice
Definition channel.h:56
fl::result< u32, DecodeError > decode(const ChipsetTiming4Phase &timing, fl::span< u8 > out) FL_NOEXCEPT
virtual ~RxChannel() FL_NOEXCEPT
const i32 mId
Definition channel.h:53
RxChannelConfig mConfig
Definition channel.h:55
size_t getRawEdgeTimes(fl::span< EdgeTime > out, size_t offset=0) FL_NOEXCEPT
static i32 nextId() FL_NOEXCEPT
RxWaitResult wait(u32 timeout_ms) FL_NOEXCEPT
bool injectEdges(fl::span< const EdgeTime > edges) FL_NOEXCEPT
static fl::string makeName(i32 id, const fl::string &config_name) FL_NOEXCEPT
int getPin() const FL_NOEXCEPT
fl::string getEngineName() const FL_NOEXCEPT
const fl::string & name() const FL_NOEXCEPT
Definition channel.h:23
const RxChannelConfig & config() const FL_NOEXCEPT
Definition channel.h:37
fl::string mName
Definition channel.h:54
static RxChannelPtr create(const RxChannelConfig &config) FL_NOEXCEPT
bool finished() const FL_NOEXCEPT
RxChannel(const RxChannelConfig &config, fl::shared_ptr< RxDevice > device) FL_NOEXCEPT
Common interface for RX devices.
Definition rx.h:256
fl::UISlider offset("Offset", 0.0f, 0.0f, 1.0f, 0.01f)
unsigned char u8
Definition stdint.h:131
constexpr T * begin(T(&array)[N]) FL_NOEXCEPT
shared_ptr< T > make_shared(Args &&... args) FL_NOEXCEPT
Definition shared_ptr.h:414
expected< T, E > result
Alias for expected (Rust-style naming)
Definition result.h:31
RxWaitResult
Result codes for RX wait() operations.
Definition rx.h:151
DecodeError
Error codes for RX decoder operations.
Definition rx.h:68
Base definition for an LED controller.
Definition crgb.hpp:179
4-phase RX timing thresholds for chipset detection
Definition rx.h:87
corkscrew_args args
Definition old.h:149
Common RX interfaces and shared types.
#define FL_NOEXCEPT
#define FASTLED_SHARED_PTR(type)
Definition shared_ptr.h:535
Universal edge timing representation (platform-agnostic)
Definition rx.h:34