machine/nano-rp2040: add UART1 and correct mappings for NINA via UART.

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram
2023-12-20 18:07:42 +01:00
committed by BCG
parent cf21380264
commit ffe6dfd21b
+11 -2
View File
@@ -87,8 +87,10 @@ const (
NINA_GPIO0 Pin = GPIO2 NINA_GPIO0 Pin = GPIO2
NINA_RESETN Pin = GPIO3 NINA_RESETN Pin = GPIO3
NINA_TX Pin = GPIO9 NINA_TX Pin = GPIO8
NINA_RX Pin = GPIO8 NINA_RX Pin = GPIO9
NINA_CTS Pin = GPIO10
NINA_RTS Pin = GPIO11
) )
// Onboard crystal oscillator frequency, in MHz. // Onboard crystal oscillator frequency, in MHz.
@@ -123,10 +125,17 @@ var (
Buffer: NewRingBuffer(), Buffer: NewRingBuffer(),
Bus: rp.UART0, Bus: rp.UART0,
} }
UART1 = &_UART1
_UART1 = UART{
Buffer: NewRingBuffer(),
Bus: rp.UART1,
}
) )
var DefaultUART = UART0 var DefaultUART = UART0
func init() { func init() {
UART0.Interrupt = interrupt.New(rp.IRQ_UART0_IRQ, _UART0.handleInterrupt) UART0.Interrupt = interrupt.New(rp.IRQ_UART0_IRQ, _UART0.handleInterrupt)
UART1.Interrupt = interrupt.New(rp.IRQ_UART1_IRQ, _UART1.handleInterrupt)
} }