ESPHome 2026.6.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
7
8static const char *const TAG = "spi_device";
9
11
13 ESP_LOGCONFIG(TAG,
14 "SPIDevice\n"
15 " Mode: %d",
16 this->mode_);
17 LOG_PIN(" CS pin: ", this->cs_);
18 if (this->data_rate_ < 1000000) {
19 ESP_LOGCONFIG(TAG, " Data rate: %" PRId32 "kHz", this->data_rate_ / 1000);
20 } else {
21 ESP_LOGCONFIG(TAG, " Data rate: %" PRId32 "MHz", this->data_rate_ / 1000000);
22 }
23}
24
25} // namespace esphome::spi_device
uint32_t data_rate_
Definition spi.h:412