/*
 * Copyright (c) 2024 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
 */

/ {
	chosen {
		nordic,nus-uart = &uart20;
	};
	nrf_radio_coex: radio_coex_three_wire {
		status = "okay";
		compatible = "generic-radio-coex-three-wire";
		req-gpios = <&gpio0 1 (GPIO_ACTIVE_HIGH)>;
		pri-dir-gpios = <&gpio0 2 (GPIO_ACTIVE_HIGH)>;
		grant-gpios = <&gpio0 0 (GPIO_ACTIVE_LOW | GPIO_PULL_DOWN)>;
	};
};

&radio {
	coex = <&nrf_radio_coex>;
};

&uart20 {
	status = "okay";
	current-speed = <921600>;
	pinctrl-0 = <&uart1_default_alt>;
	pinctrl-1 = <&uart1_sleep_alt>;
	pinctrl-names = "default", "sleep";

	// zephyr,pm-device-runtime-auto;
};

&pinctrl {
	uart1_default_alt: uart1_default_alt {
		group1 {
			psels = <NRF_PSEL(UART_TX, 1, 4)>;
		};
		group2 {
			psels = <NRF_PSEL(UART_RX, 1, 5)>;
			bias-pull-up;
		};
	};
	/* 如果启用了 CONFIG_PM_DEVICE=y,则需要此配置 */
	uart1_sleep_alt: uart1_sleep_alt {
		group1 {
			psels = <NRF_PSEL(UART_TX, 1, 4)>,
			        <NRF_PSEL(UART_RX, 1, 5)>,
			        <NRF_PSEL(UART_RTS, 1, 6)>,
			        <NRF_PSEL(UART_CTS, 1, 7)>;
			low-power-enable;
		};
	};

	spi21_default_alt: spi21_default_alt {
		group1 {
			psels = <NRF_PSEL(SPIS_SCK, 2, 6)>,
			        <NRF_PSEL(SPIS_MISO, 2, 8)>,
			        <NRF_PSEL(SPIS_MOSI, 2, 9)>,
			        <NRF_PSEL(SPIS_CSN, 2, 10)>;
		};
	};

	input-gpios {
		compatible = "gpio-leds";
		notify_host: notify_host {
			gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
			label = "notify_host";
		};
	};

	spi21_sleep_alt: spi21_sleep_alt {
		group1 {
			psels = <NRF_PSEL(SPIS_SCK, 2, 6)>,
					<NRF_PSEL(SPIS_MOSI, 2, 9)>,
					<NRF_PSEL(SPIS_CSN, 2, 10)>;
			low-power-enable;
		};
		group2 {
			psels = <NRF_PSEL(SPIS_MISO, 2, 8)>;
			low-power-enable;
			bias-pull-down;
		};
	};
};



dut_spis: &spi00 {
	compatible = "nordic,nrf-spis";
	status = "okay";
	def-char = <0x00>;
	pinctrl-0 = <&spi21_default_alt>;
	pinctrl-1 = <&spi21_sleep_alt>;
	pinctrl-names = "default", "sleep";
	/delete-property/rx-delay-supported;
	/delete-property/rx-delay;
	// 对应图纸BLE_WAKE_HOST
	wake-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
};