ESPHome  2024.3.2
spi_device.cpp
Go to the documentation of this file.
1 #include "spi_device.h"
2 #include "esphome/core/log.h"
3 #include "esphome/core/hal.h"
4 
5 namespace esphome {
6 namespace spi_device {
7 
8 static const char *const TAG = "spi_device";
9 
11  ESP_LOGD(TAG, "Setting up SPIDevice...");
12  this->spi_setup();
13  ESP_LOGCONFIG(TAG, "SPIDevice started!");
14 }
15 
17  ESP_LOGCONFIG(TAG, "SPIDevice");
18  LOG_PIN(" CS pin: ", this->cs_);
19  ESP_LOGCONFIG(TAG, " Mode: %d", this->mode_);
20  if (this->data_rate_ < 1000000) {
21  ESP_LOGCONFIG(TAG, " Data rate: %dkHz", this->data_rate_ / 1000);
22  } else {
23  ESP_LOGCONFIG(TAG, " Data rate: %dMHz", this->data_rate_ / 1000000);
24  }
25 }
26 
28 
29 } // namespace spi_device
30 } // namespace esphome
const float DATA
For components that import data from directly connected sensors like DHT.
Definition: component.cpp:19
GPIOPin * cs_
Definition: spi.h:395
uint32_t data_rate_
Definition: spi.h:393
float get_setup_priority() const override
Definition: spi_device.cpp:27
This is a workaround until we can figure out a way to get the tflite-micro idf component code availab...
Definition: a01nyub.cpp:7