FastLED 3.10.8
Loading...
Searching...
No Matches
device_impl_base.h
Go to the documentation of this file.
1#pragma once
2
6
7#include "fl/stl/shared_ptr.h"
8// IWYU pragma: begin_keep
9#include "platforms/shared/spi_hw_base.h" // ok platform headers
10#include "fl/stl/noexcept.h"
11// IWYU pragma: end_keep // ok platform headers
12
13namespace fl {
14namespace spi {
15
23
26 : backend()
27 , initialized(false)
28 , owns_backend(false) {}
29
32 bool isReady() const FL_NO_EXCEPT {
33 return initialized && backend != nullptr;
34 }
35
38 bool hasBackend() const FL_NO_EXCEPT {
39 return backend != nullptr;
40 }
41
44 backend = nullptr;
45 initialized = false;
46 }
47};
48
49} // namespace spi
50} // namespace fl
u8 u8 fract8 blur_amount FL_NO_EXCEPT
Definition blur.h:186
Base definition for an LED controller.
Definition crgb.hpp:179
bool owns_backend
Whether this device owns the backend (for cleanup)
void clearBackend() FL_NO_EXCEPT
Clear backend state.
bool hasBackend() const FL_NO_EXCEPT
Validate backend pointer.
bool initialized
Whether hardware is initialized.
DeviceImplBase() FL_NO_EXCEPT
Constructor.
bool isReady() const FL_NO_EXCEPT
Check if device is ready.
fl::shared_ptr< SpiHwBase > backend
Polymorphic SPI hardware backend (SpiHw1/2/4/8)