Skip to content

Commit

Permalink
tests: drivers: mspi: make MSPI API test more generic
Browse files Browse the repository at this point in the history
Add ifdefs to make MSPI API test more generic.

Signed-off-by: Jakub Zymelka <[email protected]>
  • Loading branch information
jaz1-nordic committed Nov 25, 2024
1 parent c36b3c0 commit da77127
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/drivers/mspi/api/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,17 @@ static struct mspi_dev_cfg device_cfg[] = {
DT_FOREACH_CHILD_STATUS_OKAY_SEP(MSPI_BUS_NODE, MSPI_DEVICE_CONFIG_DT, (,))
};

#if CONFIG_MSPI_XIP
static struct mspi_xip_cfg xip_cfg[] = {
DT_FOREACH_CHILD_STATUS_OKAY_SEP(MSPI_BUS_NODE, MSPI_XIP_CONFIG_DT, (,))
};
#endif

#if CONFIG_MSPI_SCRAMBLE
static struct mspi_scramble_cfg scramble_cfg[] = {
DT_FOREACH_CHILD_STATUS_OKAY_SEP(MSPI_BUS_NODE, MSPI_SCRAMBLE_CONFIG_DT, (,))
};
#endif

ZTEST(mspi_api, test_mspi_api)
{
Expand Down Expand Up @@ -102,9 +106,11 @@ ZTEST(mspi_api, test_mspi_api)
zassert_equal(ret, 0, "mspi_timing_config failed.");
#endif

#if CONFIG_MSPI_ASYNC
ret = mspi_register_callback(mspi_bus, &dev_id[dev_idx],
MSPI_BUS_XFER_COMPLETE, NULL, NULL);
zassert_equal(ret, 0, "mspi_register_callback failed.");
#endif

ret = mspi_get_channel_status(mspi_bus, 0);
zassert_equal(ret, 0, "mspi_get_channel_status failed.");
Expand Down

0 comments on commit da77127

Please sign in to comment.