aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authordeadprogram <[email protected]>2023-12-20 18:07:42 +0100
committerBCG <[email protected]>2023-12-20 16:51:21 -0500
commitffe6dfd21bb8aaccc63cfb2c2e93f7d98068e76a (patch)
tree6c0f712f5236bd9cb3ef20ea69af7dbd0c9f2c42
parentcf213802646dc80dcac6076c63eafda94fac0c52 (diff)
downloadtinygo-ffe6dfd21bb8aaccc63cfb2c2e93f7d98068e76a.tar.gz
tinygo-ffe6dfd21bb8aaccc63cfb2c2e93f7d98068e76a.zip
machine/nano-rp2040: add UART1 and correct mappings for NINA via UART.
Signed-off-by: deadprogram <[email protected]>
-rw-r--r--src/machine/board_nano-rp2040.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/machine/board_nano-rp2040.go b/src/machine/board_nano-rp2040.go
index 0a27290dd..e8157a41b 100644
--- a/src/machine/board_nano-rp2040.go
+++ b/src/machine/board_nano-rp2040.go
@@ -87,8 +87,10 @@ const (
NINA_GPIO0 Pin = GPIO2
NINA_RESETN Pin = GPIO3
- NINA_TX Pin = GPIO9
- NINA_RX Pin = GPIO8
+ NINA_TX Pin = GPIO8
+ NINA_RX Pin = GPIO9
+ NINA_CTS Pin = GPIO10
+ NINA_RTS Pin = GPIO11
)
// Onboard crystal oscillator frequency, in MHz.
@@ -123,10 +125,17 @@ var (
Buffer: NewRingBuffer(),
Bus: rp.UART0,
}
+
+ UART1 = &_UART1
+ _UART1 = UART{
+ Buffer: NewRingBuffer(),
+ Bus: rp.UART1,
+ }
)
var DefaultUART = UART0
func init() {
UART0.Interrupt = interrupt.New(rp.IRQ_UART0_IRQ, _UART0.handleInterrupt)
+ UART1.Interrupt = interrupt.New(rp.IRQ_UART1_IRQ, _UART1.handleInterrupt)
}