Commit 8b6c2b1e authored by Adam Kondraciuk's avatar Adam Kondraciuk Committed by Benjamin Cabé
Browse files

tests: drivers: i2s: Align tests to TDM peripheral



Some of nRF54's has TDM peripheral instead of I2S.

Signed-off-by: default avatarAdam Kondraciuk <adam.kondraciuk@nordicsemi.no>
parent 5676c65e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ supported:
  - counter
  - gpio
  - i2c
  - i2s
  - pwm
  - retained_mem
  - spi
+1 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ supported:
  - dmic
  - gpio
  - i2c
  - i2s
  - pwm
  - spi
  - watchdog
+3 −3
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ config I2S_TEST_SEPARATE_DEVICES

config I2S_TEST_USE_I2S_DIR_BOTH
	bool "Use I2S_DIR_BOTH value to perform RX/TX transfers"
	default y if DT_HAS_NORDIC_NRF_I2S_ENABLED
	default y if DT_HAS_NORDIC_NRF_I2S_ENABLED || DT_HAS_NORDIC_NRF_TDM_ENABLED
	help
	  Use the I2S_DIR_BOTH enumeration value to trigger commands in test
	  cases involving both reception and transmission. Use of this option
@@ -24,7 +24,7 @@ config I2S_TEST_USE_I2S_DIR_BOTH

config I2S_TEST_USE_GPIO_LOOPBACK
	bool "Use GPIO loopback"
	default y if DT_HAS_NORDIC_NRF_I2S_ENABLED
	default y if DT_HAS_NORDIC_NRF_I2S_ENABLED || DT_HAS_NORDIC_NRF_TDM_ENABLED
	help
	  Use wiring between the data-out and data-in pins for looping back
	  data. This option is intended to be used for devices that do not
@@ -32,7 +32,7 @@ config I2S_TEST_USE_GPIO_LOOPBACK

config I2S_TEST_ALLOWED_DATA_OFFSET
	int "Allowed offset in received data"
	default 2 if DT_HAS_NORDIC_NRF_I2S_ENABLED
	default 2 if DT_HAS_NORDIC_NRF_I2S_ENABLED || DT_HAS_NORDIC_NRF_TDM_ENABLED
	default 0
	help
	  Maximum allowed offset between sent and received samples. Non-zero
+31 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2024 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: Apache-2.0
 */

/* i2s-node0 is the transmitter/receiver */

/ {
	aliases {
		i2s-node0 = &tdm130;
	};
};

&pinctrl {
	tdm130_default_alt: tdm130_default_alt {
		group1 {
			psels = <NRF_PSEL(TDM_SCK_M, 1, 3)>,
				<NRF_PSEL(TDM_FSYNC_M, 1, 6)>,
				<NRF_PSEL(TDM_SDOUT, 1, 4)>,
				<NRF_PSEL(TDM_SDIN, 1, 5)>;
		};
	};
};

&tdm130 {
	status = "okay";
	pinctrl-0 = <&tdm130_default_alt>;
	pinctrl-names = "default";
	memory-regions = <&cpuapp_dma_region>;
};
+30 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2024 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: Apache-2.0
 */

/* i2s-node0 is the transmitter/receiver */

/ {
	aliases {
		i2s-node0 = &tdm;
	};
};

&pinctrl {
	tdm_default_alt: tdm_default_alt {
		group1 {
			psels = <NRF_PSEL(TDM_SCK_M, 1, 3)>,
				<NRF_PSEL(TDM_FSYNC_M, 1, 6)>,
				<NRF_PSEL(TDM_SDOUT, 1, 14)>,
				<NRF_PSEL(TDM_SDIN, 1, 15)>;
		};
	};
};

&tdm {
	status = "okay";
	pinctrl-0 = <&tdm_default_alt>;
	pinctrl-names = "default";
};
Loading