aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBCG <[email protected]>2019-11-13 08:40:57 -0500
committerRon Evans <[email protected]>2019-11-19 08:40:32 +0100
commit5171618284487c5f356a39f0f3b9f5646706d894 (patch)
treee8a51e49e33478343f6eda437ef6b3d510bab335
parent4605cbbc6effa47b57dc9a2b3a121ef8e51e5426 (diff)
downloadtinygo-5171618284487c5f356a39f0f3b9f5646706d894.tar.gz
tinygo-5171618284487c5f356a39f0f3b9f5646706d894.zip
Added SPI1 connected to NINA-W102 chip on Arduino Nano 33 IOT
-rw-r--r--src/machine/board_arduino_nano33.go34
1 files changed, 22 insertions, 12 deletions
diff --git a/src/machine/board_arduino_nano33.go b/src/machine/board_arduino_nano33.go
index e70f5e8eb..475a1d1e9 100644
--- a/src/machine/board_arduino_nano33.go
+++ b/src/machine/board_arduino_nano33.go
@@ -48,18 +48,6 @@ const (
LED = D13
)
-// NINA-W102 Pins
-
-const (
- NINA_MOSI Pin = PA12
- NINA_MISO Pin = PA13
- NINA_CS Pin = PA14
- NINA_SCK Pin = PA15
- NINA_GPIO0 Pin = PA27
- NINA_RESETN Pin = PA08
- NINA_ACK Pin = PA28
-)
-
// UART0 aka USBCDC pins
const (
USBCDC_DM_PIN Pin = PA24
@@ -131,6 +119,28 @@ var (
}
)
+// NINA-W102 Pins
+const (
+ NINA_MOSI Pin = PA12
+ NINA_MISO Pin = PA13
+ NINA_CS Pin = PA14
+ NINA_SCK Pin = PA15
+ NINA_GPIO0 Pin = PA27
+ NINA_RESETN Pin = PA08
+ NINA_ACK Pin = PA28
+ NINA_TX Pin = PA22
+ NINA_RX Pin = PA23
+)
+
+// SPI1 is connected to the NINA-W102 chip on the Arduino Nano 33.
+var (
+ SPI1 = SPI{
+ Bus: sam.SERCOM2_SPI,
+ SERCOM: 2,
+ }
+ NINA_SPI = SPI1
+)
+
// I2S pins
const (
I2S_SCK_PIN Pin = PA10