Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
aliases {
dmic-dev = &pdm20;
};
};

&pinctrl {
pdm20_default_alt: pdm20_default_alt {
group1 {
psels = <NRF_PSEL(PDM_CLK, 1, 14)>,
<NRF_PSEL(PDM_DIN, 1, 12)>;
};
};
};

dmic_dev: &pdm20 {
status = "okay";
pinctrl-0 = <&pdm20_default_alt>;
pinctrl-names = "default";
clock-source = "ACLK";
};

&audio_auxpll {
nordic,frequency = <NRF_AUXPLL_FREQ_DIV_AUDIO_48K>;
status = "okay";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/* Test requires loopbacks:
* - between P1.14 and P1.0,
* - between P1.13 and P1.15.
* For best performance, PDM_CLK shall be on 'Clock pin'.
*/

&pinctrl {
pdm20_default_test: pdm20_default_test {
group1 {
psels = <NRF_PSEL(PDM_CLK, 1, 14)>,
<NRF_PSEL(PDM_DIN, 1, 0)>;
};
};

pdm21_default_test: pdm21_default_test {
group1 {
psels = <NRF_PSEL(PDM_CLK, 1, 13)>,
<NRF_PSEL(PDM_DIN, 1, 15)>;
};
};
};

&pdm20 {
status = "okay";
pinctrl-0 = <&pdm20_default_test>;
pinctrl-names = "default";
clock-source = "PCLK32M";
};

&pdm21 {
status = "okay";
pinctrl-0 = <&pdm21_default_test>;
pinctrl-names = "default";
clock-source = "PCLK32M";
};
1 change: 1 addition & 0 deletions tests/drivers/audio/pdm_instances/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ tests:
- nrf54h20dk/nrf54h20/cpuapp
- nrf54l15dk/nrf54l15/cpuapp
- nrf54lm20dk/nrf54lm20a/cpuapp
- nrf7120pdk/nrf7120/cpuapp
integration_platforms:
- nrf54h20dk/nrf54h20/cpuapp
- nrf54l15dk/nrf54l15/cpuapp
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/
/* Loopback between P0.0 and P1.14 required */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is P0.0 correct? Shouldn't this be P1.0?


/ {
gpio_test {
compatible = "gpio-leds";
pulse_counter: pulse_counter {
gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>;
};
};
};

&pinctrl {
pdm20_default_alt: pdm20_default_alt {
group1 {
psels = <NRF_PSEL(PDM_CLK, 1, 14)>,
<NRF_PSEL(PDM_DIN, 1, 12)>;
};
};
};

pdm_dev: &pdm20 {
status = "okay";
pinctrl-0 = <&pdm20_default_alt>;
pinctrl-names = "default";
clock-source = "PCLK32M";
};

&gpio1 {
status = "okay";
};

&timer00 {
status = "okay";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/
/* Loopback between P0.0 and P1.14 required */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1.0?


/ {
gpio_test {
compatible = "gpio-leds";
pulse_counter: pulse_counter {
gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>;
};
};
};

&pinctrl {
pdm20_default_alt: pdm20_default_alt {
group1 {
psels = <NRF_PSEL(PDM_CLK, 1, 14)>,
<NRF_PSEL(PDM_DIN, 1, 12)>;
};
};
};

pdm_dev: &pdm20 {
status = "okay";
pinctrl-0 = <&pdm20_default_alt>;
pinctrl-names = "default";
clock-source = "ACLK";
};

&audio_auxpll {
nordic,frequency = <NRF_AUXPLL_FREQ_DIV_AUDIO_44K1>;
status = "okay";
};

&gpio1 {
status = "okay";
};

&timer00 {
status = "okay";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/
/* Loopback between P0.0 and P1.14 required */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1.0?


/ {
gpio_test {
compatible = "gpio-leds";
pulse_counter: pulse_counter {
gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>;
};
};
};

&pinctrl {
pdm20_default_alt: pdm20_default_alt {
group1 {
psels = <NRF_PSEL(PDM_CLK, 1, 14)>,
<NRF_PSEL(PDM_DIN, 1, 12)>;
};
};
};

pdm_dev: &pdm20 {
status = "okay";
pinctrl-0 = <&pdm20_default_alt>;
pinctrl-names = "default";
clock-source = "ACLK";
};

&audio_auxpll {
nordic,frequency = <NRF_AUXPLL_FREQ_DIV_AUDIO_48K>;
status = "okay";
};

&gpio1 {
status = "okay";
};

&timer00 {
status = "okay";
};
25 changes: 25 additions & 0 deletions tests/drivers/audio/pdm_loopback/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,28 @@ tests:
extra_args:
- CONFIG_NRFX_TIMER130=y
- CONFIG_TEST_PDM_SAMPLING_TIME=10
drivers.audio.pdm_loopback.nrf7120.1280khz:
platform_allow:
- nrf7120pdk/nrf7120/cpuapp
extra_args:
- CONFIG_NRFX_TIMER00=y
- CONFIG_TEST_PDM_SAMPLING_RATE=16000
- CONFIG_TEST_PDM_EXPECTED_FREQUENCY=1280000
drivers.audio.pdm_loopback.nrf7120.auxpll.44k1hz:
platform_allow:
- nrf7120pdk/nrf7120/cpuapp
extra_args:
- CONFIG_NRFX_TIMER00=y
- CONFIG_TEST_PDM_SAMPLING_RATE=44100
- CONFIG_TEST_PDM_EXPECTED_FREQUENCY=1411200
- CONFIG_CLOCK_CONTROL=y
- DTC_OVERLAY_FILE="boards/nrf7120pdk_nrf7120_cpuapp_audio_auxpll_44k1hz.overlay"
drivers.audio.pdm_loopback.nrf7120.auxpll.48khz:
platform_allow:
- nrf7120pdk/nrf7120/cpuapp
extra_args:
- CONFIG_NRFX_TIMER00=y
- CONFIG_TEST_PDM_SAMPLING_RATE=48000
- CONFIG_TEST_PDM_EXPECTED_FREQUENCY=1536000
- CONFIG_CLOCK_CONTROL=y
- DTC_OVERLAY_FILE="boards/nrf7120pdk_nrf7120_cpuapp_audio_auxpll_48khz.overlay"
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/* Test requires loopbacks:
* - between P1.14 and P1.0,
* For best performance, PDM_CLK shall be on 'Clock pin'.
*/

/ {
aliases {
dmic-dev = &pdm20;
};
};

&pinctrl {
pdm20_default_test: pdm20_default_test {
group1 {
psels = <NRF_PSEL(PDM_CLK, 1, 14)>,
<NRF_PSEL(PDM_DIN, 1, 0)>;
};
};
};

&pdm20 {
status = "okay";
pinctrl-0 = <&pdm20_default_test>;
pinctrl-names = "default";
clock-source = "PCLK32M";
};