Skip to content

Commit 79318c5

Browse files
committed
Merge branch 'ChrSchultz-master'
2 parents 8ec44eb + a9652d4 commit 79318c5

File tree

3 files changed

+71
-1
lines changed

3 files changed

+71
-1
lines changed

src/arduino_lmic_hal_boards.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const HalPinmap_t *GetPinmap_Catena4630();
3737
const HalPinmap_t *GetPinmap_Catena4801();
3838
const HalPinmap_t *GetPinmap_Catena4802();
3939
const HalPinmap_t* GetPinmap_ttgo_lora32_v1();
40+
const HalPinmap_t *GetPinmap_ttgo_lora32_v21();
4041
const HalPinmap_t* GetPinmap_heltec_lora32();
4142
const HalPinmap_t* GetPinmap_Disco_L072cz_Lrwan1();
4243

src/hal/getpinmap_thisboard.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,15 @@ const HalPinmap_t *GetPinmap_ThisBoard(void)
5656
#elif defined(ARDUINO_MCCI_CATENA_4801)
5757
return GetPinmap_Catena4801();
5858
#elif defined(ARDUINO_MCCI_CATENA_4802)
59-
return GetPinmap_Catena4802();
59+
return GetPinmap_Catena4802();
6060
#elif defined(ARDUINO_DISCO_L072CZ_LRWAN1)
6161
return GetPinmap_Disco_L072cz_Lrwan1();
6262
#elif defined(PINNOCHIO_SCOUT)
6363
return GetPinmap_PinnochioScount();
6464
#elif defined(ARDUINO_TTGO_LoRa32_V1)
6565
return GetPinmap_ttgo_lora32_v1();
66+
#elif defined(ARDUINO_TTGO_LoRa32_v21new)
67+
return GetPinmap_ttgo_lora32_v21();
6668
#elif defined(ARDUINO_HELTEC_WIFI_LORA_32) || defined(ARDUINO_HELTEC_WIFI_LORA_32_V2) || defined(ARDUINO_HELTEC_WIRELESS_STICK)
6769
return GetPinmap_heltec_lora32();
6870
#else
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
2+
3+
#include <arduino_lmic_hal_boards.h>
4+
#include <Arduino.h>
5+
6+
#include "../lmic/oslmic.h"
7+
8+
#define LORA_DIO0 26
9+
#define LORA_DIO1 33
10+
#define LORA_DIO2 32
11+
12+
namespace Arduino_LMIC {
13+
14+
class HalConfiguration_ttgo_lora32_v21 : public HalConfiguration_t
15+
{
16+
public:
17+
enum DIGITAL_PINS : uint8_t
18+
{
19+
PIN_SX1276_NSS = 18,
20+
PIN_SX1276_NRESET = 23,
21+
PIN_SX1276_DIO0 = LORA_DIO0,
22+
PIN_SX1276_DIO1 = LORA_DIO1,
23+
PIN_SX1276_DIO2 = LORA_DIO2,
24+
PIN_SX1276_ANT_SWITCH_RX = HalPinmap_t::UNUSED_PIN,
25+
PIN_SX1276_ANT_SWITCH_TX_BOOST = HalPinmap_t::UNUSED_PIN,
26+
PIN_SX1276_ANT_SWITCH_TX_RFO = HalPinmap_t::UNUSED_PIN,
27+
PIN_VDD_BOOST_ENABLE = HalPinmap_t::UNUSED_PIN,
28+
};
29+
30+
virtual void begin(void) override
31+
{
32+
digitalWrite(PIN_SX1276_NSS, 1);
33+
pinMode(PIN_SX1276_NSS, OUTPUT);
34+
}
35+
36+
// virtual void end(void) override
37+
38+
// virtual ostime_t setModuleActive(bool state) override
39+
40+
};
41+
42+
static HalConfiguration_ttgo_lora32_v21 myConfig;
43+
44+
static const HalPinmap_t myPinmap =
45+
{
46+
.nss = HalConfiguration_ttgo_lora32_v21::PIN_SX1276_NSS, // chip select is D7
47+
.rxtx = HalConfiguration_ttgo_lora32_v21::PIN_SX1276_ANT_SWITCH_RX, // RXTX is D29
48+
.rst = HalConfiguration_ttgo_lora32_v21::PIN_SX1276_NRESET, // NRESET is D8
49+
50+
.dio = {HalConfiguration_ttgo_lora32_v21::PIN_SX1276_DIO0, // DIO0 (IRQ) is D25
51+
HalConfiguration_ttgo_lora32_v21::PIN_SX1276_DIO1, // DIO1 is D26
52+
HalConfiguration_ttgo_lora32_v21::PIN_SX1276_DIO2, // DIO2 is D27
53+
},
54+
.rxtx_rx_active = 0,
55+
.rssi_cal = 10,
56+
.spi_freq = 8000000, /* 8MHz */
57+
.pConfig = &myConfig
58+
};
59+
60+
const HalPinmap_t * GetPinmap_ttgo_lora32_v21 (void)
61+
{
62+
return &myPinmap;
63+
}
64+
65+
}; // namespace Arduino_LMIC
66+
67+

0 commit comments

Comments
 (0)