Library guide · API index and notation
This page is generated from the bundled library in this checkout. Signatures and adjacent source comments are reproduced below; the linked guide explains usage, storage, failures, and platform support.
import "std/embedded/board/pico2"
Names used in signatures
Unqualified names denote this package’s types (including other source files in the same package), language built-ins, or generic parameters such as T. Qualified names use the import aliases below. These aliases belong to the library source; import a dependency yourself to use its alias in your program.
| Alias | Package | Source file |
|---|---|---|
hal |
std/embedded/hal |
pico2.dodo |
rp2350 |
std/embedded/chip/rp2350 |
pico2.dodo |
NAME
Constant · Source
pub const NAME: &str = "Raspberry Pi Pico 2"
LED_PIN
Constant · Source
pub const LED_PIN: u32 = 25
CRYSTAL_HZ
Constant · Source
pub const CRYSTAL_HZ: u32 = 12_000_000
I2C_SDA_PIN
Constant · Source
The usual bus pins, as in the Pico SDK and Raspberry Pi’s pinout diagrams: I2C0 on GP4 (SDA) and GP5 (SCL), and SPI0 on GP16 (RX), GP18 (clock), and GP19 (TX), with GP17 free for a chip select:
i2c := b.pins.i2c(I2C_SDA_PIN, I2C_SCL_PIN, hal.I2C_FAST_HZ)!
pub const I2C_SDA_PIN: u32 = 4
I2C_SCL_PIN
Constant · Source
pub const I2C_SCL_PIN: u32 = 5
SPI_RX_PIN
Constant · Source
pub const SPI_RX_PIN: u32 = 16
SPI_SELECT_PIN
Constant · Source
pub const SPI_SELECT_PIN: u32 = 17
SPI_CLOCK_PIN
Constant · Source
pub const SPI_CLOCK_PIN: u32 = 18
SPI_TX_PIN
Constant · Source
pub const SPI_TX_PIN: u32 = 19
Board
Struct · Source
pub struct Board {
// The user LED, an output pin that is on when high.
pub led: rp2350.Pin
// The remaining GPIOs, and the I2C and SPI buses on them; GP25 is
// already taken by `led`.
pub pins: rp2350.Pins
// The 1 MHz system timer: delay_us, delay_ms, and now_us.
pub timer: rp2350.Timer
}
take
Function · Source
Start the chip with the Pico 2’s crystal and claim the LED. A second call returns hal.Error.Busy.
pub fn take() -> Board!hal.Error
reboot_to_bootloader
Function · Source
Restart into the USB bootloader, as if BOOTSEL were held at power-up: the Pico 2 reappears as the RP2350 drive, ready for
dodo run. The LED shows drive activity on chip revisions after A2. Does not return.
pub fn reboot_to_bootloader()