File tree Expand file tree Collapse file tree 5 files changed +56
-4
lines changed
samples/sid_end_device/snippets/spi_nrfx Expand file tree Collapse file tree 5 files changed +56
-4
lines changed Original file line number Diff line number Diff line change @@ -188,7 +188,13 @@ config SIDEWALK_CRYPTO_PSA_KEY_STORAGE
188188 it must be enabled in every subsequent build.
189189 Otherwise, the keys will not be found and Sidewalk will not start.
190190
191- if SIDEWALK_SPI_BUS
191+ config SIDEWALK_SPI_BUS_NRFX
192+ bool "Use nrfx spi bus"
193+ depends on SOC_NRF52840
194+ help
195+ Use nrfx spi bus for Sidewalk spi bus.
196+
197+ if SIDEWALK_SPI_BUS_NRFX
192198
193199choice SIDEWALK_NRFX_SPI_INSTANCE_ID
194200 prompt "Instance of the NRX SPI driver"
@@ -219,7 +225,7 @@ config SIDEWALK_NRFX_SPI_ID
219225 default 1 if SIDEWALK_NRFX_SPI1
220226 default 2
221227
222- endif # SIDEWALK_SPI_BUS
228+ endif # SIDEWALK_SPI_BUS_NRFX
223229
224230config SIDEWALK_USE_PREBUILTS
225231 bool "Use prebuilt Sidewalk libraries"
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) 2024 Nordic Semiconductor ASA
3+ *
4+ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+ */
6+
7+ &spi2 {
8+ status = "disabled";
9+ };
10+
11+ /{
12+ nrfx_spi_gpios{
13+ compatible = "gpio-keys";
14+ nrfx_spi_sck: sck {
15+ gpios = <&gpio1 0xF GPIO_ACTIVE_HIGH>;
16+ label = "spi_sck";
17+ };
18+ nrfx_spi_miso: miso {
19+ gpios = <&gpio1 0xE GPIO_ACTIVE_HIGH>;
20+ label = "spi_miso";
21+ };
22+ nrfx_spi_mosi: mosi {
23+ gpios = <&gpio1 0xD GPIO_ACTIVE_HIGH>;
24+ label = "spi_mosi";
25+ };
26+ nrfx_spi_cs: cs {
27+ gpios = <&gpio1 0x8 GPIO_ACTIVE_LOW>;
28+ label = "spi_cs";
29+ };
30+ };
31+ };
Original file line number Diff line number Diff line change 1+ name : spi_nrfx
2+ append :
3+ EXTRA_CONF_FILE : spi_nrfx.conf
4+
5+ boards :
6+ nrf52840dk/nrf52840 :
7+ append :
8+ EXTRA_DTC_OVERLAY_FILE : boards/nrf52840dk_nrf52840.overlay
Original file line number Diff line number Diff line change 1+ #
2+ # Copyright (c) 2024 Nordic Semiconductor ASA
3+ #
4+ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+ #
6+
7+ CONFIG_SIDEWALK_SPI_BUS_NRFX=y
Original file line number Diff line number Diff line change @@ -63,11 +63,11 @@ zephyr_library_sources_ifdef(CONFIG_SIDEWALK_SW_INTERRUPTS sid_sw_interrupts.c)
6363
6464zephyr_library_sources_ifdef(CONFIG_SIDEWALK_DELAY sid_delay.c)
6565
66- if (CONFIG_SOC_NRF52840 )
66+ if (CONFIG_SIDEWALK_SPI_BUS_NRFX )
6767zephyr_library_sources_ifdef(CONFIG_SIDEWALK_SPI_BUS sid_pal_serial_bus_nrfx_spi.c)
6868else ()
6969zephyr_library_sources_ifdef(CONFIG_SIDEWALK_SPI_BUS sid_pal_serial_bus_spi.c)
70- endif () # CONFIG_SOC_NRF52840
70+ endif () # CONFIG_SIDEWALK_SPI_BUS_NRFX
7171
7272zephyr_library_sources_ifdef(CONFIG_SIDEWALK sid_common.c)
7373
You can’t perform that action at this time.
0 commit comments