ESPHome
2024.11.1
esphome
esphome
components
mcp3008
mcp3008.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/components/spi/spi.h
"
4
#include "
esphome/core/component.h
"
5
#include "
esphome/core/hal.h
"
6
7
namespace
esphome
{
8
namespace
mcp3008 {
9
10
class
MCP3008
:
public
Component
,
11
public
spi::SPIDevice
<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW, spi::CLOCK_PHASE_LEADING,
12
spi::DATA_RATE_75KHZ> {
// Running at the slowest max speed supported by the
13
// mcp3008. 2.7v = 75ksps
14
public
:
15
void
setup
()
override
;
16
void
dump_config
()
override
;
17
float
get_setup_priority
()
const override
;
18
float
read_data
(uint8_t pin);
19
};
20
21
}
// namespace mcp3008
22
}
// namespace esphome
esphome::mcp3008::MCP3008::dump_config
void dump_config() override
Definition:
mcp3008.cpp:18
esphome::mcp3008::MCP3008::get_setup_priority
float get_setup_priority() const override
Definition:
mcp3008.cpp:11
hal.h
esphome::Component
Definition:
component.h:68
esphome::mcp3008::MCP3008::setup
void setup() override
Definition:
mcp3008.cpp:13
spi.h
esphome::spi::SPIDevice
The SPIDevice is what components using the SPI will create.
Definition:
spi.h:391
esphome::mcp3008::MCP3008
Definition:
mcp3008.h:10
esphome::mcp3008::MCP3008::read_data
float read_data(uint8_t pin)
Definition:
mcp3008.cpp:23
esphome
Implementation of SPI Controller mode.
Definition:
a01nyub.cpp:7
component.h
Generated by
1.8.13