5#ifndef MODES_HARDWARE_LAMP_TYPE_HPP
6#define MODES_HARDWARE_LAMP_TYPE_HPP
11#include <etl/bitset.h>
19#ifdef LMBD_LAMP_TYPE__INDEXABLE
35#include "src/system/ext/math8.h"
43#include "src/modes/include/draw/helix_mask.hpp"
54static constexpr uint16_t
to_strip(uint16_t, uint16_t);
79static constexpr uint16_t
to_led_index(
const float angle_rad,
const float z);
102#ifdef LMBD_LAMP_TYPE__SIMPLE
106#ifdef LMBD_LAMP_TYPE__CCT
110#ifdef LMBD_LAMP_TYPE__INDEXABLE
137#ifdef LMBD_LAMP_TYPE__INDEXABLE
139 static constexpr float _fwidth = stripXCoordinates;
140 static constexpr float _fheight = stripYCoordinates;
141 static constexpr uint16_t _width = floor(_fwidth);
142 static constexpr uint16_t _height = floor(_fheight);
143 static constexpr uint16_t _ledCount = LED_COUNT;
144 static constexpr uint16_t _nbBuffers = stripNbBuffers;
145 static constexpr float _lampBodyRadius_mm = lampda::lampBodyRadius_mm;
146 static constexpr float _ledStripWidth_mm = lampda::ledStripWidth_mm;
147 static constexpr float _ledStripLength_mm = lampda::ledStripLength_mm;
148 static constexpr float _ledByMeter = lampda::ledByMeter;
152 static constexpr uint16_t _safeBufSize = (_width + 1) * (_height + 1);
155 using BufferTy = std::array<uint32_t, _ledCount>;
168 static constexpr float _fwidth = 23.5451;
169 static constexpr float _fheight = 22.51;
170 static constexpr uint16_t _width = 23;
171 static constexpr uint16_t _height = 22;
172 static constexpr uint16_t _ledCount = 530;
173 static constexpr uint16_t _nbBuffers = 3;
174 static constexpr float _lampBodyRadius_mm = 25.0f;
175 static constexpr float _ledStripWidth_mm = 5.2f;
176 static constexpr float _ledStripLength_mm = 25.0f;
177 static constexpr float _ledByMeter = 160.0f;
180 static constexpr uint16_t _safeBufSize = (_width + 1) * (_height + 1);
183 using BufferTy = std::array<uint32_t, _ledCount>;
191 BufferTy _buffers[_nbBuffers];
196 void signal_display();
198 uint8_t getBrightness();
199 void setBlackout(
bool);
200 void setPixelColor(uint16_t, uint32_t);
201 uint32_t getPixelColor(uint16_t);
202 void mask_led_at_index(
const size_t n,
const bool shouldMask);
205 COLOR _colors[_ledCount];
220 void LMBD_INLINE refresh_tick_value()
222 uint32_t* writeable_now =
const_cast<uint32_t*
>(&
now);
225 uint32_t* writable_tick =
const_cast<uint32_t*
>(&
tick);
228 uint32_t* writable_frame_count =
const_cast<uint32_t*
>(&
raw_frame_count);
229 *writable_frame_count += 1;
242 void LMBD_INLINE startup()
245 if (stripInputMinVoltage_mV == stripInputMaxVoltage_mV)
263 void LMBD_INLINE begin()
284 void LMBD_INLINE show()
305 void LMBD_INLINE show_now()
326 void LMBD_INLINE signal_display()
330 strip.signal_display();
339 static constexpr helixmask::Params helixMaskParameters = {};
351#ifndef LMBD_LAMP_TYPE__INDEXABLE_IS_HD
353 static_assert(
frameDurationMs == 12,
"Update the documentation of .tick :)");
406 static constexpr float shiftPerTurn = _fwidth - floor(_fwidth - 0.0001);
409 static constexpr uint16_t shiftPeriod = 2;
412 static constexpr float _invShiftResidue = shiftPeriod * (_fwidth - floor(_fwidth - 0.0001));
418 static constexpr auto allResiduesY = details::computeResidues<maxOverflowHeight>(_fwidth);
421 static constexpr auto allDeltaResiduesY = details::computeDeltaResidues<maxOverflowHeight>(_fwidth);
424 static constexpr auto extraShiftResiduesY = details::computeExtraShiftResidues<maxOverflowHeight>(_fwidth);
427 static constexpr int extraShiftTotal = extraShiftResiduesY[
maxOverflowHeight - 1];
465 template<
typename T>
static constexpr LMBD_INLINE uint16_t
toLedCount(T scale)
467 if constexpr (std::is_same_v<T, float>)
469 assert(scale <= 1.0 &&
"scale is 0-1");
472 else if constexpr (std::is_same_v<T, uint8_t>)
475 return static_cast<uint16_t
>(scaled / 256);
479 static_assert(std::is_same_v<T, std::false_type>,
"Invalid type, either float or uint8_t required!");
500 for (uint16_t i = 0; i <
ledCount; ++i)
519 void LMBD_INLINE
blip(
const uint32_t duration)
566 uint8_t* writeable_currentMaskStep =
const_cast<uint8_t*
>(&
currentMaskStep);
567 if (newValue <= maxMaskStep)
569 *writeable_currentMaskStep = newValue;
582 uint8_t* writeable_currentMaskStep =
const_cast<uint8_t*
>(&
currentMaskStep);
583 *writeable_currentMaskStep = 0;
608 const bool skipCallbacks =
true,
609 const bool skipUpdateBrightness =
false,
610 const bool updateSavedBrightess =
false)
612 assert((skipCallbacks || !skipUpdateBrightness) &&
"implicit callback skip!");
615 if (newBrightness < ::lampda::brightness::absoluteMinimumBrightness ||
616 newBrightness > ::lampda::brightness::absoluteMaximumBrightness)
633 if (updateSavedBrightess)
644#ifndef LMBD_LAMP_TYPE__INDEXABLE
645 static constexpr uint8_t minimumAllowedBrightness = 5;
647 static constexpr uint8_t minimumAllowedBrightness = ::lampda::minimumAllowedBrightness_8;
650 static curve_t brightnessCurve = ::lampda::common::curves::make_linear_curve(
652 curve_t::point_t {::lampda::brightness::absoluteMaximumBrightness, 255});
654 bool applyStandardBrightnessUpdate =
true;
658 applyStandardBrightnessUpdate =
false;
662 applyStandardBrightnessUpdate =
true;
671 if (applyStandardBrightnessUpdate)
675 strip.
setBrightness(brightnessCurve.sample(trueNewBrightness));
685 const bool isUserCall = skipCallbacks and skipUpdateBrightness and not updateSavedBrightess;
688 if (isUserCall and trueNewBrightness >= trueMaxBrightness)
694 static curve_t brightnessCurve(
695 curve_t::point_t {::lampda::brightness::absoluteMinimumBrightness, stripInputMinVoltage_mV},
696 curve_t::point_t {::lampda::brightness::absoluteMaximumBrightness, stripInputMaxVoltage_mV},
739 const brightness_t new_saved_brightness = min<brightness_t>(followed_saved_brightness, maxAllowedBrightness);
742 new_saved_brightness :
774 if (current != brightness)
799 if (readPreviousBrightness)
814 if (current != saved)
846 for (uint16_t i = 0; i <
ledCount; ++i)
855 constexpr uint32_t minBrightness = brightness::absoluteMinimumBrightness;
856 constexpr uint32_t brightnessRange = brightness::absoluteMaximumBrightness - minBrightness;
857 const uint32_t fadeAmount = (
static_cast<uint32_t
>(fadeBy) * brightnessRange) / UINT8_MAX;
860 const uint32_t faded = (current <= minBrightness + fadeAmount) ? minBrightness : current - fadeAmount;
874 void LMBD_INLINE
blur(uint8_t blurBy)
878 uint8_t keep = 255 - blurBy;
879 uint8_t seep = blurBy >> 1;
881 uint32_t carryover = 0;
882 for (uint16_t i = 0; i <
ledCount; i++)
886 uint32_t part = colors::fade<false>(c, seep);
887 cur = colors::add<true>(colors::fade<false>(c, keep), carryover);
914 static constexpr helixmask::StepTable kTable = helixmask::make_step_table(kStrip, helixMaskParameters);
916 for (uint16_t I = 0; I <
ledCount; ++I)
925 assert(
false &&
"unsupported");
934 void LMBD_INLINE
fill(uint32_t color, uint16_t start, uint16_t end)
938 assert(start <=
ledCount &&
"invalid start parameter");
939 assert(end <=
ledCount &&
"invalid end parameter");
941 for (uint16_t I = start; I < end; ++I)
948 assert(
false &&
"unsupported");
967 assert(start <=
ledCount &&
"invalid start parameter");
968 assert(end <=
ledCount &&
"invalid end parameter");
970 for (uint16_t I = start; I < end; ++I)
973 const auto color = colors::from_palette<false, uint8_t>(I /
static_cast<float>(
ledCount) * 255, palette);
979 assert(
false &&
"unsupported");
1001 assert(
false &&
"unsupported");
1004 void LMBD_INLINE mask_led_at_XY(uint16_t X, uint16_t Y,
const bool shouldMask)
1018 assert(n <
ledCount &&
"invalid LED index");
1020 strip.setPixelColor(n, color);
1024 assert(
false &&
"unsupported");
1034 assert(n <
ledCount &&
"invalid LED index");
1035 return strip.getPixelColor(n);
1039 assert(
false &&
"unsupported");
1069 static_assert(bufIdx <
nbBuffers,
"bufIdx must be lower than nbBuffers");
1070 BufferTy& buffer = strip.
_buffers[bufIdx];
1080 template<u
int8_t dstBufIdx, u
int8_t srcBufIdx>
void LMBD_INLINE
copyBuffer()
1082 static_assert(srcBufIdx <
nbBuffers,
"srcBufIdx must be lower than nbBuffers");
1083 static_assert(dstBufIdx <
nbBuffers,
"dstBufIdx must be lower than nbBuffers");
1092 template<u
int8_t bufIdx = 0,
typename T>
void LMBD_INLINE
fillTempBuffer(
const T& value)
1094 getTempBuffer<bufIdx>().fill(value);
1103 const BufferTy& buffer = getTempBuffer<bufIdx>();
1105 for (uint16_t I = 0; I <
ledCount; I++)
1117 const BufferTy& dstBuf = getTempBuffer<dstBufIdx>();
1118 const BufferTy& srcBuf = getTempBuffer<srcBufIdx>();
1121 uint16_t end = srcBuf.size();
1122 for (uint16_t I = start; I < end; ++I)
1126 src.color = srcBuf[I];
1127 dst.color = dstBuf[I];
1138 const BufferTy& buffer = getTempBuffer<bufIdx>();
1141 uint16_t end = buffer.size();
1148 for (uint16_t I = 0, J = start; I < end - start; ++I, ++J)
1160 BufferTy& buffer = getTempBuffer<bufIdx>();
1162 for (uint16_t I = 0; I <
ledCount; I++)
1213 static constexpr uint8_t maxMaskStep = helixMaskParameters.max_level;
1215 ::lampda::brightness::absoluteMaximumBrightness *
1224static constexpr uint16_t
to_strip(uint16_t x, uint16_t y)
1234 if (hardware::LampTy::allDeltaResiduesY[y])
1332static constexpr uint16_t
to_led_index(
const float angle_rad,
const float z_mm)
1334 constexpr int32_t maxZCoordinate =
1341 if (not(zRow >= 0.0f))
1343 if (zRow > maxZCoordinate)
1344 zRow = maxZCoordinate;
1345 const int32_t zIndex =
static_cast<int32_t
>(zRow);
Define assertions helpers.
Handle the output LED strip brightness.
Given two points and an exponent, fit an exponential function.
Definition: curves.h:140
Given a set of points, will fit multiple linear segments to it.
Definition: curves.h:36
protected inheritence to avoid uncontroled hardware calls
Definition: strip.h:45
void mask_led_at_index(const size_t n, const bool shouldMask)
Set a pixel to be masked at the next show.
Definition: strip.h:292
std::array< BufferTy, stripNbBuffers > _buffers
buffers for computations
Definition: strip.h:301
void setBrightness(uint8_t b)
Brightness is an internal counter.
Definition: strip.h:86
void setBlackout(const bool shouldBlackout)
While set, the next shows write black to all leds, whatever the brightness or masks....
Definition: strip.h:92
void begin()
Definition: strip.h:98
void show_now()
Show the current data, independant of changes.
Definition: strip.h:157
Manipulate color representations.
Compile definitions and sanity checks.
Contains shorthand macro definitions.
Define the lamps coordinates systems.
Define curves types, that can be sampled.
SoundStruct & get_sound_characteristics()
Compute and process sound data.
Definition: sound.cpp:233
void cancel_blip()
stop an ongoing blip
Definition: output_power.cpp:41
void write_voltage(const uint16_t voltage_mv)
Write a voltage to the output (will only write it in output mode)
Definition: output_power.cpp:19
bool is_bliping()
indicates that the gate is in a blip
Definition: output_power.cpp:43
void blip(const uint32_t timing)
short interruption of output voltage
Definition: output_power.cpp:39
uint32_t time_ms(void)
Returns the number of milliseconds since the Arduino board began running the current program....
brightness_t get_brightness()
Return the current brightness value.
Definition: brightness_handle.cpp:42
uint32_t when_last_update_brightness()
Get time in milliseconds when brightness was last updated.
Definition: brightness_handle.cpp:102
brightness_t get_max_user_brightness()
Return the maximum allowed brightness for the user modes.
Definition: brightness_handle.cpp:46
void update_brightness(const brightness_t newBrightness, const bool shouldSkipUserCallbacks)
update the internal brightness values
Definition: brightness_handle.cpp:73
brightness_t get_max_brightness()
Return the maximum allowed brightness.
Definition: brightness_handle.cpp:44
brightness_t get_scaled_saved_brightness()
Return the saved brightness level, with the user brightness scale applied. This is the level that the...
Definition: brightness_handle.cpp:71
static uint32_t fade(uint32_t inputColor, uint8_t fadeAmount)
fade the color toward black
Definition: utils.hpp:121
std::array< uint32_t, 16 > PaletteTy
Palette types.
Definition: palettes.hpp:18
@ Black
Definition: palettes.hpp:96
Provide interface to the physical hardware and other facilities.
Definition: coordinates.hpp:11
LampTypes
Enumeration to write code working with all lamp types.
Definition: lamp_type.hpp:96
@ indexable
Equivalent to LMBD_LAMP_TYPE__INDEXABLE.
@ simple
Equivalent to LMBD_LAMP_TYPE__SIMPLE.
@ cct
Equivalent to LMBD_LAMP_TYPE__CCT.
static constexpr LampTypes lampType
Currently implemented lamp type, defined at compile-time by the user.
Definition: lamp_type.hpp:115
Contains basic interface types to implement custom user modes.
Definition: control_fixed_modes.hpp:14
static constexpr uint16_t to_led_index(const float angle_rad, const float z)
convert a lamp coordinate to a led index
Definition: lamp_type.hpp:1332
static constexpr float to_helix_z(const int16_t n)
Convert a led index to an helix height coordinate.
Definition: lamp_type.hpp:1292
static constexpr uint16_t to_strip(uint16_t, uint16_t)
convert grid coordinates to strip index
Definition: lamp_type.hpp:1224
static constexpr XYTy strip_to_XY(uint16_t n)
convert strip index to grid coordinates
Definition: lamp_type.hpp:1256
static constexpr int16_t to_led_index_no_bounds(const float angle_rad, const float z)
convert a lamp coordinate to a led index, the result can be an index out of the lamp body
Definition: lamp_type.hpp:1370
static constexpr bool is_lamp_coordinate_out_of_bounds(const float angle_rad, const float z)
True if the given led index is out of bounds.
Definition: lamp_type.hpp:1321
static constexpr bool is_led_index_valid(const int16_t ledIndex)
True if the given strip index is a valid one.
Definition: lamp_type.hpp:1313
static constexpr HelixXYZTy strip_to_helix_unconstraint(const int16_t n)
convert strip index to 3D coordinates, without checks on led index. This allows to use 3D coordinates...
Definition: lamp_type.hpp:1302
static constexpr HelixXYZTy strip_to_helix(int16_t n)
convert strip index to 3D coordinates
Definition: lamp_type.hpp:1279
uint32_t get_gradient(const uint32_t colorStart, const uint32_t colorEnd, const float level)
Return the color gradient between colorStart to colorEnd.
Definition: utils.cpp:60
static constexpr float wrap_angle(const float angle_rad)
Wrap an angle in radians between 0 and 2*PI.
Definition: utils.h:115
static constexpr N abs(const N a)
absolute of a number
Definition: utils.h:46
static constexpr float c_TWO_PI
2*PI constant
Definition: constants.h:41
uint16_t brightness_t
Define the type of the brightness parameters.
Definition: constants.h:151
Interface for the physical components of the main power output (eg: LED strip output).
Define some useful color palettes, and tools to use them.
Interface for the physical components of the microphone.
Interface of the indexable strip object. Only used for RGB lamp type.
Handle the analysis of a sound sample. This structure handled the FastFourrier analysis of a sound sa...
Definition: sound.h:34
Definition: helix_mask.hpp:41
Definition: helix_mask.hpp:212
Definition: lamp_type.hpp:59
float x
x 3D mm coordinates
Definition: lamp_type.hpp:60
float y
y 3D mm coordinates
Definition: lamp_type.hpp:61
float z
z 3D mm coordinates
Definition: lamp_type.hpp:62
Definition: lamp_type.hpp:48
uint16_t y
y 2D led grid coordinates
Definition: lamp_type.hpp:50
uint16_t x
x 2D led grid coordinates
Definition: lamp_type.hpp:49
Store a display config.
Definition: lamp_type.hpp:127
Main interface between the user and the hardware of the lamp.
Definition: lamp_type.hpp:120
void LMBD_INLINE fill(uint32_t color, uint16_t start, uint16_t end)
(indexable) Fill lamp with target color, from start to end
Definition: lamp_type.hpp:934
void align_internal_to_system_brightness()
Special call to update the internal brightness values to the system brightness.
Definition: lamp_type.hpp:704
void setColorsFromMixedBuffers(float phase)
Mix two colors from a buffer.
Definition: lamp_type.hpp:1115
static XYTy LMBD_INLINE fromStripIndexToXY(uint16_t N)
(indexable) Given a LED index, return a corresponding X,Y value
Definition: lamp_type.hpp:1060
brightness_t LMBD_INLINE getMaxBrightness() const
Return the actual allowed maximum brightness.
Definition: lamp_type.hpp:758
static constexpr float ledByMeter
number of led per meters of strip used
Definition: lamp_type.hpp:438
void LMBD_INLINE restoreBrightness()
Reset brightness to internal saved brightness, skip callbacks.
Definition: lamp_type.hpp:809
void LMBD_INLINE blur(uint8_t blurBy)
Blur currently displayed content by blurBy units /!\ Only applied along the strip,...
Definition: lamp_type.hpp:874
static constexpr uint16_t maxHeight
(indexable) Height of "pixel space" w/ lamp taken as a LED matrix
Definition: lamp_type.hpp:397
void align_internal_to_system_brightness(const brightness_t systemBrightness)
Update the internal brightness values to a new system brightness.
Definition: lamp_type.hpp:714
static constexpr float lampHeight_mm
Computation of the lamp height.
Definition: lamp_type.hpp:447
void LMBD_INLINE setBrightness(const brightness_t newBrightness, const bool skipCallbacks=true, const bool skipUpdateBrightness=false, const bool updateSavedBrightess=false)
Set brightness of the lamp.
Definition: lamp_type.hpp:607
void LMBD_INLINE fill(const colors::PaletteTy &palette)
(indexable) Fill lamp with target palette
Definition: lamp_type.hpp:986
static constexpr float maxHeightFloat
Height as a precise floating point number, equal to stripYCoordinates.
Definition: lamp_type.hpp:400
volatile const uint8_t currentMaskStep
If true, only a proportion of the leds will be available to control If 1, all leds are available,...
Definition: lamp_type.hpp:1211
volatile brightness_t temporary_brightness
Define a localy consistant temporary brightness.
Definition: lamp_type.hpp:1179
void LMBD_INLINE copyBuffer()
Copy a source buffer at srcBufIdx to another buffer at dstBufIdx.
Definition: lamp_type.hpp:1080
static constexpr float lampBodyCircumpherence_mm
Computation of the lamp body circumpherence.
Definition: lamp_type.hpp:443
void LMBD_INLINE restoreBrightnessNow()
Same as restoreBrightness(), but ignores the brightness update rate limit.
Definition: lamp_type.hpp:822
static constexpr float maxWidthFloat
Width as a precise floating point number, equal to stripXCoordinates.
Definition: lamp_type.hpp:379
BufferTy &LMBD_INLINE getTempBuffer()
Get a reference to the bufIdx temporary buffer.
Definition: lamp_type.hpp:1067
static constexpr float ledStripWidth_mm
real size of the led strip in use
Definition: lamp_type.hpp:433
static uint16_t LMBD_INLINE fromXYtoStripIndex(uint16_t X, uint16_t Y)
(indexable) Given X,Y coordinate, return a corresponding LED index
Definition: lamp_type.hpp:1054
static constexpr float ledPerTurns
Computation of the led count per turns.
Definition: lamp_type.hpp:445
void LMBD_INLINE tempBrightness(const brightness_t brightness)
Temporarily set brightness, without affecting brightness navigation.
Definition: lamp_type.hpp:771
void setColorsFromBufferReversed(bool skipLastLine)
(indexable) Display bufIdx temporary buffer, but reversed
Definition: lamp_type.hpp:1136
void enforce_internal_brightness_limits()
Follow the system brightness and enforce its limits, if they changed. Will call setBrightness.
Definition: lamp_type.hpp:728
void LMBD_INLINE jumpBrightness(const brightness_t brightness)
Jump to brightness, affecting the next brightness navigation.
Definition: lamp_type.hpp:789
void LMBD_INLINE end_blackout() const
Stop the strip blackout of a blip (indexable only, no-op otherwise)
Definition: lamp_type.hpp:545
LampConfig config
store a display configuration
Definition: lamp_type.hpp:131
volatile const uint32_t tick
(physical) Tick number, ever-increasing every frameDurationMs
Definition: lamp_type.hpp:1197
static constexpr float ledSize_mm
Number of leds per one turn of led strip.
Definition: lamp_type.hpp:441
void LMBD_INLINE mask_led_at_index(const size_t n, const bool shouldMask)
Mark a led to be masked at the next show.
Definition: lamp_type.hpp:993
volatile const uint32_t now
(physical) The "now" on milliseconds, updated just before loop.
Definition: lamp_type.hpp:1188
void LMBD_INLINE setPixelColorXY(uint16_t X, uint16_t Y, uint32_t color)
(indexable) Set the X,Y-th LED color
Definition: lamp_type.hpp:1048
void LMBD_INLINE setPixelColor(uint16_t n, uint32_t color)
(indexable) Set the n-th LED color
Definition: lamp_type.hpp:1014
void LMBD_INLINE fillTempBuffer(const T &value)
Fill temporary buffer bufIdx with given value.
Definition: lamp_type.hpp:1092
void LMBD_INLINE clear()
Clear lamp to a clean state.
Definition: lamp_type.hpp:496
uint32_t LMBD_INLINE getPixelColor(uint16_t n)
(indexable) Get the n-th LED color
Definition: lamp_type.hpp:1030
static constexpr uint16_t maxOverflowHeight
Larger height, taken as the absolute maximum Y coordinate, overflowing.
Definition: lamp_type.hpp:403
void LMBD_INLINE blip(const uint32_t duration)
blip the power gate for set time
Definition: lamp_type.hpp:519
void setColorsFromBuffer()
(indexable) Display bufIdx temporary buffer as LED colors
Definition: lamp_type.hpp:1101
volatile brightness_t saved_brightness
Define a localy consistant saved brightness. Should be similar.
Definition: lamp_type.hpp:1177
bool LMBD_INLINE is_bliping() const
return true if the output is in a blip state
Definition: lamp_type.hpp:556
static constexpr float ledStripLength_mm
Copy the led strip lenght.
Definition: lamp_type.hpp:435
static constexpr float _invShiftResidue
(while shifting every shiftPeriod, we have a residue accumulating)
Definition: lamp_type.hpp:412
void LMBD_INLINE cancel_step_mask()
Diasble the step mask.
Definition: lamp_type.hpp:577
void LMBD_INLINE apply_low_brightness_mask()
Apply the optional low level brightnes dithering.
Definition: lamp_type.hpp:905
static constexpr LMBD_INLINE uint16_t toLedCount(T scale)
(indexable) Return a led count in 0-ledCount scaled by scale
Definition: lamp_type.hpp:465
component::microphone::SoundStruct &LMBD_INLINE get_sound_struct()
Return the an object containing sound analysis data.
Definition: lamp_type.hpp:1171
volatile bool forceDisableLedDitherMask
set to true to lock led mask brightness control
Definition: lamp_type.hpp:1212
static constexpr brightness_t ledMasking_brightnessThreshold
below this, the system will enable the led masking
Definition: lamp_type.hpp:1214
static constexpr float lampBodyRadius_mm
real radius of the lamp body
Definition: lamp_type.hpp:430
static constexpr LampTypes flavor
Which lamp flavor is currently used by the implementation?
Definition: lamp_type.hpp:346
static constexpr uint32_t frameDurationMs
Hardward try to call .loop() every frameDurationMs (12ms for 83.3fps)
Definition: lamp_type.hpp:349
void LMBD_INLINE set_steps_mask(uint8_t newValue)
Set the value of the half step mask, from 0 to maxMaskStep.
Definition: lamp_type.hpp:561
void LMBD_INLINE fill(const colors::PaletteTy &palette, uint16_t start, uint16_t end)
(indexable) Fill lamp with target palette, from start to end
Definition: lamp_type.hpp:963
static constexpr uint16_t maxWidth
(indexable) Width of "pixel space" w/ lamp taken as a LED matrix
Definition: lamp_type.hpp:376
brightness_t LMBD_INLINE getBrightness(const bool readPreviousBrightness=false)
Get brightness of the lamp.
Definition: lamp_type.hpp:797
void LMBD_INLINE fill(uint32_t color)
(indexable) Fill lamp with target color
Definition: lamp_type.hpp:956
static constexpr uint16_t maxOverflowWidth
Larger width, taken as the absolute maximum X coordinate on all rows.
Definition: lamp_type.hpp:382
void getColorsToBuffer()
(indexable) Copy all current LEDs color to bufIdx temp. buffer
Definition: lamp_type.hpp:1158
static constexpr uint16_t ledCount
(indexable) Count of indexable LEDs on the lamp
Definition: lamp_type.hpp:363
volatile brightness_t last_system_brightness
Value of the system brightness when the local saved brightness last followed it.
Definition: lamp_type.hpp:1181
brightness_t LMBD_INLINE getSavedBrightness()
Alias for getBrightness(true)
Definition: lamp_type.hpp:806
static constexpr uint8_t nbBuffers
(indexable) Number of color buffers available for direct access
Definition: lamp_type.hpp:453
volatile const uint32_t raw_frame_count
(physical) Raw frame count, incremented at an undefined rate
Definition: lamp_type.hpp:1205
static constexpr uint32_t brightnessDurationMs
Limit mode-requested brightness changes to one every few frames.
Definition: lamp_type.hpp:357
void LMBD_INLINE cancel_blip() const
Cancel the ongoing blip, if any.
Definition: lamp_type.hpp:536
void LMBD_INLINE fadeToBlackBy(uint8_t fadeBy)
Fade currently displayed content by fadeBy units.
Definition: lamp_type.hpp:839
Define the system hardware constants.
Convertion header to use the text out functions from C code.
Define all time related platform functions.
Use this to convert color to bytes.
Definition: utils.h:128
User defined constants, relative to specific lamp types.