ESPHome
2025.9.0-dev
Loading...
Searching...
No Matches
esphome
components
i2s_audio
i2s_audio.cpp
Go to the documentation of this file.
1
#include "
i2s_audio.h
"
2
3
#ifdef USE_ESP32
4
5
#include "
esphome/core/log.h
"
6
7
namespace
esphome
{
8
namespace
i2s_audio {
9
10
static
const
char
*
const
TAG =
"i2s_audio"
;
11
12
void
I2SAudioComponent::setup
() {
13
static
i2s_port_t next_port_num = I2S_NUM_0;
14
if
(next_port_num >= SOC_I2S_NUM) {
15
ESP_LOGE(TAG,
"Too many components"
);
16
this->
mark_failed
();
17
return
;
18
}
19
20
this->
port_
= next_port_num;
21
next_port_num = (i2s_port_t) (next_port_num + 1);
22
}
23
24
}
// namespace i2s_audio
25
}
// namespace esphome
26
27
#endif
// USE_ESP32
esphome::Component::mark_failed
virtual void mark_failed()
Mark this component as failed.
Definition
component.cpp:203
esphome::i2s_audio::I2SAudioComponent::port_
i2s_port_t port_
Definition
i2s_audio.h:109
esphome::i2s_audio::I2SAudioComponent::setup
void setup() override
Definition
i2s_audio.cpp:12
i2s_audio.h
log.h
esphome
Providing packet encoding functions for exchanging data with a remote host.
Definition
a01nyub.cpp:7
Generated by
1.12.0