aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2022-04-26 23:57:26 +0200
committerDario Nieuwenhuis <[email protected]>2022-04-27 01:16:14 +0200
commit009bb8e4e1b7afbe9d9d7d89135f8d4dd3c4e808 (patch)
treed734f3e82f9fb3c22b7517a70e1f47969624d248 /examples
parenta39d796c3de9c96ea4df6b9da525cb0d5ef60fc0 (diff)
stm32: add stm32u5 GPDMA, SPIv4 support, add HIL tests.
Diffstat (limited to 'examples')
-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 000000000..e1bcccf58
--- /dev/null
+++ b/examples/stm32u5/src/bin/blinky.rs
@@ -0,0 +1,29 @@
1#![no_std]
2#![no_main]
3#![feature(type_alias_impl_trait)]
4
5use defmt::*;
6use defmt_rtt as _;
7use embassy::executor::Spawner;
8use embassy::time::{Duration, Timer};
9use embassy_stm32::gpio::{Level, Output, Speed};
10use embassy_stm32::Peripherals;
11// global logger
12use panic_probe as _;
13
14#[embassy::main]
15async fn main(_spawner: Spawner, p: Peripherals) -> ! {
16 info!("Hello World!");
17
18 let mut led = Output::new(p.PH7, Level::Low, Speed::Medium);
19
20 loop {
21 defmt::info!("on!");
22 led.set_low();
23 Timer::after(Duration::from_millis(200)).await;
24
25 defmt::info!("off!");
26 led.set_high();
27 Timer::after(Duration::from_millis(200)).await;
28 }
29}