ESPHome 2025.5.0
Loading...
Searching...
No Matches
xl9535.h
Go to the documentation of this file.
1#pragma once
2
5#include "esphome/core/hal.h"
6
7namespace esphome {
8namespace xl9535 {
9
10enum {
19};
20
22 public:
23 bool digital_read(uint8_t pin);
24 void digital_write(uint8_t pin, bool value);
25 void pin_mode(uint8_t pin, gpio::Flags mode);
26
27 void setup() override;
28 void dump_config() override;
29 float get_setup_priority() const override { return setup_priority::IO; }
30};
31
32class XL9535GPIOPin : public GPIOPin {
33 public:
34 void set_parent(XL9535Component *parent) { this->parent_ = parent; }
35 void set_pin(uint8_t pin) { this->pin_ = pin; }
36 void set_inverted(bool inverted) { this->inverted_ = inverted; }
37 void set_flags(gpio::Flags flags) { this->flags_ = flags; }
38
39 gpio::Flags get_flags() const override { return this->flags_; }
40
41 void setup() override;
42 std::string dump_summary() const override;
43 void pin_mode(gpio::Flags flags) override;
44 bool digital_read() override;
45 void digital_write(bool value) override;
46
47 protected:
49
50 uint8_t pin_;
53};
54
55} // namespace xl9535
56} // namespace esphome
BedjetMode mode
BedJet operating mode.
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:133
bool digital_read(uint8_t pin)
Definition xl9535.cpp:29
float get_setup_priority() const override
Definition xl9535.h:29
void digital_write(uint8_t pin, bool value)
Definition xl9535.cpp:53
void pin_mode(uint8_t pin, gpio::Flags mode)
Definition xl9535.cpp:87
void set_parent(XL9535Component *parent)
Definition xl9535.h:34
bool digital_read() override
Definition xl9535.cpp:118
std::string dump_summary() const override
Definition xl9535.cpp:115
void set_pin(uint8_t pin)
Definition xl9535.h:35
gpio::Flags get_flags() const override
Definition xl9535.h:39
void set_flags(gpio::Flags flags)
Definition xl9535.h:37
XL9535Component * parent_
Definition xl9535.h:48
void set_inverted(bool inverted)
Definition xl9535.h:36
void pin_mode(gpio::Flags flags) override
Definition xl9535.cpp:117
void digital_write(bool value) override
Definition xl9535.cpp:119
const float IO
For components that represent GPIO pins like PCF8573.
Definition component.cpp:17
@ XL9535_INPUT_PORT_0_REGISTER
Definition xl9535.h:11
@ XL9535_INPUT_PORT_1_REGISTER
Definition xl9535.h:12
@ XL9535_OUTPUT_PORT_0_REGISTER
Definition xl9535.h:13
@ XL9535_INVERSION_PORT_1_REGISTER
Definition xl9535.h:16
@ XL9535_CONFIG_PORT_1_REGISTER
Definition xl9535.h:18
@ XL9535_CONFIG_PORT_0_REGISTER
Definition xl9535.h:17
@ XL9535_INVERSION_PORT_0_REGISTER
Definition xl9535.h:15
@ XL9535_OUTPUT_PORT_1_REGISTER
Definition xl9535.h:14
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7