9static const char *
const TAG =
"tlc59208f";
58static const uint8_t LDR_OFF = 0x00;
59static const uint8_t LDR_ON = 0x01;
60static const uint8_t LDR_PWM = 0x02;
61static const uint8_t LDR_GRPPWM = 0x03;
64 ESP_LOGV(TAG,
" Resetting all devices on the bus");
69 ESP_LOGE(TAG,
"RESET failed");
76 ESP_LOGE(TAG,
"MODE1 failed");
81 ESP_LOGE(TAG,
"MODE2 failed");
87 if (!this->
write_byte(TLC59208F_REG_LEDOUT0, (LDR_PWM << 6) | (LDR_PWM << 4) | (LDR_PWM << 2) | (LDR_PWM << 0))) {
88 ESP_LOGE(TAG,
"LEDOUT0 failed");
92 if (!this->
write_byte(TLC59208F_REG_LEDOUT1, (LDR_PWM << 6) | (LDR_PWM << 4) | (LDR_PWM << 2) | (LDR_PWM << 0))) {
93 ESP_LOGE(TAG,
"LEDOUT1 failed");
109 ESP_LOGE(TAG,
"Setting up TLC59208F failed!");
119 ESP_LOGVV(TAG,
"Channel %02u: pwm=%04u ", channel, pwm);
140 const uint8_t max_duty = 255;
141 const float duty_rounded = roundf(
state * max_duty);
142 auto duty =
static_cast<uint8_t
>(duty_rounded);
void mark_failed()
Mark this component as failed.
void status_set_warning(const char *message=nullptr)
void status_clear_warning()
TLC59208FOutput * parent_
void set_parent(T *parent)
Set the parent of this object.
virtual ErrorCode write_readv(uint8_t address, const uint8_t *write_buffer, size_t write_count, uint8_t *read_buffer, size_t read_count)=0
This virtual method writes bytes to an I2CBus from an array, then reads bytes into an array of ReadBu...
I2CBus * bus_
pointer to I2CBus instance
bool write_byte(uint8_t a_register, uint8_t data) const
I2CRegister reg(uint8_t a_register)
calls the I2CRegister constructor
void write_state(float state) override
uint8_t pwm_amounts_[256]
void register_channel(TLC59208FChannel *channel)
void dump_config() override
@ ERROR_OK
No error found during execution of method.
const uint8_t TLC59208F_REG_GROUPFREQ
const uint8_t TLC59208F_REG_LEDOUT0
const uint8_t TLC59208F_REG_MODE1
const uint8_t TLC59208F_SWRST_SEQ[2]
const uint8_t TLC59208F_REG_SUBADR1
const uint8_t TLC59208F_REG_MODE2
const uint8_t TLC59208F_SWRST_ADDR
const uint8_t TLC59208F_REG_SUBADR2
const uint8_t TLC59208F_MODE1_SLEEP
const uint8_t TLC59208F_MODE1_AI0
const uint8_t TLC59208F_REG_LEDOUT1
const uint8_t TLC59208F_MODE1_AI1
const uint8_t TLC59208F_MODE1_SUB1
const uint8_t TLC59208F_MODE1_SUB2
const uint8_t TLC59208F_REG_PWM0
const uint8_t TLC59208F_MODE1_SUB3
const uint8_t TLC59208F_MODE1_AI2
const uint8_t TLC59208F_REG_ALLCALLADR
const uint8_t TLC59208F_REG_SUBADR3
const uint8_t TLC59208F_REG_GROUPPWM
const uint8_t TLC59208F_MODE1_ALLCALL
Providing packet encoding functions for exchanging data with a remote host.
void IRAM_ATTR HOT delayMicroseconds(uint32_t us)