5#ifndef MODES_HARDWARE_LAMP_TYPE_HPP
6#define MODES_HARDWARE_LAMP_TYPE_HPP
17#ifdef LMBD_LAMP_TYPE__INDEXABLE
33#include "src/system/ext/math8.h"
50static constexpr uint16_t
to_strip(uint16_t, uint16_t);
75static constexpr uint16_t
to_led_index(
const float angle_rad,
const float z);
98#ifdef LMBD_LAMP_TYPE__SIMPLE
102#ifdef LMBD_LAMP_TYPE__CCT
106#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];
192 COLOR _colors[_ledCount];
197 void signal_display();
199 uint8_t getBrightness();
200 void setPixelColor(uint16_t, uint32_t);
201 uint32_t getPixelColor(uint16_t);
216 void LMBD_INLINE refresh_tick_value()
218 uint32_t* writeable_now =
const_cast<uint32_t*
>(&
now);
221 uint32_t* writable_tick =
const_cast<uint32_t*
>(&
tick);
224 uint32_t* writable_frame_count =
const_cast<uint32_t*
>(&
raw_frame_count);
225 *writable_frame_count += 1;
238 void LMBD_INLINE startup()
241 if (stripInputMinVoltage_mV == stripInputMaxVoltage_mV)
259 void LMBD_INLINE begin()
280 void LMBD_INLINE show()
301 void LMBD_INLINE show_now()
322 void LMBD_INLINE signal_display()
326 strip.signal_display();
345#ifndef LMBD_LAMP_TYPE__INDEXABLE_IS_HD
347 static_assert(
frameDurationMs == 12,
"Update the documentation of .tick :)");
400 static constexpr float shiftPerTurn = _fwidth - floor(_fwidth - 0.0001);
403 static constexpr uint16_t shiftPeriod = 2;
406 static constexpr float _invShiftResidue = shiftPeriod * (_fwidth - floor(_fwidth - 0.0001));
412 static constexpr auto allResiduesY = details::computeResidues<maxOverflowHeight>(_fwidth);
415 static constexpr auto allDeltaResiduesY = details::computeDeltaResidues<maxOverflowHeight>(_fwidth);
418 static constexpr auto extraShiftResiduesY = details::computeExtraShiftResidues<maxOverflowHeight>(_fwidth);
421 static constexpr int extraShiftTotal = extraShiftResiduesY[
maxOverflowHeight - 1];
459 template<
typename T>
static constexpr LMBD_INLINE uint16_t
toLedCount(T scale)
461 if constexpr (std::is_same_v<T, float>)
463 assert(scale <= 1.0 &&
"scale is 0-1");
466 else if constexpr (std::is_same_v<T, uint8_t>)
473 static_assert(std::is_same_v<T, std::false_type>,
"Invalid type, either float or uint8_t required!");
494 for (uint16_t i = 0; i <
ledCount; ++i)
513 void LMBD_INLINE
blip(
const uint32_t duration)
558 const bool skipCallbacks =
true,
559 const bool skipUpdateBrightness =
false,
560 const bool updateSavedBrightess =
false)
562 assert((skipCallbacks || !skipUpdateBrightness) &&
"implicit callback skip!");
565 if (newBrightness > ::lampda::brightness::absoluteMaximumBrightness)
582 if (updateSavedBrightess)
593#ifndef LMBD_LAMP_TYPE__INDEXABLE
594 static constexpr uint8_t minimumAllowedBrightness = 5;
596 static constexpr uint8_t minimumAllowedBrightness = ::lampda::minimumAllowedBrightness_8;
599 static curve_t brightnessCurve({curve_t::point_t {0, minimumAllowedBrightness},
600 curve_t::point_t {::lampda::brightness::absoluteMaximumBrightness, 255}});
603 strip.
setBrightness(brightnessCurve.sample(trueNewBrightness));
612 const bool isUserCall = skipCallbacks and skipUpdateBrightness and not updateSavedBrightess;
615 if (isUserCall and trueNewBrightness >= trueMaxBrightness)
621 static curve_t brightnessCurve(
622 curve_t::point_t {0, stripInputMinVoltage_mV},
623 curve_t::point_t {::lampda::brightness::absoluteMaximumBrightness, stripInputMaxVoltage_mV},
675 if (current != brightness)
700 if (readPreviousBrightness)
715 if (current != saved)
734 for (uint16_t i = 0; i <
ledCount; ++i)
743 brightness = (brightness < fadeBy) ? 0 : brightness - fadeBy;
757 void LMBD_INLINE
blur(uint8_t blurBy)
761 uint8_t keep = 255 - blurBy;
762 uint8_t seep = blurBy >> 1;
764 uint32_t carryover = 0;
765 for (
unsigned i = 0; i <
ledCount; i++)
769 uint32_t part = colors::fade<false>(c, seep);
770 cur = colors::add<true>(colors::fade<false>(c, keep), carryover);
790 void LMBD_INLINE
fill(uint32_t color, uint16_t start, uint16_t end)
794 assert(start <=
ledCount &&
"invalid start parameter");
795 assert(end <=
ledCount &&
"invalid end parameter");
797 for (uint16_t I = start; I < end; ++I)
804 assert(
false &&
"unsupported");
813 void LMBD_INLINE
fill(uint32_t color, uint16_t start, uint16_t end,
const BufferTy& shouldDisplay)
817 assert(start <=
ledCount &&
"invalid start parameter");
818 assert(end <=
ledCount &&
"invalid end parameter");
820 for (uint16_t I = start; I < end; ++I)
822 const uint8_t blendValue = min<uint32_t>(shouldDisplay[I], UINT8_MAX);
823 setPixelColor(I, colors::blend<uint8_t>(0, color, blendValue));
828 assert(
false &&
"unsupported");
842 void LMBD_INLINE
fill(uint32_t color,
const BufferTy& shouldDisplay) {
fill(color, 0,
ledCount, shouldDisplay); }
853 assert(start <
ledCount &&
"invalid start parameter");
854 assert(end <=
ledCount &&
"invalid end parameter");
856 for (uint16_t I = start; I < end; ++I)
859 const auto color = colors::from_palette<false, uint8_t>(I /
static_cast<float>(
ledCount) * 255, palette);
865 assert(
false &&
"unsupported");
887 assert(n <
ledCount &&
"invalid LED index");
888 strip.setPixelColor(n, color);
892 assert(
false &&
"unsupported");
907 assert(n <
ledCount &&
"invalid LED index");
908 return strip.getPixelColor(n);
912 assert(
false &&
"unsupported");
941 static_assert(bufIdx <
nbBuffers,
"bufIdx must be lower than nbBuffers");
942 BufferTy& buffer = strip.
_buffers[bufIdx];
952 template<u
int8_t dstBufIdx, u
int8_t srcBufIdx>
void LMBD_INLINE
copyBuffer()
954 static_assert(srcBufIdx <
nbBuffers,
"srcBufIdx must be lower than nbBuffers");
955 static_assert(dstBufIdx <
nbBuffers,
"dstBufIdx must be lower than nbBuffers");
964 template<u
int8_t bufIdx = 0,
typename T>
void LMBD_INLINE
fillTempBuffer(
const T& value)
966 getTempBuffer<bufIdx>().fill(value);
975 static_assert(
sizeof(BufferTy) ==
sizeof(strip.
_colors));
976 const BufferTy& buffer = getTempBuffer<bufIdx>();
980 uint16_t Sz =
sizeof(strip.
_colors) - Idx *
sizeof(uint32_t);
981 memcpy(&strip.
_colors[Idx], &buffer[Idx], Sz);
995 static_assert(
sizeof(BufferTy) ==
sizeof(strip.
_colors));
996 const BufferTy& dstBuf = getTempBuffer<dstBufIdx>();
997 const BufferTy& srcBuf = getTempBuffer<srcBufIdx>();
999 uint16_t start = 0, end = srcBuf.size();
1005 for (uint16_t I = start; I < end; ++I)
1008 src.color = srcBuf[I];
1009 dst.color = dstBuf[I];
1018 static_assert(
sizeof(BufferTy) ==
sizeof(strip.
_colors));
1019 const BufferTy& buffer = getTempBuffer<bufIdx>();
1021 uint16_t start = 0, end = buffer.size();
1032 for (uint16_t I = 0, J = start; I < end - start; ++I, ++J)
1034 strip.
_colors[J].color = buffer[end - start - I - 1];
1044 static_assert(
sizeof(BufferTy) ==
sizeof(strip.
_colors));
1046 BufferTy& buffer = getTempBuffer<bufIdx>();
1050 uint16_t Sz =
sizeof(strip.
_colors) - Idx *
sizeof(uint32_t);
1053 memcpy(&buffer[Idx], &strip.
_colors[Idx], Sz);
1104static constexpr uint16_t
to_strip(uint16_t x, uint16_t y)
1114 if (hardware::LampTy::allDeltaResiduesY[y])
1212static constexpr uint16_t
to_led_index(
const float angle_rad,
const float z_mm)
1214 constexpr uint16_t maxZCoordinate =
1221 if (zIndex > maxZCoordinate)
1222 zIndex = maxZCoordinate;
Define assertions helpers.
Handle the output LED strip brightness.
Given two points and an exponent, fit an exponential function.
Definition: curves.h:120
Given a set of points, will fit multiple linear segments to it.
Definition: curves.h:35
protected inheritence to avoid uncontroled hardware calls
Definition: strip.h:49
COLOR _colors[LED_COUNT]
store the display colors, with no brightness scaling
Definition: strip.h:424
void setBrightness(uint8_t b)
Brightness is an internal counter.
Definition: strip.h:111
BufferTy _buffers[stripNbBuffers]
buffers for computations
Definition: strip.h:430
void begin()
Definition: strip.h:129
void show_now()
Show the current data, independant of changes.
Definition: strip.h:173
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:169
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....
Definition: time.cpp:18
brightness_t get_brightness()
Return the current brightness value (in range 0 - brightness::absoluteMaximumBrightness)....
Definition: brightness_handle.cpp:39
uint32_t when_last_update_brightness()
Get time in milliseconds when brightness was last updated.
Definition: brightness_handle.cpp:94
void update_brightness(const brightness_t newBrightness, const bool shouldCallUserBrightnessCallback)
update the internal brightness values
Definition: brightness_handle.cpp:66
brightness_t get_saved_brightness()
Return the saved brightness level. This shoudl be the prefered option in all computations.
Definition: brightness_handle.cpp:64
brightness_t get_max_user_brightness()
Return the maximum allowed brightness for the user modes.
Definition: brightness_handle.cpp:43
brightness_t get_max_brightness()
Return the maximum allowed brightness.
Definition: brightness_handle.cpp:41
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:10
LampTypes
Enumeration to write code working with all lamp types.
Definition: lamp_type.hpp:92
@ 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:111
Contains basic interface types to implement custom user modes.
Definition: control_fixed_modes.hpp:12
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:1212
static constexpr float to_helix_z(const int16_t n)
Convert a led index to an helix height coordinate.
Definition: lamp_type.hpp:1172
static constexpr uint16_t to_strip(uint16_t, uint16_t)
convert grid coordinates to strip index
Definition: lamp_type.hpp:1104
static constexpr XYTy strip_to_XY(uint16_t n)
convert strip index to grid coordinates
Definition: lamp_type.hpp:1136
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:1247
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:1201
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:1193
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:1182
static constexpr HelixXYZTy strip_to_helix(int16_t n)
convert strip index to 3D coordinates
Definition: lamp_type.hpp:1159
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:21
uint16_t brightness_t
Define the type of the brightness parameters.
Definition: constants.h:147
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: lamp_type.hpp:55
float x
x 3D mm coordinates
Definition: lamp_type.hpp:56
float y
y 3D mm coordinates
Definition: lamp_type.hpp:57
float z
z 3D mm coordinates
Definition: lamp_type.hpp:58
Definition: lamp_type.hpp:44
uint16_t y
y 2D led grid coordinates
Definition: lamp_type.hpp:46
uint16_t x
x 2D led grid coordinates
Definition: lamp_type.hpp:45
Store a display config.
Definition: lamp_type.hpp:125
uint16_t skipFirstLedsForAmount
Skip the first N leds.
Definition: lamp_type.hpp:127
uint16_t skipFirstLedsForEffect
Skip duration.
Definition: lamp_type.hpp:126
Main interface between the user and the hardware of the lamp.
Definition: lamp_type.hpp:118
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:790
void align_internal_to_system_brightness()
Special call to update the internal brightness values to the system brightness.
Definition: lamp_type.hpp:631
void setColorsFromMixedBuffers(float phase)
Mix two colors from a buffer.
Definition: lamp_type.hpp:993
static XYTy LMBD_INLINE fromStripIndexToXY(uint16_t N)
(indexable) Given a LED index, return a corresponding X,Y value
Definition: lamp_type.hpp:932
brightness_t LMBD_INLINE getMaxBrightness() const
Return the actual allowed maximum brightness.
Definition: lamp_type.hpp:659
static constexpr float ledByMeter
number of led per meters of strip used
Definition: lamp_type.hpp:432
void LMBD_INLINE restoreBrightness()
Reset brightness to internal saved brightness, skip callbacks.
Definition: lamp_type.hpp:710
void LMBD_INLINE blur(uint8_t blurBy)
Blur currently displayed content by blurBy units /!\ Only applied along the strip,...
Definition: lamp_type.hpp:757
static constexpr uint16_t maxHeight
(indexable) Height of "pixel space" w/ lamp taken as a LED matrix
Definition: lamp_type.hpp:391
void LMBD_INLINE fill(uint32_t color, uint16_t start, uint16_t end, const BufferTy &shouldDisplay)
(indexable) Fill lamp with target color, from start to end. Apply a mask to display leds
Definition: lamp_type.hpp:813
static constexpr float lampHeight_mm
Computation of the lamp height.
Definition: lamp_type.hpp:441
void LMBD_INLINE fill(uint32_t color, const BufferTy &shouldDisplay)
(indexable) Fill lamp with target color, with a mask
Definition: lamp_type.hpp:842
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:557
void LMBD_INLINE fill(const colors::PaletteTy &palette)
(indexable) Fill lamp with target palette
Definition: lamp_type.hpp:872
static constexpr float maxHeightFloat
Height as a precise floating point number, equal to stripYCoordinates.
Definition: lamp_type.hpp:394
volatile brightness_t temporary_brightness
Define a localy consistant temporary brightness.
Definition: lamp_type.hpp:1072
void LMBD_INLINE copyBuffer()
Copy a source buffer at srcBufIdx to another buffer at dstBufIdx.
Definition: lamp_type.hpp:952
static constexpr float lampBodyCircumpherence_mm
Computation of the lamp body circumpherence.
Definition: lamp_type.hpp:437
static constexpr float maxWidthFloat
Width as a precise floating point number, equal to stripXCoordinates.
Definition: lamp_type.hpp:373
BufferTy &LMBD_INLINE getTempBuffer()
Get a reference to the bufIdx temporary buffer.
Definition: lamp_type.hpp:939
static constexpr float ledStripWidth_mm
real size of the led strip in use
Definition: lamp_type.hpp:427
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:926
static constexpr float ledPerTurns
Computation of the led count per turns.
Definition: lamp_type.hpp:439
void LMBD_INLINE tempBrightness(const brightness_t brightness)
Temporarily set brightness, without affecting brightness navigation.
Definition: lamp_type.hpp:672
void setColorsFromBufferReversed(bool skipLastLine)
(indexable) Display bufIdx temporary buffer, but reversed
Definition: lamp_type.hpp:1016
void enforce_internal_brightness_limits()
Enforce the brightness limits, if getMaxBrightness changed. Will call setBrightness.
Definition: lamp_type.hpp:638
void LMBD_INLINE jumpBrightness(const brightness_t brightness)
Jump to brightness, affecting the next brightness navigation.
Definition: lamp_type.hpp:690
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:1088
static constexpr float ledSize_mm
Number of leds per one turn of led strip.
Definition: lamp_type.hpp:435
volatile const uint32_t now
(physical) The "now" on milliseconds, updated just before loop.
Definition: lamp_type.hpp:1079
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:920
void LMBD_INLINE setPixelColor(uint16_t n, uint32_t color)
(indexable) Set the n-th LED color
Definition: lamp_type.hpp:878
void LMBD_INLINE fillTempBuffer(const T &value)
Fill temporary buffer bufIdx with given value.
Definition: lamp_type.hpp:964
void LMBD_INLINE clear()
Clear lamp to a clean state.
Definition: lamp_type.hpp:490
uint32_t LMBD_INLINE getPixelColor(uint16_t n)
(indexable) Get the n-th LED color
Definition: lamp_type.hpp:898
static constexpr uint16_t maxOverflowHeight
Larger height, taken as the absolute maximum Y coordinate, overflowing.
Definition: lamp_type.hpp:397
void LMBD_INLINE blip(const uint32_t duration)
blip the power gate for set time
Definition: lamp_type.hpp:513
void setColorsFromBuffer()
(indexable) Display bufIdx temporary buffer as LED colors
Definition: lamp_type.hpp:973
volatile brightness_t saved_brightness
Define a localy consistant saved brightness. Should be similar.
Definition: lamp_type.hpp:1070
bool LMBD_INLINE is_bliping() const
return true if the output is in a blip state
Definition: lamp_type.hpp:535
static constexpr float ledStripLength_mm
Copy the led strip lenght.
Definition: lamp_type.hpp:429
static constexpr float _invShiftResidue
(while shifting every shiftPeriod, we have a residue accumulating)
Definition: lamp_type.hpp:406
static constexpr LMBD_INLINE uint16_t toLedCount(T scale)
(indexable) Return a led count in 0-ledCount scaled by scale
Definition: lamp_type.hpp:459
component::microphone::SoundStruct &LMBD_INLINE get_sound_struct()
Return the an object containing sound analysis data.
Definition: lamp_type.hpp:1064
static constexpr float lampBodyRadius_mm
real radius of the lamp body
Definition: lamp_type.hpp:424
static constexpr LampTypes flavor
Which lamp flavor is currently used by the implementation?
Definition: lamp_type.hpp:340
static constexpr uint32_t frameDurationMs
Hardward try to call .loop() every frameDurationMs (12ms for 83.3fps)
Definition: lamp_type.hpp:343
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:849
static constexpr uint16_t maxWidth
(indexable) Width of "pixel space" w/ lamp taken as a LED matrix
Definition: lamp_type.hpp:370
brightness_t LMBD_INLINE getBrightness(const bool readPreviousBrightness=false)
Get brightness of the lamp.
Definition: lamp_type.hpp:698
void LMBD_INLINE fill(uint32_t color)
(indexable) Fill lamp with target color
Definition: lamp_type.hpp:836
static constexpr uint16_t maxOverflowWidth
Larger width, taken as the absolute maximum X coordinate on all rows.
Definition: lamp_type.hpp:376
void getColorsToBuffer()
(indexable) Copy all current LEDs color to bufIdx temp. buffer
Definition: lamp_type.hpp:1042
static constexpr uint16_t ledCount
(indexable) Count of indexable LEDs on the lamp
Definition: lamp_type.hpp:357
brightness_t LMBD_INLINE getSavedBrightness()
Alias for getBrightness(true)
Definition: lamp_type.hpp:707
static constexpr uint8_t nbBuffers
(indexable) Number of color buffers available for direct access
Definition: lamp_type.hpp:447
volatile const uint32_t raw_frame_count
(physical) Raw frame count, incremented at an undefined rate
Definition: lamp_type.hpp:1096
static constexpr uint32_t brightnessDurationMs
Limit mode-requested brightness changes to one every few frames.
Definition: lamp_type.hpp:351
void LMBD_INLINE cancel_blip() const
Cancel the ongoing blip, if any.
Definition: lamp_type.hpp:530
void LMBD_INLINE fadeToBlackBy(uint8_t fadeBy)
Fade currently displayed content by fadeBy units.
Definition: lamp_type.hpp:727
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.