File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,10 @@ struct SPDIFConfig : public AudioInfo {
110110 int pin_data = SPDIF_DATA_PIN;
111111 int buffer_count = 30 ;
112112 int buffer_size = 384 ;
113+ #if defined(RP2040_HOWER)
114+ int pin_bck = -1 ;
115+ uint32_t sys_clock = 192000 ;
116+ #endif
113117};
114118
115119/* *
@@ -165,7 +169,19 @@ class SPDIFOutput : public AudioStream {
165169 I2SConfig i2s_cfg;
166170 i2s_cfg.sample_rate = sample_rate;
167171 i2s_cfg.channels = cfg.channels ;
168- #ifndef STM32
172+ #if defined(RP2040_HOWER)
173+ if (cfg.sys_clock > 0 ) set_sys_clock_khz (cfg.sys_clock , false );
174+ // RP2040 does not support -1 for no pin
175+ if (cfg.pin_bck >= 0 ) {
176+ i2s_cfg.pin_bck = cfg.pin_bck ;
177+ i2s_cfg.pin_ws = cfg.pin_bck + 1 ;
178+ } else {
179+ LOGE (" pin_bck not defined" );
180+ }
181+ #elif defined(STM32)
182+ // pins are fixed
183+ #else
184+ // default logic for ESP32
169185 i2s_cfg.pin_ws = -1 ;
170186 i2s_cfg.pin_bck = -1 ;
171187 i2s_cfg.pin_data = cfg.pin_data ;
You can’t perform that action at this time.
0 commit comments