Add DFRobot LoRaWAN ESP32-S3 Companion BLE firmware
Add a board variant for the DFRobot DFR1195 (ESP32-S3-WROOM-1-N4, SX1262, 80x160 ST7735S) and a Companion BLE environment. The display and radio use separate SPI controllers: the SX1262 is on FSPI and the ST7735 is on HSPI. ST7735Display selects that HSPI bus and the 160x80 init sequence only when DFROBOT_LORAWAN_ESP32S3 is defined.
This commit is contained in:
1 parent
dace1a32d4
commit
ff0ce69c16
7 files changed
+210
-2
No files matched your search
@@ -0,0 +1,34 @@
|
||||
#include <Arduino.h>
|
||||
#include <SPI.h>
|
||||
#include "target.h"
|
||||
|
||||
DFRobotLoRaBoard board;
|
||||
|
||||
// FSPI is SPI2. The ST7735 driver takes HSPI (SPI3); the default SPIClass
|
||||
// constructor on ESP32-S3 is HSPI and would collide with the display.
|
||||
static SPIClass spi(FSPI);
|
||||
RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, spi);
|
||||
|
||||
WRAPPER_CLASS radio_driver(radio, board);
|
||||
|
||||
ESP32RTCClock fallback_clock;
|
||||
AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
||||
SensorManager sensors;
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
DISPLAY_CLASS display(&board.periph_power);
|
||||
// Active-low button, internal pull-up.
|
||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true, true);
|
||||
#endif
|
||||
|
||||
bool radio_init() {
|
||||
fallback_clock.begin();
|
||||
rtc_clock.begin(Wire);
|
||||
|
||||
return radio.std_init(&spi);
|
||||
}
|
||||
|
||||
mesh::LocalIdentity radio_new_identity() {
|
||||
RadioNoiseListener rng(radio);
|
||||
return mesh::LocalIdentity(&rng); // create new random identity
|
||||
}
|
||||
Reference in new issue
Block a user