aboutsummaryrefslogtreecommitdiff
path: root/examples/mimxrt6/src/bin
diff options
context:
space:
mode:
authorFelipe Balbi <[email protected]>2025-04-03 08:47:25 -0700
committerFelipe Balbi <[email protected]>2025-04-09 09:37:45 -0700
commitaa9a16e569dfb56ce2b689733975f4d854af0b00 (patch)
tree865ae0aa84bcb4c438463d34dd567ea07abe98e3 /examples/mimxrt6/src/bin
parent0ec3e78c1bb0cdb20749cca4b294cb8a16e7fd43 (diff)
Add embassy-imxrt
Adds initial support for MIMXRT600 series MCUs from NXP. Subsequent PRs will add more drivers.
Diffstat (limited to 'examples/mimxrt6/src/bin')
-rw-r--r--examples/mimxrt6/src/bin/blinky.rs29
-rw-r--r--examples/mimxrt6/src/bin/hello.rs17
2 files changed, 46 insertions, 0 deletions
diff --git a/examples/mimxrt6/src/bin/blinky.rs b/examples/mimxrt6/src/bin/blinky.rs
new file mode 100644
index 000000000..e40e71e6f
--- /dev/null
+++ b/examples/mimxrt6/src/bin/blinky.rs
@@ -0,0 +1,29 @@
1#![no_std]
2#![no_main]
3
4extern crate embassy_imxrt_examples;
5
6use defmt::info;
7use embassy_executor::Spawner;
8use embassy_imxrt::gpio;
9
10#[embassy_executor::main]
11async fn main(_spawner: Spawner) {
12 let p = embassy_imxrt::init(Default::default());
13
14 info!("Initializing GPIO");
15
16 let mut led = gpio::Output::new(
17 p.PIO0_26,
18 gpio::Level::Low,
19 gpio::DriveMode::PushPull,
20 gpio::DriveStrength::Normal,
21 gpio::SlewRate::Standard,
22 );
23
24 loop {
25 info!("Toggling LED");
26 led.toggle();
27 cortex_m::asm::delay(5_000_000);
28 }
29}
diff --git a/examples/mimxrt6/src/bin/hello.rs b/examples/mimxrt6/src/bin/hello.rs
new file mode 100644
index 000000000..c640241ce
--- /dev/null
+++ b/examples/mimxrt6/src/bin/hello.rs
@@ -0,0 +1,17 @@
1#![no_std]
2#![no_main]
3
4extern crate embassy_imxrt_examples;
5
6use defmt::info;
7use embassy_executor::Spawner;
8use {defmt_rtt as _, panic_probe as _};
9
10#[embassy_executor::main]
11async fn main(_spawner: Spawner) -> ! {
12 let _p = embassy_imxrt::init(Default::default());
13 loop {
14 info!("Hello");
15 cortex_m::asm::delay(5_000_000);
16 }
17}