/*
 * Copyright (c) 2020 Nordic Semiconductor ASA
 * Copyright (c) 2017 Linaro Limited
 *
 * SPDX-License-Identifier: Apache-2.0
 */
/ {
	model = "Nordic nRF21540 DK NRF52840";
	compatible = "nordic,nrf21540-dk-nrf52840";

	leds {
		compatible = "gpio-leds";
		led0: led_0 {
			gpios = <&gpio0 28 GPIO_ACTIVE_LOW>;
			label = "Green LED 0";
		};
		led1: led_1 {
			gpios = <&gpio0 29 GPIO_ACTIVE_LOW>;
			label = "Green LED 1";
		};		
	};
	 
	nrf_radio_fem: nrf21540_fem {
		compatible = "nordic,nrf21540-fem";
		tx-en-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
		rx-en-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
		pdn-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
		ant-sel-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
		mode-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
		spi-if = <&nrf_radio_fem_spi>;
	};	
};

 
fem_spi: &spi3 {
	status = "okay";
	sck-pin = <32>;
	miso-pin = <25>;
	mosi-pin = <24>;
	cs-gpios = <&gpio0 26 GPIO_ACTIVE_LOW>;

	nrf_radio_fem_spi: nrf21540_fem_spi@0 {
		compatible = "nordic,nrf21540-fem-spi";
		status = "okay";
		reg = <0>;
		label = "FEM_SPI_IF";
		spi-max-frequency = <8000000>;
	};
};

 
// &radio {
// 	fem = <&nrf_radio_fem>;
// };

&uart0 {
	compatible = "nordic,nrf-uarte";
	status = "okay";
	current-speed = <115200>;
	tx-pin = <4>;
	rx-pin = <5>;
	rx-pull-up;
	//rts-pin = <6>;
	//cts-pin = <7>;
	cts-pull-up;
};


