esp32-audio-player 0.1.0
Audio player engine for ESP32
Loading...
Searching...
No Matches
i2s_sink.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
21#pragma once
22
23#include "audio_player/sink.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
46
47#define AUDIO_I2S_CONFIG_DEFAULT() \
48 { \
49 .port = 0, .bck_gpio = -1, .ws_gpio = -1, .dout_gpio = -1, .mclk_gpio = -1, .mclk_multiple = 0, \
50 .mute_gpio = -1, .mute_active_level = 0, .amp_enable_gpio = -1, .max_sample_rate = 0, \
51 .accept_dop = false, .fifo_ms = 200, .feeder_core = 1, .feeder_priority = 19, .dac_name = NULL, \
52 }
53
56audio_sink_t *audio_i2s_sink_create(const audio_i2s_config_t *cfg);
59void audio_i2s_sink_destroy(audio_sink_t *sink);
60
61#ifdef __cplusplus
62}
63#endif
void audio_i2s_sink_destroy(audio_sink_t *sink)
Stops the feeder task and frees the sink.
audio_sink_t * audio_i2s_sink_create(const audio_i2s_config_t *cfg)
Create the sink.
Audio output interface.
Definition i2s_sink.h:29
int amp_enable_gpio
amplifier enable, high while the output is open, -1 = none
Definition i2s_sink.h:38
int mute_gpio
DAC soft-mute input (PCM5102A XSMT), -1 = none.
Definition i2s_sink.h:36
int port
I2S controller number (0 or 1)
Definition i2s_sink.h:30
const char * dac_name
shown by describe(), NULL = "I2S"
Definition i2s_sink.h:44
int dout_gpio
data to the DAC (DIN)
Definition i2s_sink.h:33
uint8_t mute_active_level
level of mute_gpio while muted (PCM5102A XSMT: 0)
Definition i2s_sink.h:37
uint16_t fifo_ms
FIFO in front of the DMA at the highest rate, 0 = 200.
Definition i2s_sink.h:41
int mclk_gpio
master clock to the DAC, -1 when the DAC derives it from BCK
Definition i2s_sink.h:34
int8_t feeder_core
core of the feeder task, -1 = any
Definition i2s_sink.h:42
bool accept_dop
pass DoP (DSD) frames to the DAC
Definition i2s_sink.h:40
uint32_t max_sample_rate
highest rate the DAC takes, 0 = 192000
Definition i2s_sink.h:39
int bck_gpio
bit clock (BCK, SCK on some boards)
Definition i2s_sink.h:31
uint16_t mclk_multiple
MCLK / sample rate; 0 = 256 (128 above 96 kHz)
Definition i2s_sink.h:35
uint8_t feeder_priority
FreeRTOS priority, above the audio task.
Definition i2s_sink.h:43
int ws_gpio
word select (LRCK, LCK)
Definition i2s_sink.h:32