ESPHome 2025.5.0
Loading...
Searching...
No Matches
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#include <cinttypes>
5
6namespace esphome {
7namespace spi_device {
8
9static const char *const TAG = "spi_device";
10
12 ESP_LOGD(TAG, "Setting up SPIDevice...");
13 this->spi_setup();
14 ESP_LOGCONFIG(TAG, "SPIDevice started!");
15}
16
18 ESP_LOGCONFIG(TAG, "SPIDevice");
19 LOG_PIN(" CS pin: ", this->cs_);
20 ESP_LOGCONFIG(TAG, " Mode: %d", this->mode_);
21 if (this->data_rate_ < 1000000) {
22 ESP_LOGCONFIG(TAG, " Data rate: %" PRId32 "kHz", this->data_rate_ / 1000);
23 } else {
24 ESP_LOGCONFIG(TAG, " Data rate: %" PRId32 "MHz", this->data_rate_ / 1000000);
25 }
26}
27
29
30} // namespace spi_device
31} // namespace esphome
uint32_t data_rate_
Definition spi.h:406
float get_setup_priority() const override
const float DATA
For components that import data from directly connected sensors like DHT.
Definition component.cpp:19
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7