ESPHome
2025.2.2
Main Page
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
y
+
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
d
e
f
i
j
l
m
n
p
q
r
s
t
u
v
+
Enumerations
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
+
Enumerator
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
c
d
o
p
s
t
v
w
+
Enumerations
b
c
e
f
i
m
n
p
r
s
t
v
+
Enumerator
a
b
c
d
e
f
g
i
l
m
n
o
p
r
s
t
u
v
w
Related Functions
+
Files
File List
+
Globals
+
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
+
Functions
_
a
l
m
o
s
t
u
+
Variables
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
Typedefs
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Modules
Pages
esphome
esphome
components
mcp47a1
mcp47a1.cpp
Go to the documentation of this file.
1
#include "
mcp47a1.h
"
2
#include "
esphome/core/helpers.h
"
3
#include "
esphome/core/log.h
"
4
5
namespace
esphome
{
6
namespace
mcp47a1 {
7
8
static
const
char
*
const
TAG =
"mcp47a1"
;
9
10
void
MCP47A1::dump_config
() {
11
ESP_LOGCONFIG(TAG,
"MCP47A1 Output:"
);
12
LOG_I2C_DEVICE(
this
);
13
}
14
15
void
MCP47A1::write_state
(
float
state
) {
16
const
uint8_t value =
remap
(state, 0.0f, 1.0f, 63, 0);
17
this->
write_byte
(0, value);
18
}
19
20
}
// namespace mcp47a1
21
}
// namespace esphome
esphome::mcp47a1::MCP47A1::write_state
void write_state(float state) override
Definition:
mcp47a1.cpp:15
esphome::mcp47a1::MCP47A1::dump_config
void dump_config() override
Definition:
mcp47a1.cpp:10
mcp47a1.h
esphome::remap
T remap(U value, U min, U max, T min_out, T max_out)
Remap value from the range (min, max) to (min_out, max_out).
Definition:
helpers.h:162
esphome::i2c::I2CDevice::write_byte
bool write_byte(uint8_t a_register, uint8_t data, bool stop=true)
Definition:
i2c.h:262
esphome
Implementation of SPI Controller mode.
Definition:
a01nyub.cpp:7
helpers.h
log.h
state
bool state
Definition:
fan.h:34
Generated by
1.8.13