#![no_std]
#![no_main]
#![no_implicit_prelude]
#![feature(never_type)]
extern crate cortex_m;
extern crate cortex_m_rt;
extern crate rp2040_hal_macros;
#[unsafe(link_section = ".boot2")]
#[unsafe(no_mangle)]
#[used]
pub static BOOT2_FIRMWARE: [u8; 256] = *include_bytes!("../bin/rp2040_pico_boot2.bin");
pub use cortex_m::asm;
pub use cortex_m_rt::{exception, ExceptionFrame};
pub use rp2040_hal_macros::entry;
#[cfg_attr(rustfmt, rustfmt_skip)]
#[cfg(feature = "cyw")]
pub mod cyw;
pub mod atomic;
pub mod clock;
pub mod cores;
pub mod dma;
pub mod fifo;
pub mod i2c;
pub mod int;
pub mod interp;
pub mod io;
pub mod locks;
mod pico;
pub mod pin;
pub mod pio;
pub mod rand;
pub mod spi;
pub mod sys;
pub mod time;
pub mod uart;
pub mod watchdog;
pub use pico::*;
#[macro_export]
macro_rules! ignore_error {
($expression:expr) => {
let _ = $expression; };
}
#[cfg_attr(rustfmt, rustfmt_skip)]
#[cfg(feature = "debug")]
pub use self::debug::uart_debug;
mod pac {
extern crate rp2040_pac;
pub use rp2040_pac::*;
}
#[cfg(feature = "debug")]
mod debug {
extern crate core;
use crate::pin::PinID;
use crate::uart::{Uart, UartConfig, UartDev};
use crate::Pico;
#[inline]
pub fn uart_debug() -> Uart {
Uart::new(
&Pico::get(),
UartConfig::DEFAULT_BAUDRATE,
UartConfig::new(),
UartDev::new(PinID::Pin0, PinID::Pin1).unwrap(),
)
.unwrap()
}
#[macro_export]
macro_rules! debug {
($dst:expr, $($arg:tt)*) => {{
let _ = core::writeln!($dst, $($arg)*);
}};
}
}