ESPHome  2024.10.2
pcf8574_display.h
Go to the documentation of this file.
1 #pragma once
2 
6 
7 namespace esphome {
8 namespace lcd_pcf8574 {
9 
11  public:
12  void set_writer(std::function<void(PCF8574LCDDisplay &)> &&writer) { this->writer_ = std::move(writer); }
13  void setup() override;
14  void dump_config() override;
15  void backlight();
16  void no_backlight();
17 
18  protected:
19  bool is_four_bit_mode() override { return true; }
20  void write_n_bits(uint8_t value, uint8_t n) override;
21  void send(uint8_t value, bool rs) override;
22 
23  void call_writer() override { this->writer_(*this); }
24 
25  // Stores the current state of the backlight.
27  std::function<void(PCF8574LCDDisplay &)> writer_;
28 };
29 
30 } // namespace lcd_pcf8574
31 } // namespace esphome
void send(uint8_t value, bool rs) override
std::function< void(PCF8574LCDDisplay &)> writer_
void write_n_bits(uint8_t value, uint8_t n) override
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
This Class provides the methods to read/write bytes from/to an i2c device.
Definition: i2c.h:133
void set_writer(std::function< void(PCF8574LCDDisplay &)> &&writer)