New base class for SX126x modules. Added new SX1268 module support.

This commit is contained in:
Vladislav Osmanov
2021-09-12 00:35:16 +03:00
parent 00bf7879af
commit 098f38fb83
19 changed files with 425 additions and 670 deletions
+7 -7
View File
@@ -151,13 +151,13 @@ static const uint8_t SCK = PIN_SPI_SCK;
*/
// RAK4630 LoRa module
#define SX1262_CS (42)
#define SX1262_DIO1 (47)
#define SX1262_BUSY (46)
#define SX1262_RESET (38)
#define SX1262_TXEN (39)
#define SX1262_RXEN (37)
#define SX1262_E22 // DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
#define SX126X_CS (42)
#define SX126X_DIO1 (47)
#define SX126X_BUSY (46)
#define SX126X_RESET (38)
#define SX126X_TXEN (39)
#define SX126X_RXEN (37)
#define SX126X_E22 // DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
// RAK1910 GPS module
// If using the wisblock GPS module and pluged into Port A on WisBlock base
+5 -5
View File
@@ -178,15 +178,15 @@ External serial flash WP25R1635FZUIL0
* Lora radio
*/
#define SX1262_CS (0 + 24) // FIXME - we really should define LORA_CS instead
#define SX1262_DIO1 (0 + 20)
#define SX126X_CS (0 + 24) // FIXME - we really should define LORA_CS instead
#define SX126X_DIO1 (0 + 20)
// Note DIO2 is attached internally to the module to an analog switch for TX/RX switching
#define SX1262_DIO3 \
(0 + 21) // This is used as an *output* from the sx1262 and connected internally to power the tcxo, do not drive from the main
// CPU?
#define SX1262_BUSY (0 + 17)
#define SX1262_RESET (0 + 25)
#define SX1262_E22 // Not really an E22 but TTGO seems to be trying to clone that
#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
// Internally the TTGO module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for the sx1262interface
// code)
+5 -5
View File
@@ -57,10 +57,10 @@
#define WIRE_INTERFACES_COUNT 0
// GPIOs the SX1262 is connected
#define SX1262_CS 1 // aka SPI_NSS
#define SX1262_DIO1 (4)
#define SX1262_BUSY (5)
#define SX1262_RESET (6)
#define SX126X_CS 1 // aka SPI_NSS
#define SX126X_DIO1 (4)
#define SX126X_BUSY (5)
#define SX126X_RESET (6)
/*
* Serial interfaces
@@ -91,7 +91,7 @@
#define BATTERY_PIN 3
#define ADC_MULTIPLIER 1.436
#define SX1262_E22 // Not really an E22 but this board clones using DIO3 for tcxo control
#define SX126X_E22 // Not really an E22 but this board clones using DIO3 for tcxo control
#define NO_WIRE
#define NO_GPS
+8 -8
View File
@@ -117,21 +117,21 @@ static const uint8_t SCK = PIN_SPI_SCK;
#define I2C_ADDR_BQ27441 0x55 // Battery gauge
// CUSTOM GPIOs the SX1262
#define SX1262_CS (32)
#define SX126X_CS (32)
// If you would prefer to get console debug output over the JTAG ICE connection rather than the CDC-ACM USB serial device, just
// define this. #define USE_SEGGER
#define SX1262_DIO1 (29)
#define SX126X_DIO1 (29)
#define SX1262_DIO2 (30)
#define SX1262_BUSY (33) // Supposed to be P0.18 but because of reworks, now on P0.31 (18)
#define SX1262_RESET (34)
#define SX126X_BUSY (33) // Supposed to be P0.18 but because of reworks, now on P0.31 (18)
#define SX126X_RESET (34)
// #define SX1262_ANT_SW (32 + 10)
#define SX1262_RXEN (14)
#define SX1262_TXEN (31)
#define SX1262_POWER_EN \
#define SX126X_RXEN (14)
#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 SX1262_E22 // Indicates this SX1262 is inside of an ebyte E22 module and special config should be done for that
#define SX126X_E22 // Indicates this SX1262 is inside of an ebyte E22 module and special config should be done for that
#define ST7735_RESET (11) // Output
#define ST7735_CS (12)
+8 -8
View File
@@ -137,21 +137,21 @@ static const uint8_t SCK = PIN_SPI_SCK;
#define I2C_ADDR_BQ27441 0x55 // Battery gauge
// CUSTOM GPIOs the SX1262
#define SX1262_CS (32)
#define SX126X_CS (32)
// If you would prefer to get console debug output over the JTAG ICE connection rather than the CDC-ACM USB serial device, just
// define this. #define USE_SEGGER
#define SX1262_DIO1 (29)
#define SX126X_DIO1 (29)
#define SX1262_DIO2 (30)
#define SX1262_BUSY (33) // Supposed to be P0.18 but because of reworks, now on P0.31 (18)
#define SX1262_RESET (34)
#define SX126X_BUSY (33) // Supposed to be P0.18 but because of reworks, now on P0.31 (18)
#define SX126X_RESET (34)
// #define SX1262_ANT_SW (32 + 10)
#define SX1262_RXEN (14)
#define SX1262_TXEN (31)
#define SX1262_POWER_EN \
#define SX126X_RXEN (14)
#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 SX1262_E22 // Indicates this SX1262 is inside of an ebyte E22 module and special config should be done for that
#define SX126X_E22 // Indicates this SX1262 is inside of an ebyte E22 module and special config should be done for that
// ST7565 SPI
#define ST7735_RESET (11) // Output
+4 -4
View File
@@ -140,10 +140,10 @@ static const uint8_t SCK = PIN_SPI_SCK;
#define EXTERNAL_FLASH_USE_QSPI
// CUSTOM GPIOs the SX1262MB2CAS shield when installed on the NRF52840-DK development board
#define SX1262_CS (32 + 8) // P1.08
#define SX1262_DIO1 (32 + 6) // P1.06
#define SX1262_BUSY (32 + 4) // P1.04
#define SX1262_RESET (0 + 3) // P0.03
#define SX126X_CS (32 + 8) // P1.08
#define SX126X_DIO1 (32 + 6) // P1.06
#define SX126X_BUSY (32 + 4) // P1.04
#define SX126X_RESET (0 + 3) // P0.03
#define SX1262_ANT_SW (32 + 10) // P1.10
// To debug via the segger JLINK console rather than the CDC-ACM serial device
+7 -7
View File
@@ -129,15 +129,15 @@ static const uint8_t SCK = PIN_SPI_SCK;
#define PIN_WIRE_SCL (32)
// CUSTOM GPIOs the SX1262
#define SX1262_CS (10)
#define SX1262_DIO1 (20)
#define SX126X_CS (10)
#define SX126X_DIO1 (20)
#define SX1262_DIO2 (26)
#define SX1262_BUSY (31) // Supposed to be P0.18 but because of reworks, now on P0.31 (18)
#define SX1262_RESET (17)
#define SX126X_BUSY (31) // Supposed to be P0.18 but because of reworks, now on P0.31 (18)
#define SX126X_RESET (17)
// #define SX1262_ANT_SW (32 + 10)
#define SX1262_RXEN (22)
#define SX1262_TXEN (24)
#define SX1262_E22 // Indicates this SX1262 is inside of an ebyte E22 module and special config should be done for that
#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
// ERC12864-10 LCD
#define ERC12864_CS (32 + 4)
+8 -8
View File
@@ -152,18 +152,18 @@ static const uint8_t SCK = PIN_SPI_SCK;
#define PIN_WIRE_SCL (32)
// CUSTOM GPIOs the SX1262
#define SX1262_CS (0 + 10) // FIXME - we really should define LORA_CS instead
#define SX1262_DIO1 (0 + 20)
#define SX126X_CS (0 + 10) // FIXME - we really should define LORA_CS instead
#define SX126X_DIO1 (0 + 20)
#define SX1262_DIO2 (0 + 26)
#define SX1262_BUSY (0 + 19)
#define SX1262_RESET (0 + 17)
#define SX1262_TXEN (0 + 24)
#define SX1262_RXEN (0 + 22)
#define SX1262_E22 // Not really an E22 but this board clones using DIO3 for tcxo control
#define SX126X_BUSY (0 + 19)
#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
// FIXME, to prevent burning out parts I've set the power level super low, because I don't have
// an antenna wired up
#define SX1262_MAX_POWER 1
#define SX126X_MAX_POWER 1
#define LORA_DISABLE_SENDING // Define this to disable transmission for testing (power testing etc...)
+6 -6
View File
@@ -180,21 +180,21 @@ External serial flash WP25R1635FZUIL0
* Lora radio
*/
#define SX1262_CS (0 + 24) // FIXME - we really should define LORA_CS instead
#define SX1262_DIO1 (0 + 20)
#define SX126X_CS (0 + 24) // FIXME - we really should define LORA_CS instead
#define SX126X_DIO1 (0 + 20)
// Note DIO2 is attached internally to the module to an analog switch for TX/RX switching
#define SX1262_DIO3 \
(0 + 21) // This is used as an *output* from the sx1262 and connected internally to power the tcxo, do not drive from the main
// CPU?
#define SX1262_BUSY (0 + 17)
#define SX1262_RESET (0 + 25)
#define SX1262_E22 // Not really an E22 but TTGO seems to be trying to clone that
#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
// Internally the TTGO module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for the sx1262interface
// code)
// #define LORA_DISABLE_SENDING // Define this to disable transmission for testing (power testing etc...)
// #undef SX1262_CS
// #undef SX126X_CS
// #define USE_SIM_RADIO // define to not use the lora radio hardware at all
/*