Skip to content

Commit

Permalink
Updated examples
Browse files Browse the repository at this point in the history
Added check if SX126x is really connected    
Fixed second bug in the definition of the sync word    
Added IRQ settings in RadioSetRxDutyCycle
  • Loading branch information
beegee-tokyo committed Dec 28, 2019
1 parent 7953568 commit a2bd4e3
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 182 deletions.
2 changes: 1 addition & 1 deletion .library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SX126x-Arduino",
"version": "1.0.5",
"version": "1.0.6",
"keywords": [
"lora",
"Semtech",
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Arduino library for LoRa communication with Semtech SX126x chips. It is based on

# Release Notes

## V1.0.6 Bug fix and deep-sleep functionality
- Updated examples
- Added check if SX126x is really connected
- Fixed second bug in the definition of the sync word
- Added IRQ settings in RadioSetRxDutyCycle
## V1.0.5 Bug fix and deep-sleep functionality
- Fixed bug in the definition of the sync word
- Added possibility to re-init connection to SX1261/2 after CPU wakes up from sleep/deep-sleep
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
```
----
## Changelog
- 2019-12-28:
- Updated examples
- 2019-12-12:
- Added check if SX126x is really connected
- Fixed second bug in the definition of the sync word
- Added IRQ settings in RadioSetRxDutyCycle
- 2019-12-09:
- Fixed bug in the definition of the sync word
- Added possibility to re-init connection to SX1261/2 after CPU wakes up from sleep/deep-sleep
Expand Down
30 changes: 15 additions & 15 deletions examples/LoRaWan/LoRaWan.ino
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ int PIN_LORA_MISO = 19; // LORA SPI MISO
int PIN_LORA_DIO_1 = 21; // LORA DIO_1
int PIN_LORA_BUSY = 22; // LORA SPI BUSY
int PIN_LORA_MOSI = 23; // LORA SPI MOSI
int RADIO_TXEN = 26; // LORA ANTENNA TX ENABLE
int RADIO_RXEN = 27; // LORA ANTENNA RX ENABLE
int RADIO_TXEN = -1; // LORA ANTENNA TX ENABLE
int RADIO_RXEN = -1; // LORA ANTENNA RX ENABLE
#endif
#ifdef ESP8266
// ESP32 - SX126x pin configuration
int PIN_LORA_RESET = -1; // LORA RESET
int PIN_LORA_NSS = 15; // LORA SPI CS
int PIN_LORA_SCLK = 14; // LORA SPI CLK
int PIN_LORA_MISO = 12; // LORA SPI MISO
int PIN_LORA_DIO_1 = 4; // LORA DIO_1
int PIN_LORA_BUSY = 5; // LORA SPI BUSY
int PIN_LORA_MOSI = 13; // LORA SPI MOSI
int RADIO_TXEN = 16; // LORA ANTENNA TX ENABLE
int RADIO_RXEN = 2; // LORA ANTENNA RX ENABLE
int PIN_LORA_RESET = 0; // LORA RESET
int PIN_LORA_NSS = 2; // LORA SPI CS
int PIN_LORA_DIO_1 = 15; // LORA DIO_1
int PIN_LORA_BUSY = 16; // LORA SPI BUSY
int PIN_LORA_SCLK = SCK; // LORA SPI CLK
int PIN_LORA_MISO = MISO; // LORA SPI MISO
int PIN_LORA_MOSI = MOSI; // LORA SPI MOSI
int RADIO_TXEN = -1; // LORA ANTENNA TX ENABLE
int RADIO_RXEN = -1; // LORA ANTENNA RX ENABLE
#endif
#ifdef NRF52
// nRF52832 - SX126x pin configuration
Expand All @@ -49,8 +49,8 @@ int PIN_LORA_MISO = 14; // LORA SPI MISO
int PIN_LORA_DIO_1 = 11; // LORA DIO_1
int PIN_LORA_BUSY = 29; // LORA SPI BUSY
int PIN_LORA_MOSI = 13; // LORA SPI MOSI
int RADIO_TXEN = 31; // LORA ANTENNA TX ENABLE
int RADIO_RXEN = 27; // LORA ANTENNA RX ENABLE
int RADIO_TXEN = -1; // LORA ANTENNA TX ENABLE
int RADIO_RXEN = -1; // LORA ANTENNA RX ENABLE
// Replace PIN_SPI_MISO, PIN_SPI_SCK, PIN_SPI_MOSI with your
SPIClass SPI_LORA(NRF_SPI2, 14, 12, 13);
#endif
Expand Down Expand Up @@ -122,8 +122,8 @@ void setup()
hwConfig.PIN_LORA_MOSI = PIN_LORA_MOSI; // LORA SPI MOSI
hwConfig.RADIO_TXEN = RADIO_TXEN; // LORA ANTENNA TX ENABLE
hwConfig.RADIO_RXEN = RADIO_RXEN; // LORA ANTENNA RX ENABLE
hwConfig.USE_DIO2_ANT_SWITCH = false; // Example uses an eByte E22 module which uses RXEN and TXEN pins as antenna control
hwConfig.USE_DIO3_TCXO = true; // Example uses an eByte E22 module which uses DIO3 to control oscillator voltage
hwConfig.USE_DIO2_ANT_SWITCH = true; // Example uses an CircuitRocks Alora RFM1262 which uses DIO2 pins as antenna control
hwConfig.USE_DIO3_TCXO = true; // Example uses an CircuitRocks Alora RFM1262 which uses DIO3 to control oscillator voltage
hwConfig.USE_DIO3_ANT_SWITCH = false; // Only Insight ISP4520 module uses DIO3 as antenna control

// Initialize Serial for debug output
Expand Down
12 changes: 6 additions & 6 deletions examples/LoRaWanPio/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ int PIN_LORA_MISO = 19; // LORA SPI MISO
int PIN_LORA_DIO_1 = 21; // LORA DIO_1
int PIN_LORA_BUSY = 22; // LORA SPI BUSY
int PIN_LORA_MOSI = 23; // LORA SPI MOSI
int RADIO_TXEN = 26; // LORA ANTENNA TX ENABLE
int RADIO_RXEN = 27; // LORA ANTENNA RX ENABLE
int RADIO_TXEN = -1; // LORA ANTENNA TX ENABLE
int RADIO_RXEN = -1; // LORA ANTENNA RX ENABLE
#endif
#ifdef NRF52
// nRF52832 - SX126x pin configuration
Expand All @@ -37,8 +37,8 @@ int PIN_LORA_MISO = 14; // LORA SPI MISO
int PIN_LORA_DIO_1 = 11; // LORA DIO_1
int PIN_LORA_BUSY = 29; // LORA SPI BUSY
int PIN_LORA_MOSI = 13; // LORA SPI MOSI
int RADIO_TXEN = 31; // LORA ANTENNA TX ENABLE
int RADIO_RXEN = 27; // LORA ANTENNA RX ENABLE
int RADIO_TXEN = -1; // LORA ANTENNA TX ENABLE
int RADIO_RXEN = -1; // LORA ANTENNA RX ENABLE
// Replace PIN_SPI_MISO, PIN_SPI_SCK, PIN_SPI_MOSI with your
SPIClass SPI_LORA(NRF_SPI2, 14, 12, 13);
#endif
Expand Down Expand Up @@ -110,8 +110,8 @@ void setup()
hwConfig.PIN_LORA_MOSI = PIN_LORA_MOSI; // LORA SPI MOSI
hwConfig.RADIO_TXEN = RADIO_TXEN; // LORA ANTENNA TX ENABLE
hwConfig.RADIO_RXEN = RADIO_RXEN; // LORA ANTENNA RX ENABLE
hwConfig.USE_DIO2_ANT_SWITCH = false; // Example uses an eByte E22 module which uses RXEN and TXEN pins as antenna control
hwConfig.USE_DIO3_TCXO = true; // Example uses an eByte E22 module which uses DIO3 to control oscillator voltage
hwConfig.USE_DIO2_ANT_SWITCH = true; // Example uses an CircuitRocks Alora RFM1262 which uses DIO2 pins as antenna control
hwConfig.USE_DIO3_TCXO = true; // Example uses an CircuitRocks Alora RFM1262 which uses DIO3 to control oscillator voltage
hwConfig.USE_DIO3_ANT_SWITCH = false; // Only Insight ISP4520 module uses DIO3 as antenna control

// Initialize Serial for debug output
Expand Down
32 changes: 16 additions & 16 deletions examples/PingPong/PingPong.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,38 @@ hw_config hwConfig;
#ifdef ESP32
// ESP32 - SX126x pin configuration
int PIN_LORA_RESET = 4; // LORA RESET
int PIN_LORA_DIO_1 = 21; // LORA DIO_1
int PIN_LORA_BUSY = 22; // LORA SPI BUSY
int PIN_LORA_NSS = 5; // LORA SPI CS
int PIN_LORA_SCLK = 18; // LORA SPI CLK
int PIN_LORA_MISO = 19; // LORA SPI MISO
int PIN_LORA_DIO_1 = 21; // LORA DIO_1
int PIN_LORA_BUSY = 22; // LORA SPI BUSY
int PIN_LORA_MOSI = 23; // LORA SPI MOSI
int RADIO_TXEN = 26; // LORA ANTENNA TX ENABLE
int RADIO_RXEN = 27; // LORA ANTENNA RX ENABLE
int RADIO_TXEN = -1; // LORA ANTENNA TX ENABLE
int RADIO_RXEN = -1; // LORA ANTENNA RX ENABLE
#endif
#ifdef ESP8266
// ESP32 - SX126x pin configuration
int PIN_LORA_RESET = -1; // LORA RESET
int PIN_LORA_NSS = 15; // LORA SPI CS
int PIN_LORA_RESET = 0; // LORA RESET
int PIN_LORA_DIO_1 = 15; // LORA DIO_1
int PIN_LORA_BUSY = 16; // LORA SPI BUSY
int PIN_LORA_NSS = 2; // LORA SPI CS
int PIN_LORA_SCLK = 14; // LORA SPI CLK
int PIN_LORA_MISO = 12; // LORA SPI MISO
int PIN_LORA_DIO_1 = 4; // LORA DIO_1
int PIN_LORA_BUSY = 5; // LORA SPI BUSY
int PIN_LORA_MOSI = 13; // LORA SPI MOSI
int RADIO_TXEN = 16; // LORA ANTENNA TX ENABLE
int RADIO_RXEN = 2; // LORA ANTENNA RX ENABLE
int RADIO_TXEN = -1; // LORA ANTENNA TX ENABLE
int RADIO_RXEN = -1; // LORA ANTENNA RX ENABLE
#endif
#ifdef NRF52
// nRF52832 - SX126x pin configuration
int PIN_LORA_RESET = 4; // LORA RESET
int PIN_LORA_DIO_1 = 11; // LORA DIO_1
int PIN_LORA_BUSY = 29; // LORA SPI BUSY
int PIN_LORA_NSS = 28; // LORA SPI CS
int PIN_LORA_SCLK = 12; // LORA SPI CLK
int PIN_LORA_MISO = 14; // LORA SPI MISO
int PIN_LORA_DIO_1 = 11; // LORA DIO_1
int PIN_LORA_BUSY = 29; // LORA SPI BUSY
int PIN_LORA_MOSI = 13; // LORA SPI MOSI
int RADIO_TXEN = 31; // LORA ANTENNA TX ENABLE
int RADIO_RXEN = 27; // LORA ANTENNA RX ENABLE
int RADIO_TXEN = -1; // LORA ANTENNA TX ENABLE
int RADIO_RXEN = -1; // LORA ANTENNA RX ENABLE
// Replace PIN_SPI_MISO, PIN_SPI_SCK, PIN_SPI_MOSI with your
SPIClass SPI_LORA(NRF_SPI2, 14, 12, 13);
#endif
Expand Down Expand Up @@ -116,8 +116,8 @@ void setup()
hwConfig.PIN_LORA_MOSI = PIN_LORA_MOSI; // LORA SPI MOSI
hwConfig.RADIO_TXEN = RADIO_TXEN; // LORA ANTENNA TX ENABLE
hwConfig.RADIO_RXEN = RADIO_RXEN; // LORA ANTENNA RX ENABLE
hwConfig.USE_DIO2_ANT_SWITCH = false; // Example uses an eByte E22 module which uses RXEN and TXEN pins as antenna control
hwConfig.USE_DIO3_TCXO = true; // Example uses an eByte E22 module which uses DIO3 to control oscillator voltage
hwConfig.USE_DIO2_ANT_SWITCH = true; // Example uses an CircuitRocks Alora RFM1262 which uses DIO2 pins as antenna control
hwConfig.USE_DIO3_TCXO = true; // Example uses an CircuitRocks Alora RFM1262 which uses DIO3 to control oscillator voltage
hwConfig.USE_DIO3_ANT_SWITCH = false; // Only Insight ISP4520 module uses DIO3 as antenna control

// Initialize Serial for debug output
Expand Down
40 changes: 20 additions & 20 deletions examples/PingPongPio/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,40 @@ hw_config hwConfig;
#ifdef ESP32
// ESP32 - SX126x pin configuration
int PIN_LORA_RESET = 4; // LORA RESET
int PIN_LORA_DIO_1 = 21; // LORA DIO_1
int PIN_LORA_BUSY = 22; // LORA SPI BUSY
int PIN_LORA_NSS = 5; // LORA SPI CS
int PIN_LORA_SCLK = 18; // LORA SPI CLK
int PIN_LORA_MISO = 19; // LORA SPI MISO
int PIN_LORA_DIO_1 = 21; // LORA DIO_1
int PIN_LORA_BUSY = 22; // LORA SPI BUSY
int PIN_LORA_MOSI = 23; // LORA SPI MOSI
int RADIO_TXEN = 26; // LORA ANTENNA TX ENABLE
int RADIO_RXEN = 27; // LORA ANTENNA RX ENABLE
#endif
#ifdef ESP8266
// ESP32 - SX126x pin configuration
int PIN_LORA_RESET = -1; // LORA RESET
int PIN_LORA_NSS = 15; // LORA SPI CS
int PIN_LORA_SCLK = 14; // LORA SPI CLK
int PIN_LORA_MISO = 12; // LORA SPI MISO
int PIN_LORA_DIO_1 = 4; // LORA DIO_1
int PIN_LORA_BUSY = 5; // LORA SPI BUSY
int PIN_LORA_MOSI = 13; // LORA SPI MOSI
int RADIO_TXEN = 16; // LORA ANTENNA TX ENABLE
int RADIO_RXEN = 2; // LORA ANTENNA RX ENABLE
int PIN_LORA_RESET = 0; // LORA RESET
int PIN_LORA_DIO_1 = 15; // LORA DIO_1
int PIN_LORA_BUSY = 16; // LORA SPI BUSY
int PIN_LORA_NSS = 2; // LORA SPI CS
int PIN_LORA_SCLK = SCK; // LORA SPI CLK
int PIN_LORA_MISO = MISO; // LORA SPI MISO
int PIN_LORA_MOSI = MOSI; // LORA SPI MOSI
int RADIO_TXEN = -1; // LORA ANTENNA TX ENABLE
int RADIO_RXEN = -1; // LORA ANTENNA RX ENABLE
#endif
#ifdef NRF52
// nRF52832 - SX126x pin configuration
int PIN_LORA_RESET = 4; // LORA RESET
int PIN_LORA_NSS = 28; // LORA SPI CS
int PIN_LORA_RESET = 30; // LORA RESET
int PIN_LORA_DIO_1 = 27; // LORA DIO_1
int PIN_LORA_BUSY = 7; // LORA SPI BUSY
int PIN_LORA_NSS = 11; // LORA SPI CS
int PIN_LORA_SCLK = 12; // LORA SPI CLK
int PIN_LORA_MISO = 14; // LORA SPI MISO
int PIN_LORA_DIO_1 = 11; // LORA DIO_1
int PIN_LORA_BUSY = 29; // LORA SPI BUSY
int PIN_LORA_MOSI = 13; // LORA SPI MOSI
int RADIO_TXEN = 31; // LORA ANTENNA TX ENABLE
int RADIO_RXEN = 27; // LORA ANTENNA RX ENABLE
int RADIO_TXEN = -1; // LORA ANTENNA TX ENABLE
int RADIO_RXEN = -1; // LORA ANTENNA RX ENABLE
// Replace PIN_SPI_MISO, PIN_SPI_SCK, PIN_SPI_MOSI with your
SPIClass SPI_LORA(NRF_SPI2, 14, 12, 13);
SPIClass SPI_LORA(NRF_SPI2, PIN_LORA_MISO, PIN_LORA_SCLK, PIN_LORA_MOSI);
#endif

// Function declarations
Expand Down Expand Up @@ -116,8 +116,8 @@ void setup()
hwConfig.PIN_LORA_MOSI = PIN_LORA_MOSI; // LORA SPI MOSI
hwConfig.RADIO_TXEN = RADIO_TXEN; // LORA ANTENNA TX ENABLE
hwConfig.RADIO_RXEN = RADIO_RXEN; // LORA ANTENNA RX ENABLE
hwConfig.USE_DIO2_ANT_SWITCH = false; // Example uses an eByte E22 module which uses RXEN and TXEN pins as antenna control
hwConfig.USE_DIO3_TCXO = true; // Example uses an eByte E22 module which uses DIO3 to control oscillator voltage
hwConfig.USE_DIO2_ANT_SWITCH = true; // Example uses an CircuitRocks Alora RFM1262 which uses DIO2 pins as antenna control
hwConfig.USE_DIO3_TCXO = true; // Example uses an CircuitRocks Alora RFM1262 which uses DIO3 to control oscillator voltage
hwConfig.USE_DIO3_ANT_SWITCH = false; // Only Insight ISP4520 module uses DIO3 as antenna control

// Initialize Serial for debug output
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=SX126x-Arduino
version=1.0.5
version=1.0.6
author=Bernd Giesecke <[email protected]>
maintainer=Bernd Giesecke <[email protected]>
sentence=Arduino library to use Semtech SX126x LoRa chips and modules to communicate
Expand Down
Loading

0 comments on commit a2bd4e3

Please sign in to comment.