boards: add Challenger RP2040 LoRa

This commit is contained in:
Kenneth Bell
2022-07-01 17:06:08 +01:00
committed by Ron Evans
parent e1405640da
commit 1d99b1ed84
12 changed files with 348 additions and 34 deletions
+28
View File
@@ -9,6 +9,11 @@
//
package machine
import (
"device/rp"
"runtime/interrupt"
)
const (
LED Pin = GPIO25
@@ -79,3 +84,26 @@ var (
usb_VID uint16 = 0x2e8a
usb_PID uint16 = 0x0003
)
// UART pins
const (
UART0_TX_PIN = GPIO0
UART0_RX_PIN = GPIO1
UART_TX_PIN = UART0_TX_PIN
UART_RX_PIN = UART0_RX_PIN
)
// UART on the RP2040
var (
UART0 = &_UART0
_UART0 = UART{
Buffer: NewRingBuffer(),
Bus: rp.UART0,
}
)
var DefaultUART = UART0
func init() {
UART0.Interrupt = interrupt.New(rp.IRQ_UART0_IRQ, _UART0.handleInterrupt)
}