diff options
| author | Felipe Balbi <[email protected]> | 2025-04-03 08:47:25 -0700 |
|---|---|---|
| committer | Felipe Balbi <[email protected]> | 2025-04-09 09:37:45 -0700 |
| commit | aa9a16e569dfb56ce2b689733975f4d854af0b00 (patch) | |
| tree | 865ae0aa84bcb4c438463d34dd567ea07abe98e3 /examples/mimxrt6/src/bin | |
| parent | 0ec3e78c1bb0cdb20749cca4b294cb8a16e7fd43 (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.rs | 29 | ||||
| -rw-r--r-- | examples/mimxrt6/src/bin/hello.rs | 17 |
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 | |||
| 4 | extern crate embassy_imxrt_examples; | ||
| 5 | |||
| 6 | use defmt::info; | ||
| 7 | use embassy_executor::Spawner; | ||
| 8 | use embassy_imxrt::gpio; | ||
| 9 | |||
| 10 | #[embassy_executor::main] | ||
| 11 | async 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 | |||
| 4 | extern crate embassy_imxrt_examples; | ||
| 5 | |||
| 6 | use defmt::info; | ||
| 7 | use embassy_executor::Spawner; | ||
| 8 | use {defmt_rtt as _, panic_probe as _}; | ||
| 9 | |||
| 10 | #[embassy_executor::main] | ||
| 11 | async 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 | } | ||
