Skip to content

Commit 629adc2

Browse files
authored
Merge pull request #1508 from recrof/rak4631-cleanup
cleanup: moved RAK4631 pindefs from board file to variant.h
2 parents 8f605f8 + f418724 commit 629adc2

2 files changed

Lines changed: 30 additions & 34 deletions

File tree

variants/rak4631/RAK4631Board.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,6 @@
44
#include <Arduino.h>
55
#include <helpers/NRF52Board.h>
66

7-
// LoRa radio module pins for RAK4631
8-
#define P_LORA_DIO_1 47
9-
#define P_LORA_NSS 42
10-
#define P_LORA_RESET RADIOLIB_NC // 38
11-
#define P_LORA_BUSY 46
12-
#define P_LORA_SCLK 43
13-
#define P_LORA_MISO 45
14-
#define P_LORA_MOSI 44
15-
#define SX126X_POWER_EN 37
16-
17-
//#define PIN_GPS_SDA 13 //GPS SDA pin (output option)
18-
//#define PIN_GPS_SCL 14 //GPS SCL pin (output option)
19-
//#define PIN_GPS_TX 16 //GPS TX pin
20-
//#define PIN_GPS_RX 15 //GPS RX pin
21-
#define PIN_GPS_1PPS 17 //GPS PPS pin
22-
#define GPS_BAUD_RATE 9600
23-
#define GPS_ADDRESS 0x42 //i2c address for GPS
24-
25-
#define SX126X_DIO2_AS_RF_SWITCH true
26-
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
27-
287
// built-ins
298
#define PIN_VBAT_READ 5
309
#define ADC_MULTIPLIER (3 * 1.73 * 1.187 * 1000)

variants/rak4631/variant.h

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,19 @@ extern "C"
144144
static const uint8_t MISO = PIN_SPI_MISO;
145145
static const uint8_t SCK = PIN_SPI_SCK;
146146

147+
// LoRa radio module pins for RAK4631
148+
#define P_LORA_DIO_1 (47)
149+
#define P_LORA_NSS (42)
150+
#define P_LORA_RESET (-1)
151+
#define P_LORA_BUSY (46)
152+
#define P_LORA_SCLK (43)
153+
#define P_LORA_MISO (45)
154+
#define P_LORA_MOSI (44)
155+
#define SX126X_POWER_EN (37)
156+
157+
#define SX126X_DIO2_AS_RF_SWITCH true
158+
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
159+
147160
/*
148161
* Wire Interfaces
149162
*/
@@ -155,19 +168,23 @@ extern "C"
155168
#define PIN_WIRE1_SDA (24)
156169
#define PIN_WIRE1_SCL (25)
157170

158-
// QSPI Pins
159-
// QSPI occupied by GPIO's
160-
#define PIN_QSPI_SCK 3 // 19
161-
#define PIN_QSPI_CS 26 // 17
162-
#define PIN_QSPI_IO0 30 // 20
163-
#define PIN_QSPI_IO1 29 // 21
164-
#define PIN_QSPI_IO2 28 // 22
165-
#define PIN_QSPI_IO3 2 // 23
166-
167-
// On-board QSPI Flash
168-
// No onboard flash
169-
#define EXTERNAL_FLASH_DEVICES IS25LP080D
170-
#define EXTERNAL_FLASH_USE_QSPI
171+
// QSPI Pins
172+
// QSPI occupied by GPIO's
173+
#define PIN_QSPI_SCK 3 // 19
174+
#define PIN_QSPI_CS 26 // 17
175+
#define PIN_QSPI_IO0 30 // 20
176+
#define PIN_QSPI_IO1 29 // 21
177+
#define PIN_QSPI_IO2 28 // 22
178+
#define PIN_QSPI_IO3 2 // 23
179+
180+
// On-board QSPI Flash
181+
// No onboard flash
182+
#define EXTERNAL_FLASH_DEVICES IS25LP080D
183+
#define EXTERNAL_FLASH_USE_QSPI
184+
185+
#define PIN_GPS_1PPS 17 //GPS PPS pin
186+
#define GPS_BAUD_RATE 9600
187+
#define GPS_ADDRESS 0x42 //i2c address for GPS
171188

172189
#ifdef __cplusplus
173190
}

0 commit comments

Comments
 (0)