ESPHome 2026.3.0-dev
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
14 ESP_LOGCONFIG(TAG,
15 "SPIDevice\n"
16 " Mode: %d",
17 this->mode_);
18 LOG_PIN(" CS pin: ", this->cs_);
19 if (this->data_rate_ < 1000000) {
20 ESP_LOGCONFIG(TAG, " Data rate: %" PRId32 "kHz", this->data_rate_ / 1000);
21 } else {
22 ESP_LOGCONFIG(TAG, " Data rate: %" PRId32 "MHz", this->data_rate_ / 1000000);
23 }
24}
25
26} // namespace spi_device
27} // namespace esphome
uint32_t data_rate_
Definition spi.h:410
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7