Skip to content

Commit 1e1b5ab

Browse files
committed
[RK35] add an I/O map for Waveshare SX1262-L76K HAT with recent Luckfox Lyra Zero W SBC [skip ci]
1 parent 454fb18 commit 1e1b5ab

5 files changed

Lines changed: 39 additions & 6 deletions

File tree

software/firmware/source/SoftRF/src/platform/RK35.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ const char *Hardware_Rev[] = {
196196
[0] = "Unknown"
197197
};
198198

199+
static int RK35_board = RK35_LUCKFOX_LYRA_B; /* default */
200+
static int RK35_hat = RK35_WAVESHARE_PICO_LORA; /* default */
201+
199202
#include "mode-s.h"
200203
#include "sdr/common.h"
201204

software/firmware/source/SoftRF/src/platform/RK35.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ enum rst_reason {
5252
REASON_EXT_SYS_RST = 6 /* external system reset */
5353
};
5454

55+
enum RK35_board_id {
56+
RK35_LUCKFOX_LYRA_B, /* Pico form factor */
57+
RK35_LUCKFOX_LYRA_ZW, /* Zero Wireless */
58+
};
59+
60+
enum RK35_hat_id {
61+
RK35_WAVESHARE_PICO_LORA, /* Waveshare Pico-LoRa-SX1262 */
62+
RK35_WAVESHARE_HAT_LORA_GNSS, /* Waveshare SX1262-L76K HAT */
63+
};
64+
5565
struct rst_info {
5666
uint32_t reason;
5767
uint32_t exccause;
@@ -85,6 +95,20 @@ struct rst_info {
8595
#define SOC_GPIO_PIN_STATUS SOC_UNUSED_PIN
8696
#define SOC_GPIO_PIN_BUZZER SOC_UNUSED_PIN // RMIO8
8797

98+
// Luckfox Lyra Zero W with Waveshare SX1262-L76K HAT
99+
#define SOC_GPIO_PIN_HAT_MOSI 0 RMIO6
100+
#define SOC_GPIO_PIN_HAT_MISO 0 RMIO7
101+
#define SOC_GPIO_PIN_HAT_SCK 0 RMIO8
102+
#define SOC_GPIO_PIN_HAT_SS 0 // RMIO18
103+
#define SOC_GPIO_PIN_HAT_RST 0 // RMIO14
104+
#define SOC_GPIO_PIN_HAT_DIO 0 // RMIO29
105+
#define SOC_GPIO_PIN_HAT_BUSY 0 // RMIO17
106+
#define SOC_GPIO_PIN_HAT_SDA RMIO0
107+
#define SOC_GPIO_PIN_HAT_SCL RMIO1
108+
#define SOC_GPIO_PIN_HAT_GNSS_RX RMIO23
109+
#define SOC_GPIO_PIN_HAT_GNSS_TX RMIO22
110+
#define SOC_GPIO_PIN_HAT_GNSS_PPS SOC_UNUSED_PIN
111+
88112
#define HTTP_SRV_PORT 8081 /* port 8080 can cause conflict with dump1090 */
89113
#define JSON_SRV_TCP_PORT 30007
90114

software/firmware/source/SoftRF/src/platform/RPi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ void notFound(Request &req, Response &res) {
373373
#define ARRAY_SIZE(stuff) (sizeof(stuff) / sizeof(stuff[0]))
374374

375375
#define TARGET_FREQ WS2811_TARGET_FREQ
376-
#define GPIO_PIN 18
376+
#define GPIO_PIN 12
377377
#define DMA 10
378378
//#define STRIP_TYPE WS2811_STRIP_RGB // WS2812/SK6812RGB integrated chip+leds
379379
#define STRIP_TYPE WS2811_STRIP_GBR // WS2812/SK6812RGB integrated chip+leds

software/firmware/source/SoftRF/src/platform/RPi.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ struct rst_info {
9090
#define SOC_GPIO_PIN_SS 16
9191
#define SOC_GPIO_PIN_RST 26
9292
#define SOC_GPIO_PIN_DIO0 13 // IRQ on GPIO13 so P1 connector pin #33
93-
#define SOC_GPIO_PIN_BUSY 12
93+
#define SOC_GPIO_PIN_BUSY 5
9494
#else
9595
#define SOC_GPIO_PIN_MOSI 10
9696
#define SOC_GPIO_PIN_MISO 9
@@ -113,9 +113,12 @@ struct rst_info {
113113
#define SOC_GPIO_PIN_WS_DIO1 16
114114
#define SOC_GPIO_PIN_WS_BUSY 20
115115

116+
#define SOC_GPIO_PIN_SDA 2
117+
#define SOC_GPIO_PIN_SCL 3
118+
116119
#define SOC_GPIO_PIN_GNSS_PPS SOC_UNUSED_PIN // 1 /* rev. 1.4 only */
117120
#define SOC_GPIO_PIN_BUZZER 22
118-
#define SOC_GPIO_PIN_NEOPIXEL SOC_UNUSED_PIN // 18
121+
#define SOC_GPIO_PIN_NEOPIXEL 12
119122

120123
#else /* BCM */
121124

@@ -127,7 +130,7 @@ struct rst_info {
127130
#define SOC_GPIO_PIN_SS RPI_V2_GPIO_P1_36
128131
#define SOC_GPIO_PIN_RST RPI_V2_GPIO_P1_37
129132
#define SOC_GPIO_PIN_DIO0 RPI_V2_GPIO_P1_33 // IRQ on GPIO13 so P1 connector pin #33
130-
#define SOC_GPIO_PIN_BUSY RPI_V2_GPIO_P1_32
133+
#define SOC_GPIO_PIN_BUSY RPI_V2_GPIO_P1_29
131134
#else
132135
#define SOC_GPIO_PIN_MOSI RPI_V2_GPIO_P1_19
133136
#define SOC_GPIO_PIN_MISO RPI_V2_GPIO_P1_21
@@ -152,9 +155,10 @@ struct rst_info {
152155

153156
#define SOC_GPIO_PIN_GNSS_PPS SOC_UNUSED_PIN // RPI_V2_GPIO_P1_12 /* rev. 1.4 */
154157
#define SOC_GPIO_PIN_BUZZER SOC_UNUSED_PIN
158+
#define SOC_GPIO_PIN_NEOPIXEL SOC_UNUSED_PIN
155159
#endif /* GPIO */
156160

157-
#define SOC_GPIO_PIN_LED SOC_UNUSED_PIN // 18
161+
#define SOC_GPIO_PIN_LED SOC_GPIO_PIN_NEOPIXEL
158162
#define SOC_GPIO_PIN_STATUS SOC_UNUSED_PIN
159163

160164
#define HTTP_SRV_PORT 8081 /* port 8080 can cause conflict with dump1090 */

software/firmware/source/SoftRF/src/platform/iomap/WT99P4C5.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,16 @@
3030
#define SOC_GPIO_PIN_P4_DIO 47
3131
#define SOC_GPIO_PIN_P4_BUSY 27
3232

33-
// Waveshare SX1262-L76K HAT with Espressif ESP32-P4 EVB
33+
// Waveshare ESP32-P4-Module-DEV-KIT with SX1262-L76K HAT
3434
#define SOC_GPIO_PIN_P4_WS_MOSI 3
3535
#define SOC_GPIO_PIN_P4_WS_MISO 2
3636
#define SOC_GPIO_PIN_P4_WS_SCK 0
3737
#define SOC_GPIO_PIN_P4_WS_SS 45
3838
#define SOC_GPIO_PIN_P4_WS_RST 22
3939
#define SOC_GPIO_PIN_P4_WS_DIO 46
4040
#define SOC_GPIO_PIN_P4_WS_BUSY 27
41+
#define SOC_GPIO_PIN_P4_WS_GNSS_RX 38
42+
#define SOC_GPIO_PIN_P4_WS_GNSS_TX 37
4143
#define SOC_GPIO_PIN_P4_WS_GNSS_PPS SOC_UNUSED_PIN
4244

4345
// SDIO 1 - SDMMC

0 commit comments

Comments
 (0)