ESPHome 2025.5.0
Loading...
Searching...
No Matches
mcp3008.h
Go to the documentation of this file.
1#pragma once
2
5#include "esphome/core/hal.h"
6
7namespace esphome {
8namespace mcp3008 {
9
10class 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
float read_data(uint8_t pin)
Definition mcp3008.cpp:23
void setup() override
Definition mcp3008.cpp:13
void dump_config() override
Definition mcp3008.cpp:18
float get_setup_priority() const override
Definition mcp3008.cpp:11
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