-
Notifications
You must be signed in to change notification settings - Fork 479
Bi-directional I2S support #2775
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
Merged
earlephilhower
merged 16 commits into
earlephilhower:master
from
relic-se:i2s_bidirectional
Jan 24, 2025
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
d40f328
Initial bi-directional I2S support.
relic-se 1f438a8
Formatting update on pioasm file.
relic-se 70047e2
Added loopback example.
relic-se 0dcda7b
Updated documentation.
relic-se 7dcdad6
Fix `getOverUnderflow` naming.
relic-se 5ff06f4
Revert `getOverUnderflow` naming changes.
relic-se aabb137
Remove python cache file.
relic-se f88dd49
Remove `availableForRead`.
relic-se 2041486
Updated naming convention of OverUnderflow methods.
relic-se 7206295
Update constructor to prevent conflicts with existing code.
relic-se 4466f0e
Avoid ambiguous `setDATA` in bi-directional mode.
relic-se f5c07d2
Use only input buffer manager in `available`.
relic-se 2075949
Fix input checks in `read` and `peek`.
relic-se a57ae1d
Fix erroneous comment.
relic-se f2b8087
Update pio_i2s.pio to pio v1.
relic-se 9b27176
Change pio_i2s.pio back to pio v0.
relic-se File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
I2S bi-directional input and output loopback example | ||
Released to the Public Domain by Cooper Dalrymple | ||
*/ | ||
|
||
#include <I2S.h> | ||
|
||
I2S i2s(INPUT_PULLUP); | ||
|
||
void setup() { | ||
Serial.begin(115200); | ||
|
||
i2s.setDOUT(0); | ||
i2s.setDIN(1); | ||
i2s.setBCLK(2); // Note: LRCLK = BCLK + 1 | ||
i2s.setBitsPerSample(16); | ||
i2s.setFrequency(22050); | ||
// NOTE: The following values are known to work with the Adafruit microphone: | ||
// i2s.setBitsPerSample(32); | ||
// i2s.setFrequency(16000); | ||
i2s.begin(); | ||
|
||
while (1) { | ||
int16_t l, r; | ||
i2s.read16(&l, &r); | ||
i2s.write16(l, r); | ||
// NOTE: Adafruit microphone word size needs to match the BPS above. | ||
// int32_t l, r; | ||
// i2s.read32(&l, &r); | ||
// i2s.write32(l, r); | ||
} | ||
} | ||
|
||
void loop() { | ||
/* Nothing here */ | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.