Some tests need more work. * The adc test builds, but isn't set up correctly for the 2350 hardware yet. * The multicore and gpio_multicore tests only work from flash, seems to be a probe-rs issue. * The i2c and flash tests also only works from flash, these are probably bugs but I don't have time to run them down now. * The 2350 gpio test skips anything with pull downs. I think these fail because of E9. The float, bootsel, cyw43, and ethernet tests don't have 2350 equivalents. There's no reason to use the float romfuncs, use the FPU. Bootsel as a button isn't supported on the 2350 yet. The wifi and eth tests don't have appropriate hardware. The i2c test has also been tweaked to run on one core.
45 lines
1.1 KiB
Rust
45 lines
1.1 KiB
Rust
#![no_std]
|
|
#![no_main]
|
|
#[cfg(feature = "rp2040")]
|
|
teleprobe_meta::target!(b"rpi-pico");
|
|
#[cfg(feature = "rp235xb")]
|
|
teleprobe_meta::target!(b"pimoroni-pico-plus-2");
|
|
|
|
use defmt::{assert_eq, *};
|
|
use embassy_executor::Spawner;
|
|
use embassy_rp::dma::copy;
|
|
use {defmt_rtt as _, panic_probe as _};
|
|
|
|
#[embassy_executor::main]
|
|
async fn main(_spawner: Spawner) {
|
|
let p = embassy_rp::init(Default::default());
|
|
info!("Hello World!");
|
|
|
|
// Check `u8` copy
|
|
{
|
|
let data: [u8; 2] = [0xC0, 0xDE];
|
|
let mut buf = [0; 2];
|
|
unsafe { copy(p.DMA_CH0, &data, &mut buf).await };
|
|
assert_eq!(buf, data);
|
|
}
|
|
|
|
// Check `u16` copy
|
|
{
|
|
let data: [u16; 2] = [0xC0BE, 0xDEAD];
|
|
let mut buf = [0; 2];
|
|
unsafe { copy(p.DMA_CH1, &data, &mut buf).await };
|
|
assert_eq!(buf, data);
|
|
}
|
|
|
|
// Check `u32` copy
|
|
{
|
|
let data: [u32; 2] = [0xC0BEDEAD, 0xDEADAAFF];
|
|
let mut buf = [0; 2];
|
|
unsafe { copy(p.DMA_CH2, &data, &mut buf).await };
|
|
assert_eq!(buf, data);
|
|
}
|
|
|
|
info!("Test OK");
|
|
cortex_m::asm::bkpt();
|
|
}
|