API reference Dodo 0.1.5

std/embedded/board/pico

Public declarations, types, methods, and source contracts for std/embedded/board/pico.

On this page

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/pico"

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 pico.dodo
rp2040 std/embedded/chip/rp2040 pico.dodo

NAME

Constant · Source

pub const NAME: &str = "Raspberry Pi Pico"

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: rp2040.Pin
    // The remaining GPIOs, and the I2C and SPI buses on them; GP25 is
    // already taken by `led`.
    pub pins: rp2040.Pins
    // The 1 MHz system timer: delay_us, delay_ms, and now_us.
    pub timer: rp2040.Timer
}

take

Function · Source

Start the chip with the Pico’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 reappears as the RPI-RP2 drive, ready for dodo run. The LED shows drive activity. Does not return.

pub fn reboot_to_bootloader()

Type to search all documentation.

Keyboard shortcuts

Search documentation
Ctrl K or /
Move through results
↑ ↓
Open selected result
Enter
Close a dialog
Esc
Show these shortcuts
?