Slide 58
Slide 58 text
enum USB {
...
static func initialize() {
// 1. Reset to a clean slate before bringing it up (clk_usb assumes
//
Clocks.initialize has already run).
Resets.reset(.usbctrl)
Resets.unreset(.usbctrl)
// 2. DPRAM holds undefined values right after power-on -> zero it out.
DPRAM.clear()
// 3. Controller core, wiring to the physical pins, and self-reported power.
mainControl.store(controllerEnable)
muxing.store(muxToPhySoftcon)
power.store(vbusDetectOverride) // The Pico's detect pin isn't wired -> declare "power is present".
// 4. Raise a flag on every EP0 completion / address 0 (accept newcomers).
sieControl.store(ep0IntPerBuffer)
addressEndpoint.store(0)
// 5. The one bit that announces us. From here the host's script begins.
sieControl.set(pullupEnable)
}
...
}