Expand description
§rp2350
Hardware Abstraction Layer for RP2350 microcontrollers (Raspberry Pi Pico 2)
§Features
rt- Runtime support (rp2350-rt)atomics- Portable atomic operationsdefmt- Defmt logging supportpanic-handler- Built-in embedded panic handler for bare-metal targetsboot2-w25q80/boot2-generic-03h- Link the optional second stage boot loader (XIP setup) and select the flash part;boot2is the bare switch those features imply
§Panic And Logging
panic-handler is enabled by default on embedded targets. Disable it if the
final binary provides its own #[panic_handler].
- With
defmtenabled, panic messages are emitted through the active defmt transport selected by the binary, such asdefmt-rttin the examples. - Without
defmt, the panic handler skips formatted output and terminates the core immediately. - In both modes, interrupts are disabled first,
SHCSR.USGFAULTENAis cleared through the runtime crate’s SCB definition, and execution ends inudfso the failure reliably escalates to HardFault. - The examples no longer depend on
panic-probe; they use this crate’s built-in panic handler directly.
§Example
ⓘ
#![no_std]
#![no_main]
use rp2350::main;
use rp2350::systick::Delay;
#[main]
fn main() -> ! {
let delay = Delay::init(cp.SYST, 150_000_000); // 150 MHz
loop {
delay.delay_ms(500);
}
}Re-exports§
pub use accessctrl::Accessctrl;pub use adc::Adc;pub use busctrl::Busctrl;pub use clocks::Clocks;pub use dcp::Dcp;pub use dma::Channel;pub use dma::Dma;pub use eppb::Eppb;pub use gpio::Pins;pub use i2c::I2c0;pub use i2c::I2c0Slave;pub use i2c::I2c1;pub use i2c::I2c1Slave;pub use multicore::Fifo;pub use multicore::Multicore;pub use multicore::Stack;pub use otp::Otp;pub use pads_qspi::PadsQspi;pub use powman::AonTimer;pub use powman::Powman;pub use powman::Timespec;pub use pwm::Pwm;pub use reboot::RebootKind;pub use sha256::Sha256;pub use spi::Spi0;pub use spi::Spi0Slave;pub use spi::Spi1;pub use spi::Spi1Slave;pub use syscfg::Syscfg;pub use sysinfo::Sysinfo;pub use systick::Delay;pub use systick::SysTick;pub use ticks::Ticks;pub use time::Duration;pub use time::Instant;pub use timer::Timer0;pub use timer::Timer1;pub use trng::Trng;pub use uart::Uart0;pub use uart::Uart1;pub use watchdog::Watchdog;pub use xip::Xip;pub use rp2350_rt as rt;pub use rp2350_pac as pac;pub use defmt;
Modules§
- accessctrl
- ACCESSCTRL (Access Control) HAL for RP2350
- adc
- ADC (Analog-to-Digital Converter) HAL for RP2350
- binary_
info - Binary Info support for RP2350
- block
- RP2350 Boot Block (PICOBIN) definitions
- bootrom
- RP2350 bootrom (mask ROM) API access
- busctrl
- BUSCTRL (Bus Control) HAL for RP2350
- clocks
- Clock Management HAL for RP2350
- dcp
- DCP (Double-precision Co-Processor) HAL for RP2350 Arm
- delay
- Delay abstraction trait
- dma
- DMA (Direct Memory Access) HAL for RP2350
- eppb
- EPPB (Extended Private Peripheral Bus) HAL for RP2350
- flash
- Flash read, erase and program through the bootrom
- gpio
- GPIO (General Purpose Input/Output) HAL for RP2350
- gpioc
- GPIO Coprocessor (GPIOC) for RP2350 Cortex-M33
- i2c
- I2C (Inter-Integrated Circuit) HAL for RP2350
- interp
- Hardware Interpolator (INTERP) driver for RP2350
- interrupt
- Interrupt Management HAL for RP2350
- kit
- Platform-independent utility library.
- multicore
- Multicore support for RP2350
- otp
- OTP (One-Time Programmable memory) HAL for RP2350
- pads_
qspi - QSPI pad configuration (
PADS_QSPI) for RP2350 - pin
- Per-GPIO Pin Function Description for RP2350
- pio
- Programmable I/O (PIO) driver for RP2350
- powman
- Power Management (POWMAN) HAL for RP2350
- ppb
- PPB (Private Peripheral Bus) HAL for RP2350 Cortex-M33
- pwm
- PWM (Pulse Width Modulation) HAL for RP2350
- qspi
- QSPI (Quad SPI) HAL for RP2350
- reboot
- System reboot through the bootrom
- reset
- Reset subsystem for RP2350
- sha256
- SHA-256 hardware accelerator driver for RP2350
- sio
- Single-cycle IO (SIO) driver for RP2350
- spi
- SPI (Serial Peripheral Interface) HAL for RP2350
- startup
- Shared RP2350 startup initialisation.
- syscfg
- System Configuration (SYSCFG) HAL for RP2350
- sysinfo
- SYSINFO (System Information) HAL for RP2350
- sysinfo_
rom - System information read through the bootrom
- systick
- SysTick timer driver for Cortex-M33
- ticks
- TICKS (Tick Generator) HAL for RP2350
- time
- Time and Duration types for embedded systems
- timer
- Timer HAL for RP2350
- trng
- TRNG (True Random Number Generator) HAL for RP2350
- uart
- UART (Universal Asynchronous Receiver/Transmitter) HAL for RP2350
- watchdog
- WATCHDOG HAL for RP2350
- xip
- XIP (Execute-In-Place) HAL for RP2350
Macros§
- bi_
int_ value - Declare an integer value with a tag and ID
- bi_
pin_ range_ with_ func - Declare a pin range with a GPIO function
- bi_
pin_ with_ func - Declare a pin with a GPIO function (32-bit, for RP2350A with <=32 GPIOs)
- bi_
pin_ with_ name - Declare a pin with a custom name
- bi_
program_ build_ attribute - Declare a program build attribute
- bi_
program_ build_ date - Declare a program build date
- bi_
program_ description - Declare a program description
- bi_
program_ feature - Declare a program feature
- bi_
program_ name - Declare a program name
- bi_
program_ url - Declare a program URL
- bi_
program_ version - Declare a program version string
- bi_
rp2350_ board - Declare a Pico board identifier
- bi_
string_ value - Declare a string value with a tag and ID
- define_
events - Define event ID constants
- make_
static - Allocate a value in a hidden
staticand return&'static mut T. - pio_asm
- Compile PIO assembly code into a
PioProgram
Structs§
- Core
Peripherals - Core Peripherals container
- Exception
Frame - Registers stacked (pushed into the stack) during an exception.
- Peripherals
- All the peripherals.
- Steal
- Zero-cost wrapper returned by
steal()methods.
Enums§
- Interrupt
- RP2350 Interrupt enumeration