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

Bidirectional I2S #9909

Draft
wants to merge 25 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
bfa7db1
Initial build of I2SIn.
relic-se Nov 13, 2024
0daaeb4
Enable I2SIn on RP2xxx
relic-se Nov 13, 2024
5feb12f
Merge branch 'adafruit:main' into i2sin
relic-se Dec 18, 2024
805a6b1
Remove `record` method.
relic-se Dec 18, 2024
e30e234
Update audio dma to support independent input dma.
relic-se Dec 18, 2024
f1e6f01
Fix pointer issue with dma setup.
relic-se Dec 18, 2024
9a0d1c2
Only reset buffer if output is enabled.
relic-se Dec 18, 2024
d0e2b01
Rename `last_record` to `last_index`.
relic-se Dec 18, 2024
76ac311
Handle dma input write destination.
relic-se Dec 18, 2024
55d3252
Send bit width to start PIO program on `reset_buffer`.
relic-se Dec 18, 2024
be48374
Fix errors within PIO program.
relic-se Dec 21, 2024
3c97fd8
Run background tasks while waiting for next buffer.
relic-se Dec 21, 2024
15384bc
Add bidirectional I2S class.
relic-se Dec 23, 2024
dc6e67e
Start input dma channel before output dma channel to allow blocks to …
relic-se Dec 23, 2024
ececb9c
Remove bug comment.
relic-se Dec 23, 2024
3d1a16d
Merge branch 'adafruit:main' into i2sin
relic-se Dec 23, 2024
1e9d455
Fix formatting errors.
relic-se Dec 23, 2024
c6bdd36
Fix input playback example.
relic-se Dec 23, 2024
05c719f
Add empty files within other port families to fix builds.
relic-se Dec 23, 2024
7c6f010
Add record method.
relic-se Dec 23, 2024
c04489c
Merge branch 'adafruit:main' into i2sin
relic-se Jan 18, 2025
c8499a5
Support 32-bit pio pin mask.
relic-se Jan 18, 2025
1aaf4f1
Return number of samples recorded.
relic-se Jan 22, 2025
851765e
Improve dma initialization.
relic-se Jan 22, 2025
4b82933
Double-buffering and improved buffer testing.
relic-se Jan 23, 2025
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
32 changes: 30 additions & 2 deletions locale/circuitpython.pot
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ msgstr ""
msgid "%q must be array of type 'h'"
msgstr ""

#: shared-bindings/audiobusio/I2S.c shared-bindings/audiobusio/I2SIn.c
#: shared-bindings/audiobusio/PDMIn.c
msgid "%q must be multiple of 8."
msgstr ""
Expand Down Expand Up @@ -630,6 +631,8 @@ msgstr ""
msgid "Below minimum frame rate"
msgstr ""

#: ports/raspberrypi/common-hal/audiobusio/I2S.c
#: ports/raspberrypi/common-hal/audiobusio/I2SIn.c
#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c
msgid "Bit clock and word select must be sequential GPIO pins"
msgstr ""
Expand All @@ -638,6 +641,10 @@ msgstr ""
msgid "Bitmap size and bits per value must match"
msgstr ""

#: ports/raspberrypi/common-hal/audiobusio/I2S.c
msgid "Bits per sample cannot be greater than input."
msgstr ""

#: supervisor/shared/safe_mode.c
msgid "Boot device must be first (interface #0)."
msgstr ""
Expand Down Expand Up @@ -1435,6 +1442,8 @@ msgstr ""

#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
#: ports/raspberrypi/common-hal/audiobusio/I2S.c
#: ports/raspberrypi/common-hal/audiobusio/I2SIn.c
#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c
#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "No DMA channel found"
Expand Down Expand Up @@ -1467,6 +1476,14 @@ msgstr ""
msgid "No connection: length cannot be determined"
msgstr ""

#: ports/raspberrypi/common-hal/audiobusio/I2S.c
msgid "No data in"
msgstr ""

#: ports/raspberrypi/common-hal/audiobusio/I2S.c
msgid "No data out"
msgstr ""

#: shared-bindings/board/__init__.c
msgid "No default %q bus"
msgstr ""
Expand Down Expand Up @@ -1546,8 +1563,8 @@ msgstr ""
msgid "Not connected"
msgstr ""

#: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c
#: shared-bindings/audiopwmio/PWMAudioOut.c
#: shared-bindings/audiobusio/I2S.c shared-bindings/audiobusio/I2SOut.c
#: shared-bindings/audioio/AudioOut.c shared-bindings/audiopwmio/PWMAudioOut.c
msgid "Not playing"
msgstr ""

Expand Down Expand Up @@ -1904,6 +1921,10 @@ msgstr ""
msgid "SPI re-init"
msgstr ""

#: ports/raspberrypi/common-hal/audiobusio/I2S.c
msgid "Sample rate must match."
msgstr ""

#: shared-bindings/is31fl3741/FrameBuffer.c
msgid "Scale dimensions must divide by 3"
msgstr ""
Expand All @@ -1922,6 +1943,10 @@ msgstr ""
msgid "Server side context cannot have hostname"
msgstr ""

#: ports/raspberrypi/common-hal/audiobusio/I2S.c
msgid "Single channel output not supported."
msgstr ""

#: ports/cxd56/common-hal/camera/Camera.c
msgid "Size not supported"
msgstr ""
Expand Down Expand Up @@ -2024,6 +2049,7 @@ msgstr ""
msgid "Too many channels in sample"
msgstr ""

#: ports/raspberrypi/common-hal/audiobusio/I2S.c
#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c
msgid "Too many channels in sample."
msgstr ""
Expand Down Expand Up @@ -2113,6 +2139,8 @@ msgstr ""

#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
#: ports/raspberrypi/common-hal/audiobusio/I2S.c
#: ports/raspberrypi/common-hal/audiobusio/I2SIn.c
#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c
#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Unable to allocate buffers for signed conversion"
Expand Down
7 changes: 7 additions & 0 deletions ports/atmel-samd/common-hal/audiobusio/I2S.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2024 Cooper Dalrymple
//
// SPDX-License-Identifier: MIT

// Although IS2 is not enabled on this family, this file is still required for the build to pass
11 changes: 11 additions & 0 deletions ports/atmel-samd/common-hal/audiobusio/I2S.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2024 Cooper Dalrymple
//
// SPDX-License-Identifier: MIT

#pragma once

#include "shared-module/audiocore/__init__.h"

// Although IS2 is not enabled on this family, this file is still required for the build to pass
7 changes: 7 additions & 0 deletions ports/atmel-samd/common-hal/audiobusio/I2SIn.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2024 Cooper Dalrymple
//
// SPDX-License-Identifier: MIT

// Although IS2In is not enabled on this family, this file is still required for the build to pass
11 changes: 11 additions & 0 deletions ports/atmel-samd/common-hal/audiobusio/I2SIn.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2024 Cooper Dalrymple
//
// SPDX-License-Identifier: MIT

#pragma once

#include "shared-module/audiocore/__init__.h"

// Although IS2In is not enabled on this family, this file is still required for the build to pass
7 changes: 7 additions & 0 deletions ports/espressif/common-hal/audiobusio/I2S.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2024 Cooper Dalrymple
//
// SPDX-License-Identifier: MIT

// Although IS2 is not enabled on this family, this file is still required for the build to pass
11 changes: 11 additions & 0 deletions ports/espressif/common-hal/audiobusio/I2S.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2024 Cooper Dalrymple
//
// SPDX-License-Identifier: MIT

#pragma once

#include "shared-module/audiocore/__init__.h"

// Although IS2 is not enabled on this family, this file is still required for the build to pass
7 changes: 7 additions & 0 deletions ports/espressif/common-hal/audiobusio/I2SIn.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2024 Cooper Dalrymple
//
// SPDX-License-Identifier: MIT

// Although IS2In is not enabled on this family, this file is still required for the build to pass
11 changes: 11 additions & 0 deletions ports/espressif/common-hal/audiobusio/I2SIn.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2024 Cooper Dalrymple
//
// SPDX-License-Identifier: MIT

#pragma once

#include "shared-module/audiocore/__init__.h"

// Although IS2In is not enabled on this family, this file is still required for the build to pass
7 changes: 7 additions & 0 deletions ports/mimxrt10xx/common-hal/audiobusio/I2S.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2024 Cooper Dalrymple
//
// SPDX-License-Identifier: MIT

// Although IS2 is not enabled on this family, this file is still required for the build to pass
11 changes: 11 additions & 0 deletions ports/mimxrt10xx/common-hal/audiobusio/I2S.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2024 Cooper Dalrymple
//
// SPDX-License-Identifier: MIT

#pragma once

#include "shared-module/audiocore/__init__.h"

// Although IS2 is not enabled on this family, this file is still required for the build to pass
7 changes: 7 additions & 0 deletions ports/mimxrt10xx/common-hal/audiobusio/I2SIn.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2024 Cooper Dalrymple
//
// SPDX-License-Identifier: MIT

// Although IS2In is not enabled on this family, this file is still required for the build to pass
11 changes: 11 additions & 0 deletions ports/mimxrt10xx/common-hal/audiobusio/I2SIn.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2024 Cooper Dalrymple
//
// SPDX-License-Identifier: MIT

#pragma once

#include "shared-module/audiocore/__init__.h"

// Although IS2In is not enabled on this family, this file is still required for the build to pass
7 changes: 7 additions & 0 deletions ports/nordic/common-hal/audiobusio/I2S.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2024 Cooper Dalrymple
//
// SPDX-License-Identifier: MIT

// Although IS2 is not enabled on this family, this file is still required for the build to pass
11 changes: 11 additions & 0 deletions ports/nordic/common-hal/audiobusio/I2S.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2024 Cooper Dalrymple
//
// SPDX-License-Identifier: MIT

#pragma once

#include "shared-module/audiocore/__init__.h"

// Although IS2 is not enabled on this family, this file is still required for the build to pass
7 changes: 7 additions & 0 deletions ports/nordic/common-hal/audiobusio/I2SIn.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2024 Cooper Dalrymple
//
// SPDX-License-Identifier: MIT

// Although IS2In is not enabled on this family, this file is still required for the build to pass
11 changes: 11 additions & 0 deletions ports/nordic/common-hal/audiobusio/I2SIn.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2024 Cooper Dalrymple
//
// SPDX-License-Identifier: MIT

#pragma once

#include "shared-module/audiocore/__init__.h"

// Although IS2In is not enabled on this family, this file is still required for the build to pass
Loading