forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix RP2xxx I2SOut reversed channels #10250
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
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
fdc4abf
uniform swap now
dhalbert 122ea2f
raspberrypi I2SOut: fix flipped stereo channels
dhalbert 1e29c6a
address review
dhalbert 0ddaf75
add README.pio, mostly to force another build
dhalbert 6b99053
Explicate .pio file usage
dhalbert 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,7 @@ | ||
.pio files right now are compiled by hand with pico-sdk/tools/pioasm and inserted into I2SOut.c | ||
|
||
i2s.pio regular pin order, not left_justified | ||
i2s_left.pio regular pin order, left_justified | ||
|
||
i2s_swap.pio swapped pin order, not left_justified | ||
i2s_swap_left.pio swapped pin order, left_justified |
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,25 @@ | ||
; This file is part of the CircuitPython project: https://circuitpython.org | ||
; | ||
; SPDX-FileCopyrightText: Copyright (c) 2025 Dan Halbert for Adafruit Industries | ||
; | ||
; SPDX-License-Identifier: MIT | ||
|
||
.program i2s | ||
.side_set 2 | ||
|
||
; Load the next set of samples | ||
; /--- LRCLK | ||
; |/-- BCLK | ||
; || | ||
pull noblock side 0b11 ; Loads OSR with the next FIFO value or X | ||
mov x osr side 0b11 ; Save the new value in case we need it again | ||
set y 14 side 0b11 | ||
bitloop1: | ||
out pins 1 side 0b10 [2] ; Right channel first | ||
jmp y-- bitloop1 side 0b11 [2] | ||
out pins 1 side 0b00 [2] | ||
set y 14 side 0b01 [2] | ||
bitloop0: | ||
out pins 1 side 0b00 [2] ; Then left channel | ||
jmp y-- bitloop0 side 0b01 [2] | ||
out pins 1 side 0b10 [2] |
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,25 @@ | ||
; This file is part of the CircuitPython project: https://circuitpython.org | ||
; | ||
; SPDX-FileCopyrightText: Copyright (c) 2025 Dan Halbert for Adafruit Industries | ||
; | ||
; SPDX-License-Identifier: MIT | ||
|
||
.program i2s | ||
.side_set 2 | ||
|
||
; Load the next set of samples | ||
; /--- LRCLK | ||
; |/-- BCLK | ||
; || | ||
pull noblock side 0b01 ; Loads OSR with the next FIFO value or X | ||
mov x osr side 0b01 ; Save the new value in case we need it again | ||
set y 14 side 0b01 | ||
bitloop1: | ||
out pins 1 side 0b10 [2] ; Right channel first | ||
jmp y-- bitloop1 side 0b11 [2] | ||
out pins 1 side 0b10 [2] | ||
set y 14 side 0b11 [2] | ||
bitloop0: | ||
out pins 1 side 0b00 [2] ; Then left channel | ||
jmp y-- bitloop0 side 0b01 [2] | ||
out pins 1 side 0b00 [2] |
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,25 @@ | ||
; This file is part of the CircuitPython project: https://circuitpython.org | ||
; | ||
; SPDX-FileCopyrightText: Copyright (c) 2025 Dan Halbert for Adafruit Industries | ||
; | ||
; SPDX-License-Identifier: MIT | ||
|
||
.program i2s | ||
.side_set 2 | ||
|
||
; Load the next set of samples | ||
; /--- BCLK | ||
; |/-- LRCLK | ||
; || | ||
pull noblock side 0b11 ; Loads OSR with the next FIFO value or X | ||
mov x osr side 0b11 ; Save the new value in case we need it again | ||
set y 14 side 0b11 | ||
bitloop1: | ||
out pins 1 side 0b01 [2] ; Right channel first | ||
jmp y-- bitloop1 side 0b11 [2] | ||
out pins 1 side 0b00 [2] | ||
set y 14 side 0b10 [2] | ||
bitloop0: | ||
out pins 1 side 0b00 [2] ; Then left channel | ||
jmp y-- bitloop0 side 0b10 [2] | ||
out pins 1 side 0b01 [2] |
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,25 @@ | ||
; This file is part of the CircuitPython project: https://circuitpython.org | ||
; | ||
; SPDX-FileCopyrightText: Copyright (c) 2025 Dan Halbert for Adafruit Industries | ||
; | ||
; SPDX-License-Identifier: MIT | ||
|
||
.program i2s | ||
.side_set 2 | ||
|
||
; Load the next set of samples | ||
; /--- BCLK | ||
; |/-- LRCLK | ||
; || | ||
pull noblock side 0b10 ; Loads OSR with the next FIFO value or X | ||
mov x osr side 0b10 ; Save the new value in case we need it again | ||
set y 14 side 0b10 | ||
bitloop1: | ||
out pins 1 side 0b01 [2] ; Right channel first | ||
jmp y-- bitloop1 side 0b11 [2] | ||
out pins 1 side 0b01 [2] | ||
set y 14 side 0b11 [2] | ||
bitloop0: | ||
out pins 1 side 0b00 [2] ; Then left channel | ||
jmp y-- bitloop0 side 0b10 [2] | ||
out pins 1 side 0b00 [2] |
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.