5static constexpr uint8_t SM10BIT_MODEL_ID = 0xC0;
7static constexpr uint8_t SM10BIT_ADDR_STANDBY = 0x0;
8static constexpr uint8_t SM10BIT_ADDR_START_3CH = 0x8;
9static constexpr uint8_t SM10BIT_ADDR_START_2CH = 0x10;
10static constexpr uint8_t SM10BIT_ADDR_START_5CH = 0x18;
12static constexpr uint8_t SM10BIT_DELAY = 2;
45 uint8_t addr = SM10BIT_ADDR_START_5CH;
46 if (color_on && !white_on) {
47 addr = SM10BIT_ADDR_START_3CH;
48 }
else if (white_on && !color_on) {
49 addr = SM10BIT_ADDR_START_2CH;
53 data[0] = SM10BIT_MODEL_ID + addr;
62 if (!color_on && !white_on) {
64 data[0] = SM10BIT_MODEL_ID + SM10BIT_ADDR_STANDBY;
70 auto value =
static_cast<uint16_t
>(
state * 0x3FF);
87 for (uint8_t mask = 0x80; mask; mask >>= 1) {
void enable_loop()
Enable this component's loop.
void disable_loop()
Disable this component's loop.
virtual void pin_mode(gpio::Flags flags)=0
virtual void digital_write(bool value)=0
void write_channel(uint8_t channel, float state)
void write_byte_(uint8_t data)
const uint8_t max_power_color_channels_
const uint8_t max_power_white_channels_
void write_bit_(bool value)
void write_buffer_(const uint8_t *buffer, uint8_t size)
GPIOPin *const clock_pin_
void loop() override
Send the new duty values, then sleep until write_channel() changes one.
std::array< uint16_t, 5 > pwm_amounts_
void IRAM_ATTR HOT delayMicroseconds(uint32_t us)