diff --git a/adapter_ninafw-machine.go b/adapter_ninafw-machine.go new file mode 100644 index 00000000..3c94a2b3 --- /dev/null +++ b/adapter_ninafw-machine.go @@ -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 +} diff --git a/adapter_ninafw.go b/adapter_ninafw.go index 7ff3c052..05d91f5e 100644 --- a/adapter_ninafw.go +++ b/adapter_ninafw.go @@ -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