forked from things-nyc/arduino-lmic
-
Notifications
You must be signed in to change notification settings - Fork 221
Add driver for SX126x modems #949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
61ddc6d
add radio_sx126x.c
TristanWebber dfb841f
sync to master
TristanWebber 2ab63be
sx126x defines
TristanWebber 8af7bcb
update TODO list
TristanWebber 2369ad4
add FSK functions
TristanWebber d99987f
remove deprecated variable
TristanWebber 1a0d007
fix type issue
TristanWebber 6991657
review comments
TristanWebber 92d8464
adjust FSK parameters
TristanWebber 4920adf
add whitening initial value
TristanWebber 6862817
define fsk crc config
TristanWebber 71db6ba
Initialise busy pin when configured
oseiler2 3417cd7
Added pinmap for T-Beam Core S3/Supreme
oseiler2 4800a68
PR feedback
oseiler2 fa08713
Merge pull request #1 from oseiler2/sx126x-TBeamS3
TristanWebber File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
|
||
Module: getpinmap_heltec_lora32_v3.cpp | ||
|
||
Function: | ||
Arduino-LMIC C++ HAL pinmap for Heltec Wireless Stick Lite V3 and Wifi Lora32 V3 | ||
|
||
Copyright & License: | ||
See accompanying LICENSE file. | ||
|
||
Author: | ||
Tristan Webber, Shrunk Innovation Labs July 2023 | ||
|
||
*/ | ||
|
||
#if defined(ARDUINO_heltec_wifi_lora_32_V3) | ||
|
||
#include <arduino_lmic_hal_boards.h> | ||
#include <Arduino.h> | ||
|
||
#include "../lmic/oslmic.h" | ||
|
||
namespace Arduino_LMIC | ||
{ | ||
|
||
class HalConfiguration_heltec_lora32_v3 : public HalConfiguration_t | ||
{ | ||
public: | ||
enum DIGITAL_PINS : uint8_t | ||
{ | ||
PIN_SX1262_NSS = SS, | ||
PIN_SX1262_NRESET = RST_LoRa, | ||
PIN_SX1262_BUSY = BUSY_LoRa, | ||
PIN_SX1262_DIO1 = DIO0, | ||
PIN_SX1262_DIO2 = HalPinmap_t::UNUSED_PIN, | ||
PIN_SX1262_DIO3 = HalPinmap_t::UNUSED_PIN, | ||
PIN_SX1262_ANT_SWITCH_RX = HalPinmap_t::UNUSED_PIN, | ||
PIN_SX1262_ANT_SWITCH_TX_BOOST = HalPinmap_t::UNUSED_PIN, | ||
PIN_SX1262_ANT_SWITCH_TX_RFO = HalPinmap_t::UNUSED_PIN, | ||
PIN_VDD_BOOST_ENABLE = HalPinmap_t::UNUSED_PIN, | ||
}; | ||
|
||
virtual u1_t queryBusyPin(void) override { return HalConfiguration_heltec_lora32_v3::PIN_SX1262_BUSY; }; | ||
|
||
virtual bool queryUsingDcdc(void) override { return true; }; | ||
|
||
virtual bool queryUsingDIO2AsRfSwitch(void) override { return true; }; | ||
|
||
virtual bool queryUsingDIO3AsTCXOSwitch(void) override { return true; }; | ||
}; | ||
|
||
static HalConfiguration_heltec_lora32_v3 myConfig; | ||
|
||
static const HalPinmap_t myPinmap = | ||
{ | ||
.nss = HalConfiguration_heltec_lora32_v3::PIN_SX1262_NSS, | ||
.rxtx = HalConfiguration_heltec_lora32_v3::PIN_SX1262_ANT_SWITCH_RX, | ||
.rst = HalConfiguration_heltec_lora32_v3::PIN_SX1262_NRESET, | ||
.dio = { | ||
HalConfiguration_heltec_lora32_v3::PIN_SX1262_DIO1, | ||
HalConfiguration_heltec_lora32_v3::PIN_SX1262_DIO2, | ||
HalConfiguration_heltec_lora32_v3::PIN_SX1262_DIO3, | ||
}, | ||
.rxtx_rx_active = 0, | ||
.rssi_cal = 10, | ||
.spi_freq = 8000000, /* 8MHz */ | ||
.pConfig = &myConfig}; | ||
|
||
const HalPinmap_t *GetPinmap_heltec_lora32_v3(void) | ||
{ | ||
return &myPinmap; | ||
} | ||
|
||
}; // namespace Arduino_LMIC | ||
|
||
#endif // defined(ARDUINO_heltec_wifi_lora_32_V3) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
|
||
Module: getpinmap_ttgo_tbeam_s3.cpp.cpp | ||
|
||
Function: | ||
Arduino-LMIC C++ HAL pinmap for T-Beam S3 Core and T-Beam Supreme | ||
|
||
Copyright & License: | ||
See accompanying LICENSE file. | ||
|
||
*/ | ||
|
||
#if defined(ARDUINO_TTGO_T_BEAM_S3) | ||
|
||
#include <arduino_lmic_hal_boards.h> | ||
#include <Arduino.h> | ||
|
||
#include "../lmic/oslmic.h" | ||
|
||
namespace Arduino_LMIC { | ||
|
||
class HalConfiguration_ttgo_tbeam_s3 : public HalConfiguration_t { | ||
public: | ||
enum DIGITAL_PINS : uint8_t { | ||
PIN_SX1262_NSS = 10, | ||
PIN_SX1262_NRESET = 5, | ||
PIN_SX1262_BUSY = 4, | ||
PIN_SX1262_DIO1 = 1, | ||
PIN_SX1262_DIO2 = HalPinmap_t::UNUSED_PIN, | ||
PIN_SX1262_DIO3 = HalPinmap_t::UNUSED_PIN, | ||
PIN_SX1262_ANT_SWITCH_RX = HalPinmap_t::UNUSED_PIN, | ||
PIN_SX1262_ANT_SWITCH_TX_BOOST = HalPinmap_t::UNUSED_PIN, | ||
PIN_SX1262_ANT_SWITCH_TX_RFO = HalPinmap_t::UNUSED_PIN, | ||
PIN_VDD_BOOST_ENABLE = HalPinmap_t::UNUSED_PIN, | ||
}; | ||
|
||
virtual u1_t queryBusyPin(void) override { return HalConfiguration_ttgo_tbeam_s3::PIN_SX1262_BUSY; }; | ||
|
||
virtual bool queryUsingDcdc(void) override { return true; }; | ||
|
||
virtual bool queryUsingDIO2AsRfSwitch(void) override { return true; }; | ||
|
||
virtual bool queryUsingDIO3AsTCXOSwitch(void) override { return true; }; | ||
}; | ||
|
||
static HalConfiguration_ttgo_tbeam_s3 myConfig; | ||
|
||
static const HalPinmap_t myPinmap = | ||
{ | ||
.nss = HalConfiguration_ttgo_tbeam_s3::PIN_SX1262_NSS, | ||
.rxtx = HalConfiguration_ttgo_tbeam_s3::PIN_SX1262_ANT_SWITCH_RX, | ||
.rst = HalConfiguration_ttgo_tbeam_s3::PIN_SX1262_NRESET, | ||
.dio = { | ||
HalConfiguration_ttgo_tbeam_s3::PIN_SX1262_DIO1, | ||
HalConfiguration_ttgo_tbeam_s3::PIN_SX1262_DIO2, | ||
HalConfiguration_ttgo_tbeam_s3::PIN_SX1262_DIO3, | ||
}, | ||
.rxtx_rx_active = 0, | ||
.rssi_cal = 8, | ||
.spi_freq = 8000000, /* 8MHz */ | ||
.pConfig = &myConfig | ||
}; | ||
|
||
const HalPinmap_t* GetPinmap_ttgo_tbeam_s3(void) { | ||
return &myPinmap; | ||
} | ||
|
||
}; // namespace Arduino_LMIC | ||
|
||
#endif // defined(ARDUINO_TTGO_T_BEAM_S3) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is_busy()
should not be a global -- or should behal_is_radio_busy()
if it needs to be global for the driver.