Skip to content

Commit 8aab268

Browse files
committed
[nrf fromlist] tests: drivers: i2s: Add test with 48kHz sample rate
Add KConfig that defines frame clock frequency used in the test execution. Add test configuration where frame clock frequency is set to 48000 samples per second. Upstream PR #: 85126 Signed-off-by: Sebastian Głąb <[email protected]>
1 parent 7cbe361 commit 8aab268

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

tests/drivers/i2s/i2s_speed/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,10 @@ config I2S_TEST_ALLOWED_DATA_OFFSET
3737
help
3838
Maximum allowed offset between sent and received samples. Non-zero
3939
value of this option may be needed when GPIO loopback is used.
40+
41+
config I2S_TEST_SPEED
42+
int "I2S frame clock frequency"
43+
default 44000
44+
help
45+
Value assigned to the i2s_cfg.frame_clk_freq.
46+
Frame clock (WS) frequency, this is sampling rate used in the test.

tests/drivers/i2s/i2s_speed/src/test_i2s_speed.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static int verify_buf(int16_t *rx_block, int att)
125125
}
126126

127127
#define TIMEOUT 2000
128-
#define FRAME_CLK_FREQ 44000
128+
#define FRAME_CLK_FREQ CONFIG_I2S_TEST_SPEED
129129

130130
static int configure_stream(const struct device *dev_i2s, enum i2s_dir dir)
131131
{

tests/drivers/i2s/i2s_speed/testcase.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ tests:
55
- drivers
66
- i2s
77
filter: not CONFIG_I2S_TEST_USE_GPIO_LOOPBACK
8-
drivers.i2s.speed.gpio_loopback:
8+
drivers.i2s.speed.gpio_loopback.44000:
99
depends_on:
1010
- i2s
1111
- gpio
@@ -16,3 +16,16 @@ tests:
1616
harness: ztest
1717
harness_config:
1818
fixture: gpio_loopback
19+
drivers.i2s.speed.gpio_loopback.48000:
20+
depends_on:
21+
- i2s
22+
- gpio
23+
tags:
24+
- drivers
25+
- i2s
26+
filter: CONFIG_I2S_TEST_USE_GPIO_LOOPBACK
27+
harness: ztest
28+
harness_config:
29+
fixture: gpio_loopback
30+
extra_configs:
31+
- CONFIG_I2S_TEST_SPEED=48000

0 commit comments

Comments
 (0)