-
Notifications
You must be signed in to change notification settings - Fork 212
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
Support for TTGO-LoRa32-v2.1.6 #692
Changes from 1 commit
3f1c021
436177c
65aa4ec
2494a86
85c92e3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please look at the changes I made for #736 -- it turns out that compilers don't actually do a great job of discarding vtables, so we need to condition this module compilation on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The module should have a simple descriptive header to match the other files in this group. |
||
|
||
#include <arduino_lmic_hal_boards.h> | ||
#include <Arduino.h> | ||
|
||
#include "../lmic/oslmic.h" | ||
|
||
#define LORA_DIO0 26 | ||
#define LORA_DIO1 33 | ||
#define LORA_DIO2 32 | ||
|
||
namespace Arduino_LMIC { | ||
|
||
class HalConfiguration_ttgo_lora32_v21 : public HalConfiguration_t | ||
{ | ||
public: | ||
enum DIGITAL_PINS : uint8_t | ||
{ | ||
PIN_SX1276_NSS = 18, | ||
PIN_SX1276_NRESET = 23, | ||
PIN_SX1276_DIO0 = LORA_DIO0, | ||
PIN_SX1276_DIO1 = LORA_DIO1, | ||
PIN_SX1276_DIO2 = LORA_DIO2, | ||
PIN_SX1276_ANT_SWITCH_RX = HalPinmap_t::UNUSED_PIN, | ||
PIN_SX1276_ANT_SWITCH_TX_BOOST = HalPinmap_t::UNUSED_PIN, | ||
PIN_SX1276_ANT_SWITCH_TX_RFO = HalPinmap_t::UNUSED_PIN, | ||
PIN_VDD_BOOST_ENABLE = HalPinmap_t::UNUSED_PIN, | ||
}; | ||
|
||
virtual void begin(void) override | ||
{ | ||
digitalWrite(PIN_SX1276_NSS, 1); | ||
pinMode(PIN_SX1276_NSS, OUTPUT); | ||
} | ||
|
||
// virtual void end(void) override | ||
|
||
// virtual ostime_t setModuleActive(bool state) override | ||
|
||
}; | ||
|
||
static HalConfiguration_ttgo_lora32_v21 myConfig; | ||
|
||
static const HalPinmap_t myPinmap = | ||
{ | ||
.nss = HalConfiguration_ttgo_lora32_v21::PIN_SX1276_NSS, // chip select is D7 | ||
.rxtx = HalConfiguration_ttgo_lora32_v21::PIN_SX1276_ANT_SWITCH_RX, // RXTX is D29 | ||
.rst = HalConfiguration_ttgo_lora32_v21::PIN_SX1276_NRESET, // NRESET is D8 | ||
|
||
.dio = {HalConfiguration_ttgo_lora32_v21::PIN_SX1276_DIO0, // DIO0 (IRQ) is D25 | ||
HalConfiguration_ttgo_lora32_v21::PIN_SX1276_DIO1, // DIO1 is D26 | ||
HalConfiguration_ttgo_lora32_v21::PIN_SX1276_DIO2, // DIO2 is D27 | ||
}, | ||
.rxtx_rx_active = 0, | ||
.rssi_cal = 10, | ||
.spi_freq = 8000000, /* 8MHz */ | ||
.pConfig = &myConfig | ||
}; | ||
|
||
const HalPinmap_t * GetPinmap_ttgo_lora32_v21 (void) | ||
{ | ||
return &myPinmap; | ||
} | ||
|
||
}; // namespace Arduino_LMIC | ||
|
||
|
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.
Why are these deleted? Merge conflict?