raspberrypi / pico-playground

BSD 3-Clause "New" or "Revised" License
438 stars 92 forks source link

audio/sine_wave/CMakeLists.txt wrong I2S pins #27

Open Gustavomurta opened 2 years ago

Gustavomurta commented 2 years ago

I think it is impossible to test this I2S audio application with these pins configurations:

_https://github.com/raspberrypi/pico-playground/tree/master/audio/sine_wave_

audio/sine_wave/CMakeLists.txt

            USE_AUDIO_I2S=1
#            PICO_AUDIO_I2S_DATA_PIN=22   - is acessible 
#            PICO_AUDIO_I2S_CLOCK_PIN_BASE=23 - not acessible 

/audio/sine_wave/sine_wave.c

#if PICO_ON_DEVICE
#include "pico/binary_info.h"
bi_decl(bi_3pins_with_names(PICO_AUDIO_I2S_DATA_PIN, "I2S DIN", PICO_AUDIO_I2S_CLOCK_PIN_BASE, "I2S BCK", PICO_AUDIO_I2S_CLOCK_PIN_BASE+1, "I2S LRCK"));
#endif

OK = PICO_AUDIO_I2S_DATA_PIN, "I2S DIN" = GPIO22 Not acessible = PICO_AUDIO_I2S_CLOCK_PIN_BASE, "I2S BCK" = GPIO23 Not acessible = PICO_AUDIO_I2S_CLOCK_PIN_BASE+1, "I2S LRCK" = GPIO24

Thanks

Gustavomurta commented 10 months ago

The only way to discover the pins on the Raspberry Pico dedicated to the I2S interface in this project was using an oscilloscope.

Audio output (Stereo) = 375 Hz 3,1 V pp

Gustavomurta commented 10 months ago

image

Gustavomurta commented 10 months ago

Finally, i found:

_src/rp2_common/pico_audio_i2s/include/pico/audioi2s.h

#ifndef PICO_AUDIO_I2S_DATA_PIN
//#warning PICO_AUDIO_I2S_DATA_PIN should be defined when using AUDIO_I2S
#define PICO_AUDIO_I2S_DATA_PIN 28
#endif

#ifndef PICO_AUDIO_I2S_CLOCK_PIN_BASE
//#warning PICO_AUDIO_I2S_CLOCK_PIN_BASE should be defined when using AUDIO_I2S
#define PICO_AUDIO_I2S_CLOCK_PIN_BASE 26
#endif