1/*
2 * Copyright (c)  2021 Dean Weiten <dmw@weiten.com>
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7
8#include <st/l0/stm32l073Xz.dtsi>
9#include <st/l0/stm32l073r(b-z)tx-pinctrl.dtsi>
10
11&spi2 {
12	/* SX1276 SPI communication */
13	pinctrl-0 = <&spi2_sck_pb13 &spi2_miso_pb14 &spi2_mosi_pb15>;
14	pinctrl-names = "default";
15	cs-gpios = <&gpiob 12 GPIO_ACTIVE_LOW>;
16	status = "okay";
17
18	lora: lora@0 {
19		compatible = "semtech,sx1276";
20		reg = <0>;
21		/* SX1276 nRESET */
22		reset-gpios = <&gpiob 10 GPIO_ACTIVE_LOW>;
23		dio-gpios =
24			/* SX1276 D0 */
25			<&gpiob 11 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>,
26			/* SX1276 D1 */
27			<&gpioc 13 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>,
28			/* SX1276 D2 */
29			<&gpiob 9 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>,
30			/* SX1276 D3 */
31			<&gpiob 4 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>,
32			/* SX1276 D4 */
33			<&gpiob 3 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>,
34			/* SX1276 D5 */
35			<&gpioa 15 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>;
36		spi-max-frequency = <1000000>;
37		power-amplifier-output = "pa-boost";
38	};
39};
40