mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-08 06:02:05 +00:00
Simplify SX126x variant configuration (#2813)
* Update SX126xInterface.cpp * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update SX126xInterface.cpp * Update SX126xInterface.cpp * Update variant.h * Update variant.h * trunk fmt * trunk fmt * Update variant.h * trunk fmt * trunk fmt * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update pins_arduino.h * Update pins_arduino.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h * trunk fmt * Update variant.h * Update variant.h * Update variant.h * Update variant.h * trunk fmt * trunk fmt * Update variant.h * Update variant.h * Update variant.h * Update variant.h Specify behavior * Update variant.h Maintain behavior * trunk fmt * Update variant.h * Update variant.h * Update variant.h * Update variant.h * Update variant.h --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
parent
98290e5d7b
commit
4e3576ae48
@ -3,7 +3,8 @@
|
||||
#include "error.h"
|
||||
#include "mesh/NodeDB.h"
|
||||
|
||||
// Particular boards might define a different max power based on what their hardware can do
|
||||
// Particular boards might define a different max power based on what their hardware can do, default to max power output if not
|
||||
// specified (may be dangerous if using external PA and SX126x power config forgotten)
|
||||
#ifndef SX126X_MAX_POWER
|
||||
#define SX126X_MAX_POWER 22
|
||||
#endif
|
||||
@ -26,20 +27,23 @@ template <typename T> bool SX126xInterface<T>::init()
|
||||
pinMode(SX126X_POWER_EN, OUTPUT);
|
||||
#endif
|
||||
|
||||
#ifndef SX126X_E22
|
||||
float tcxoVoltage = 0; // None - we use an XTAL
|
||||
// FIXME: correct logic to default to not using TCXO if no voltage is specified for SX126X_DIO3_TCXO_VOLTAGE
|
||||
#if !defined(SX126X_DIO3_TCXO_VOLTAGE)
|
||||
float tcxoVoltage =
|
||||
0; // "TCXO reference voltage to be set on DIO3. Defaults to 1.6 V, set to 0 to skip." per
|
||||
// https://github.com/jgromes/RadioLib/blob/690a050ebb46e6097c5d00c371e961c1caa3b52e/src/modules/SX126x/SX126x.h#L471C26-L471C104
|
||||
// (DIO3 is free to be used as an IRQ)
|
||||
LOG_DEBUG("SX126X_DIO3_TCXO_VOLTAGE not defined, not using DIO3 as TCXO reference voltage\n");
|
||||
#else
|
||||
// Use DIO3 to power tcxo per https://github.com/jgromes/RadioLib/issues/12#issuecomment-520695575
|
||||
float tcxoVoltage = 1.8;
|
||||
float tcxoVoltage = SX126X_DIO3_TCXO_VOLTAGE;
|
||||
LOG_DEBUG("SX126X_DIO3_TCXO_VOLTAGE defined, using DIO3 as TCXO reference voltage at %f V\n", SX126X_DIO3_TCXO_VOLTAGE);
|
||||
// (DIO3 is not free to be used as an IRQ)
|
||||
#endif
|
||||
// FIXME: May want to set depending on a definition, currently all SX126x variant files use the DC-DC regulator option
|
||||
bool useRegulatorLDO = false; // Seems to depend on the connection to pin 9/DCC_SW - if an inductor DCDC?
|
||||
|
||||
RadioLibInterface::init();
|
||||
|
||||
if (power == 0)
|
||||
power = SX126X_MAX_POWER;
|
||||
|
||||
if (power > SX126X_MAX_POWER) // This chip has lower power limits than some
|
||||
if (power > SX126X_MAX_POWER) // Clamp power to maximum defined level
|
||||
power = SX126X_MAX_POWER;
|
||||
|
||||
limitPower();
|
||||
@ -54,49 +58,50 @@ template <typename T> bool SX126xInterface<T>::init()
|
||||
LOG_INFO("Bandwidth set to %f\n", bw);
|
||||
LOG_INFO("Power output set to %d\n", power);
|
||||
|
||||
// current limit was removed from module' ctor
|
||||
// override default value (60 mA)
|
||||
// Overriding current limit
|
||||
// (https://github.com/jgromes/RadioLib/blob/690a050ebb46e6097c5d00c371e961c1caa3b52e/src/modules/SX126x/SX126x.cpp#L85) using
|
||||
// value in SX126xInterface.h (currently 140 mA) It may or may not be neccessary, depending on how RadioLib functions, from
|
||||
// SX1261/2 datasheet: OCP after setting DeviceSel with SetPaConfig(): SX1261 - 60 mA, SX1262 - 140 mA For the SX1268 the IC
|
||||
// defaults to 140mA no matter the set power level, but RadioLib set it lower, this would need further checking Default values
|
||||
// are: SX1262, SX1268: 0x38 (140 mA), SX1261: 0x18 (60 mA)
|
||||
// FIXME: Not ideal to increase SX1261 current limit above 60mA as it can only transmit max 15dBm, should probably only do it
|
||||
// if using SX1262 or SX1268
|
||||
res = lora.setCurrentLimit(currentLimit);
|
||||
LOG_DEBUG("Current limit set to %f\n", currentLimit);
|
||||
LOG_DEBUG("Current limit set result %d\n", res);
|
||||
|
||||
#if defined(SX126X_E22)
|
||||
// E22 Emulation explicitly requires DIO2 as RF switch, so set it to TRUE again for good measure. In case somebody defines
|
||||
// SX126X_TX for an E22 Module
|
||||
if (res == RADIOLIB_ERR_NONE) {
|
||||
LOG_DEBUG("SX126X_E22 mode enabled. Setting DIO2 as RF Switch\n");
|
||||
res = lora.setDio2AsRfSwitch(true);
|
||||
}
|
||||
#ifdef SX126X_DIO2_AS_RF_SWITCH
|
||||
LOG_DEBUG("Setting DIO2 as RF switch\n");
|
||||
bool dio2AsRfSwitch = true;
|
||||
#else
|
||||
LOG_DEBUG("Setting DIO2 as not RF switch\n");
|
||||
bool dio2AsRfSwitch = false;
|
||||
#endif
|
||||
if (res == RADIOLIB_ERR_NONE) {
|
||||
res = lora.setDio2AsRfSwitch(dio2AsRfSwitch);
|
||||
}
|
||||
|
||||
#if defined(SX126X_TXEN) && (SX126X_TXEN != RADIOLIB_NC)
|
||||
// If SX126X_TXEN is connected to the MCU, we are manually controlling RX and TX.
|
||||
// But lora.begin (called above) sets Dio2 as RF switch control, which is not true here, so set it back to false.
|
||||
if (res == RADIOLIB_ERR_NONE) {
|
||||
LOG_DEBUG("SX126X_TXEN pin defined. Setting RF Switch: RXEN=%i, TXEN=%i\n", SX126X_RXEN, SX126X_TXEN);
|
||||
res = lora.setDio2AsRfSwitch(false);
|
||||
lora.setRfSwitchPins(SX126X_RXEN, SX126X_TXEN);
|
||||
}
|
||||
#elif defined(SX126X_RXEN) && (SX126X_RXEN != RADIOLIB_NC && defined(E22_TXEN_CONNECTED_TO_DIO2))
|
||||
// Otherwise, if SX126X_RXEN is connected to the MCU, and E22_TXEN_CONNECTED_TO_DIO2 is defined, we are letting the
|
||||
// E22 control RX and TX via DIO2. In this configuration, the E22's TXEN and DIO2 pins are connected to each other,
|
||||
// but not to the MCU.
|
||||
// However, we must still connect the E22's RXEN pin to the MCU, define SX126X_RXEN accordingly, and then call
|
||||
// setRfSwitchPins, otherwise RX sensitivity (observed via RSSI) is greatly diminished.
|
||||
LOG_DEBUG("SX126X_RXEN and E22_TXEN_CONNECTED_TO_DIO2 are defined; value of res: %d", res);
|
||||
if (res == RADIOLIB_ERR_NONE) {
|
||||
LOG_DEBUG("SX126X_TXEN is RADIOLIB_NC, but SX126X_RXEN and E22_TXEN_CONNECTED_TO_DIO2 are both defined; calling "
|
||||
"lora.setRfSwitchPins.");
|
||||
lora.setRfSwitchPins(SX126X_RXEN, SX126X_TXEN);
|
||||
}
|
||||
// If a pin isn't defined, we set it to RADIOLIB_NC, it is safe to always do external RF switching with RADIOLIB_NC as it has
|
||||
// no effect
|
||||
#ifndef SX126X_RXEN
|
||||
#define SX126X_RXEN RADIOLIB_NC
|
||||
LOG_DEBUG("SX126X_RXEN not defined, defaulting to RADIOLIB_NC\n");
|
||||
#endif
|
||||
#ifndef SX126X_TXEN
|
||||
#define SX126X_TXEN RADIOLIB_NC
|
||||
LOG_DEBUG("SX126X_TXEN not defined, defaulting to RADIOLIB_NC\n");
|
||||
#endif
|
||||
if (res == RADIOLIB_ERR_NONE) {
|
||||
LOG_DEBUG("Using MCU pin %i as RXEN and pin %i as TXEN to control RF switching\n", SX126X_RXEN, SX126X_TXEN);
|
||||
lora.setRfSwitchPins(SX126X_RXEN, SX126X_TXEN);
|
||||
}
|
||||
|
||||
if (config.lora.sx126x_rx_boosted_gain) {
|
||||
uint16_t result = lora.setRxBoostedGainMode(true);
|
||||
LOG_INFO("Set Rx Boosted Gain mode; result: %d\n", result);
|
||||
LOG_INFO("Set RX gain to boosted mode; result: %d\n", result);
|
||||
} else {
|
||||
uint16_t result = lora.setRxBoostedGainMode(false);
|
||||
LOG_INFO("Set Rx Power Saving Gain mode; result: %d\n", result);
|
||||
LOG_INFO("Set RX gain to power saving mode (boosted mode off); result: %d\n", result);
|
||||
}
|
||||
|
||||
#if 0
|
||||
@ -265,7 +270,7 @@ template <typename T> bool SX126xInterface<T>::isChannelActive()
|
||||
/** Could we send right now (i.e. either not actively receiving or transmitting)? */
|
||||
template <typename T> bool SX126xInterface<T>::isActivelyReceiving()
|
||||
{
|
||||
// The IRQ status will be cleared when we start our read operation. Check if we've started a header, but haven't yet
|
||||
// The IRQ status will be cleared when we start our read operation. Check if we've started a header, but haven't yet
|
||||
// received and handled the interrupt for reading the packet/handling errors.
|
||||
|
||||
uint16_t irq = lora.getIrqStatus();
|
||||
@ -296,7 +301,7 @@ template <typename T> bool SX126xInterface<T>::sleep()
|
||||
{
|
||||
// Not keeping config is busted - next time nrf52 board boots lora sending fails tcxo related? - see datasheet
|
||||
// \todo Display actual typename of the adapter, not just `SX126x`
|
||||
LOG_DEBUG("sx126x entering sleep mode (FIXME, don't keep config)\n");
|
||||
LOG_DEBUG("SX126x entering sleep mode (FIXME, don't keep config)\n");
|
||||
setStandby(); // Stop any pending operations
|
||||
|
||||
// turn off TCXO if it was powered
|
||||
@ -312,4 +317,4 @@ template <typename T> bool SX126xInterface<T>::sleep()
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -47,12 +47,12 @@ extern "C" {
|
||||
#define PIN_LED2 (0 + 6) // Built in Green P0.06
|
||||
|
||||
// Green Built in LED1
|
||||
//#define PIN_LED1 (0 + 6) // LED1 P1.15
|
||||
// #define PIN_LED1 (0 + 6) // LED1 P1.15
|
||||
|
||||
// RGB NeoPixel LED2
|
||||
//#define PIN_LED1 (0 + 8) Red
|
||||
//#define PIN_LED1 (32 + 9) Green
|
||||
//#define PIN_LED1 (0 + 12) Blue
|
||||
// #define PIN_LED1 (0 + 8) Red
|
||||
// #define PIN_LED1 (32 + 9) Green
|
||||
// #define PIN_LED1 (0 + 12) Blue
|
||||
|
||||
#define LED_BUILTIN PIN_LED1
|
||||
#define LED_CONN PIN_LED2
|
||||
@ -113,7 +113,7 @@ static const uint8_t SCK = PIN_SPI_SCK;
|
||||
* eink display pins
|
||||
*/
|
||||
|
||||
//#define PIN_EINK_EN (-1)
|
||||
// #define PIN_EINK_EN (-1)
|
||||
#define PIN_EINK_EN (0 + 6) // Turn on the Green built in LED
|
||||
#define PIN_EINK_CS (32) // EPD_CS
|
||||
#define PIN_EINK_BUSY (20) // EPD_BUSY
|
||||
@ -140,7 +140,8 @@ static const uint8_t SCK = PIN_SPI_SCK;
|
||||
#define SX126X_RESET (32 + 15) // LORA_RESET P1.15
|
||||
#define SX126X_TXEN (32 + 13) // TXEN P1.13 NiceRF 868 dont use
|
||||
#define SX126X_RXEN (32 + 10) // RXEN P1.10 NiceRF 868 dont use
|
||||
#define SX126X_E22
|
||||
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
||||
#define PIN_GPS_EN (-1)
|
||||
#define PIN_GPS_PPS (-1) // Pulse per second input from the GPS
|
||||
|
@ -73,7 +73,7 @@ static const uint8_t AREF = PIN_AREF;
|
||||
*/
|
||||
#define SPI_INTERFACES_COUNT 2
|
||||
// here
|
||||
//#define SPI_INTERFACES_COUNT 1
|
||||
// #define SPI_INTERFACES_COUNT 1
|
||||
|
||||
#define PIN_SPI_MISO (0 + 31) // MISO P0.31
|
||||
#define PIN_SPI_MOSI (0 + 30) // MOSI P0.30
|
||||
@ -94,7 +94,7 @@ static const uint8_t SCK = PIN_SPI_SCK;
|
||||
* eink display pins
|
||||
*/
|
||||
|
||||
//#define PIN_EINK_EN (-1)
|
||||
// #define PIN_EINK_EN (-1)
|
||||
#define PIN_EINK_CS (0 + 3) // EPD_CS
|
||||
#define PIN_EINK_BUSY (32 + 11) // EPD_BUSY
|
||||
#define PIN_EINK_DC (32 + 13) // EPD_D/C
|
||||
@ -118,8 +118,8 @@ static const uint8_t SCK = PIN_SPI_SCK;
|
||||
#define SX128X_CS (0 + 23)
|
||||
#define SX128X_DIO1 (0 + 4)
|
||||
#define SX128X_BUSY (0 + 7)
|
||||
//#define SX128X_TXEN (32 + 9)
|
||||
//#define SX128X_RXEN (0 + 12)
|
||||
// #define SX128X_TXEN (32 + 9)
|
||||
// #define SX128X_RXEN (0 + 12)
|
||||
#define SX128X_RESET LORA_RESET
|
||||
|
||||
#define PIN_GPS_EN (-1)
|
||||
|
@ -96,8 +96,8 @@ static const uint8_t SCK = PIN_SPI_SCK;
|
||||
#define SX128X_CS (0 + 23)
|
||||
#define SX128X_DIO1 (0 + 4)
|
||||
#define SX128X_BUSY (0 + 7)
|
||||
//#define SX128X_TXEN (32 + 9)
|
||||
//#define SX128X_RXEN (0 + 12)
|
||||
// #define SX128X_TXEN (32 + 9)
|
||||
// #define SX128X_RXEN (0 + 12)
|
||||
#define SX128X_RESET LORA_RESET
|
||||
|
||||
#define PIN_GPS_EN (-1)
|
||||
|
@ -23,7 +23,9 @@
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY 10
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_E22 // use DIO2 as RF switch
|
||||
|
||||
#define SX126X_DIO2_AS_RF_SWITCH // use DIO2 as RF switch
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
||||
#define HAS_GPS 0
|
||||
#undef GPS_RX_PIN
|
||||
|
@ -27,11 +27,11 @@ static const uint8_t SCK = 21;
|
||||
static const uint8_t MOSI = 38;
|
||||
static const uint8_t SS = 17;
|
||||
|
||||
//#define SPI_MOSI (11)
|
||||
//#define SPI_SCK (14)
|
||||
//#define SPI_MISO (2)
|
||||
//#define SPI_CS (13)
|
||||
// #define SPI_MOSI (11)
|
||||
// #define SPI_SCK (14)
|
||||
// #define SPI_MISO (2)
|
||||
// #define SPI_CS (13)
|
||||
|
||||
//#define SDCARD_CS SPI_CS
|
||||
// #define SDCARD_CS SPI_CS
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
#endif /* Pins_Arduino_h */
|
||||
|
@ -2,10 +2,10 @@
|
||||
#undef GPS_RX_PIN
|
||||
#undef GPS_TX_PIN
|
||||
|
||||
//#define HAS_SCREEN 0
|
||||
// #define HAS_SCREEN 0
|
||||
|
||||
//#define HAS_SDCARD
|
||||
//#define SDCARD_USE_SPI1
|
||||
// #define HAS_SDCARD
|
||||
// #define SDCARD_USE_SPI1
|
||||
|
||||
#define USE_SSD1306
|
||||
#define I2C_SDA 12
|
||||
@ -14,13 +14,13 @@
|
||||
#define LED_PIN 46
|
||||
#define LED_STATE_ON 0 // State when LED is litted
|
||||
|
||||
//#define BUTTON_PIN 15 // Pico OLED 1.3 User key 0 - removed User key 1 (17)
|
||||
// #define BUTTON_PIN 15 // Pico OLED 1.3 User key 0 - removed User key 1 (17)
|
||||
|
||||
#define BUTTON_PIN 40
|
||||
//#define BUTTON_PIN 0 // This is the BOOT button pad at the moment
|
||||
//#define BUTTON_NEED_PULLUP
|
||||
// #define BUTTON_PIN 0 // This is the BOOT button pad at the moment
|
||||
// #define BUTTON_NEED_PULLUP
|
||||
|
||||
//#define USE_RF95 // RFM95/SX127x
|
||||
// #define USE_RF95 // RFM95/SX127x
|
||||
|
||||
#undef RF95_SCK
|
||||
#undef RF95_MISO
|
||||
@ -43,10 +43,11 @@
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_BUSY
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_E22
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#endif
|
||||
|
||||
//#define USE_SX1280
|
||||
// #define USE_SX1280
|
||||
#ifdef USE_SX1280
|
||||
#define RF95_MISO 1
|
||||
#define RF95_SCK 3
|
||||
@ -61,13 +62,13 @@
|
||||
#define SX128X_RESET LORA_RESET
|
||||
#endif
|
||||
|
||||
//#define USE_EINK
|
||||
// #define USE_EINK
|
||||
/*
|
||||
* eink display pins
|
||||
*/
|
||||
//#define PIN_EINK_CS
|
||||
//#define PIN_EINK_BUSY
|
||||
//#define PIN_EINK_DC
|
||||
//#define PIN_EINK_RES (-1)
|
||||
//#define PIN_EINK_SCLK 3
|
||||
//#define PIN_EINK_MOSI 4
|
||||
// #define PIN_EINK_CS
|
||||
// #define PIN_EINK_BUSY
|
||||
// #define PIN_EINK_DC
|
||||
// #define PIN_EINK_RES (-1)
|
||||
// #define PIN_EINK_SCLK 3
|
||||
// #define PIN_EINK_MOSI 4
|
||||
|
@ -31,10 +31,13 @@
|
||||
|
||||
// PINS FOR THE 900M22S
|
||||
|
||||
#define LORA_DIO1 26 // IRQ for SX1262/SX1268
|
||||
#define LORA_DIO2 22 // BUSY for SX1262/SX1268
|
||||
#define LORA_TXEN NOT_A_PIN // Input - RF switch TX control, connecting external MCU IO or DIO2, valid in high level
|
||||
#define LORA_RXEN 17 // Input - RF switch RX control, connecting external MCU IO, valid in high level
|
||||
#define LORA_DIO1 26 // IRQ for SX1262/SX1268
|
||||
#define LORA_DIO2 22 // BUSY for SX1262/SX1268
|
||||
// NOT_A_PIN is treated as RADIOLIB_NC due to how they are defined, best to use RADIOLIB_NC directly
|
||||
#define LORA_TXEN RADIOLIB_NC // Input - RF switch TX control, connecting external MCU IO or DIO2, valid in high level
|
||||
// E22_TXEN_CONNECTED_TO_DIO2 wasn't defined, so RXEN wasn't controlled. Commented it out to maintain behavior, but shouldn't be.
|
||||
// Need to comment out defining SX126X_RXEN as LORA_RXEN too
|
||||
// #define LORA_RXEN 17 // Input - RF switch RX control, connecting external MCU IO, valid in high level
|
||||
#undef RF95_NSS
|
||||
#define RF95_NSS 16
|
||||
#define SX126X_BUSY 22
|
||||
@ -53,7 +56,7 @@
|
||||
*/
|
||||
|
||||
// RX/TX for RFM95/SX127x
|
||||
#define RF95_RXEN LORA_RXEN
|
||||
// #define RF95_RXEN LORA_RXEN
|
||||
#define RF95_TXEN LORA_TXEN
|
||||
// #define RF95_TCXO <GPIO#>
|
||||
|
||||
@ -61,12 +64,13 @@
|
||||
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_RXEN LORA_RXEN
|
||||
// #define SX126X_RXEN LORA_RXEN
|
||||
#define SX126X_TXEN LORA_TXEN
|
||||
|
||||
// supported modules list
|
||||
//#define USE_RF95 // RFM95/SX127x
|
||||
// #define USE_RF95 // RFM95/SX127x
|
||||
#define USE_SX1262
|
||||
//#define USE_SX1268
|
||||
//#define USE_LLCC68
|
||||
#define SX126X_E22
|
||||
// #define USE_SX1268
|
||||
// #define USE_LLCC68
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
@ -37,8 +37,9 @@
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_RXEN 14
|
||||
#define SX126X_TXEN RADIOLIB_NC
|
||||
#define E22_TXEN_CONNECTED_TO_DIO2 1
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
|
||||
// Set lora.tx_power to 13 for Hydra or other E22 900M30S target due to PA
|
||||
#define SX126X_MAX_POWER 13
|
||||
#define SX126X_E22
|
||||
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
@ -52,5 +52,5 @@
|
||||
#ifdef EBYTE_E22
|
||||
// Internally the TTGO module hooks the SX126x-DIO2 in to control the TX/RX switch
|
||||
// (which is the default for the sx1262interface code)
|
||||
#define SX126X_E22
|
||||
#endif
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#endif
|
||||
|
@ -53,5 +53,5 @@
|
||||
#ifdef EBYTE_E22
|
||||
// Internally the TTGO module hooks the SX126x-DIO2 in to control the TX/RX switch
|
||||
// (which is the default for the sx1262interface code)
|
||||
#define SX126X_E22
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#endif
|
||||
|
@ -105,7 +105,7 @@ extern "C" {
|
||||
#ifdef EBYTE_E22
|
||||
// Internally the TTGO module hooks the SX126x-DIO2 in to control the TX/RX switch
|
||||
// (which is the default for the sx1262interface code)
|
||||
#define SX126X_E22
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -33,4 +33,5 @@
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_BUSY
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_E22
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
@ -33,4 +33,6 @@
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_E22
|
||||
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
@ -40,4 +40,6 @@
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_E22
|
||||
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
@ -59,4 +59,6 @@
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_E22
|
||||
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
@ -32,4 +32,6 @@
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_E22
|
||||
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#define USE_LFXO
|
||||
|
||||
//#define USE_SEGGER
|
||||
// #define USE_SEGGER
|
||||
|
||||
// Number of pins defined in PinDescription array
|
||||
#define PINS_COUNT (16)
|
||||
@ -88,6 +88,7 @@
|
||||
#define BATTERY_PIN 3
|
||||
#define ADC_MULTIPLIER 1.436
|
||||
|
||||
#define SX126X_E22 // Not really an E22 but this board clones using DIO3 for tcxo control
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8 // Not really an E22 but this board clones using DIO3 for tcxo control
|
||||
|
||||
#endif
|
||||
|
@ -134,7 +134,8 @@ static const uint8_t SCK = PIN_SPI_SCK;
|
||||
#define SX126X_TXEN (31)
|
||||
#define SX126X_POWER_EN \
|
||||
(15) // FIXME, see warning hre https://github.com/BigCorvus/SX1262-LoRa-BLE-Relay/blob/master/LORA_RELAY_NRF52840.ino
|
||||
#define SX126X_E22 // Indicates this SX1262 is inside of an ebyte E22 module and special config should be done for that
|
||||
// Indicates this SX1262 is inside of an ebyte E22 module and special config should be done for that
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
||||
#define ST7735_RESET (11) // Output
|
||||
#define ST7735_CS (12)
|
||||
|
@ -154,7 +154,8 @@ static const uint8_t SCK = PIN_SPI_SCK;
|
||||
#define SX126X_TXEN (31)
|
||||
#define SX126X_POWER_EN \
|
||||
(15) // FIXME, see warning hre https://github.com/BigCorvus/SX1262-LoRa-BLE-Relay/blob/master/LORA_RELAY_NRF52840.ino
|
||||
#define SX126X_E22 // Indicates this SX1262 is inside of an ebyte E22 module and special config should be done for that
|
||||
// Indicates this SX1262 is inside of an ebyte E22 module and special config should be done for that
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
||||
// ST7565 SPI
|
||||
#define ST7735_RESET (11) // Output
|
||||
|
@ -4,7 +4,7 @@
|
||||
#define BUTTON_PIN 3 // M5Stack STAMP C3 built in button
|
||||
#define BUTTON_NEED_PULLUP
|
||||
|
||||
//#define HAS_SCREEN 0
|
||||
// #define HAS_SCREEN 0
|
||||
#define HAS_GPS 0
|
||||
#undef GPS_RX_PIN
|
||||
#undef GPS_TX_PIN
|
||||
@ -28,45 +28,46 @@
|
||||
|
||||
// WaveShare Core1262-868M OK
|
||||
// https://www.waveshare.com/wiki/Core1262-868M
|
||||
//#define USE_SX1262
|
||||
//#define RF95_SCK 4
|
||||
//#define RF95_MISO 5
|
||||
//#define RF95_MOSI 6
|
||||
//#define RF95_NSS 7
|
||||
//#define LORA_DIO0 RADIOLIB_NC
|
||||
//#define LORA_RESET 8
|
||||
//#define LORA_DIO1 10
|
||||
//#define LORA_DIO2 RADIOLIB_NC
|
||||
//#define LORA_BUSY 18
|
||||
//#define SX126X_CS RF95_NSS
|
||||
//#define SX126X_DIO1 LORA_DIO1
|
||||
//#define SX126X_BUSY LORA_BUSY
|
||||
//#define SX126X_RESET LORA_RESET
|
||||
//#define SX126X_E22
|
||||
// #define USE_SX1262
|
||||
// #define RF95_SCK 4
|
||||
// #define RF95_MISO 5
|
||||
// #define RF95_MOSI 6
|
||||
// #define RF95_NSS 7
|
||||
// #define LORA_DIO0 RADIOLIB_NC
|
||||
// #define LORA_RESET 8
|
||||
// #define LORA_DIO1 10
|
||||
// #define LORA_DIO2 RADIOLIB_NC
|
||||
// #define LORA_BUSY 18
|
||||
// #define SX126X_CS RF95_NSS
|
||||
// #define SX126X_DIO1 LORA_DIO1
|
||||
// #define SX126X_BUSY LORA_BUSY
|
||||
// #define SX126X_RESET LORA_RESET
|
||||
// #define SX126X_DIO2_AS_RF_SWITCH
|
||||
// #define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
||||
// SX128X 2.4 Ghz LoRa module Not OK - RadioLib issue ? still to confirm
|
||||
//#define USE_SX1280
|
||||
//#define RF95_SCK 4
|
||||
//#define RF95_MISO 5
|
||||
//#define RF95_MOSI 6
|
||||
//#define RF95_NSS 7
|
||||
//#define LORA_DIO0 -1
|
||||
//#define LORA_DIO1 10
|
||||
//#define LORA_DIO2 21
|
||||
//#define LORA_RESET 8
|
||||
//#define LORA_BUSY 1
|
||||
//#define SX128X_CS RF95_NSS
|
||||
//#define SX128X_DIO1 LORA_DIO1
|
||||
//#define SX128X_BUSY LORA_BUSY
|
||||
//#define SX128X_RESET LORA_RESET
|
||||
//#define SX128X_MAX_POWER 10
|
||||
// #define USE_SX1280
|
||||
// #define RF95_SCK 4
|
||||
// #define RF95_MISO 5
|
||||
// #define RF95_MOSI 6
|
||||
// #define RF95_NSS 7
|
||||
// #define LORA_DIO0 -1
|
||||
// #define LORA_DIO1 10
|
||||
// #define LORA_DIO2 21
|
||||
// #define LORA_RESET 8
|
||||
// #define LORA_BUSY 1
|
||||
// #define SX128X_CS RF95_NSS
|
||||
// #define SX128X_DIO1 LORA_DIO1
|
||||
// #define SX128X_BUSY LORA_BUSY
|
||||
// #define SX128X_RESET LORA_RESET
|
||||
// #define SX128X_MAX_POWER 10
|
||||
|
||||
// Not yet tested
|
||||
//#define USE_EINK
|
||||
//#define PIN_EINK_EN -1 // N/C
|
||||
//#define PIN_EINK_CS 9 // EPD_CS
|
||||
//#define PIN_EINK_BUSY 18 // EPD_BUSY
|
||||
//#define PIN_EINK_DC 19 // EPD_D/C
|
||||
//#define PIN_EINK_RES -1 // Connected but not needed
|
||||
//#define PIN_EINK_SCLK 4 // EPD_SCLK
|
||||
//#define PIN_EINK_MOSI 6 // EPD_MOSI
|
||||
// #define USE_EINK
|
||||
// #define PIN_EINK_EN -1 // N/C
|
||||
// #define PIN_EINK_CS 9 // EPD_CS
|
||||
// #define PIN_EINK_BUSY 18 // EPD_BUSY
|
||||
// #define PIN_EINK_DC 19 // EPD_D/C
|
||||
// #define PIN_EINK_RES -1 // Connected but not needed
|
||||
// #define PIN_EINK_SCLK 4 // EPD_SCLK
|
||||
// #define PIN_EINK_MOSI 6 // EPD_MOSI
|
||||
|
@ -4,7 +4,7 @@
|
||||
#define I2C_SCL 22
|
||||
|
||||
// #define BUTTON_PIN 39 // 38, 37
|
||||
//#define BUTTON_PIN 0
|
||||
// #define BUTTON_PIN 0
|
||||
#define BUTTON_NEED_PULLUP
|
||||
// #define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Plugin.
|
||||
|
||||
|
@ -3,8 +3,8 @@
|
||||
#define I2C_SCL 22
|
||||
|
||||
// 7-07-2023 Or enable Secondary I2C Bus
|
||||
//#define I2C_SDA1 32
|
||||
//#define I2C_SCL1 33
|
||||
// #define I2C_SDA1 32
|
||||
// #define I2C_SCL1 33
|
||||
|
||||
#define HAS_GPS 1
|
||||
#undef GPS_RX_PIN
|
||||
@ -39,7 +39,7 @@
|
||||
#undef RF95_MOSI
|
||||
#undef RF95_NSS
|
||||
#define USE_RF95
|
||||
//#define USE_SX1280
|
||||
// #define USE_SX1280
|
||||
|
||||
#ifdef USE_RF95
|
||||
#define RF95_SCK 18
|
||||
|
@ -64,7 +64,7 @@ extern "C" {
|
||||
* Buttons
|
||||
*/
|
||||
|
||||
//#define PIN_BUTTON1 9 // Pin for button on E-ink button module or IO expansion
|
||||
// #define PIN_BUTTON1 9 // Pin for button on E-ink button module or IO expansion
|
||||
#define BUTTON_NEED_PULLUP
|
||||
#define PIN_BUTTON2 12
|
||||
#define PIN_BUTTON3 24
|
||||
@ -191,7 +191,9 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
|
||||
// #define SX126X_TXEN (39)
|
||||
// #define SX126X_RXEN (37)
|
||||
#define SX126X_POWER_EN (37)
|
||||
#define SX126X_E22 // DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
|
||||
|
||||
#define SX126X_DIO2_AS_RF_SWITCH // DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
||||
#define PIN_GPS_RESET (34) // Must be P1.02
|
||||
// #define PIN_GPS_EN
|
||||
@ -220,7 +222,7 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
|
||||
#define ADC_MULTIPLIER VBAT_DIVIDER_COMP // REAL_VBAT_MV_PER_LSB
|
||||
#define VBAT_RAW_TO_SCALED(x) (REAL_VBAT_MV_PER_LSB * x)
|
||||
|
||||
//#define HAS_RTC 1
|
||||
// #define HAS_RTC 1
|
||||
|
||||
#define HAS_ETHERNET 1
|
||||
|
||||
@ -237,4 +239,4 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -24,11 +24,11 @@ static const uint8_t SCK = 5;
|
||||
static const uint8_t MOSI = 6;
|
||||
static const uint8_t SS = 7;
|
||||
|
||||
//#define SPI_MOSI (11)
|
||||
//#define SPI_SCK (14)
|
||||
//#define SPI_MISO (2)
|
||||
//#define SPI_CS (13)
|
||||
// #define SPI_MOSI (11)
|
||||
// #define SPI_SCK (14)
|
||||
// #define SPI_MISO (2)
|
||||
// #define SPI_CS (13)
|
||||
|
||||
//#define SDCARD_CS SPI_CS
|
||||
// #define SDCARD_CS SPI_CS
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
|
@ -2,22 +2,22 @@
|
||||
#undef GPS_RX_PIN
|
||||
#undef GPS_TX_PIN
|
||||
|
||||
//#define HAS_SCREEN 0
|
||||
//#define HAS_SDCARD
|
||||
//#define SDCARD_USE_SPI1
|
||||
// #define HAS_SCREEN 0
|
||||
// #define HAS_SDCARD
|
||||
// #define SDCARD_USE_SPI1
|
||||
|
||||
//#define USE_SSD1306
|
||||
// #define USE_SSD1306
|
||||
|
||||
#define I2C_SDA 18 // 1 // I2C pins for this board
|
||||
#define I2C_SCL 17 // 2
|
||||
|
||||
//#define LED_PIN 38 // This is a RGB LED not a standard LED
|
||||
// #define LED_PIN 38 // This is a RGB LED not a standard LED
|
||||
|
||||
#define BUTTON_PIN 0 // This is the BOOT button
|
||||
#define BUTTON_NEED_PULLUP
|
||||
|
||||
//#define USE_RF95 // RFM95/SX127x
|
||||
//#define USE_SX1262
|
||||
// #define USE_RF95 // RFM95/SX127x
|
||||
// #define USE_SX1262
|
||||
#define USE_SX1280
|
||||
|
||||
#define RF95_MISO 3
|
||||
|
@ -24,11 +24,11 @@ static const uint8_t SCK = 5;
|
||||
static const uint8_t MOSI = 6;
|
||||
static const uint8_t SS = 7;
|
||||
|
||||
//#define SPI_MOSI (11)
|
||||
//#define SPI_SCK (14)
|
||||
//#define SPI_MISO (2)
|
||||
//#define SPI_CS (13)
|
||||
// #define SPI_MOSI (11)
|
||||
// #define SPI_SCK (14)
|
||||
// #define SPI_MISO (2)
|
||||
// #define SPI_CS (13)
|
||||
|
||||
//#define SDCARD_CS SPI_CS
|
||||
// #define SDCARD_CS SPI_CS
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
|
@ -2,22 +2,22 @@
|
||||
#undef GPS_RX_PIN
|
||||
#undef GPS_TX_PIN
|
||||
|
||||
//#define HAS_SCREEN 0
|
||||
//#define HAS_SDCARD
|
||||
//#define SDCARD_USE_SPI1
|
||||
// #define HAS_SCREEN 0
|
||||
// #define HAS_SDCARD
|
||||
// #define SDCARD_USE_SPI1
|
||||
|
||||
#define USE_SSD1306
|
||||
|
||||
#define I2C_SDA 18 // 1 // I2C pins for this board
|
||||
#define I2C_SCL 17 // 2
|
||||
|
||||
//#define LED_PIN 38 // This is a RGB LED not a standard LED
|
||||
// #define LED_PIN 38 // This is a RGB LED not a standard LED
|
||||
|
||||
#define BUTTON_PIN 0 // This is the BOOT button
|
||||
#define BUTTON_NEED_PULLUP
|
||||
|
||||
//#define USE_RF95 // RFM95/SX127x
|
||||
//#define USE_SX1262
|
||||
// #define USE_RF95 // RFM95/SX127x
|
||||
// #define USE_SX1262
|
||||
#define USE_SX1280
|
||||
|
||||
#define RF95_MISO 3
|
||||
@ -44,13 +44,13 @@
|
||||
#define SX128X_RESET LORA_RESET
|
||||
#endif
|
||||
|
||||
//#define USE_EINK
|
||||
// #define USE_EINK
|
||||
/*
|
||||
* eink display pins
|
||||
*/
|
||||
//#define PIN_EINK_CS 13
|
||||
//#define PIN_EINK_BUSY 2
|
||||
//#define PIN_EINK_DC 1
|
||||
//#define PIN_EINK_RES (-1)
|
||||
//#define PIN_EINK_SCLK 5
|
||||
//#define PIN_EINK_MOSI 6
|
||||
// #define PIN_EINK_CS 13
|
||||
// #define PIN_EINK_BUSY 2
|
||||
// #define PIN_EINK_DC 1
|
||||
// #define PIN_EINK_RES (-1)
|
||||
// #define PIN_EINK_SCLK 5
|
||||
// #define PIN_EINK_MOSI 6
|
||||
|
@ -27,7 +27,9 @@
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_E22 // Not really an E22
|
||||
// Not really an E22
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
// Internally the module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for the sx1262interface
|
||||
// code)
|
||||
#endif
|
||||
@ -37,4 +39,4 @@
|
||||
#define BATTERY_SENSE_SAMPLES 15 // Set the number of samples, It has an effect of increasing sensitivity.
|
||||
#define ADC_MULTIPLIER 2
|
||||
|
||||
#define USE_SH1107_128_64
|
||||
#define USE_SH1107_128_64
|
||||
|
@ -27,7 +27,9 @@
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_E22 // Not really an E22
|
||||
// Not really an E22
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
// Internally the module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for the sx1262interface
|
||||
// code)
|
||||
#endif
|
||||
|
@ -118,7 +118,9 @@ External serial flash W25Q16JV_IQ
|
||||
// This is used as an *output* from the sx1262 and connected internally to power the tcxo, do not drive from the main CPU?
|
||||
#define SX126X_BUSY (32 + 11)
|
||||
#define SX126X_RESET (32 + 15)
|
||||
#define SX126X_E22 // DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
|
||||
// DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
||||
// #define LORA_DISABLE_SENDING // Define this to disable transmission for testing (power testing etc...)
|
||||
|
||||
@ -193,4 +195,4 @@ External serial flash W25Q16JV_IQ
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -146,6 +146,7 @@ static const uint8_t SCK = PIN_SPI_SCK;
|
||||
#define SX126X_BUSY (32 + 4) // P1.04
|
||||
#define SX126X_RESET (0 + 3) // P0.03
|
||||
#define SX126X_ANT_SW (32 + 10) // P1.10
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
|
||||
// To debug via the segger JLINK console rather than the CDC-ACM serial device
|
||||
// #define USE_SEGGER
|
||||
|
@ -20,5 +20,6 @@
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
// HOPE RFM90 does not have a TCXO therefore not SX126X_E22
|
||||
#endif
|
||||
|
@ -89,8 +89,8 @@ static const uint8_t A7 = PIN_A7;
|
||||
|
||||
// Other pins
|
||||
#define PIN_AREF (0xff)
|
||||
//#define PIN_NFC1 (9)
|
||||
//#define PIN_NFC2 (10)
|
||||
// #define PIN_NFC1 (9)
|
||||
// #define PIN_NFC2 (10)
|
||||
|
||||
static const uint8_t AREF = PIN_AREF;
|
||||
|
||||
@ -103,8 +103,8 @@ static const uint8_t AREF = PIN_AREF;
|
||||
#define PIN_SERIAL1_TX (9)
|
||||
|
||||
// Connected to Jlink CDC
|
||||
//#define PIN_SERIAL2_RX (8)
|
||||
//#define PIN_SERIAL2_TX (6)
|
||||
// #define PIN_SERIAL2_RX (8)
|
||||
// #define PIN_SERIAL2_TX (6)
|
||||
|
||||
/*
|
||||
* SPI Interfaces
|
||||
@ -138,7 +138,8 @@ static const uint8_t SCK = PIN_SPI_SCK;
|
||||
// #define SX126X_ANT_SW (32 + 10)
|
||||
#define SX126X_RXEN (22)
|
||||
#define SX126X_TXEN (24)
|
||||
#define SX126X_E22 // Indicates this SX1262 is inside of an ebyte E22 module and special config should be done for that
|
||||
// Indicates this SX1262 is inside of an ebyte E22 module and special config should be done for that
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
||||
// ERC12864-10 LCD
|
||||
#define ERC12864_CS (32 + 4)
|
||||
|
@ -89,8 +89,8 @@ static const uint8_t A7 = PIN_A7;
|
||||
|
||||
// Other pins
|
||||
#define PIN_AREF (0xff)
|
||||
//#define PIN_NFC1 (9)
|
||||
//#define PIN_NFC2 (10)
|
||||
// #define PIN_NFC1 (9)
|
||||
// #define PIN_NFC2 (10)
|
||||
|
||||
static const uint8_t AREF = PIN_AREF;
|
||||
|
||||
@ -158,7 +158,8 @@ static const uint8_t SCK = PIN_SPI_SCK;
|
||||
#define SX126X_RESET (0 + 17)
|
||||
#define SX126X_TXEN (0 + 24)
|
||||
#define SX126X_RXEN (0 + 22)
|
||||
#define SX126X_E22 // Not really an E22 but this board clones using DIO3 for tcxo control
|
||||
// Not really an E22 but this board clones using DIO3 for tcxo control
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
||||
// FIXME, to prevent burning out parts I've set the power level super low, because I don't have
|
||||
// an antenna wired up
|
||||
|
@ -81,4 +81,6 @@ static const uint8_t SCK = 33;
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_POWER_EN WB_IO3
|
||||
#define SX126X_E22 // DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
|
||||
// DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
@ -48,5 +48,7 @@
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_POWER_EN 25
|
||||
#define SX126X_E22 // DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
|
||||
#endif
|
||||
// DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#endif
|
||||
|
@ -209,7 +209,9 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
|
||||
// #define SX126X_TXEN (39)
|
||||
// #define SX126X_RXEN (37)
|
||||
#define SX126X_POWER_EN (37)
|
||||
#define SX126X_E22 // DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
|
||||
// DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
||||
// enables 3.3V periphery like GPS or IO Module
|
||||
#define PIN_3V3_EN (34)
|
||||
@ -275,4 +277,4 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -186,7 +186,9 @@ static const uint8_t SCK = PIN_SPI_SCK;
|
||||
// #define SX126X_TXEN (39)
|
||||
// #define SX126X_RXEN (37)
|
||||
#define SX126X_POWER_EN (37)
|
||||
#define SX126X_E22 // DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
|
||||
// DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
||||
// enables 3.3V periphery like GPS or IO Module
|
||||
#define PIN_3V3_EN (34)
|
||||
@ -239,4 +241,4 @@ static const uint8_t SCK = PIN_SPI_SCK;
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -43,7 +43,7 @@ extern "C" {
|
||||
|
||||
#define PIN_BUTTON1 9 // Pin for button on E-ink button module or IO expansion
|
||||
#define BUTTON_NEED_PULLUP
|
||||
//#define PIN_BUTTON2 12
|
||||
// #define PIN_BUTTON2 12
|
||||
|
||||
/*
|
||||
* Analog pins
|
||||
@ -69,8 +69,8 @@ static const uint8_t A7 = PIN_A7;
|
||||
|
||||
// Other pins
|
||||
#define PIN_AREF (2)
|
||||
//#define PIN_NFC1 (9)
|
||||
//#define PIN_NFC2 (10)
|
||||
// #define PIN_NFC1 (9)
|
||||
// #define PIN_NFC2 (10)
|
||||
|
||||
static const uint8_t AREF = PIN_AREF;
|
||||
|
||||
@ -111,7 +111,7 @@ static const uint8_t SCK = PIN_SPI_SCK;
|
||||
#define PIN_EINK_CS (0 + 16) // TX1
|
||||
#define PIN_EINK_BUSY (0 + 15) // RX1
|
||||
#define PIN_EINK_DC (0 + 17) // IO1
|
||||
//#define PIN_EINK_RES (-1) //first try without RESET then connect it to AIN (AIN0 5 )
|
||||
// #define PIN_EINK_RES (-1) //first try without RESET then connect it to AIN (AIN0 5 )
|
||||
#define PIN_EINK_RES (0 + 5) // 2.13 BN Display needs RESET
|
||||
#define PIN_EINK_SCLK (0 + 14) // SCL
|
||||
#define PIN_EINK_MOSI (0 + 13) // SDA
|
||||
@ -155,7 +155,9 @@ static const uint8_t SCK = PIN_SPI_SCK;
|
||||
// #define SX126X_TXEN (39)
|
||||
// #define SX126X_RXEN (37)
|
||||
#define SX126X_POWER_EN (37)
|
||||
#define SX126X_E22 // DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
|
||||
// DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
|
||||
// enables 3.3V periphery like GPS or IO Module
|
||||
#define PIN_3V3_EN (34)
|
||||
@ -171,36 +173,36 @@ static const uint8_t SCK = PIN_SPI_SCK;
|
||||
// Therefore must be 1 to keep peripherals powered
|
||||
// Power is on the controllable 3V3_S rail
|
||||
// #define PIN_GPS_RESET (34)
|
||||
//#define PIN_GPS_EN PIN_3V3_EN
|
||||
//#define PIN_GPS_PPS (17) // Pulse per second input from the GPS
|
||||
// #define PIN_GPS_EN PIN_3V3_EN
|
||||
// #define PIN_GPS_PPS (17) // Pulse per second input from the GPS
|
||||
|
||||
//#define GPS_RX_PIN PIN_SERIAL1_RX
|
||||
//#define GPS_TX_PIN PIN_SERIAL1_TX
|
||||
// #define GPS_RX_PIN PIN_SERIAL1_RX
|
||||
// #define GPS_TX_PIN PIN_SERIAL1_TX
|
||||
|
||||
// RAK12002 RTC Module
|
||||
#define RV3028_RTC (uint8_t)0b1010010
|
||||
|
||||
// Battery
|
||||
// The battery sense is hooked to pin A0 (5)
|
||||
//#define BATTERY_PIN PIN_A0
|
||||
// #define BATTERY_PIN PIN_A0
|
||||
// and has 12 bit resolution
|
||||
//#define BATTERY_SENSE_RESOLUTION_BITS 12
|
||||
//#define BATTERY_SENSE_RESOLUTION 4096.0
|
||||
// #define BATTERY_SENSE_RESOLUTION_BITS 12
|
||||
// #define BATTERY_SENSE_RESOLUTION 4096.0
|
||||
// Definition of milliVolt per LSB => 3.0V ADC range and 12-bit ADC resolution = 3000mV/4096
|
||||
//#define VBAT_MV_PER_LSB (0.73242188F)
|
||||
// #define VBAT_MV_PER_LSB (0.73242188F)
|
||||
// Voltage divider value => 1.5M + 1M voltage divider on VBAT = (1.5M / (1M + 1.5M))
|
||||
//#define VBAT_DIVIDER (0.4F)
|
||||
// #define VBAT_DIVIDER (0.4F)
|
||||
// Compensation factor for the VBAT divider
|
||||
//#define VBAT_DIVIDER_COMP (1.73)
|
||||
// #define VBAT_DIVIDER_COMP (1.73)
|
||||
// Fixed calculation of milliVolt from compensation value
|
||||
//#define REAL_VBAT_MV_PER_LSB (VBAT_DIVIDER_COMP * VBAT_MV_PER_LSB)
|
||||
//#undef AREF_VOLTAGE
|
||||
//#define AREF_VOLTAGE 3.0
|
||||
//#define VBAT_AR_INTERNAL AR_INTERNAL_3_0
|
||||
//#define ADC_MULTIPLIER VBAT_DIVIDER_COMP // REAL_VBAT_MV_PER_LSB
|
||||
//#define VBAT_RAW_TO_SCALED(x) (REAL_VBAT_MV_PER_LSB * x)
|
||||
// #define REAL_VBAT_MV_PER_LSB (VBAT_DIVIDER_COMP * VBAT_MV_PER_LSB)
|
||||
// #undef AREF_VOLTAGE
|
||||
// #define AREF_VOLTAGE 3.0
|
||||
// #define VBAT_AR_INTERNAL AR_INTERNAL_3_0
|
||||
// #define ADC_MULTIPLIER VBAT_DIVIDER_COMP // REAL_VBAT_MV_PER_LSB
|
||||
// #define VBAT_RAW_TO_SCALED(x) (REAL_VBAT_MV_PER_LSB * x)
|
||||
|
||||
//#define HAS_RTC 1
|
||||
// #define HAS_RTC 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
@ -210,4 +212,4 @@ static const uint8_t SCK = PIN_SPI_SCK;
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -53,5 +53,6 @@
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_E22
|
||||
#endif
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#endif
|
||||
|
@ -51,5 +51,6 @@
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_E22
|
||||
#endif
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#endif
|
||||
|
@ -27,9 +27,7 @@
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
// #define SX126X_E22 // Not really an E22
|
||||
// Internally the module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for the sx1262interface
|
||||
// code)
|
||||
#define SX126X_DIO2_AS_RF_SWITCH // Internally the module hooks the SX1262-DIO2 in to control the TX/RX switch
|
||||
#define SX126X_MAX_POWER \
|
||||
16 // Ensure the PA does not exceed the saturation output power. More
|
||||
// Info:https://uniteng.com/wiki/doku.php?id=meshtastic:station#rf_design_-_lora_station_edition_g1
|
||||
@ -49,4 +47,4 @@
|
||||
|
||||
// Station may not have GPS installed, but it has a labeled GPS pinout
|
||||
#define GPS_RX_PIN 34
|
||||
#define GPS_TX_PIN 12
|
||||
#define GPS_TX_PIN 12
|
||||
|
@ -84,6 +84,8 @@
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_E22 // Not really an E22 but TTGO seems to be trying to clone that
|
||||
// Not really an E22 but TTGO seems to be trying to clone that
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
// Internally the TTGO module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for the sx1262interface
|
||||
// code)
|
||||
// code)
|
||||
|
@ -133,7 +133,9 @@ External serial flash WP25R1635FZUIL0
|
||||
// CPU?
|
||||
#define SX126X_BUSY (0 + 17)
|
||||
#define SX126X_RESET (0 + 25)
|
||||
#define SX126X_E22 // Not really an E22 but TTGO seems to be trying to clone that
|
||||
// Not really an E22 but TTGO seems to be trying to clone that
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
// Internally the TTGO module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for the sx1262interface
|
||||
// code)
|
||||
|
||||
|
@ -63,6 +63,8 @@
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_E22 // Not really an E22 but TTGO seems to be trying to clone that
|
||||
// Internally the TTGO module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for
|
||||
// the sx1262interface code)
|
||||
// Not really an E22 but TTGO seems to be trying to clone that
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
// Internally the TTGO module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for
|
||||
// the sx1262interface code)
|
||||
|
@ -7,9 +7,9 @@
|
||||
#define I2C_SCL 18 // For QMC6310 sensors and screens
|
||||
|
||||
#define BUTTON_PIN 0 // The middle button GPIO on the T-Beam S3
|
||||
//#define BUTTON_PIN_ALT 13 // Alternate GPIO for an external button if needed. Does anyone use this? It is not documented
|
||||
// anywhere.
|
||||
// #define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module.
|
||||
// #define BUTTON_PIN_ALT 13 // Alternate GPIO for an external button if needed. Does anyone use this? It is not documented
|
||||
// anywhere.
|
||||
// #define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module.
|
||||
|
||||
#define LED_INVERTED 1
|
||||
|
||||
@ -29,7 +29,9 @@
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_E22 // Not really an E22 but TTGO seems to be trying to clone that
|
||||
// Not really an E22 but TTGO seems to be trying to clone that
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
// Internally the TTGO module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for the sx1262interface
|
||||
// code)
|
||||
#endif
|
||||
@ -64,4 +66,4 @@
|
||||
// has 32768 Hz crystal
|
||||
#define HAS_32768HZ
|
||||
|
||||
#define USE_SH1106
|
||||
#define USE_SH1106
|
||||
|
@ -28,7 +28,9 @@
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY LORA_DIO2
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_E22 // Not really an E22 but TTGO seems to be trying to clone that
|
||||
// Not really an E22 but TTGO seems to be trying to clone that
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
// Internally the TTGO module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for the sx1262interface
|
||||
// code)
|
||||
#endif
|
||||
@ -39,4 +41,4 @@
|
||||
#define HAS_AXP192
|
||||
#define GPS_UBLOX
|
||||
#define GPS_RX_PIN 34
|
||||
#define GPS_TX_PIN 12
|
||||
#define GPS_TX_PIN 12
|
||||
|
@ -44,7 +44,8 @@
|
||||
#define SX126X_DIO1 33
|
||||
#define SX126X_BUSY 34
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_E22
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#endif
|
||||
|
||||
// per SX128x_Receive_Interrupt/utilities.h
|
||||
@ -58,4 +59,4 @@
|
||||
#define SX128X_RXEN 21
|
||||
#define SX128X_TXEN 10
|
||||
#define SX128X_MAX_POWER 3
|
||||
#endif
|
||||
#endif
|
||||
|
@ -5,7 +5,7 @@
|
||||
#define VARIANT_MCK (64000000ul)
|
||||
|
||||
#define USE_LFXO // Board uses 32khz crystal for LF
|
||||
//#define USE_LFRC // Board uses RC for LF
|
||||
// #define USE_LFRC // Board uses RC for LF
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Headers
|
||||
@ -125,7 +125,6 @@ static const uint8_t SCK = PIN_SPI_SCK;
|
||||
|
||||
#define SX126X_TXEN RADIOLIB_NC
|
||||
#define SX126X_RXEN D7
|
||||
#define E22_TXEN_CONNECTED_TO_DIO2
|
||||
|
||||
// ------------------------------ OR ------------------------------
|
||||
|
||||
@ -141,7 +140,8 @@ static const uint8_t SCK = PIN_SPI_SCK;
|
||||
#ifdef EBYTE_E22
|
||||
// Internally the TTGO module hooks the SX126x-DIO2 in to control the TX/RX switch
|
||||
// (which is the default for the sx1262interface code)
|
||||
#define SX126X_E22
|
||||
#define SX126X_DIO2_AS_RF_SWITCH
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -198,4 +198,4 @@ static const uint8_t SCL = PIN_WIRE_SCL;
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user