rp2040: make all RP2040 boards available for simulation

This makes all rp2040 boards available for simulation using
-tags=<board_name>. Importantly, this includes the Gopher Badge which
I'm working on to add to the TinyGo Playground.
This commit is contained in:
Ayke van Laethem
2024-03-30 13:37:52 +01:00
committed by Ron Evans
parent c55ac9f28e
commit 90b0bf646c
5 changed files with 57 additions and 45 deletions
+7 -3
View File
@@ -7,15 +7,14 @@ package machine
const deviceName = "generic"
var (
UART0 = &UART{0}
USB = &UART{100}
USB = &UART{100}
)
// The Serial port always points to the default UART in a simulated environment.
//
// TODO: perhaps this should be a special serial object that outputs via WASI
// stdout calls.
var Serial = UART0
var Serial = hardwareUART0
const (
PinInput PinMode = iota
@@ -176,6 +175,11 @@ func uartRead(bus uint8, buf *byte, bufLen int) int
//export __tinygo_uart_write
func uartWrite(bus uint8, buf *byte, bufLen int) int
var (
hardwareUART0 = &UART{0}
hardwareUART1 = &UART{1}
)
// Some objects used by Atmel SAM D chips (samd21, samd51).
// Defined here (without build tag) for convenience.
var (