ESPHome 2025.5.0
Loading...
Searching...
No Matches
tlc59208f_output.h
Go to the documentation of this file.
1#pragma once
2
7
8namespace esphome {
9namespace tlc59208f {
10
11// 0*: Group dimming, 1: Group blinking
12extern const uint8_t TLC59208F_MODE2_DMBLNK;
13// 0*: Output change on Stop command, 1: Output change on ACK
14extern const uint8_t TLC59208F_MODE2_OCH;
15// 0*: WDT disabled, 1: WDT enabled
16extern const uint8_t TLC59208F_MODE2_WDTEN;
17// WDT timeouts
18extern const uint8_t TLC59208F_MODE2_WDT_5MS;
19extern const uint8_t TLC59208F_MODE2_WDT_15MS;
20extern const uint8_t TLC59208F_MODE2_WDT_25MS;
21extern const uint8_t TLC59208F_MODE2_WDT_35MS;
22
23class TLC59208FOutput;
24
25class TLC59208FChannel : public output::FloatOutput, public Parented<TLC59208FOutput> {
26 public:
27 void set_channel(uint8_t channel) { channel_ = channel; }
28
29 protected:
30 friend class TLC59208FOutput;
31
32 void write_state(float state) override;
33
34 uint8_t channel_;
35};
36
39 public:
41
43
44 void setup() override;
45 void dump_config() override;
46 float get_setup_priority() const override { return setup_priority::HARDWARE; }
47 void loop() override;
48
49 protected:
51
52 void set_channel_value_(uint8_t channel, uint8_t value) {
53 if (this->pwm_amounts_[channel] != value)
54 this->update_ = true;
55 this->pwm_amounts_[channel] = value;
56 }
57
58 uint8_t mode_;
59
60 uint8_t min_channel_{0xFF};
61 uint8_t max_channel_{0x00};
62 uint8_t pwm_amounts_[256] = {
63 0,
64 };
65 bool update_{true};
66};
67
68} // namespace tlc59208f
69} // namespace esphome
BedjetMode mode
BedJet operating mode.
Helper class to easily give an object a parent of type T.
Definition helpers.h:538
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:133
Base class for all output components that can output a variable level, like PWM.
void write_state(float state) override
TLC59208F float output component.
float get_setup_priority() const override
void set_channel_value_(uint8_t channel, uint8_t value)
void register_channel(TLC59208FChannel *channel)
TLC59208FOutput(uint8_t mode=TLC59208F_MODE2_OCH)
bool state
Definition fan.h:0
const float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
Definition component.cpp:18
const uint8_t TLC59208F_MODE2_OCH
const uint8_t TLC59208F_MODE2_WDT_35MS
const uint8_t TLC59208F_MODE2_WDT_5MS
const uint8_t TLC59208F_MODE2_WDT_25MS
const uint8_t TLC59208F_MODE2_WDT_15MS
const uint8_t TLC59208F_MODE2_WDTEN
const uint8_t TLC59208F_MODE2_DMBLNK
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7