#include <nrf9160dk_nrf52840_reset_on_if5.dtsi>

/ {
	aliases {
		uart4=&uart3;
	};

	chosen {
		zephyr,bt-uart=&lpuart;
        nordic,nus-uart=&uart0;
		
	};
	aux_display: hd44780 {
		compatible = "hit,hd44780";
		columns = <20>;
		rows = <4>;
		mode = <4>;
		register-select-gpios = <&aux_display_gpio_controller 0 (GPIO_ACTIVE_HIGH)>;
		read-write-gpios = <&aux_display_gpio_controller 1 (GPIO_ACTIVE_HIGH)>;
		enable-gpios = <&aux_display_gpio_controller 2 (GPIO_ACTIVE_HIGH)>;
		backlight-gpios = <&aux_display_gpio_controller 3 (GPIO_ACTIVE_HIGH)>;
		data-bus-gpios = <0>, <0>, <0>, <0>, <&aux_display_gpio_controller 4 (GPIO_ACTIVE_HIGH)>, <&aux_display_gpio_controller 5 (GPIO_ACTIVE_HIGH)>, <&aux_display_gpio_controller 6 (GPIO_ACTIVE_HIGH)>, <&aux_display_gpio_controller 7 (GPIO_ACTIVE_HIGH)>;
	};
};

&gpiote {
	interrupts = <49 NRF_DEFAULT_IRQ_PRIORITY>;
};

&uart2 {
	current-speed = <230400>;
	status = "okay";
	/delete-property/ hw-flow-control;

	pinctrl-0 = <&uart2_default_alt>;
	pinctrl-1 = <&uart2_sleep_alt>;
	pinctrl-names = "default", "sleep";
	lpuart: nrf-sw-lpuart {
		compatible = "nordic,nrf-sw-lpuart";
		status = "okay";
		req-pin = <21>; /* <&interface_to_nrf52840 3 0>; */
		rdy-pin = <19>; /* <&interface_to_nrf52840 2 0>; */
	};
};
uart3: &uart3 {
    status = "okay";
	reg = <0xb000 0x1000>;
	current-speed = <115200>;
	pinctrl-0 = <&uart3_default_alt>;
	pinctrl-1 = <&uart3_sleep_alt>;
	pinctrl-names = "default", "sleep";
};

&spi3 {
	status = "disabled";
};

&i2c2 {
	status = "disabled";
};
&uart1 {
	status = "disabled";

};
&spi1 {
	status = "disabled";

};


&i2c1{
	compatible = "nordic,nrf-twim";
	status = "okay";
	clock-frequency = <I2C_BITRATE_STANDARD>;
	#address-cells = <1>;
	#size-cells = <0>;
	pinctrl-0 = < &i2c1_default >;
	pinctrl-1 = < &i2c1_sleep >;
	aux_display_gpio_controller: pcf8574@27 {
		status = "okay";
		compatible = "nxp,pcf8574";
		reg = <0x27>;
		gpio-controller;
		ngpios = <8>;
		#gpio-cells = <2>;
	};
};
&pinctrl {
	uart2_default_alt: uart2_default_alt {
		group1 {
			psels = <NRF_PSEL(UART_TX, 0, 18)>,
				<NRF_PSEL(UART_RX, 0, 17)>;
		};
	};

	uart2_sleep_alt: uart2_sleep_alt {
		group1 {
			psels = <NRF_PSEL(UART_TX, 0, 18)>,
				<NRF_PSEL(UART_RX, 0, 17)>;
			low-power-enable;
		};
	};
	uart3_default_alt: uart3_default_alt {
		group1 {
			psels = <NRF_PSEL(UART_TX, 0, 22)>,
				<NRF_PSEL(UART_RX, 0, 23)>;
		};
	};

	uart3_sleep_alt: uart3_sleep_alt {
		group1 {
			psels = <NRF_PSEL(UART_TX, 0, 22)>,
				<NRF_PSEL(UART_RX, 0, 23)>;
			low-power-enable;
		};
	};
    i2c1_default: i2c1_default {
		group1 {
			psels = <NRF_PSEL(TWIM_SDA, 0, 6)>, <NRF_PSEL(TWIM_SCL, 0, 7)>;
		};
	};

	i2c1_sleep: i2c1_sleep {
		group1 {
			psels = <NRF_PSEL(TWIM_SDA, 0, 6)>,
				   <NRF_PSEL(TWIM_SCL, 0, 7)>;
				
		};
	};
};


&pwm0 {
	status = "disabled";
};
