ESPHome 2025.5.0
Loading...
Searching...
No Matches
mcp23s17.h
Go to the documentation of this file.
1#pragma once
2
5#include "esphome/core/hal.h"
7
8namespace esphome {
9namespace mcp23s17 {
10
12 public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW, spi::CLOCK_PHASE_LEADING,
13 spi::DATA_RATE_8MHZ> {
14 public:
15 MCP23S17() = default;
16
17 void setup() override;
18 void dump_config() override;
19 void set_device_address(uint8_t device_addr);
20
21 protected:
22 bool read_reg(uint8_t reg, uint8_t *value) override;
23 bool write_reg(uint8_t reg, uint8_t value) override;
24
25 uint8_t device_opcode_ = 0x40;
26};
27
28} // namespace mcp23s17
29} // namespace esphome
void dump_config() override
Definition mcp23s17.cpp:44
void set_device_address(uint8_t device_addr)
Definition mcp23s17.cpp:9
bool read_reg(uint8_t reg, uint8_t *value) override
Definition mcp23s17.cpp:49
bool write_reg(uint8_t reg, uint8_t value) override
Definition mcp23s17.cpp:58
The SPIDevice is what components using the SPI will create.
Definition spi.h:421
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7