2023-05-08 15:43:58 +02:00
|
|
|
#![no_std]
|
|
|
|
#![no_main]
|
|
|
|
#![feature(type_alias_impl_trait)]
|
|
|
|
|
|
|
|
use defmt::*;
|
|
|
|
use embassy_executor::Spawner;
|
2023-05-09 23:45:24 +02:00
|
|
|
use embassy_rp::clocks;
|
2023-05-09 18:10:24 +02:00
|
|
|
use embassy_time::{Duration, Timer};
|
2023-05-08 15:43:58 +02:00
|
|
|
use {defmt_rtt as _, panic_probe as _};
|
|
|
|
|
|
|
|
#[embassy_executor::main]
|
|
|
|
async fn main(_spawner: Spawner) {
|
|
|
|
let p = embassy_rp::init(Default::default());
|
|
|
|
|
2023-05-09 18:10:24 +02:00
|
|
|
let gpout3 = clocks::Gpout::new(p.PIN_25);
|
|
|
|
gpout3.set_div(1000, 0);
|
|
|
|
gpout3.enable();
|
2023-05-08 15:43:58 +02:00
|
|
|
|
2023-05-09 18:10:24 +02:00
|
|
|
loop {
|
2023-05-16 18:13:15 +02:00
|
|
|
gpout3.set_src(clocks::GpoutSrc::Sys);
|
2023-05-09 18:10:24 +02:00
|
|
|
info!(
|
|
|
|
"Pin 25 is now outputing CLK_SYS/1000, should be toggling at {}",
|
2023-05-09 23:45:24 +02:00
|
|
|
gpout3.get_freq()
|
2023-05-09 18:10:24 +02:00
|
|
|
);
|
|
|
|
Timer::after(Duration::from_secs(2)).await;
|
|
|
|
|
2023-05-16 18:13:15 +02:00
|
|
|
gpout3.set_src(clocks::GpoutSrc::Ref);
|
2023-05-09 18:10:24 +02:00
|
|
|
info!(
|
|
|
|
"Pin 25 is now outputing CLK_REF/1000, should be toggling at {}",
|
2023-05-09 23:45:24 +02:00
|
|
|
gpout3.get_freq()
|
2023-05-09 18:10:24 +02:00
|
|
|
);
|
|
|
|
Timer::after(Duration::from_secs(2)).await;
|
|
|
|
}
|
2023-05-08 15:43:58 +02:00
|
|
|
}
|