Skip to content

Commit

Permalink
[nrf fromlist] tests: drivers: i2s: Add tests at typical audio sample…
Browse files Browse the repository at this point in the history
… rates

Add short transfer test at 8000, 16000, 32000, 44100, 48000, 88200
and 96000 frame clock frequency.

Add KConfigs to skip test cases based on value of sample rate.

Add configuration for nrf5340dk where i2s peripheral is clocked
from ACLK.

Upstream PR #: 85126

Signed-off-by: Sebastian Głąb <[email protected]>
  • Loading branch information
nordic-segl committed Feb 14, 2025
1 parent c8aea90 commit bdf6b20
Show file tree
Hide file tree
Showing 4 changed files with 290 additions and 34 deletions.
42 changes: 42 additions & 0 deletions tests/drivers/i2s/i2s_speed/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,45 @@ config I2S_TEST_ALLOWED_DATA_OFFSET
help
Maximum allowed offset between sent and received samples. Non-zero
value of this option may be needed when GPIO loopback is used.

config I2S_TEST_SKIP_SAMPLERATE_8000
bool "Skip short transfer tests at 8000 samples per socond"
help
When set to 'y', short transfer tests at 8000 samples per second
will be skipped.

config I2S_TEST_SKIP_SAMPLERATE_16000
bool "Skip short transfer tests at 16000 samples per socond"
help
When set to 'y', short transfer tests at 16000 samples per second
will be skipped.

config I2S_TEST_SKIP_SAMPLERATE_32000
bool "Skip short transfer tests at 32000 samples per socond"
help
When set to 'y', short transfer tests at 32000 samples per second
will be skipped.

config I2S_TEST_SKIP_SAMPLERATE_44100
bool "Skip short transfer tests at 44100 samples per socond"
help
When set to 'y', short transfer tests at 44100 samples per second
will be skipped.

config I2S_TEST_SKIP_SAMPLERATE_48000
bool "Skip short transfer tests at 48000 samples per socond"
help
When set to 'y', short transfer tests at 48000 samples per second
will be skipped.

config I2S_TEST_SKIP_SAMPLERATE_88200
bool "Skip short transfer tests at 88200 samples per socond"
help
When set to 'y', short transfer tests at 88200 samples per second
will be skipped.

config I2S_TEST_SKIP_SAMPLERATE_96000
bool "Skip short transfer tests at 96000 samples per socond"
help
When set to 'y', short transfer tests at 96000 samples per second
will be skipped.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* Drive i2s peripheral from ACLK. */

&clock {
hfclkaudio-frequency = <11289600>;
};

&i2s0 {
clock-source = "ACLK";
};
Loading

0 comments on commit bdf6b20

Please sign in to comment.