File tree Expand file tree Collapse file tree 4 files changed +12
-9
lines changed Expand file tree Collapse file tree 4 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ void setup(void) {
43
43
config_in.pin_bck = 15 ;
44
44
config_in.pin_data = 16 ;
45
45
// config_in.fixed_mclk = sample_rate * 256
46
- // config_in.pin_mck = 2
46
+ // config_in.pin_mck = 3
47
47
48
48
in.begin (config_in);
49
49
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ void setup(void) {
32
32
config.pin_data = 16 ;
33
33
config.pin_data_rx = 17 ;
34
34
// config.fixed_mclk = sample_rate * 256;
35
- // config.pin_mck = 2 ; // must be 0,1 or 2 - only for ESP_IDF_VERSION_MAJOR >= 4
35
+ // config.pin_mck = 3 ; // must be 0,1 or 3 - only for ESP_IDF_VERSION_MAJOR >= 4
36
36
i2s.begin (config);
37
37
38
38
Serial.println (" I2S started..." );
Original file line number Diff line number Diff line change @@ -72,10 +72,14 @@ class I2SConfig : public AudioBaseInfo {
72
72
I2SFormat i2s_format = I2S_STD_FORMAT;
73
73
74
74
#ifdef ESP32
75
+ int buffer_count = I2S_BUFFER_COUNT;
76
+ int buffer_size = I2S_BUFFER_SIZE;
77
+
75
78
bool is_digital = true ; // e.g. the ESP32 supports analog input or output
76
79
bool auto_clear;
77
80
bool use_apll = I2S_USE_APLL;
78
81
uint32_t fixed_mclk = 0 ;
82
+
79
83
#if ESP_IDF_VERSION_MAJOR >= 4
80
84
int pin_mck = -1 ;
81
85
#endif
@@ -90,14 +94,16 @@ class I2SConfig : public AudioBaseInfo {
90
94
LOGI (" number of channels: %d" , channels);
91
95
LOGI (" i2s_format: %s" , i2s_formats[i2s_format]);
92
96
#ifdef ESP32
93
- LOGI (" I2S_AUTO_CLEAR=%d" ,auto_clear);
94
-
97
+ LOGI (" auto_clear:%d" ,auto_clear);
95
98
if (use_apll) {
96
99
LOGI (" use_apll: %s" , use_apll ? " true" : " false" );
97
100
}
98
101
if (fixed_mclk){
99
102
LOGI (" fixed_mclk: %d" , fixed_mclk);
100
103
}
104
+ LOGI (" buffer_count:%d" ,buffer_count);
105
+ LOGI (" buffer_size:%d" ,buffer_size);
106
+
101
107
#endif
102
108
103
109
LOGI (" pin_bck: %d" , pin_bck);
Original file line number Diff line number Diff line change @@ -136,18 +136,15 @@ class I2SBase {
136
136
this ->i2s_num = (i2s_port_t ) cfg.port_no ;
137
137
setChannels (cfg.channels );
138
138
139
- LOGI (" I2S_BUFFER_COUNT=%d" ,I2S_BUFFER_COUNT);
140
- LOGI (" I2S_BUFFER_SIZE=%d" ,I2S_BUFFER_SIZE);
141
-
142
139
i2s_config_t i2s_config_new = {
143
140
.mode = toMode (cfg),
144
141
.sample_rate = (eps32_i2s_sample_rate_type)cfg.sample_rate ,
145
142
.bits_per_sample = (i2s_bits_per_sample_t ) cfg.bits_per_sample ,
146
143
.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT,
147
144
.communication_format = toCommFormat (cfg.i2s_format ),
148
145
.intr_alloc_flags = 0 , // default interrupt priority
149
- .dma_buf_count = I2S_BUFFER_COUNT ,
150
- .dma_buf_len = I2S_BUFFER_SIZE ,
146
+ .dma_buf_count = cfg. buffer_count ,
147
+ .dma_buf_len = cfg. buffer_size ,
151
148
.use_apll = (bool ) cfg.use_apll ,
152
149
.tx_desc_auto_clear = cfg.auto_clear ,
153
150
.fixed_mclk = (int ) (cfg.fixed_mclk >0 ? cfg.fixed_mclk : 0 )
You can’t perform that action at this time.
0 commit comments