Skip to content

Commit

Permalink
adding customizable ninafw
Browse files Browse the repository at this point in the history
  • Loading branch information
bgould committed Jan 7, 2024
1 parent cd3c0c4 commit b9f5114
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
20 changes: 20 additions & 0 deletions adapter_ninafw-machine.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//go:build ninafw

package bluetooth

import (
"machine"
)

func init() {
NINA_SCK = machine.NINA_SCK
NINA_SDO = machine.NINA_SDO
NINA_SDI = machine.NINA_SDI
NINA_CS = machine.NINA_CS
NINA_ACK = machine.NINA_ACK
NINA_GPIO0 = machine.NINA_GPIO0
NINA_RESETN = machine.NINA_RESETN
NINA_BAUDRATE = machine.NINA_BAUDRATE
NINA_RESET_INVERTED = machine.NINA_RESET_INVERTED
NINA_SOFT_FLOWCONTROL = machine.NINA_SOFT_FLOWCONTROL
}
22 changes: 22 additions & 0 deletions adapter_ninafw.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,28 @@ import (

const maxConnections = 1

var (
// NINA-W102 Pins
NINA_SCK machine.Pin
NINA_SDO machine.Pin
NINA_SDI machine.Pin

NINA_CS machine.Pin
NINA_ACK machine.Pin
NINA_GPIO0 machine.Pin
NINA_RESETN machine.Pin

NINA_TX machine.Pin
NINA_RX machine.Pin
NINA_CTS machine.Pin
NINA_RTS machine.Pin

// NINA-W102 settings
NINA_BAUDRATE = 115200
NINA_RESET_INVERTED = true
NINA_SOFT_FLOWCONTROL = false
)

// Adapter represents the UART connection to the NINA fw.
type Adapter struct {
hci *hci
Expand Down

0 comments on commit b9f5114

Please sign in to comment.