Skip to content

Commit 67f58c1

Browse files
committed
tests: spi: Add overlay for frdm_mcxa156 dual test
Add an overlay to the spi_controller_peripheral test for the frdm_mcxa156. Since this IP has multiple CS, need to introduce a way to configure the correct CS to the test; just going to use zephyr,user for now instead of refactoring to be less nordic-specific, keeping the usage optional. Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
1 parent 7e209ca commit 67f58c1

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright 2025 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <lpspi1_header.overlay>
8+
9+
/ {
10+
zephyr,user {
11+
peripheral-cs = <1>;
12+
};
13+
};
14+
15+
&lpspi0 {
16+
dut_spi_dt: test-spi-dev@0 {
17+
compatible = "vnd,spi-device";
18+
reg = <0>;
19+
spi-max-frequency = <10000000>;
20+
};
21+
transfer-delay = <100>;
22+
sck-pcs-delay = <10>;
23+
pcs-sck-delay = <10>;
24+
/* lower the master interrupt priority so slave can interrupt */
25+
interrupts = <28 1>;
26+
};
27+
28+
dut_spis: &lpspi1 {};

tests/drivers/spi/spi_controller_peripheral/src/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
static struct spi_dt_spec spim = SPI_DT_SPEC_GET(DT_NODELABEL(dut_spi_dt), SPIM_OP, 0);
2929
static const struct device *spis_dev = DEVICE_DT_GET(DT_NODELABEL(dut_spis));
3030
static const struct spi_config spis_config = {
31-
.operation = SPIS_OP
31+
.operation = SPIS_OP,
32+
.slave = DT_PROP_OR(DT_PATH(zephyr_user), peripheral_cs, 0),
3233
};
3334

3435
static struct k_poll_signal async_sig = K_POLL_SIGNAL_INITIALIZER(async_sig);

0 commit comments

Comments
 (0)