Skip to content
New issue

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

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

Already on GitHub? # to your account

Bidirectional TDM Support #2843

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

efairbanks
Copy link

@efairbanks efairbanks commented Mar 10, 2025

Adding support for bidirectional TDM support. Sets are on falling BCLK to maintain consistency with other TDM/I2S code here, and TDM implementation assumes that this is I2S-compatible TDM.

Tested all four channels working on AK4619 4i4o codec with the following register settings:

0x01: 0b10101100
0x02: 0b00011100
0x03: 0b00000011

See AK4619 datasheet for more details, though this should work with any I2S-compatible TDM codec.

@efairbanks efairbanks changed the title Bidirectional TDM Support (not working) Bidirectional TDM Support (not working DO NOT MERGE) Mar 10, 2025
@earlephilhower earlephilhower marked this pull request as draft March 10, 2025 17:11
@earlephilhower
Copy link
Owner

Haven't tried it yet, but thanks!

For the pio->h conversion, it looks like you ran an old pioasm executable, hence the missing field in the generated structures. We ship a cli pioasm as part of the tools install here, you'll find it same spot as the other exes like gcc and openocd.

@efairbanks efairbanks changed the title Bidirectional TDM Support (not working DO NOT MERGE) Bidirectional TDM Support Mar 10, 2025
@efairbanks
Copy link
Author

efairbanks commented Mar 10, 2025

Ok @earlephilhower done. This is tested and working on an RP2350 hooked up to an AK4619 codec. Hopefully this is helpful to other folks who want to use codecs like this AsahiKASEI one or those Cirrus Logic codecs that are so popular.

Let me know if there's anything additional I can do to make sure this PR is ready to be merged in, and thanks for the prompt response earlier! I appreciate it.

@earlephilhower earlephilhower marked this pull request as ready for review March 11, 2025 01:10
@earlephilhower
Copy link
Owner

CI failure needs the formatting fixes shown in the diff. If you can run ./tools/restyle.sh it'll reformat things for you automatically.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants