From 28e188aec9a2330cd05d16122511b6fd6d8039de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Wed, 2 Oct 2024 23:24:06 +0200 Subject: [PATCH 1/7] preliminary Othernet Dreamcatcher 2206 Support Need to adapt to 2301 final version --- src/configuration.h | 5 ++ src/detect/ScanI2C.h | 3 +- src/detect/ScanI2CTwoWire.cpp | 1 + src/main.cpp | 15 ++++++ src/mesh/LR11x0Interface.cpp | 12 +++++ variants/dreamcatcher/platformio.ini | 10 ++++ variants/dreamcatcher/rfswitch.h | 17 +++++++ variants/dreamcatcher/variant.h | 73 ++++++++++++++++++++++++++++ 8 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 variants/dreamcatcher/platformio.ini create mode 100644 variants/dreamcatcher/rfswitch.h create mode 100644 variants/dreamcatcher/variant.h diff --git a/src/configuration.h b/src/configuration.h index 3cd93ec83d..dc6012a820 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -185,6 +185,11 @@ along with this program. If not, see . // ----------------------------------------------------------------------------- #define FT6336U_ADDR 0x48 +// ----------------------------------------------------------------------------- +// BIAS-T Generator +// ----------------------------------------------------------------------------- +#define TPS65233_ADDR 0x60 + // convert 24-bit color to 16-bit (56K) #define COLOR565(r, g, b) (((r & 0xF8) << 8) | ((g & 0xFC) << 3) | ((b & 0xF8) >> 3)) diff --git a/src/detect/ScanI2C.h b/src/detect/ScanI2C.h index 3b49026ced..1f277088da 100644 --- a/src/detect/ScanI2C.h +++ b/src/detect/ScanI2C.h @@ -58,7 +58,8 @@ class ScanI2C NAU7802, FT6336U, STK8BAXX, - ICM20948 + ICM20948, + TPS65233 } DeviceType; // typedef uint8_t DeviceAddress; diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index 43340765aa..5db1b641e6 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -394,6 +394,7 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) SCAN_SIMPLE_CASE(NAU7802_ADDR, NAU7802, "NAU7802 based scale found\n"); SCAN_SIMPLE_CASE(FT6336U_ADDR, FT6336U, "FT6336U touchscreen found\n"); SCAN_SIMPLE_CASE(MAX1704X_ADDR, MAX17048, "MAX17048 lipo fuel gauge found\n"); + SCAN_SIMPLE_CASE(TPS65233_ADDR, TPS65233, "TPS65233 BIAS-T found\n"); case ICM20948_ADDR: // same as BMX160_ADDR case ICM20948_ADDR_ALT: // same as MPU6050_ADDR diff --git a/src/main.cpp b/src/main.cpp index c119958376..3951cd0f72 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -535,6 +535,21 @@ void setup() rgb_found = i2cScanner->find(ScanI2C::DeviceType::NCP5623); #endif +#ifdef HAS_TPS65233 + // TPS65233 is a power management IC for satellite modems, used in the Dreamcatcher + // We are switching it off here since we don't use an LNB. + if (i2cScanner->exists(ScanI2C::DeviceType::TPS65233)) { + Wire.beginTransmission(TPS65233_ADDR); + Wire.write(0); // Register 0 + Wire.write(128); // Turn off the LNB power, keep I2C Control enabled + Wire.endTransmission(); + Wire.beginTransmission(TPS65233_ADDR); + Wire.write(1); // Register 1 + Wire.write(0); // Turn off Tone Generator 22kHz + Wire.endTransmission(); + } +#endif + #if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) auto acc_info = i2cScanner->firstAccelerometer(); accelerometer_found = acc_info.type != ScanI2C::DeviceType::NONE ? acc_info.address : accelerometer_found; diff --git a/src/mesh/LR11x0Interface.cpp b/src/mesh/LR11x0Interface.cpp index 6641634c4c..a985a9006c 100644 --- a/src/mesh/LR11x0Interface.cpp +++ b/src/mesh/LR11x0Interface.cpp @@ -72,6 +72,18 @@ template bool LR11x0Interface::init() limitPower(); +#ifdef LR11X0_RF_SWITCH_SUBGHZ + pinMode(LR11X0_RF_SWITCH_SUBGHZ, OUTPUT); + digitalWrite(LR11X0_RF_SWITCH_SUBGHZ, getFreq() < 1e9 ? HIGH : LOW); + LOG_DEBUG("Setting RF0 switch to %s\n", getFreq() < 1e9 ? "SubGHz" : "2.4GHz"); +#endif + +#ifdef LR11X0_RF_SWITCH_2_4GHZ + pinMode(LR11X0_RF_SWITCH_2_4GHZ, OUTPUT); + digitalWrite(LR11X0_RF_SWITCH_2_4GHZ, getFreq() < 1e9 ? LOW : HIGH); + LOG_DEBUG("Setting RF1 switch to %s\n", getFreq() < 1e9 ? "SubGHz" : "2.4GHz"); +#endif + int res = lora.begin(getFreq(), bw, sf, cr, syncWord, power, preambleLength, tcxoVoltage); // \todo Display actual typename of the adapter, not just `LR11x0` LOG_INFO("LR11x0 init result %d\n", res); diff --git a/variants/dreamcatcher/platformio.ini b/variants/dreamcatcher/platformio.ini new file mode 100644 index 0000000000..9046ce40b1 --- /dev/null +++ b/variants/dreamcatcher/platformio.ini @@ -0,0 +1,10 @@ +[env:dreamcatcher] +extends = esp32s3_base +board = esp32s3box +board_level = extra + +build_flags = + ${esp32s3_base.build_flags} + -D PRIVATE_HW + -I variants/dreamcatcher + -DARDUINO_USB_CDC_ON_BOOT=1 \ No newline at end of file diff --git a/variants/dreamcatcher/rfswitch.h b/variants/dreamcatcher/rfswitch.h new file mode 100644 index 0000000000..74edb25d11 --- /dev/null +++ b/variants/dreamcatcher/rfswitch.h @@ -0,0 +1,17 @@ +#include "RadioLib.h" + +// RF Switch Matrix SubG RFO_HP_LF / RFO_LP_LF / RFI_[NP]_LF0 +// DIO5 -> RFSW0_V1 +// DIO6 -> RFSW1_V2 +// DIO7 -> ANT_CTRL_ON + ESP_IO9/LR_GPS_ANT_DC_EN -> RFI_GPS (Bias-T GPS) + +static const uint32_t rfswitch_dio_pins[] = {RADIOLIB_LR11X0_DIO5, RADIOLIB_LR11X0_DIO6, RADIOLIB_LR11X0_DIO7, RADIOLIB_NC, + RADIOLIB_NC}; + +static const Module::RfSwitchMode_t rfswitch_table[] = { + // mode DIO5 DIO6 DIO7 + {LR11x0::MODE_STBY, {LOW, LOW, LOW}}, {LR11x0::MODE_RX, {HIGH, LOW, LOW}}, + {LR11x0::MODE_TX, {LOW, HIGH, LOW}}, {LR11x0::MODE_TX_HP, {LOW, HIGH, LOW}}, + {LR11x0::MODE_TX_HF, {LOW, LOW, LOW}}, {LR11x0::MODE_GNSS, {LOW, LOW, HIGH}}, + {LR11x0::MODE_WIFI, {LOW, LOW, LOW}}, END_OF_MODE_TABLE, +}; \ No newline at end of file diff --git a/variants/dreamcatcher/variant.h b/variants/dreamcatcher/variant.h new file mode 100644 index 0000000000..ded3f63ed6 --- /dev/null +++ b/variants/dreamcatcher/variant.h @@ -0,0 +1,73 @@ +#undef I2C_SDA +#undef I2C_SCL +#define I2C_SDA 16 // I2C pins for this board +#define I2C_SCL 17 + +// #define TPS_EXTM 45 not used + +#define GPS_RX_PIN 36 +#define GPS_TX_PIN 37 + +#define LED_PIN 6 +#define LED_STATE_ON 1 +#define BUTTON_PIN 0 +#define PIN_BUZZER 48 + +#define PIN_POWER_EN 7 // RF section power supply enable +#define PERIPHERAL_WARMUP_MS 1000 // wait for TPS chip to initialize +#define HAS_TPS65233 + +// V1 of SubG Switch SMA 0 or F Selector 1 +// #define RF_SW_SUBG1 8 +// V2 of SubG Switch SMA 1 or F Selector 0 +// #define RF_SW_SUBG2 5 + +#define RESET_OLED 8 // Emulate RF_SW_SUBG1, Use F Connector +#define VTFT_CTRL 5 // Emulate RF_SW_SUBG2, for SMA swap the pin values + +#define USE_LR1120 +#define USE_LR1121 + +#define LORA_RESET 3 +#define LORA_SCK 12 +#define LORA_MISO 13 +#define LORA_MOSI 11 +#define LORA_CS 14 +#define LORA_DIO9 4 +#define LORA_DIO2 47 + +#define LR1120_IRQ_PIN LORA_DIO9 +#define LR1120_NRESET_PIN LORA_RESET +#define LR1120_BUSY_PIN LORA_DIO2 +#define LR1120_SPI_NSS_PIN LORA_CS +#define LR1120_SPI_SCK_PIN LORA_SCK +#define LR1120_SPI_MOSI_PIN LORA_MOSI +#define LR1120_SPI_MISO_PIN LORA_MISO + +#define LR1121_IRQ_PIN LORA_DIO9 +#define LR1121_NRESET_PIN LORA_RESET +#define LR1121_BUSY_PIN LORA_DIO2 +#define LR1121_SPI_NSS_PIN LORA_CS +#define LR1121_SPI_SCK_PIN LORA_SCK +#define LR1121_SPI_MOSI_PIN LORA_MOSI +#define LR1121_SPI_MISO_PIN LORA_MISO + +#define LR11X0_DIO3_TCXO_VOLTAGE 1.8 +#define LR11X0_DIO_AS_RF_SWITCH + +// This board needs external switching between sub-GHz and 2.4G circuits + +// V1 of RF1 selector SubG 1 or 2.4GHz 0 +// #define RF_SW_SMA1 42 +// V2 of RF1 Selector SubG 0 or 2.4GHz 1 +// #define RF_SW_SMA2 41 + +#define LR11X0_RF_SWITCH_SUBGHZ 42 +#define LR11X0_RF_SWITCH_2_4GHZ 41 + +#define HAS_SDCARD // Have SPI interface SD card slot +#define SPI_MISO 10 +#define SPI_MOSI 39 +#define SPI_SCK 38 +#define SDCARD_CS 40 +#define SDCARD_USE_SPI1 \ No newline at end of file From 5c21e350b549be0ca4f0cb5929ec10261496d33d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Sat, 5 Oct 2024 13:35:00 +0200 Subject: [PATCH 2/7] second target for latest revision --- src/main.cpp | 5 +++ variants/dreamcatcher/platformio.ini | 19 ++++++++- variants/dreamcatcher/variant.h | 62 +++++++++++++++++++++------- 3 files changed, 71 insertions(+), 15 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 70b5c838fc..cfdebf093e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -298,6 +298,11 @@ void setup() digitalWrite(VEXT_ENABLE, VEXT_ON_VALUE); // turn on the display power #endif +#if defined(BIAS_T_ENABLE) + pinMode(BIAS_T_ENABLE, OUTPUT); + digitalWrite(BIAS_T_ENABLE, BIAS_T_VALUE); // turn on 5V for GPS Antenna +#endif + #if defined(VTFT_CTRL) pinMode(VTFT_CTRL, OUTPUT); digitalWrite(VTFT_CTRL, LOW); diff --git a/variants/dreamcatcher/platformio.ini b/variants/dreamcatcher/platformio.ini index 9046ce40b1..46f9b9871b 100644 --- a/variants/dreamcatcher/platformio.ini +++ b/variants/dreamcatcher/platformio.ini @@ -1,4 +1,4 @@ -[env:dreamcatcher] +[env:dreamcatcher] ; 2301, latest revision extends = esp32s3_base board = esp32s3box board_level = extra @@ -6,5 +6,22 @@ board_level = extra build_flags = ${esp32s3_base.build_flags} -D PRIVATE_HW + -D OTHERNET_DC_REV=2301 + -I variants/dreamcatcher + -DARDUINO_USB_CDC_ON_BOOT=1 + +lib_deps = ${esp32s3_base.lib_deps} + earlephilhower/ESP8266Audio@^1.9.7 + earlephilhower/ESP8266SAM@^1.0.1 + +[env:dreamcatcher-2206] +extends = esp32s3_base +board = esp32s3box +board_level = extra + +build_flags = + ${esp32s3_base.build_flags} + -D PRIVATE_HW + -D OTHERNET_DC_REV=2206 -I variants/dreamcatcher -DARDUINO_USB_CDC_ON_BOOT=1 \ No newline at end of file diff --git a/variants/dreamcatcher/variant.h b/variants/dreamcatcher/variant.h index ded3f63ed6..e640156036 100644 --- a/variants/dreamcatcher/variant.h +++ b/variants/dreamcatcher/variant.h @@ -3,18 +3,13 @@ #define I2C_SDA 16 // I2C pins for this board #define I2C_SCL 17 -// #define TPS_EXTM 45 not used - -#define GPS_RX_PIN 36 -#define GPS_TX_PIN 37 +#define I2C_SDA1 45 +#define I2C_SCL1 46 #define LED_PIN 6 #define LED_STATE_ON 1 #define BUTTON_PIN 0 -#define PIN_BUZZER 48 -#define PIN_POWER_EN 7 // RF section power supply enable -#define PERIPHERAL_WARMUP_MS 1000 // wait for TPS chip to initialize #define HAS_TPS65233 // V1 of SubG Switch SMA 0 or F Selector 1 @@ -25,8 +20,54 @@ #define RESET_OLED 8 // Emulate RF_SW_SUBG1, Use F Connector #define VTFT_CTRL 5 // Emulate RF_SW_SUBG2, for SMA swap the pin values +#if OTHERNET_DC_REV == 2206 #define USE_LR1120 + +#define SPI_MISO 37 +#define SPI_MOSI 39 +#define SPI_SCK 38 +#define SDCARD_CS 40 + +#define PIN_BUZZER 48 + +#define GPS_RX_PIN 10 +#define GPS_TX_PIN 21 + +#define PIN_POWER_EN 7 // RF section power supply enable +#define PERIPHERAL_WARMUP_MS 1000 // wait for TPS chip to initialize +#define TPS_EXTM 45 // connected, but not used +#define BIAS_T_ENABLE 9 // needs to be low +#define BIAS_T_VALUE 0 +#else // 2301 #define USE_LR1121 +#define SPI_MISO 10 +#define SPI_MOSI 39 +#define SPI_SCK 38 + +#define SDCARD_CS 40 + +// This is only informational, we always use SD cards in 1 bit mode +#define SPI_DATA1 15 +#define SPI_DATA2 18 + +#define GPS_RX_PIN 36 +#define GPS_TX_PIN 37 + +// dac / amp instead of buzzer +#define HAS_I2S +#define DAC_I2S_BCK 21 +#define DAC_I2S_WS 9 +#define DAC_I2S_DOUT 48 + +#define BIAS_T_ENABLE 7 // needs to be low +#define BIAS_T_VALUE 0 +#define BIAS_T_SUBGHZ 2 // also needs to be low, we hijack SENSOR_POWER_CTRL_PIN to emulate this +#define SENSOR_POWER_CTRL_PIN BIAS_T_SUBGHZ +#define SENSOR_POWER_ON 0 +#endif + +#define HAS_SDCARD // Have SPI interface SD card slot +#define SDCARD_USE_SPI1 #define LORA_RESET 3 #define LORA_SCK 12 @@ -64,10 +105,3 @@ #define LR11X0_RF_SWITCH_SUBGHZ 42 #define LR11X0_RF_SWITCH_2_4GHZ 41 - -#define HAS_SDCARD // Have SPI interface SD card slot -#define SPI_MISO 10 -#define SPI_MOSI 39 -#define SPI_SCK 38 -#define SDCARD_CS 40 -#define SDCARD_USE_SPI1 \ No newline at end of file From 202f01fb6b0a9301a3b6f1978ad8a7acdd76e65b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Wed, 2 Oct 2024 23:24:06 +0200 Subject: [PATCH 3/7] preliminary Othernet Dreamcatcher 2206 Support Need to adapt to 2301 final version --- src/configuration.h | 5 ++ src/detect/ScanI2C.h | 3 +- src/detect/ScanI2CTwoWire.cpp | 1 + src/main.cpp | 15 ++++++ src/mesh/LR11x0Interface.cpp | 12 +++++ variants/dreamcatcher/platformio.ini | 10 ++++ variants/dreamcatcher/rfswitch.h | 17 +++++++ variants/dreamcatcher/variant.h | 73 ++++++++++++++++++++++++++++ 8 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 variants/dreamcatcher/platformio.ini create mode 100644 variants/dreamcatcher/rfswitch.h create mode 100644 variants/dreamcatcher/variant.h diff --git a/src/configuration.h b/src/configuration.h index 3cd93ec83d..dc6012a820 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -185,6 +185,11 @@ along with this program. If not, see . // ----------------------------------------------------------------------------- #define FT6336U_ADDR 0x48 +// ----------------------------------------------------------------------------- +// BIAS-T Generator +// ----------------------------------------------------------------------------- +#define TPS65233_ADDR 0x60 + // convert 24-bit color to 16-bit (56K) #define COLOR565(r, g, b) (((r & 0xF8) << 8) | ((g & 0xFC) << 3) | ((b & 0xF8) >> 3)) diff --git a/src/detect/ScanI2C.h b/src/detect/ScanI2C.h index 3b49026ced..1f277088da 100644 --- a/src/detect/ScanI2C.h +++ b/src/detect/ScanI2C.h @@ -58,7 +58,8 @@ class ScanI2C NAU7802, FT6336U, STK8BAXX, - ICM20948 + ICM20948, + TPS65233 } DeviceType; // typedef uint8_t DeviceAddress; diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index 43340765aa..5db1b641e6 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -394,6 +394,7 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) SCAN_SIMPLE_CASE(NAU7802_ADDR, NAU7802, "NAU7802 based scale found\n"); SCAN_SIMPLE_CASE(FT6336U_ADDR, FT6336U, "FT6336U touchscreen found\n"); SCAN_SIMPLE_CASE(MAX1704X_ADDR, MAX17048, "MAX17048 lipo fuel gauge found\n"); + SCAN_SIMPLE_CASE(TPS65233_ADDR, TPS65233, "TPS65233 BIAS-T found\n"); case ICM20948_ADDR: // same as BMX160_ADDR case ICM20948_ADDR_ALT: // same as MPU6050_ADDR diff --git a/src/main.cpp b/src/main.cpp index 95ac7c1c3a..70b5c838fc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -538,6 +538,21 @@ void setup() rgb_found = i2cScanner->find(ScanI2C::DeviceType::NCP5623); #endif +#ifdef HAS_TPS65233 + // TPS65233 is a power management IC for satellite modems, used in the Dreamcatcher + // We are switching it off here since we don't use an LNB. + if (i2cScanner->exists(ScanI2C::DeviceType::TPS65233)) { + Wire.beginTransmission(TPS65233_ADDR); + Wire.write(0); // Register 0 + Wire.write(128); // Turn off the LNB power, keep I2C Control enabled + Wire.endTransmission(); + Wire.beginTransmission(TPS65233_ADDR); + Wire.write(1); // Register 1 + Wire.write(0); // Turn off Tone Generator 22kHz + Wire.endTransmission(); + } +#endif + #if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) auto acc_info = i2cScanner->firstAccelerometer(); accelerometer_found = acc_info.type != ScanI2C::DeviceType::NONE ? acc_info.address : accelerometer_found; diff --git a/src/mesh/LR11x0Interface.cpp b/src/mesh/LR11x0Interface.cpp index 6641634c4c..a985a9006c 100644 --- a/src/mesh/LR11x0Interface.cpp +++ b/src/mesh/LR11x0Interface.cpp @@ -72,6 +72,18 @@ template bool LR11x0Interface::init() limitPower(); +#ifdef LR11X0_RF_SWITCH_SUBGHZ + pinMode(LR11X0_RF_SWITCH_SUBGHZ, OUTPUT); + digitalWrite(LR11X0_RF_SWITCH_SUBGHZ, getFreq() < 1e9 ? HIGH : LOW); + LOG_DEBUG("Setting RF0 switch to %s\n", getFreq() < 1e9 ? "SubGHz" : "2.4GHz"); +#endif + +#ifdef LR11X0_RF_SWITCH_2_4GHZ + pinMode(LR11X0_RF_SWITCH_2_4GHZ, OUTPUT); + digitalWrite(LR11X0_RF_SWITCH_2_4GHZ, getFreq() < 1e9 ? LOW : HIGH); + LOG_DEBUG("Setting RF1 switch to %s\n", getFreq() < 1e9 ? "SubGHz" : "2.4GHz"); +#endif + int res = lora.begin(getFreq(), bw, sf, cr, syncWord, power, preambleLength, tcxoVoltage); // \todo Display actual typename of the adapter, not just `LR11x0` LOG_INFO("LR11x0 init result %d\n", res); diff --git a/variants/dreamcatcher/platformio.ini b/variants/dreamcatcher/platformio.ini new file mode 100644 index 0000000000..9046ce40b1 --- /dev/null +++ b/variants/dreamcatcher/platformio.ini @@ -0,0 +1,10 @@ +[env:dreamcatcher] +extends = esp32s3_base +board = esp32s3box +board_level = extra + +build_flags = + ${esp32s3_base.build_flags} + -D PRIVATE_HW + -I variants/dreamcatcher + -DARDUINO_USB_CDC_ON_BOOT=1 \ No newline at end of file diff --git a/variants/dreamcatcher/rfswitch.h b/variants/dreamcatcher/rfswitch.h new file mode 100644 index 0000000000..74edb25d11 --- /dev/null +++ b/variants/dreamcatcher/rfswitch.h @@ -0,0 +1,17 @@ +#include "RadioLib.h" + +// RF Switch Matrix SubG RFO_HP_LF / RFO_LP_LF / RFI_[NP]_LF0 +// DIO5 -> RFSW0_V1 +// DIO6 -> RFSW1_V2 +// DIO7 -> ANT_CTRL_ON + ESP_IO9/LR_GPS_ANT_DC_EN -> RFI_GPS (Bias-T GPS) + +static const uint32_t rfswitch_dio_pins[] = {RADIOLIB_LR11X0_DIO5, RADIOLIB_LR11X0_DIO6, RADIOLIB_LR11X0_DIO7, RADIOLIB_NC, + RADIOLIB_NC}; + +static const Module::RfSwitchMode_t rfswitch_table[] = { + // mode DIO5 DIO6 DIO7 + {LR11x0::MODE_STBY, {LOW, LOW, LOW}}, {LR11x0::MODE_RX, {HIGH, LOW, LOW}}, + {LR11x0::MODE_TX, {LOW, HIGH, LOW}}, {LR11x0::MODE_TX_HP, {LOW, HIGH, LOW}}, + {LR11x0::MODE_TX_HF, {LOW, LOW, LOW}}, {LR11x0::MODE_GNSS, {LOW, LOW, HIGH}}, + {LR11x0::MODE_WIFI, {LOW, LOW, LOW}}, END_OF_MODE_TABLE, +}; \ No newline at end of file diff --git a/variants/dreamcatcher/variant.h b/variants/dreamcatcher/variant.h new file mode 100644 index 0000000000..ded3f63ed6 --- /dev/null +++ b/variants/dreamcatcher/variant.h @@ -0,0 +1,73 @@ +#undef I2C_SDA +#undef I2C_SCL +#define I2C_SDA 16 // I2C pins for this board +#define I2C_SCL 17 + +// #define TPS_EXTM 45 not used + +#define GPS_RX_PIN 36 +#define GPS_TX_PIN 37 + +#define LED_PIN 6 +#define LED_STATE_ON 1 +#define BUTTON_PIN 0 +#define PIN_BUZZER 48 + +#define PIN_POWER_EN 7 // RF section power supply enable +#define PERIPHERAL_WARMUP_MS 1000 // wait for TPS chip to initialize +#define HAS_TPS65233 + +// V1 of SubG Switch SMA 0 or F Selector 1 +// #define RF_SW_SUBG1 8 +// V2 of SubG Switch SMA 1 or F Selector 0 +// #define RF_SW_SUBG2 5 + +#define RESET_OLED 8 // Emulate RF_SW_SUBG1, Use F Connector +#define VTFT_CTRL 5 // Emulate RF_SW_SUBG2, for SMA swap the pin values + +#define USE_LR1120 +#define USE_LR1121 + +#define LORA_RESET 3 +#define LORA_SCK 12 +#define LORA_MISO 13 +#define LORA_MOSI 11 +#define LORA_CS 14 +#define LORA_DIO9 4 +#define LORA_DIO2 47 + +#define LR1120_IRQ_PIN LORA_DIO9 +#define LR1120_NRESET_PIN LORA_RESET +#define LR1120_BUSY_PIN LORA_DIO2 +#define LR1120_SPI_NSS_PIN LORA_CS +#define LR1120_SPI_SCK_PIN LORA_SCK +#define LR1120_SPI_MOSI_PIN LORA_MOSI +#define LR1120_SPI_MISO_PIN LORA_MISO + +#define LR1121_IRQ_PIN LORA_DIO9 +#define LR1121_NRESET_PIN LORA_RESET +#define LR1121_BUSY_PIN LORA_DIO2 +#define LR1121_SPI_NSS_PIN LORA_CS +#define LR1121_SPI_SCK_PIN LORA_SCK +#define LR1121_SPI_MOSI_PIN LORA_MOSI +#define LR1121_SPI_MISO_PIN LORA_MISO + +#define LR11X0_DIO3_TCXO_VOLTAGE 1.8 +#define LR11X0_DIO_AS_RF_SWITCH + +// This board needs external switching between sub-GHz and 2.4G circuits + +// V1 of RF1 selector SubG 1 or 2.4GHz 0 +// #define RF_SW_SMA1 42 +// V2 of RF1 Selector SubG 0 or 2.4GHz 1 +// #define RF_SW_SMA2 41 + +#define LR11X0_RF_SWITCH_SUBGHZ 42 +#define LR11X0_RF_SWITCH_2_4GHZ 41 + +#define HAS_SDCARD // Have SPI interface SD card slot +#define SPI_MISO 10 +#define SPI_MOSI 39 +#define SPI_SCK 38 +#define SDCARD_CS 40 +#define SDCARD_USE_SPI1 \ No newline at end of file From 572835c96c97a6955484eca27cc1b71ef07ad20e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Sat, 5 Oct 2024 13:35:00 +0200 Subject: [PATCH 4/7] second target for latest revision --- src/main.cpp | 5 +++ variants/dreamcatcher/platformio.ini | 19 ++++++++- variants/dreamcatcher/variant.h | 62 +++++++++++++++++++++------- 3 files changed, 71 insertions(+), 15 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 70b5c838fc..cfdebf093e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -298,6 +298,11 @@ void setup() digitalWrite(VEXT_ENABLE, VEXT_ON_VALUE); // turn on the display power #endif +#if defined(BIAS_T_ENABLE) + pinMode(BIAS_T_ENABLE, OUTPUT); + digitalWrite(BIAS_T_ENABLE, BIAS_T_VALUE); // turn on 5V for GPS Antenna +#endif + #if defined(VTFT_CTRL) pinMode(VTFT_CTRL, OUTPUT); digitalWrite(VTFT_CTRL, LOW); diff --git a/variants/dreamcatcher/platformio.ini b/variants/dreamcatcher/platformio.ini index 9046ce40b1..46f9b9871b 100644 --- a/variants/dreamcatcher/platformio.ini +++ b/variants/dreamcatcher/platformio.ini @@ -1,4 +1,4 @@ -[env:dreamcatcher] +[env:dreamcatcher] ; 2301, latest revision extends = esp32s3_base board = esp32s3box board_level = extra @@ -6,5 +6,22 @@ board_level = extra build_flags = ${esp32s3_base.build_flags} -D PRIVATE_HW + -D OTHERNET_DC_REV=2301 + -I variants/dreamcatcher + -DARDUINO_USB_CDC_ON_BOOT=1 + +lib_deps = ${esp32s3_base.lib_deps} + earlephilhower/ESP8266Audio@^1.9.7 + earlephilhower/ESP8266SAM@^1.0.1 + +[env:dreamcatcher-2206] +extends = esp32s3_base +board = esp32s3box +board_level = extra + +build_flags = + ${esp32s3_base.build_flags} + -D PRIVATE_HW + -D OTHERNET_DC_REV=2206 -I variants/dreamcatcher -DARDUINO_USB_CDC_ON_BOOT=1 \ No newline at end of file diff --git a/variants/dreamcatcher/variant.h b/variants/dreamcatcher/variant.h index ded3f63ed6..e640156036 100644 --- a/variants/dreamcatcher/variant.h +++ b/variants/dreamcatcher/variant.h @@ -3,18 +3,13 @@ #define I2C_SDA 16 // I2C pins for this board #define I2C_SCL 17 -// #define TPS_EXTM 45 not used - -#define GPS_RX_PIN 36 -#define GPS_TX_PIN 37 +#define I2C_SDA1 45 +#define I2C_SCL1 46 #define LED_PIN 6 #define LED_STATE_ON 1 #define BUTTON_PIN 0 -#define PIN_BUZZER 48 -#define PIN_POWER_EN 7 // RF section power supply enable -#define PERIPHERAL_WARMUP_MS 1000 // wait for TPS chip to initialize #define HAS_TPS65233 // V1 of SubG Switch SMA 0 or F Selector 1 @@ -25,8 +20,54 @@ #define RESET_OLED 8 // Emulate RF_SW_SUBG1, Use F Connector #define VTFT_CTRL 5 // Emulate RF_SW_SUBG2, for SMA swap the pin values +#if OTHERNET_DC_REV == 2206 #define USE_LR1120 + +#define SPI_MISO 37 +#define SPI_MOSI 39 +#define SPI_SCK 38 +#define SDCARD_CS 40 + +#define PIN_BUZZER 48 + +#define GPS_RX_PIN 10 +#define GPS_TX_PIN 21 + +#define PIN_POWER_EN 7 // RF section power supply enable +#define PERIPHERAL_WARMUP_MS 1000 // wait for TPS chip to initialize +#define TPS_EXTM 45 // connected, but not used +#define BIAS_T_ENABLE 9 // needs to be low +#define BIAS_T_VALUE 0 +#else // 2301 #define USE_LR1121 +#define SPI_MISO 10 +#define SPI_MOSI 39 +#define SPI_SCK 38 + +#define SDCARD_CS 40 + +// This is only informational, we always use SD cards in 1 bit mode +#define SPI_DATA1 15 +#define SPI_DATA2 18 + +#define GPS_RX_PIN 36 +#define GPS_TX_PIN 37 + +// dac / amp instead of buzzer +#define HAS_I2S +#define DAC_I2S_BCK 21 +#define DAC_I2S_WS 9 +#define DAC_I2S_DOUT 48 + +#define BIAS_T_ENABLE 7 // needs to be low +#define BIAS_T_VALUE 0 +#define BIAS_T_SUBGHZ 2 // also needs to be low, we hijack SENSOR_POWER_CTRL_PIN to emulate this +#define SENSOR_POWER_CTRL_PIN BIAS_T_SUBGHZ +#define SENSOR_POWER_ON 0 +#endif + +#define HAS_SDCARD // Have SPI interface SD card slot +#define SDCARD_USE_SPI1 #define LORA_RESET 3 #define LORA_SCK 12 @@ -64,10 +105,3 @@ #define LR11X0_RF_SWITCH_SUBGHZ 42 #define LR11X0_RF_SWITCH_2_4GHZ 41 - -#define HAS_SDCARD // Have SPI interface SD card slot -#define SPI_MISO 10 -#define SPI_MOSI 39 -#define SPI_SCK 38 -#define SDCARD_CS 40 -#define SDCARD_USE_SPI1 \ No newline at end of file From f7e4d32f10f50ae5da1798489d7bbf7a50cbe5f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Wed, 2 Oct 2024 23:24:06 +0200 Subject: [PATCH 5/7] preliminary Othernet Dreamcatcher 2206 Support Need to adapt to 2301 final version --- src/configuration.h | 5 ++ src/detect/ScanI2C.h | 3 +- src/detect/ScanI2CTwoWire.cpp | 1 + src/main.cpp | 15 ++++++ src/mesh/LR11x0Interface.cpp | 12 +++++ variants/dreamcatcher/platformio.ini | 10 ++++ variants/dreamcatcher/rfswitch.h | 17 +++++++ variants/dreamcatcher/variant.h | 73 ++++++++++++++++++++++++++++ 8 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 variants/dreamcatcher/platformio.ini create mode 100644 variants/dreamcatcher/rfswitch.h create mode 100644 variants/dreamcatcher/variant.h diff --git a/src/configuration.h b/src/configuration.h index 3cd93ec83d..dc6012a820 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -185,6 +185,11 @@ along with this program. If not, see . // ----------------------------------------------------------------------------- #define FT6336U_ADDR 0x48 +// ----------------------------------------------------------------------------- +// BIAS-T Generator +// ----------------------------------------------------------------------------- +#define TPS65233_ADDR 0x60 + // convert 24-bit color to 16-bit (56K) #define COLOR565(r, g, b) (((r & 0xF8) << 8) | ((g & 0xFC) << 3) | ((b & 0xF8) >> 3)) diff --git a/src/detect/ScanI2C.h b/src/detect/ScanI2C.h index 3b49026ced..1f277088da 100644 --- a/src/detect/ScanI2C.h +++ b/src/detect/ScanI2C.h @@ -58,7 +58,8 @@ class ScanI2C NAU7802, FT6336U, STK8BAXX, - ICM20948 + ICM20948, + TPS65233 } DeviceType; // typedef uint8_t DeviceAddress; diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index 43340765aa..5db1b641e6 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -394,6 +394,7 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) SCAN_SIMPLE_CASE(NAU7802_ADDR, NAU7802, "NAU7802 based scale found\n"); SCAN_SIMPLE_CASE(FT6336U_ADDR, FT6336U, "FT6336U touchscreen found\n"); SCAN_SIMPLE_CASE(MAX1704X_ADDR, MAX17048, "MAX17048 lipo fuel gauge found\n"); + SCAN_SIMPLE_CASE(TPS65233_ADDR, TPS65233, "TPS65233 BIAS-T found\n"); case ICM20948_ADDR: // same as BMX160_ADDR case ICM20948_ADDR_ALT: // same as MPU6050_ADDR diff --git a/src/main.cpp b/src/main.cpp index 25059f3c7f..ddb1721761 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -538,6 +538,21 @@ void setup() rgb_found = i2cScanner->find(ScanI2C::DeviceType::NCP5623); #endif +#ifdef HAS_TPS65233 + // TPS65233 is a power management IC for satellite modems, used in the Dreamcatcher + // We are switching it off here since we don't use an LNB. + if (i2cScanner->exists(ScanI2C::DeviceType::TPS65233)) { + Wire.beginTransmission(TPS65233_ADDR); + Wire.write(0); // Register 0 + Wire.write(128); // Turn off the LNB power, keep I2C Control enabled + Wire.endTransmission(); + Wire.beginTransmission(TPS65233_ADDR); + Wire.write(1); // Register 1 + Wire.write(0); // Turn off Tone Generator 22kHz + Wire.endTransmission(); + } +#endif + #if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) auto acc_info = i2cScanner->firstAccelerometer(); accelerometer_found = acc_info.type != ScanI2C::DeviceType::NONE ? acc_info.address : accelerometer_found; diff --git a/src/mesh/LR11x0Interface.cpp b/src/mesh/LR11x0Interface.cpp index 6641634c4c..a985a9006c 100644 --- a/src/mesh/LR11x0Interface.cpp +++ b/src/mesh/LR11x0Interface.cpp @@ -72,6 +72,18 @@ template bool LR11x0Interface::init() limitPower(); +#ifdef LR11X0_RF_SWITCH_SUBGHZ + pinMode(LR11X0_RF_SWITCH_SUBGHZ, OUTPUT); + digitalWrite(LR11X0_RF_SWITCH_SUBGHZ, getFreq() < 1e9 ? HIGH : LOW); + LOG_DEBUG("Setting RF0 switch to %s\n", getFreq() < 1e9 ? "SubGHz" : "2.4GHz"); +#endif + +#ifdef LR11X0_RF_SWITCH_2_4GHZ + pinMode(LR11X0_RF_SWITCH_2_4GHZ, OUTPUT); + digitalWrite(LR11X0_RF_SWITCH_2_4GHZ, getFreq() < 1e9 ? LOW : HIGH); + LOG_DEBUG("Setting RF1 switch to %s\n", getFreq() < 1e9 ? "SubGHz" : "2.4GHz"); +#endif + int res = lora.begin(getFreq(), bw, sf, cr, syncWord, power, preambleLength, tcxoVoltage); // \todo Display actual typename of the adapter, not just `LR11x0` LOG_INFO("LR11x0 init result %d\n", res); diff --git a/variants/dreamcatcher/platformio.ini b/variants/dreamcatcher/platformio.ini new file mode 100644 index 0000000000..9046ce40b1 --- /dev/null +++ b/variants/dreamcatcher/platformio.ini @@ -0,0 +1,10 @@ +[env:dreamcatcher] +extends = esp32s3_base +board = esp32s3box +board_level = extra + +build_flags = + ${esp32s3_base.build_flags} + -D PRIVATE_HW + -I variants/dreamcatcher + -DARDUINO_USB_CDC_ON_BOOT=1 \ No newline at end of file diff --git a/variants/dreamcatcher/rfswitch.h b/variants/dreamcatcher/rfswitch.h new file mode 100644 index 0000000000..74edb25d11 --- /dev/null +++ b/variants/dreamcatcher/rfswitch.h @@ -0,0 +1,17 @@ +#include "RadioLib.h" + +// RF Switch Matrix SubG RFO_HP_LF / RFO_LP_LF / RFI_[NP]_LF0 +// DIO5 -> RFSW0_V1 +// DIO6 -> RFSW1_V2 +// DIO7 -> ANT_CTRL_ON + ESP_IO9/LR_GPS_ANT_DC_EN -> RFI_GPS (Bias-T GPS) + +static const uint32_t rfswitch_dio_pins[] = {RADIOLIB_LR11X0_DIO5, RADIOLIB_LR11X0_DIO6, RADIOLIB_LR11X0_DIO7, RADIOLIB_NC, + RADIOLIB_NC}; + +static const Module::RfSwitchMode_t rfswitch_table[] = { + // mode DIO5 DIO6 DIO7 + {LR11x0::MODE_STBY, {LOW, LOW, LOW}}, {LR11x0::MODE_RX, {HIGH, LOW, LOW}}, + {LR11x0::MODE_TX, {LOW, HIGH, LOW}}, {LR11x0::MODE_TX_HP, {LOW, HIGH, LOW}}, + {LR11x0::MODE_TX_HF, {LOW, LOW, LOW}}, {LR11x0::MODE_GNSS, {LOW, LOW, HIGH}}, + {LR11x0::MODE_WIFI, {LOW, LOW, LOW}}, END_OF_MODE_TABLE, +}; \ No newline at end of file diff --git a/variants/dreamcatcher/variant.h b/variants/dreamcatcher/variant.h new file mode 100644 index 0000000000..ded3f63ed6 --- /dev/null +++ b/variants/dreamcatcher/variant.h @@ -0,0 +1,73 @@ +#undef I2C_SDA +#undef I2C_SCL +#define I2C_SDA 16 // I2C pins for this board +#define I2C_SCL 17 + +// #define TPS_EXTM 45 not used + +#define GPS_RX_PIN 36 +#define GPS_TX_PIN 37 + +#define LED_PIN 6 +#define LED_STATE_ON 1 +#define BUTTON_PIN 0 +#define PIN_BUZZER 48 + +#define PIN_POWER_EN 7 // RF section power supply enable +#define PERIPHERAL_WARMUP_MS 1000 // wait for TPS chip to initialize +#define HAS_TPS65233 + +// V1 of SubG Switch SMA 0 or F Selector 1 +// #define RF_SW_SUBG1 8 +// V2 of SubG Switch SMA 1 or F Selector 0 +// #define RF_SW_SUBG2 5 + +#define RESET_OLED 8 // Emulate RF_SW_SUBG1, Use F Connector +#define VTFT_CTRL 5 // Emulate RF_SW_SUBG2, for SMA swap the pin values + +#define USE_LR1120 +#define USE_LR1121 + +#define LORA_RESET 3 +#define LORA_SCK 12 +#define LORA_MISO 13 +#define LORA_MOSI 11 +#define LORA_CS 14 +#define LORA_DIO9 4 +#define LORA_DIO2 47 + +#define LR1120_IRQ_PIN LORA_DIO9 +#define LR1120_NRESET_PIN LORA_RESET +#define LR1120_BUSY_PIN LORA_DIO2 +#define LR1120_SPI_NSS_PIN LORA_CS +#define LR1120_SPI_SCK_PIN LORA_SCK +#define LR1120_SPI_MOSI_PIN LORA_MOSI +#define LR1120_SPI_MISO_PIN LORA_MISO + +#define LR1121_IRQ_PIN LORA_DIO9 +#define LR1121_NRESET_PIN LORA_RESET +#define LR1121_BUSY_PIN LORA_DIO2 +#define LR1121_SPI_NSS_PIN LORA_CS +#define LR1121_SPI_SCK_PIN LORA_SCK +#define LR1121_SPI_MOSI_PIN LORA_MOSI +#define LR1121_SPI_MISO_PIN LORA_MISO + +#define LR11X0_DIO3_TCXO_VOLTAGE 1.8 +#define LR11X0_DIO_AS_RF_SWITCH + +// This board needs external switching between sub-GHz and 2.4G circuits + +// V1 of RF1 selector SubG 1 or 2.4GHz 0 +// #define RF_SW_SMA1 42 +// V2 of RF1 Selector SubG 0 or 2.4GHz 1 +// #define RF_SW_SMA2 41 + +#define LR11X0_RF_SWITCH_SUBGHZ 42 +#define LR11X0_RF_SWITCH_2_4GHZ 41 + +#define HAS_SDCARD // Have SPI interface SD card slot +#define SPI_MISO 10 +#define SPI_MOSI 39 +#define SPI_SCK 38 +#define SDCARD_CS 40 +#define SDCARD_USE_SPI1 \ No newline at end of file From 8476dc5670d1fa225a0d961d3992013be8c04aca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Sat, 5 Oct 2024 13:35:00 +0200 Subject: [PATCH 6/7] second target for latest revision --- src/main.cpp | 5 +++ variants/dreamcatcher/platformio.ini | 19 ++++++++- variants/dreamcatcher/variant.h | 62 +++++++++++++++++++++------- 3 files changed, 71 insertions(+), 15 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index ddb1721761..4b8dc8f941 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -298,6 +298,11 @@ void setup() digitalWrite(VEXT_ENABLE, VEXT_ON_VALUE); // turn on the display power #endif +#if defined(BIAS_T_ENABLE) + pinMode(BIAS_T_ENABLE, OUTPUT); + digitalWrite(BIAS_T_ENABLE, BIAS_T_VALUE); // turn on 5V for GPS Antenna +#endif + #if defined(VTFT_CTRL) pinMode(VTFT_CTRL, OUTPUT); digitalWrite(VTFT_CTRL, LOW); diff --git a/variants/dreamcatcher/platformio.ini b/variants/dreamcatcher/platformio.ini index 9046ce40b1..46f9b9871b 100644 --- a/variants/dreamcatcher/platformio.ini +++ b/variants/dreamcatcher/platformio.ini @@ -1,4 +1,4 @@ -[env:dreamcatcher] +[env:dreamcatcher] ; 2301, latest revision extends = esp32s3_base board = esp32s3box board_level = extra @@ -6,5 +6,22 @@ board_level = extra build_flags = ${esp32s3_base.build_flags} -D PRIVATE_HW + -D OTHERNET_DC_REV=2301 + -I variants/dreamcatcher + -DARDUINO_USB_CDC_ON_BOOT=1 + +lib_deps = ${esp32s3_base.lib_deps} + earlephilhower/ESP8266Audio@^1.9.7 + earlephilhower/ESP8266SAM@^1.0.1 + +[env:dreamcatcher-2206] +extends = esp32s3_base +board = esp32s3box +board_level = extra + +build_flags = + ${esp32s3_base.build_flags} + -D PRIVATE_HW + -D OTHERNET_DC_REV=2206 -I variants/dreamcatcher -DARDUINO_USB_CDC_ON_BOOT=1 \ No newline at end of file diff --git a/variants/dreamcatcher/variant.h b/variants/dreamcatcher/variant.h index ded3f63ed6..e640156036 100644 --- a/variants/dreamcatcher/variant.h +++ b/variants/dreamcatcher/variant.h @@ -3,18 +3,13 @@ #define I2C_SDA 16 // I2C pins for this board #define I2C_SCL 17 -// #define TPS_EXTM 45 not used - -#define GPS_RX_PIN 36 -#define GPS_TX_PIN 37 +#define I2C_SDA1 45 +#define I2C_SCL1 46 #define LED_PIN 6 #define LED_STATE_ON 1 #define BUTTON_PIN 0 -#define PIN_BUZZER 48 -#define PIN_POWER_EN 7 // RF section power supply enable -#define PERIPHERAL_WARMUP_MS 1000 // wait for TPS chip to initialize #define HAS_TPS65233 // V1 of SubG Switch SMA 0 or F Selector 1 @@ -25,8 +20,54 @@ #define RESET_OLED 8 // Emulate RF_SW_SUBG1, Use F Connector #define VTFT_CTRL 5 // Emulate RF_SW_SUBG2, for SMA swap the pin values +#if OTHERNET_DC_REV == 2206 #define USE_LR1120 + +#define SPI_MISO 37 +#define SPI_MOSI 39 +#define SPI_SCK 38 +#define SDCARD_CS 40 + +#define PIN_BUZZER 48 + +#define GPS_RX_PIN 10 +#define GPS_TX_PIN 21 + +#define PIN_POWER_EN 7 // RF section power supply enable +#define PERIPHERAL_WARMUP_MS 1000 // wait for TPS chip to initialize +#define TPS_EXTM 45 // connected, but not used +#define BIAS_T_ENABLE 9 // needs to be low +#define BIAS_T_VALUE 0 +#else // 2301 #define USE_LR1121 +#define SPI_MISO 10 +#define SPI_MOSI 39 +#define SPI_SCK 38 + +#define SDCARD_CS 40 + +// This is only informational, we always use SD cards in 1 bit mode +#define SPI_DATA1 15 +#define SPI_DATA2 18 + +#define GPS_RX_PIN 36 +#define GPS_TX_PIN 37 + +// dac / amp instead of buzzer +#define HAS_I2S +#define DAC_I2S_BCK 21 +#define DAC_I2S_WS 9 +#define DAC_I2S_DOUT 48 + +#define BIAS_T_ENABLE 7 // needs to be low +#define BIAS_T_VALUE 0 +#define BIAS_T_SUBGHZ 2 // also needs to be low, we hijack SENSOR_POWER_CTRL_PIN to emulate this +#define SENSOR_POWER_CTRL_PIN BIAS_T_SUBGHZ +#define SENSOR_POWER_ON 0 +#endif + +#define HAS_SDCARD // Have SPI interface SD card slot +#define SDCARD_USE_SPI1 #define LORA_RESET 3 #define LORA_SCK 12 @@ -64,10 +105,3 @@ #define LR11X0_RF_SWITCH_SUBGHZ 42 #define LR11X0_RF_SWITCH_2_4GHZ 41 - -#define HAS_SDCARD // Have SPI interface SD card slot -#define SPI_MISO 10 -#define SPI_MOSI 39 -#define SPI_SCK 38 -#define SDCARD_CS 40 -#define SDCARD_USE_SPI1 \ No newline at end of file From ad8e6c7f1e0e8563281f455a4b00f06f3366d949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Tue, 8 Oct 2024 12:29:32 +0200 Subject: [PATCH 7/7] address comments --- src/detect/ScanI2CTwoWire.cpp | 2 ++ variants/dreamcatcher/variant.h | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index 4b35b8ed33..af94290d26 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -405,7 +405,9 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) SCAN_SIMPLE_CASE(NAU7802_ADDR, NAU7802, "NAU7802 based scale found\n"); SCAN_SIMPLE_CASE(FT6336U_ADDR, FT6336U, "FT6336U touchscreen found\n"); SCAN_SIMPLE_CASE(MAX1704X_ADDR, MAX17048, "MAX17048 lipo fuel gauge found\n"); +#ifdef HAS_TPS65233 SCAN_SIMPLE_CASE(TPS65233_ADDR, TPS65233, "TPS65233 BIAS-T found\n"); +#endif SCAN_SIMPLE_CASE(MLX90614_ADDR_DEF, MLX90614, "MLX90614 IR temp sensor found\n"); case ICM20948_ADDR: // same as BMX160_ADDR diff --git a/variants/dreamcatcher/variant.h b/variants/dreamcatcher/variant.h index e640156036..eb95a95dde 100644 --- a/variants/dreamcatcher/variant.h +++ b/variants/dreamcatcher/variant.h @@ -30,8 +30,9 @@ #define PIN_BUZZER 48 -#define GPS_RX_PIN 10 -#define GPS_TX_PIN 21 +// These can either be used for GPS or a serial link. Define through Protobufs +// #define GPS_RX_PIN 10 +// #define GPS_TX_PIN 21 #define PIN_POWER_EN 7 // RF section power supply enable #define PERIPHERAL_WARMUP_MS 1000 // wait for TPS chip to initialize @@ -50,8 +51,9 @@ #define SPI_DATA1 15 #define SPI_DATA2 18 -#define GPS_RX_PIN 36 -#define GPS_TX_PIN 37 +// These can either be used for GPS or a serial link. Define through Protobufs +// #define GPS_RX_PIN 36 +// #define GPS_TX_PIN 37 // dac / amp instead of buzzer #define HAS_I2S