Skip to content

Commit 085c77d

Browse files
nordic-seglPerMac
authored andcommitted
samples: zephyr: drivers: spi_bitbang: Run on 54* devices
Add overlys required to run spi_bitbang sample on: - nrf54h20dk/nrf54h20/cpuapp; - nrf54l15dk/nrf54l15/cpuapp; - [email protected]/nrf54lm20a/cpuapp; - [email protected]/nrf54lm20a/cpuapp; - nrf54lv10apdk/nrf54lv10a/cpuapp. Signed-off-by: Sebastian Głąb <[email protected]>
1 parent 4a7d7a3 commit 085c77d

11 files changed

+146
-0
lines changed

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,7 @@
679679
/samples/zephyr/drivers/i2c/rtio_loopback/ @nrfconnect/ncs-low-level-test
680680
/samples/zephyr/drivers/jesd216/ @nrfconnect/ncs-low-level-test
681681
/samples/zephyr/drivers/mbox/ @nrfconnect/ncs-low-level-test
682+
/samples/zephyr/drivers/spi_bitbang/ @nrfconnect/ncs-low-level-test
682683
/samples/zephyr/drivers/spi_flash/ @nrfconnect/ncs-low-level-test
683684
/samples/zephyr/drivers/watchdog/ @nrfconnect/ncs-low-level-test
684685
/samples/zephyr/sensor/accel_polling/ @nrfconnect/ncs-low-level-test
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
cmake_minimum_required(VERSION 3.20.0)
8+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
9+
project(spi_bitbang)
10+
11+
FILE(GLOB app_sources ${ZEPHYR_BASE}/samples/drivers/spi_bitbang/src/*.c)
12+
target_sources(app PRIVATE ${app_sources})
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This sample extends the same-named Zephyr sample to verify it with Nordic development kits.
2+
3+
Source code and basic configuration files can be found in the corresponding folder structure in zephyr/samples/drivers/spi_bitbang.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
spibb0: spibb0 {
9+
compatible = "zephyr,spi-bitbang";
10+
status="okay";
11+
#address-cells = <1>;
12+
#size-cells = <0>;
13+
clk-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
14+
mosi-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
15+
miso-gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
16+
cs-gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
17+
};
18+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
spibb0: spibb0 {
9+
compatible = "zephyr,spi-bitbang";
10+
status="okay";
11+
#address-cells = <1>;
12+
#size-cells = <0>;
13+
clk-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
14+
mosi-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
15+
miso-gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
16+
cs-gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
17+
};
18+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
spibb0: spibb0 {
9+
compatible = "zephyr,spi-bitbang";
10+
status="okay";
11+
#address-cells = <1>;
12+
#size-cells = <0>;
13+
clk-gpios = <&gpio1 18 GPIO_ACTIVE_HIGH>;
14+
mosi-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
15+
miso-gpios = <&gpio1 16 GPIO_ACTIVE_HIGH>;
16+
cs-gpios = <&gpio1 30 GPIO_ACTIVE_LOW>;
17+
};
18+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
spibb0: spibb0 {
9+
compatible = "zephyr,spi-bitbang";
10+
status="okay";
11+
#address-cells = <1>;
12+
#size-cells = <0>;
13+
clk-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
14+
mosi-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
15+
miso-gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
16+
cs-gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
17+
};
18+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
spibb0: spibb0 {
9+
compatible = "zephyr,spi-bitbang";
10+
status="okay";
11+
#address-cells = <1>;
12+
#size-cells = <0>;
13+
clk-gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>;
14+
mosi-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
15+
miso-gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
16+
cs-gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
17+
};
18+
};
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CONFIG_STDOUT_CONSOLE=y
2+
CONFIG_SPI=y
3+
CONFIG_SPI_BITBANG=y
4+
5+
CONFIG_LOG=y
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
sample:
2+
name: SPI Bitbang Driver Sample
3+
tests:
4+
nrf.extended.sample.drivers.spi.bitbang:
5+
tags:
6+
- drivers
7+
- spi
8+
- gpio
9+
- ci_samples_zephyr_drivers_spi_bitbang
10+
platform_allow:
11+
- nrf54h20dk/nrf54h20/cpuapp
12+
- nrf54l15dk/nrf54l15/cpuapp
13+
- [email protected]/nrf54lm20a/cpuapp
14+
- [email protected]/nrf54lm20a/cpuapp
15+
- nrf54lv10apdk/nrf54lv10a/cpuapp
16+
harness: console
17+
harness_config:
18+
fixture: gpio_loopback
19+
type: multi_line
20+
ordered: true
21+
regex:
22+
- "basic_write_9bit_words; ret: 0"
23+
- "wrote 0101 00ff 00a5 0000 0102"
24+
- "9bit_loopback_partial; ret: 0"
25+
- "tx [(]i[)] : 0101 0102"
26+
- "tx [(]ii[)] : 0003 0004 0105"
27+
- "rx [(]ii[)] : 0003 0004 0105"
28+
- "8bit_loopback_partial; ret: 0"
29+
- "tx [(]i[)] : 01 02 03 04 05"
30+
- "rx [(]i[)] : 01 02 03 04 05"

0 commit comments

Comments
 (0)