ESPHome  2024.9.2
ade7953_spi.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "esphome/core/hal.h"
8 
9 #include <vector>
10 
11 namespace esphome {
12 namespace ade7953_spi {
13 
15  public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_HIGH, spi::CLOCK_PHASE_LEADING,
16  spi::DATA_RATE_1MHZ> {
17  public:
18  void setup() override;
19 
20  void dump_config() override;
21 
22  protected:
23  bool ade_write_8(uint16_t reg, uint8_t value) override;
24  bool ade_write_16(uint16_t reg, uint16_t value) override;
25  bool ade_write_32(uint16_t reg, uint32_t value) override;
26  bool ade_read_8(uint16_t reg, uint8_t *value) override;
27  bool ade_read_16(uint16_t reg, uint16_t *value) override;
28  bool ade_read_32(uint16_t reg, uint32_t *value) override;
29 };
30 
31 } // namespace ade7953_spi
32 } // namespace esphome
bool ade_write_8(uint16_t reg, uint8_t value) override
Definition: ade7953_spi.cpp:21
The SPIDevice is what components using the SPI will create.
Definition: spi.h:391
bool ade_write_32(uint16_t reg, uint32_t value) override
Definition: ade7953_spi.cpp:39
bool ade_read_8(uint16_t reg, uint8_t *value) override
Definition: ade7953_spi.cpp:49
bool ade_read_32(uint16_t reg, uint32_t *value) override
Definition: ade7953_spi.cpp:69
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
bool ade_read_16(uint16_t reg, uint16_t *value) override
Definition: ade7953_spi.cpp:58
bool ade_write_16(uint16_t reg, uint16_t value) override
Definition: ade7953_spi.cpp:30