aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authori509VCB <[email protected]>2025-10-25 02:23:51 +0000
committerGitHub <[email protected]>2025-10-25 02:23:51 +0000
commitc8c4c6f40bd8a2e548f3c8e06b798d448f67b884 (patch)
treef0c7c2462234d04a951c7f0376a98206b24abacd /examples
parent4bff7cea1a26267ec3671250e954d9d4242fabde (diff)
parent5ed604fc0453066f0d0cf0c161823df5f4b7900f (diff)
Merge pull request #4738 from WyliodrinEmbeddedIoT/pwm-dev
lpc55: pwm simple
Diffstat (limited to 'examples')
-rw-r--r--examples/lpc55s69/src/bin/pwm.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/examples/lpc55s69/src/bin/pwm.rs b/examples/lpc55s69/src/bin/pwm.rs
new file mode 100644
index 000000000..93b898b9d
--- /dev/null
+++ b/examples/lpc55s69/src/bin/pwm.rs
@@ -0,0 +1,18 @@
1#![no_std]
2#![no_main]
3
4use defmt::*;
5use embassy_executor::Spawner;
6use embassy_nxp::pwm::{Config, Pwm};
7use embassy_time::Timer;
8use {defmt_rtt as _, panic_halt as _};
9
10#[embassy_executor::main]
11async fn main(_spawner: Spawner) {
12 let p = embassy_nxp::init(Default::default());
13 let pwm = Pwm::new_output(p.PWM_OUTPUT1, p.PIO0_18, Config::new(1_000_000_000, 2_000_000_000));
14 loop {
15 info!("Counter: {}", pwm.counter());
16 Timer::after_millis(50).await;
17 }
18}