Skip to content

Commit 1f3e000

Browse files
authored
add board: RAKwireless RAK4631 (#4454)
targets: add rak4631
1 parent d4cb92f commit 1f3e000

File tree

3 files changed

+94
-0
lines changed

3 files changed

+94
-0
lines changed

GNUmakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,8 @@ endif
642642
@$(MD5SUM) test.hex
643643
$(TINYGO) build -size short -o test.hex -target=xiao examples/blinky1
644644
@$(MD5SUM) test.hex
645+
$(TINYGO) build -size short -o test.hex -target=rak4631 examples/blinky1
646+
@$(MD5SUM) test.hex
645647
$(TINYGO) build -size short -o test.hex -target=circuitplay-express examples/dac
646648
@$(MD5SUM) test.hex
647649
$(TINYGO) build -size short -o test.hex -target=pyportal examples/dac

src/machine/board_rak4631.go

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
//go:build rak4631
2+
3+
package machine
4+
5+
const HasLowFrequencyCrystal = true
6+
7+
// Digital Pins
8+
const (
9+
D0 Pin = P0_28
10+
D1 Pin = P0_02
11+
)
12+
13+
// Analog pins
14+
const (
15+
A0 Pin = P0_17
16+
A1 Pin = P1_02
17+
A2 Pin = P0_21
18+
)
19+
20+
// Onboard LEDs
21+
const (
22+
LED = LED2
23+
LED1 = P1_03
24+
LED2 = P1_04
25+
)
26+
27+
// UART pins
28+
const (
29+
// Default to UART1
30+
UART_RX_PIN = UART0_RX_PIN
31+
UART_TX_PIN = UART0_TX_PIN
32+
33+
// UART1
34+
UART0_RX_PIN = P0_19
35+
UART0_TX_PIN = P0_20
36+
37+
// UART2
38+
UART1_RX_PIN = P0_15
39+
UART1_TX_PIN = P0_16
40+
)
41+
42+
// I2C pins
43+
const (
44+
SDA_PIN = SDA1_PIN
45+
SCL_PIN = SCL1_PIN
46+
47+
SDA1_PIN = P0_13
48+
SCL1_PIN = P0_14
49+
50+
SDA2_PIN = P0_24
51+
SCL2_PIN = P0_25
52+
)
53+
54+
// SPI pins
55+
const (
56+
SPI0_SCK_PIN = P0_03
57+
SPI0_SDO_PIN = P0_29
58+
SPI0_SDI_PIN = P0_30
59+
)
60+
61+
// Peripherals
62+
const (
63+
LORA_NSS = P1_10
64+
LORA_SCK = P1_11
65+
LORA_MOSI = P1_12
66+
LORA_MISO = P1_13
67+
LORA_BUSY = P1_14
68+
LORA_DIO1 = P1_15
69+
LORA_NRESET = P1_06
70+
LORA_POWER = P1_05
71+
)
72+
73+
// USB CDC identifiers
74+
const (
75+
usb_STRING_PRODUCT = "WisCore RAK4631 Board"
76+
usb_STRING_MANUFACTURER = "RAKwireless"
77+
)
78+
79+
var (
80+
usb_VID uint16 = 0x239a
81+
usb_PID uint16 = 0x8029
82+
)
83+
84+
var (
85+
DefaultUART = UART0
86+
)

targets/rak4631.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"inherits": ["nrf52840", "nrf52840-s140v6-uf2"],
3+
"build-tags": ["rak4631"],
4+
"serial-port": ["239a:8029"],
5+
"msd-volume-name": ["RAK4631"]
6+
}

0 commit comments

Comments
 (0)