mirror of
https://github.com/esphome/esphome.git
synced 2024-11-30 13:04:13 +01:00
[sx1509] Fix up includes (#7828)
This commit is contained in:
parent
ebf895990b
commit
aa6cea6f7e
@ -1,5 +1,6 @@
|
|||||||
#include "esphome/core/helpers.h"
|
#include "esphome/core/helpers.h"
|
||||||
#include "esphome/core/log.h"
|
#include "esphome/core/log.h"
|
||||||
|
#include "sx1509.h"
|
||||||
#include "sx1509_gpio_pin.h"
|
#include "sx1509_gpio_pin.h"
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
@ -13,7 +14,7 @@ bool SX1509GPIOPin::digital_read() { return this->parent_->digital_read(this->pi
|
|||||||
void SX1509GPIOPin::digital_write(bool value) { this->parent_->digital_write(this->pin_, value != this->inverted_); }
|
void SX1509GPIOPin::digital_write(bool value) { this->parent_->digital_write(this->pin_, value != this->inverted_); }
|
||||||
std::string SX1509GPIOPin::dump_summary() const {
|
std::string SX1509GPIOPin::dump_summary() const {
|
||||||
char buffer[32];
|
char buffer[32];
|
||||||
snprintf(buffer, sizeof(buffer), "%u via sx1509", pin_);
|
snprintf(buffer, sizeof(buffer), "%u via sx1509", this->pin_);
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "sx1509.h"
|
#include "esphome/core/gpio.h"
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
namespace sx1509 {
|
namespace sx1509 {
|
||||||
@ -15,10 +15,10 @@ class SX1509GPIOPin : public GPIOPin {
|
|||||||
void digital_write(bool value) override;
|
void digital_write(bool value) override;
|
||||||
std::string dump_summary() const override;
|
std::string dump_summary() const override;
|
||||||
|
|
||||||
void set_parent(SX1509Component *parent) { parent_ = parent; }
|
void set_parent(SX1509Component *parent) { this->parent_ = parent; }
|
||||||
void set_pin(uint8_t pin) { pin_ = pin; }
|
void set_pin(uint8_t pin) { this->pin_ = pin; }
|
||||||
void set_inverted(bool inverted) { inverted_ = inverted; }
|
void set_inverted(bool inverted) { this->inverted_ = inverted; }
|
||||||
void set_flags(gpio::Flags flags) { flags_ = flags; }
|
void set_flags(gpio::Flags flags) { this->flags_ = flags; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
SX1509Component *parent_;
|
SX1509Component *parent_;
|
||||||
|
Loading…
Reference in New Issue
Block a user