mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-07 05:13:31 +02:00
68e7e5a51c
* added tx20 wind speed sensor * added test * fixed lint errors * fixed more lint errors * updated tx20 * updated tx20 sensor * updated to new structure and removed static variables * removed content from __init__.py * fixing lint errors * resolved issues from review * added as3935 sensor * updated as3935 with more settings * update * support for i2c + spi updated * added tests and various fixes * added tx20 wind speed sensor * fixed lint errors * fixed more lint errors * updated tx20 * updated tx20 sensor * updated to new structure and removed static variables * removed content from __init__.py * fixing lint errors * resolved issues from review * added as3935 sensor * updated as3935 with more settings * update * support for i2c + spi updated * added tests and various fixes * updated tests * fixed style issues * Remove debug line * Update log levels * Reformat * Auto-convert to int Co-authored-by: Thomas <thomas.eckerstorfer@mic-cust.com> Co-authored-by: Otto Winter <otto@otto-winter.com>
28 lines
885 B
C++
28 lines
885 B
C++
#pragma once
|
|
|
|
#include "esphome/core/component.h"
|
|
#include "esphome/components/as3935_base/as3935_base.h"
|
|
#include "esphome/components/spi/spi.h"
|
|
#include "esphome/components/sensor/sensor.h"
|
|
#include "esphome/components/binary_sensor/binary_sensor.h"
|
|
|
|
namespace esphome {
|
|
namespace as3935_spi {
|
|
|
|
enum AS3935RegisterMasks { SPI_READ_M = 0x40 };
|
|
|
|
class SPIAS3935Component : public as3935_base::AS3935Component,
|
|
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW,
|
|
spi::CLOCK_PHASE_LEADING, spi::DATA_RATE_2MHZ> {
|
|
public:
|
|
void setup() override;
|
|
void dump_config() override;
|
|
|
|
protected:
|
|
void write_register(uint8_t reg, uint8_t mask, uint8_t bits, uint8_t start_position) override;
|
|
uint8_t read_register(uint8_t reg) override;
|
|
};
|
|
|
|
} // namespace as3935_spi
|
|
} // namespace esphome
|