9 static const char *
const TAG =
"sm2135";
11 static const uint8_t SM2135_ADDR_MC = 0xC0;
12 static const uint8_t SM2135_ADDR_CH = 0xC1;
13 static const uint8_t SM2135_ADDR_R = 0xC2;
14 static const uint8_t SM2135_ADDR_G = 0xC3;
15 static const uint8_t SM2135_ADDR_B = 0xC4;
16 static const uint8_t SM2135_ADDR_C = 0xC5;
17 static const uint8_t SM2135_ADDR_W = 0xC6;
19 static const uint8_t SM2135_RGB = 0x00;
20 static const uint8_t SM2135_CW = 0x80;
23 ESP_LOGCONFIG(TAG,
"Setting up SM2135OutputComponent...");
38 ESP_LOGCONFIG(TAG,
"SM2135:");
41 ESP_LOGCONFIG(TAG,
" CW Current: %dmA", 10 + (this->
cw_current_ * 5));
42 ESP_LOGCONFIG(TAG,
" RGB Current: %dmA", 10 + (this->
rgb_current_ * 5));
46 for (uint8_t mask = 0x80; mask; mask >>= 1) {
85 for (uint32_t i = 0; i < size; i++) {
virtual void digital_write(bool value)=0
void sm2135_set_low_(GPIOPin *pin)
void sm2135_set_high_(GPIOPin *pin)
SM2135Current cw_current_
void set_channel_value_(uint8_t channel, uint8_t value)
virtual void pin_mode(gpio::Flags flags)=0
SM2135Current rgb_current_
void dump_config() override
void write_byte_(uint8_t data)
std::vector< uint8_t > pwm_amounts_
void write_buffer_(uint8_t *buffer, uint8_t size)
void loop() override
Send new values if they were updated.
Implementation of SPI Controller mode.
void IRAM_ATTR HOT delayMicroseconds(uint32_t us)
void IRAM_ATTR HOT delay(uint32_t ms)