diff options
| author | i509VCB <[email protected]> | 2025-08-06 05:43:58 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-06 05:43:58 +0000 |
| commit | 3a197df07c14873a52e42394ef350152eef60a41 (patch) | |
| tree | 55817c094aea9b9ea7a20faeb6824c7142981296 /examples/lpc55s69/src/bin | |
| parent | fcccbc85fbfabb29604381fc6bfb61c660098559 (diff) | |
| parent | 517714c98e4b5dc4c7ee844527f5d33fdc342125 (diff) | |
Merge pull request #4459 from IrinaCh524/feat/lpc55-time-driver
feat: add RTC time driver
Diffstat (limited to 'examples/lpc55s69/src/bin')
| -rw-r--r-- | examples/lpc55s69/src/bin/blinky_embassy_time.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/examples/lpc55s69/src/bin/blinky_embassy_time.rs b/examples/lpc55s69/src/bin/blinky_embassy_time.rs new file mode 100644 index 000000000..adc3d8bd3 --- /dev/null +++ b/examples/lpc55s69/src/bin/blinky_embassy_time.rs | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | #![no_std] | ||
| 2 | #![no_main] | ||
| 3 | |||
| 4 | use defmt::*; | ||
| 5 | use embassy_executor::Spawner; | ||
| 6 | use embassy_nxp::gpio::{Level, Output}; | ||
| 7 | use embassy_time::Timer; | ||
| 8 | use {defmt_rtt as _, panic_halt as _}; | ||
| 9 | |||
| 10 | #[embassy_executor::main] | ||
| 11 | async fn main(_spawner: Spawner) { | ||
| 12 | let p = embassy_nxp::init(Default::default()); | ||
| 13 | info!("Initialization complete"); | ||
| 14 | let mut led = Output::new(p.PIO1_6, Level::Low); | ||
| 15 | |||
| 16 | info!("Entering main loop"); | ||
| 17 | loop { | ||
| 18 | info!("led off!"); | ||
| 19 | led.set_high(); | ||
| 20 | Timer::after_millis(500).await; | ||
| 21 | |||
| 22 | info!("led on!"); | ||
| 23 | led.set_low(); | ||
| 24 | Timer::after_millis(500).await; | ||
| 25 | } | ||
| 26 | } | ||
