2023-06-04 04:10:43 +02:00
|
|
|
#![no_std]
|
|
|
|
#![no_main]
|
|
|
|
#![feature(type_alias_impl_trait)]
|
|
|
|
|
|
|
|
use defmt::*;
|
|
|
|
use embassy_executor::Spawner;
|
2023-06-14 18:44:51 +02:00
|
|
|
use embassy_stm32::rcc::{ClockSrc, Pll, PllM, PllN, PllR, PllSrc};
|
2023-06-04 04:10:43 +02:00
|
|
|
use embassy_stm32::Config;
|
2023-10-15 01:57:25 +02:00
|
|
|
use embassy_time::Timer;
|
2023-06-04 04:10:43 +02:00
|
|
|
use {defmt_rtt as _, panic_probe as _};
|
|
|
|
|
|
|
|
#[embassy_executor::main]
|
|
|
|
async fn main(_spawner: Spawner) {
|
|
|
|
let mut config = Config::default();
|
|
|
|
|
2023-06-14 18:44:51 +02:00
|
|
|
config.rcc.pll = Some(Pll {
|
2023-10-22 22:39:55 +02:00
|
|
|
source: PllSrc::HSI,
|
2023-10-09 02:48:22 +02:00
|
|
|
prediv_m: PllM::DIV4,
|
|
|
|
mul_n: PllN::MUL85,
|
2023-06-14 18:44:51 +02:00
|
|
|
div_p: None,
|
|
|
|
div_q: None,
|
|
|
|
// Main system clock at 170 MHz
|
2023-10-09 02:48:22 +02:00
|
|
|
div_r: Some(PllR::DIV2),
|
2023-06-14 18:44:51 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
config.rcc.mux = ClockSrc::PLL;
|
2023-06-04 04:10:43 +02:00
|
|
|
|
|
|
|
let _p = embassy_stm32::init(config);
|
|
|
|
info!("Hello World!");
|
|
|
|
|
|
|
|
loop {
|
2023-10-15 01:57:25 +02:00
|
|
|
Timer::after_millis(1000).await;
|
2023-06-04 04:10:43 +02:00
|
|
|
info!("1s elapsed");
|
|
|
|
}
|
|
|
|
}
|