ESPHome
2024.11.0
esphome
esphome
components
mcp23x17_base
mcp23x17_base.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/core/component.h
"
4
#include "
esphome/components/mcp23xxx_base/mcp23xxx_base.h
"
5
#include "
esphome/core/hal.h
"
6
7
namespace
esphome
{
8
namespace
mcp23x17_base {
9
10
enum
MCP23X17GPIORegisters
{
11
// A side
12
MCP23X17_IODIRA
= 0x00,
13
MCP23X17_IPOLA
= 0x02,
14
MCP23X17_GPINTENA
= 0x04,
15
MCP23X17_DEFVALA
= 0x06,
16
MCP23X17_INTCONA
= 0x08,
17
MCP23X17_IOCONA
= 0x0A,
18
MCP23X17_GPPUA
= 0x0C,
19
MCP23X17_INTFA
= 0x0E,
20
MCP23X17_INTCAPA
= 0x10,
21
MCP23X17_GPIOA
= 0x12,
22
MCP23X17_OLATA
= 0x14,
23
// B side
24
MCP23X17_IODIRB
= 0x01,
25
MCP23X17_IPOLB
= 0x03,
26
MCP23X17_GPINTENB
= 0x05,
27
MCP23X17_DEFVALB
= 0x07,
28
MCP23X17_INTCONB
= 0x09,
29
MCP23X17_IOCONB
= 0x0B,
30
MCP23X17_GPPUB
= 0x0D,
31
MCP23X17_INTFB
= 0x0F,
32
MCP23X17_INTCAPB
= 0x11,
33
MCP23X17_GPIOB
= 0x13,
34
MCP23X17_OLATB
= 0x15,
35
};
36
37
class
MCP23X17Base
:
public
mcp23xxx_base::MCP23XXXBase
{
38
public
:
39
bool
digital_read
(uint8_t pin)
override
;
40
void
digital_write
(uint8_t pin,
bool
value)
override
;
41
void
pin_mode
(uint8_t pin,
gpio::Flags
flags
)
override
;
42
void
pin_interrupt_mode
(uint8_t pin,
mcp23xxx_base::MCP23XXXInterruptMode
interrupt_mode)
override
;
43
44
protected
:
45
void
update_reg
(uint8_t pin,
bool
pin_value, uint8_t reg_a)
override
;
46
47
uint8_t
olat_a_
{0x00};
48
uint8_t
olat_b_
{0x00};
49
};
50
51
}
// namespace mcp23x17_base
52
}
// namespace esphome
esphome::mcp23x17_base::MCP23X17_INTCONB
Definition:
mcp23x17_base.h:28
esphome::mcp23x17_base::MCP23X17Base::digital_write
void digital_write(uint8_t pin, bool value) override
Definition:
mcp23x17_base.cpp:17
esphome::mcp23x17_base::MCP23X17_IOCONA
Definition:
mcp23x17_base.h:17
esphome::mcp23x17_base::MCP23X17_IPOLA
Definition:
mcp23x17_base.h:13
esphome::mcp23x17_base::MCP23X17_GPINTENA
Definition:
mcp23x17_base.h:14
esphome::mcp23x17_base::MCP23X17_IPOLB
Definition:
mcp23x17_base.h:25
esphome::mcp23x17_base::MCP23X17_GPINTENB
Definition:
mcp23x17_base.h:26
esphome::mcp23x17_base::MCP23X17Base::update_reg
void update_reg(uint8_t pin, bool pin_value, uint8_t reg_a) override
Definition:
mcp23x17_base.cpp:62
esphome::mcp23x17_base::MCP23X17_IODIRA
Definition:
mcp23x17_base.h:12
hal.h
esphome::mcp23xxx_base::MCP23XXXBase
Definition:
mcp23xxx_base.h:11
esphome::mcp23x17_base::MCP23X17_IOCONB
Definition:
mcp23x17_base.h:29
esphome::mcp23x17_base::MCP23X17_INTFA
Definition:
mcp23x17_base.h:19
esphome::mcp23x17_base::MCP23X17Base::olat_b_
uint8_t olat_b_
Definition:
mcp23x17_base.h:48
esphome::mcp23x17_base::MCP23X17_OLATA
Definition:
mcp23x17_base.h:22
esphome::mcp23x17_base::MCP23X17_GPPUA
Definition:
mcp23x17_base.h:18
esphome::mcp23x17_base::MCP23X17_OLATB
Definition:
mcp23x17_base.h:34
mcp23xxx_base.h
esphome::mcp23x17_base::MCP23X17Base::digital_read
bool digital_read(uint8_t pin) override
Definition:
mcp23x17_base.cpp:9
esphome::mcp23x17_base::MCP23X17_DEFVALA
Definition:
mcp23x17_base.h:15
esphome::mcp23x17_base::MCP23X17_GPPUB
Definition:
mcp23x17_base.h:30
esphome::mcp23x17_base::MCP23X17_GPIOB
Definition:
mcp23x17_base.h:33
esphome::mcp23x17_base::MCP23X17_INTCONA
Definition:
mcp23x17_base.h:16
esphome::mcp23x17_base::MCP23X17_DEFVALB
Definition:
mcp23x17_base.h:27
esphome::mcp23xxx_base::MCP23XXXInterruptMode
MCP23XXXInterruptMode
Definition:
mcp23xxx_base.h:9
esphome::mcp23x17_base::MCP23X17_GPIOA
Definition:
mcp23x17_base.h:21
esphome::shelly_dimmer::flags
const uint32_t flags
Definition:
stm32flash.h:85
esphome::mcp23x17_base::MCP23X17_INTCAPA
Definition:
mcp23x17_base.h:20
esphome::mcp23x17_base::MCP23X17_INTFB
Definition:
mcp23x17_base.h:31
esphome
Implementation of SPI Controller mode.
Definition:
a01nyub.cpp:7
esphome::mcp23x17_base::MCP23X17Base::pin_interrupt_mode
void pin_interrupt_mode(uint8_t pin, mcp23xxx_base::MCP23XXXInterruptMode interrupt_mode) override
Definition:
mcp23x17_base.cpp:36
component.h
esphome::gpio::Flags
Flags
Definition:
gpio.h:15
esphome::mcp23x17_base::MCP23X17Base
Definition:
mcp23x17_base.h:37
esphome::mcp23x17_base::MCP23X17Base::olat_a_
uint8_t olat_a_
Definition:
mcp23x17_base.h:47
esphome::mcp23x17_base::MCP23X17_IODIRB
Definition:
mcp23x17_base.h:24
esphome::mcp23x17_base::MCP23X17_INTCAPB
Definition:
mcp23x17_base.h:32
esphome::mcp23x17_base::MCP23X17Base::pin_mode
void pin_mode(uint8_t pin, gpio::Flags flags) override
Definition:
mcp23x17_base.cpp:22
esphome::mcp23x17_base::MCP23X17GPIORegisters
MCP23X17GPIORegisters
Definition:
mcp23x17_base.h:10
Generated by
1.8.13