forked from PAWPAW-Mirror/lib_xua
test_i2s_loopback: add testing support for 16bit
This commit is contained in:
@@ -71,7 +71,7 @@ def do_test(
|
|||||||
@pytest.mark.parametrize("i2s_role", ["master", "slave"])
|
@pytest.mark.parametrize("i2s_role", ["master", "slave"])
|
||||||
@pytest.mark.parametrize("pcm_format", ["i2s", "tdm"])
|
@pytest.mark.parametrize("pcm_format", ["i2s", "tdm"])
|
||||||
@pytest.mark.parametrize("channel_count", [2, 8, 16])
|
@pytest.mark.parametrize("channel_count", [2, 8, 16])
|
||||||
@pytest.mark.parametrize("word_length", [32]) # I2S world length in bits
|
@pytest.mark.parametrize("word_length", [16, 32]) # I2S world length in bits
|
||||||
@pytest.mark.parametrize("sample_rate", [48000, 96000, 192000])
|
@pytest.mark.parametrize("sample_rate", [48000, 96000, 192000])
|
||||||
def test_i2s_loopback(
|
def test_i2s_loopback(
|
||||||
i2s_role, pcm_format, channel_count, sample_rate, word_length, test_file, options, capfd
|
i2s_role, pcm_format, channel_count, sample_rate, word_length, test_file, options, capfd
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2016-2022 XMOS LIMITED.
|
// Copyright 2016-2023 XMOS LIMITED.
|
||||||
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
|
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
|
||||||
#include <platform.h>
|
#include <platform.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -92,9 +92,10 @@ clock clk_audio_mclk = on tile[AUDIO_IO_TILE]: XS1_CLKBLK_2; /*
|
|||||||
#define TOTAL_TEST_FRAMES (5 * DEFAULT_FREQ)
|
#define TOTAL_TEST_FRAMES (5 * DEFAULT_FREQ)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SAMPLE(frame_count, channel_num) (((frame_count) << 8) | ((channel_num) & 0xFF))
|
#define SHIFT (16) /* Note, we shift samples up such that we can test down to 16bit I2S */
|
||||||
#define SAMPLE_FRAME_NUM(test_word) ((test_word) >> 8)
|
#define SAMPLE(frame_count, channel_num) ((((frame_count) << 8) | ((channel_num) & 0xFF))<<SHIFT)
|
||||||
#define SAMPLE_CHANNEL_NUM(test_word) ((test_word) & 0xFF)
|
#define SAMPLE_FRAME_NUM(test_word) ((test_word>>SHIFT) >> 8)
|
||||||
|
#define SAMPLE_CHANNEL_NUM(test_word) ((test_word>>SHIFT) & 0xFF)
|
||||||
|
|
||||||
void generator(chanend c_checker, chanend c_out)
|
void generator(chanend c_checker, chanend c_out)
|
||||||
{
|
{
|
||||||
@@ -105,7 +106,6 @@ void generator(chanend c_checker, chanend c_out)
|
|||||||
|
|
||||||
frame_count = 0;
|
frame_count = 0;
|
||||||
|
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
underflow_word = inuint(c_out);
|
underflow_word = inuint(c_out);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user