-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsy6970.h
36 lines (26 loc) · 796 Bytes
/
sy6970.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#pragma once
#include "esphome/components/i2c/i2c.h"
#include "esphome/core/component.h"
#include "esphome/core/hal.h"
namespace esphome {
namespace sy6970 {
class SY6970 : public Component, public i2c::I2CDevice {
public:
void setup() override;
void dump_config() override;
void set_state_led_enabled(bool enabled) {
this->is_state_led_enabled_ = enabled;
}
void reset_default();
void enable_state_led();
void disable_state_led();
void disable_watchdog();
protected:
i2c::ErrorCode get_register_bit(uint8_t reg, uint8_t bit, bool &out);
i2c::ErrorCode set_register_bit(uint8_t reg, uint8_t bit);
i2c::ErrorCode clear_register_bit(uint8_t reg, uint8_t bit);
protected:
bool is_state_led_enabled_ = false;
};
} // namespace sy6970
} // namespace esphome