ESPHome
2025.9.0-dev
Loading...
Searching...
No Matches
esphome
components
spi_device
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
6
namespace
esphome
{
7
namespace
spi_device {
8
9
static
const
char
*
const
TAG =
"spi_device"
;
10
11
void
SPIDeviceComponent::setup
() { this->
spi_setup
(); }
12
13
void
SPIDeviceComponent::dump_config
() {
14
ESP_LOGCONFIG(TAG,
"SPIDevice"
);
15
LOG_PIN(
" CS pin: "
, this->
cs_
);
16
ESP_LOGCONFIG(TAG,
" Mode: %d"
, this->
mode_
);
17
if
(this->
data_rate_
< 1000000) {
18
ESP_LOGCONFIG(TAG,
" Data rate: %"
PRId32
"kHz"
, this->
data_rate_
/ 1000);
19
}
else
{
20
ESP_LOGCONFIG(TAG,
" Data rate: %"
PRId32
"MHz"
, this->
data_rate_
/ 1000000);
21
}
22
}
23
24
float
SPIDeviceComponent::get_setup_priority
()
const
{
return
setup_priority::DATA
; }
25
26
}
// namespace spi_device
27
}
// namespace esphome
esphome::spi::SPIClient::cs_
GPIOPin * cs_
Definition
spi.h:412
esphome::spi::SPIClient::data_rate_
uint32_t data_rate_
Definition
spi.h:410
esphome::spi::SPIClient::mode_
SPIMode mode_
Definition
spi.h:409
esphome::spi::SPIDevice< spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_HIGH, spi::CLOCK_PHASE_TRAILING, spi::DATA_RATE_1MHZ >::spi_setup
void spi_setup() override
Definition
spi.h:436
esphome::spi_device::SPIDeviceComponent::setup
void setup() override
Definition
spi_device.cpp:11
esphome::spi_device::SPIDeviceComponent::dump_config
void dump_config() override
Definition
spi_device.cpp:13
esphome::spi_device::SPIDeviceComponent::get_setup_priority
float get_setup_priority() const override
Definition
spi_device.cpp:24
hal.h
log.h
esphome::setup_priority::DATA
const float DATA
For components that import data from directly connected sensors like DHT.
Definition
component.cpp:50
esphome
Providing packet encoding functions for exchanging data with a remote host.
Definition
a01nyub.cpp:7
spi_device.h
Generated by
1.12.0