1
0
mirror of https://github.com/esphome/esphome.git synced 2025-04-19 09:10:29 +01:00
Otto Winter 726b0e73d9
Add more efficient SPI implementation (#622)
* Add more efficient SPI implementation

* Lint

* Add 200KHZ

* Updates

* Fix write_byte

* Update from datasheet

* Shift clock

* Fix calculation
2019-06-07 14:25:57 +02:00

27 lines
687 B
C++

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