mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-19 20:14:04 +00:00
add rp2040, pico
adds preliminary support (just enough to run blinky1) for the Raspberry Pi Pico board along with the rp2040 mcu.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
// +build rp2040
|
||||
|
||||
package machine
|
||||
|
||||
import (
|
||||
"device/rp"
|
||||
"runtime/volatile"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
type watchdogType struct {
|
||||
ctrl volatile.Register32
|
||||
load volatile.Register32
|
||||
reason volatile.Register32
|
||||
scratch [8]volatile.Register32
|
||||
tick volatile.Register32
|
||||
}
|
||||
|
||||
var watchdog = (*watchdogType)(unsafe.Pointer(rp.WATCHDOG))
|
||||
|
||||
// startTick starts the watchdog tick.
|
||||
// cycles needs to be a divider that when applied to the xosc input,
|
||||
// produces a 1MHz clock. So if the xosc frequency is 12MHz,
|
||||
// this will need to be 12.
|
||||
func (wd *watchdogType) startTick(cycles uint32) {
|
||||
wd.tick.Set(cycles | rp.WATCHDOG_TICK_ENABLE)
|
||||
}
|
||||
Reference in New Issue
Block a user