ESPHome 2026.5.1
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::mcp3008 {
8
9class MCP3008 : public Component,
10 public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW, spi::CLOCK_PHASE_LEADING,
11 spi::DATA_RATE_75KHZ> { // Running at the slowest max speed supported by the
12 // mcp3008. 2.7v = 75ksps
13 public:
14 void setup() override;
15 void dump_config() override;
16 float get_setup_priority() const override;
17 float read_data(uint8_t pin);
18};
19
20} // namespace esphome::mcp3008
float read_data(uint8_t pin)
Definition mcp3008.cpp:19
void setup() override
Definition mcp3008.cpp:12
void dump_config() override
Definition mcp3008.cpp:14
float get_setup_priority() const override
Definition mcp3008.cpp:10
The SPIDevice is what components using the SPI will create.
Definition spi.h:429