ESPHome 2025.5.0
Loading...
Searching...
No Matches
mcp23s08.h
Go to the documentation of this file.
1#pragma once
2
5#include "esphome/core/hal.h"
7
8namespace esphome {
9namespace mcp23s08 {
10
12 public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW, spi::CLOCK_PHASE_LEADING,
13 spi::DATA_RATE_10MHZ> {
14 public:
15 MCP23S08() = default;
16
17 void setup() override;
18 void dump_config() override;
19
20 void set_device_address(uint8_t device_addr);
21
22 protected:
23 bool read_reg(uint8_t reg, uint8_t *value) override;
24 bool write_reg(uint8_t reg, uint8_t value) override;
25
26 uint8_t device_opcode_ = 0x40;
27};
28
29} // namespace mcp23s08
30} // namespace esphome
bool write_reg(uint8_t reg, uint8_t value) override
Definition mcp23s08.cpp:49
void dump_config() override
Definition mcp23s08.cpp:35
void set_device_address(uint8_t device_addr)
Definition mcp23s08.cpp:9
bool read_reg(uint8_t reg, uint8_t *value) override
Definition mcp23s08.cpp:40
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