esphome/esphome/components/max6675/max6675.h
2023-10-04 15:18:33 -05:00

26 lines
681 B
C++

#pragma once
#include "esphome/core/component.h"
#include "esphome/components/sensor/sensor.h"
#include "esphome/components/spi/spi.h"
namespace esphome {
namespace max6675 {
class MAX6675Sensor : public sensor::Sensor,
public PollingComponent,
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW, spi::CLOCK_PHASE_LEADING,
spi::DATA_RATE_1MHZ> {
public:
void setup() override;
void dump_config() override;
float get_setup_priority() const override;
void update() override;
protected:
void read_data_();
};
} // namespace max6675
} // namespace esphome