Skip to content

Commit

Permalink
[STM32] build with LR11XX driver
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Dec 11, 2024
1 parent 72aa345 commit 844251d
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 2 deletions.
6 changes: 5 additions & 1 deletion software/firmware/source/SoftRF/src/platform/STM32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ lmic_pinmap lmic_pins = {
.rst = SOC_GPIO_PIN_RST,
.dio = {SOC_GPIO_PIN_DIO0, LMIC_UNUSED_PIN, LMIC_UNUSED_PIN},
#endif
.busy = LMIC_UNUSED_PIN,
.busy = SOC_GPIO_PIN_BUSY,
.tcxo = LMIC_UNUSED_PIN,
};

Expand Down Expand Up @@ -523,6 +523,10 @@ static void STM32_setup()
}
#endif /* ARDUINO_NUCLEO_L073RZ || ARDUINO_GENERIC_WLE5CCUX */

#if defined(USE_RADIOLIB)
lmic_pins.dio[0] = SOC_GPIO_PIN_DIO0;
#endif /* USE_RADIOLIB */

Serial.begin(SERIAL_OUT_BR, SERIAL_OUT_BITS);

#if defined(USBD_USE_CDC) && !defined(DISABLE_GENERIC_SERIALUSB)
Expand Down
9 changes: 8 additions & 1 deletion software/firmware/source/SoftRF/src/platform/STM32.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ extern char *dtostrf_workaround(double, signed char, unsigned char, char *);
#define uni_Color(r,g,b) strip.Color(r,g,b)
#define color_t uint32_t

#define yield() ({ })
#define snprintf_P snprintf
#define EEPROM_commit() {}

//#define yield() ({ })
inline void yield() { };

#define AN3155_BR 115200
#define AN3155_BITS SERIAL_8E1

Expand Down Expand Up @@ -173,13 +175,16 @@ typedef struct stm32_backup_struct {
//#define USE_OGN_ENCRYPTION
#define EXCLUDE_LK8EX1
#define EXCLUDE_IMU
//#define USE_RADIOLIB

//#define ENFORCE_S78G
#define USE_TIME_SLOTS

/* Experimental */
#define ENABLE_ADSL // + 2 kb
#if !defined(USE_RADIOLIB)
#define ENABLE_PROL // + 18 kb
#endif /* USE_RADIOLIB */

/* Secondary target ("Blue pill") */
#elif defined(ARDUINO_BLUEPILL_F103CB)
Expand Down Expand Up @@ -287,6 +292,7 @@ typedef struct stm32_backup_struct {

#define USE_BASICMAC // + 7 kb
#define EXCLUDE_SX1276 // - 3 kb
//#define USE_RADIOLIB

#define USE_TIME_SLOTS
#define USE_OGN_ENCRYPTION
Expand Down Expand Up @@ -343,6 +349,7 @@ typedef struct stm32_backup_struct {

#define USE_BASICMAC // + 7 kb
#define EXCLUDE_SX1276 // - 3 kb
//#define USE_RADIOLIB

#define USE_TIME_SLOTS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
#define SOC_GPIO_PIN_RST PB5
#define SOC_GPIO_PIN_DIO0 PB4

/* SX1262 */
#define SOC_GPIO_PIN_BUSY LMIC_UNUSED_PIN

/* RF antenna switch */
#define SOC_GPIO_PIN_ANT_RXTX LMIC_UNUSED_PIN

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
#define SOC_GPIO_PIN_DIO4 PB3
#define SOC_GPIO_PIN_DIO5 PA15

/* SX1262 */
#define SOC_GPIO_PIN_BUSY LMIC_UNUSED_PIN

/* RF antenna switch */
#define SOC_GPIO_PIN_ANT_RXTX PA1 // 1:Rx, 0:Tx

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
/* SX1262 */
#define SOC_GPIO_PIN_RST LMIC_UNUSED_PIN
#define SOC_GPIO_PIN_BUSY LMIC_UNUSED_PIN
#define SOC_GPIO_PIN_DIO0 LMIC_UNUSED_PIN
#define SOC_GPIO_PIN_DIO1 LMIC_UNUSED_PIN

/* RF antenna switch */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
/* SX1262 */
#define SOC_GPIO_PIN_RST LMIC_UNUSED_PIN
#define SOC_GPIO_PIN_BUSY LMIC_UNUSED_PIN
#define SOC_GPIO_PIN_DIO0 LMIC_UNUSED_PIN
#define SOC_GPIO_PIN_DIO1 LMIC_UNUSED_PIN

/* RF antenna switch */
Expand Down

0 comments on commit 844251d

Please sign in to comment.