mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-09-14 15:16:40 +00:00
Merge pull request #1983 from rgregg/rak-ethernet
Support for RAK ethernet module
This commit is contained in:
@@ -1,8 +1,21 @@
|
||||
#include <Arduino.h>
|
||||
#include <Wire.h>
|
||||
#include "nrf_gpio.h"
|
||||
|
||||
#include "RAK4631Board.h"
|
||||
|
||||
#ifdef ETHERNET_ENABLED
|
||||
// Drive WB_IO2 HIGH as early as possible using direct register access.
|
||||
// WB_IO2 (P1.02, Arduino pin 34) controls the WisBlock slot power switch.
|
||||
// With POE through RAK13800, this must be enabled before the framework
|
||||
// initializes or the board will brownout from insufficient power delivery.
|
||||
// Priority 102 runs just after SystemInit.
|
||||
static void __attribute__((constructor(102))) rak4631_early_poe_power() {
|
||||
nrf_gpio_cfg_output(NRF_GPIO_PIN_MAP(1, 2)); // WB_IO2 = P1.02
|
||||
nrf_gpio_pin_set(NRF_GPIO_PIN_MAP(1, 2));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef NRF52_POWER_MANAGEMENT
|
||||
// Static configuration for power management
|
||||
// Values set in variant.h defines
|
||||
@@ -36,6 +49,7 @@ void RAK4631Board::begin() {
|
||||
pinMode(PIN_USER_BTN_ANA, INPUT_PULLUP);
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(PIN_BOARD_SDA) && defined(PIN_BOARD_SCL)
|
||||
Wire.setPins(PIN_BOARD_SDA, PIN_BOARD_SCL);
|
||||
#endif
|
||||
|
||||
@@ -53,6 +53,25 @@ build_src_filter = ${rak4631.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<../examples/simple_repeater>
|
||||
|
||||
[env:RAK_4631_repeater_ethernet]
|
||||
extends = rak4631
|
||||
build_flags =
|
||||
${rak4631.build_flags}
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D ADVERT_NAME='"RAK4631 Repeater"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
-D ADMIN_PASSWORD='"password"'
|
||||
-D MAX_NEIGHBOURS=50
|
||||
-D ETHERNET_ENABLED=1
|
||||
; -D MESH_DEBUG=1
|
||||
build_src_filter = ${rak4631.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<../examples/simple_repeater>
|
||||
lib_deps =
|
||||
${rak4631.lib_deps}
|
||||
https://github.com/RAKWireless/RAK13800-W5100S/archive/1.0.2.zip
|
||||
|
||||
[env:RAK_4631_repeater_bridge_rs232_serial1]
|
||||
extends = rak4631
|
||||
build_flags =
|
||||
@@ -115,6 +134,25 @@ build_src_filter = ${rak4631.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<../examples/simple_room_server>
|
||||
|
||||
[env:RAK_4631_room_server_ethernet]
|
||||
extends = rak4631
|
||||
build_flags =
|
||||
${rak4631.build_flags}
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D ADVERT_NAME='"RAK4631 Room Server"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
-D ADMIN_PASSWORD='"password"'
|
||||
-D ROOM_PASSWORD='"hello"'
|
||||
-D ETHERNET_ENABLED=1
|
||||
; -D MESH_DEBUG=1
|
||||
build_src_filter = ${rak4631.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<../examples/simple_room_server>
|
||||
lib_deps =
|
||||
${rak4631.lib_deps}
|
||||
https://github.com/RAKWireless/RAK13800-W5100S/archive/1.0.2.zip
|
||||
|
||||
[env:RAK_4631_companion_radio_usb]
|
||||
extends = rak4631
|
||||
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||
@@ -136,6 +174,35 @@ lib_deps =
|
||||
${rak4631.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
||||
|
||||
[env:RAK_4631_companion_radio_ethernet]
|
||||
extends = rak4631
|
||||
board_build.ldscript = boards/nrf52840_s140_v6.ld
|
||||
board_upload.maximum_size = 712704
|
||||
build_unflags =
|
||||
-D EXTRAFS=1
|
||||
build_flags =
|
||||
${rak4631.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-D PIN_USER_BTN=9
|
||||
-D PIN_USER_BTN_ANA=31
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D ETHERNET_ENABLED=1
|
||||
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
|
||||
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1
|
||||
; -D ETHERNET_DEBUG_LOGGING=1
|
||||
build_src_filter = ${rak4631.build_src_filter}
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
+<helpers/nrf52/SerialEthernetInterface.cpp>
|
||||
lib_deps =
|
||||
${rak4631.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
https://github.com/RAKWireless/RAK13800-W5100S/archive/1.0.2.zip
|
||||
|
||||
|
||||
[env:RAK_4631_companion_radio_ble]
|
||||
extends = rak4631
|
||||
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||
@@ -199,4 +266,4 @@ build_flags =
|
||||
build_src_filter = ${rak4631.build_src_filter}
|
||||
+<../examples/kiss_modem/>
|
||||
lib_deps =
|
||||
${rak4631.lib_deps}
|
||||
${rak4631.lib_deps}
|
||||
|
||||
Reference in New Issue
Block a user