summaryrefslogtreecommitdiff
path: root/examples/stm32u5/src/bin
diff options
context:
space:
mode:
authorDario Nieuwenhuis <dirbaio@dirbaio.net>2022-04-26 23:57:26 +0200
committerDario Nieuwenhuis <dirbaio@dirbaio.net>2022-04-27 01:16:14 +0200
commit009bb8e4e1b7afbe9d9d7d89135f8d4dd3c4e808 (patch)
treed734f3e82f9fb3c22b7517a70e1f47969624d248 /examples/stm32u5/src/bin
parenta39d796c3de9c96ea4df6b9da525cb0d5ef60fc0 (diff)
downloadembassy-009bb8e4e1b7afbe9d9d7d89135f8d4dd3c4e808.zip
stm32: add stm32u5 GPDMA, SPIv4 support, add HIL tests.
Diffstat (limited to 'examples/stm32u5/src/bin')
-rw-r--r--examples/stm32u5/src/bin/blinky.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/examples/stm32u5/src/bin/blinky.rs b/examples/stm32u5/src/bin/blinky.rs
new file mode 100644
index 00000000..e1bcccf5
--- /dev/null
+++ b/examples/stm32u5/src/bin/blinky.rs
@@ -0,0 +1,29 @@
+#![no_std]
+#![no_main]
+#![feature(type_alias_impl_trait)]
+
+use defmt::*;
+use defmt_rtt as _;
+use embassy::executor::Spawner;
+use embassy::time::{Duration, Timer};
+use embassy_stm32::gpio::{Level, Output, Speed};
+use embassy_stm32::Peripherals;
+// global logger
+use panic_probe as _;
+
+#[embassy::main]
+async fn main(_spawner: Spawner, p: Peripherals) -> ! {
+ info!("Hello World!");
+
+ let mut led = Output::new(p.PH7, Level::Low, Speed::Medium);
+
+ loop {
+ defmt::info!("on!");
+ led.set_low();
+ Timer::after(Duration::from_millis(200)).await;
+
+ defmt::info!("off!");
+ led.set_high();
+ Timer::after(Duration::from_millis(200)).await;
+ }
+}