aboutsummaryrefslogtreecommitdiff
path: root/docs/examples/layer-by-layer/blinky-hal/src
diff options
context:
space:
mode:
authorUlf Lilleengen <[email protected]>2024-05-18 10:17:03 +0200
committerUlf Lilleengen <[email protected]>2024-05-21 10:05:21 +0200
commit739e5861c2e47db251725163fcd91cd822cf97b7 (patch)
tree947dc7961ca7c42ec216056fc2adf616ab812b10 /docs/examples/layer-by-layer/blinky-hal/src
parent51d553092550059afb22b2620cea14bbed21abff (diff)
convert from antora to asciidoctor
Diffstat (limited to 'docs/examples/layer-by-layer/blinky-hal/src')
-rw-r--r--docs/examples/layer-by-layer/blinky-hal/src/main.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/examples/layer-by-layer/blinky-hal/src/main.rs b/docs/examples/layer-by-layer/blinky-hal/src/main.rs
new file mode 100644
index 000000000..d0c9f4907
--- /dev/null
+++ b/docs/examples/layer-by-layer/blinky-hal/src/main.rs
@@ -0,0 +1,21 @@
1#![no_std]
2#![no_main]
3
4use cortex_m_rt::entry;
5use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed};
6use {defmt_rtt as _, panic_probe as _};
7
8#[entry]
9fn main() -> ! {
10 let p = embassy_stm32::init(Default::default());
11 let mut led = Output::new(p.PB14, Level::High, Speed::VeryHigh);
12 let button = Input::new(p.PC13, Pull::Up);
13
14 loop {
15 if button.is_low() {
16 led.set_high();
17 } else {
18 led.set_low();
19 }
20 }
21}