Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added possibility to change DOUT pin. #182

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/AudioOutputI2S.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#endif
#include "AudioOutputI2S.h"

int AudioOutputI2S::DOUT = 22;

AudioOutputI2S::AudioOutputI2S(int port, int output_mode, int dma_buf_count, int use_apll)
{
this->portNo = port;
Expand Down Expand Up @@ -77,12 +79,11 @@ AudioOutputI2S::AudioOutputI2S(int port, int output_mode, int dma_buf_count, int
i2s_set_pin((i2s_port_t)portNo, NULL);
i2s_set_dac_mode(I2S_DAC_CHANNEL_BOTH_EN);
} else {
SetPinout(26, 25, 22);
SetPinout(26, 25, AudioOutputI2S::DOUT);
}
i2s_zero_dma_buffer((i2s_port_t)portNo);
}
#else
(void) dma_buf_count;
(void) use_apll;
if (!i2sOn) {
i2s_begin();
Expand Down
2 changes: 2 additions & 0 deletions src/AudioOutputI2S.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class AudioOutputI2S : public AudioOutput

enum : int { APLL_AUTO = -1, APLL_ENABLE = 1, APLL_DISABLE = 0 };
enum : int { EXTERNAL_I2S = 0, INTERNAL_DAC = 1, INTERNAL_PDM = 2 };

static int DOUT;

protected:
virtual int AdjustI2SRate(int hz) { return hz; }
Expand Down