Commit cd9d2db8 authored by Gaël PORTAY's avatar Gaël PORTAY Committed by Carles Cufi
Browse files

boards: heltec_wifi_lora32_v2: enable lora

This enables the support for the Semtech SX1276 chip on board (see the
pinout[1] and schematic[2] documents).

The chip is connected to SPI as follow:

| PIN  | GPIO   |
| ---- | -------|
| CS#  | GPIO18 |
| CLK  | GPIO5  |
| MOSI | GPIO27 |
| MISO | GPIO19 |
| RST# | GPIO14 |

Additionally, the LoRa DIO PINs are connected as follow:

| PIN  | GPIO   |
| ---- | -------|
| DIO0 | GPIO26 |
| DIO1 | GPIO35 |
| DIO2 | GPIO34 |

_Note_: The first three DIO PINs are connected to the ESP32 MCU only.

[1]: https://resource.heltec.cn/download/WiFi_LoRa_32/WIFI_LoRa_32_V2.1.pdf
[2]: https://resource.heltec.cn/download/WiFi_LoRa_32/V2/WIFI_LoRa_32_V2(868-915).PDF



Signed-off-by: default avatarGaël PORTAY <gael.portay@gmail.com>
parent ac76c27a
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -20,6 +20,17 @@
		};
	};

	spim3_default: spim3_default {
		group1 {
			pinmux = <SPIM3_MISO_GPIO19>,
				 <SPIM3_SCLK_GPIO5>;
		};
		group2 {
			pinmux = <SPIM3_MOSI_GPIO27>;
			output-low;
		};
	};

	i2c0_default: i2c0_default {
		group1 {
			pinmux = <I2C0_SDA_GPIO4>,
+24 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
		led0 = &led0;
		sw0 = &button0;
		watchdog0 = &wdt0;
		lora0 = &lora0;
	};

	leds {
@@ -56,7 +57,6 @@
	};
};


&cpu0 {
	clock-frequency = <ESP32_CLK_CPU_240M>;
};
@@ -89,6 +89,29 @@
	pinctrl-names = "default";
};

&spi3 {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";
	pinctrl-0 = <&spim3_default>;
	pinctrl-names = "default";
	cs-gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
	lora0: lora@0 {
		compatible = "semtech,sx1276";
		reg = <0>;
		reset-gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
		dio-gpios =
			/* SX1276 D0 -> GPIO26 */
			<&gpio0 26 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>,
			/* SX1276 D1 -> GPIO35 */
			<&gpio1 3 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>,
			/* SX1276 D1 -> GPIO34 */
			<&gpio1 2 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>;
		spi-max-frequency = <1000000>;
		power-amplifier-output = "pa-boost";
	};
};

&flash0 {
	status = "okay";
	partitions {