ESPHome 2026.5.0b1
Loading...
Searching...
No Matches
weikai_spi.h
Go to the documentation of this file.
1
7
8#pragma once
9#include <memory>
14
15namespace esphome::weikai_spi {
20 public:
21 WeikaiRegisterSPI(weikai::WeikaiComponent *const comp, uint8_t reg, uint8_t channel)
22 : weikai::WeikaiRegister(comp, reg, channel) {}
23
24 uint8_t read_reg() const override;
25 void write_reg(uint8_t value) override;
26 void read_fifo(uint8_t *data, size_t length) const override;
27 void write_fifo(uint8_t *data, size_t length) override;
28};
29
35 public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW,
36 spi::CLOCK_PHASE_LEADING, spi::DATA_RATE_1MHZ> {
37 public:
38 weikai::WeikaiRegister &reg(uint8_t reg, uint8_t channel) override {
40 reg_spi_.channel_ = channel;
41 return reg_spi_;
42 }
43
44 void setup() override;
45 void dump_config() override;
46
47 protected:
49};
50
51} // namespace esphome::weikai_spi
The SPIDevice is what components using the SPI will create.
Definition spi.h:429
The WeikaiComponent class stores the information global to the WeiKai component and provides methods ...
Definition weikai.h:195
WeikaiRegister objects acts as proxies to access remote register independently of the bus type.
Definition weikai.h:137
uint8_t register_
address of the register
Definition weikai.h:184
uint8_t channel_
channel for this register
Definition weikai.h:185
The WeikaiComponentSPI class stores the information to the WeiKai component connected through an SPI ...
Definition weikai_spi.h:36
weikai::WeikaiRegister & reg(uint8_t reg, uint8_t channel) override
Definition weikai_spi.h:38
WeikaiRegisterSPI reg_spi_
init to this component
Definition weikai_spi.h:48
WeikaiRegisterSPI objects acts as proxies to access remote register through an SPI Bus.
Definition weikai_spi.h:19
WeikaiRegisterSPI(weikai::WeikaiComponent *const comp, uint8_t reg, uint8_t channel)
Definition weikai_spi.h:21
void write_reg(uint8_t value) override
uint8_t read_reg() const override
void write_fifo(uint8_t *data, size_t length) override
void read_fifo(uint8_t *data, size_t length) const override
uint16_t length
Definition tt21100.cpp:0
WeiKai component family - classes declaration.