Skip to content

Commit b9f5114

Browse files
committed
adding customizable ninafw
1 parent cd3c0c4 commit b9f5114

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

adapter_ninafw-machine.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//go:build ninafw
2+
3+
package bluetooth
4+
5+
import (
6+
"machine"
7+
)
8+
9+
func init() {
10+
NINA_SCK = machine.NINA_SCK
11+
NINA_SDO = machine.NINA_SDO
12+
NINA_SDI = machine.NINA_SDI
13+
NINA_CS = machine.NINA_CS
14+
NINA_ACK = machine.NINA_ACK
15+
NINA_GPIO0 = machine.NINA_GPIO0
16+
NINA_RESETN = machine.NINA_RESETN
17+
NINA_BAUDRATE = machine.NINA_BAUDRATE
18+
NINA_RESET_INVERTED = machine.NINA_RESET_INVERTED
19+
NINA_SOFT_FLOWCONTROL = machine.NINA_SOFT_FLOWCONTROL
20+
}

adapter_ninafw.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,28 @@ import (
1111

1212
const maxConnections = 1
1313

14+
var (
15+
// NINA-W102 Pins
16+
NINA_SCK machine.Pin
17+
NINA_SDO machine.Pin
18+
NINA_SDI machine.Pin
19+
20+
NINA_CS machine.Pin
21+
NINA_ACK machine.Pin
22+
NINA_GPIO0 machine.Pin
23+
NINA_RESETN machine.Pin
24+
25+
NINA_TX machine.Pin
26+
NINA_RX machine.Pin
27+
NINA_CTS machine.Pin
28+
NINA_RTS machine.Pin
29+
30+
// NINA-W102 settings
31+
NINA_BAUDRATE = 115200
32+
NINA_RESET_INVERTED = true
33+
NINA_SOFT_FLOWCONTROL = false
34+
)
35+
1436
// Adapter represents the UART connection to the NINA fw.
1537
type Adapter struct {
1638
hci *hci

0 commit comments

Comments
 (0)