diff --git a/embassy-nrf/src/pwm.rs b/embassy-nrf/src/pwm.rs index 94dfdeda6..a4bc94765 100644 --- a/embassy-nrf/src/pwm.rs +++ b/embassy-nrf/src/pwm.rs @@ -381,6 +381,7 @@ impl<'a, T: Instance> Drop for SequencePwm<'a, T> { } } +/// Configuration for the PWM as a whole. #[non_exhaustive] pub struct Config { /// Selects up mode or up-and-down mode for the counter @@ -404,6 +405,7 @@ impl Default for Config { } } +/// Configuration per sequence #[non_exhaustive] #[derive(Clone)] pub struct SequenceConfig { @@ -422,6 +424,7 @@ impl Default for SequenceConfig { } } +/// A composition of a sequence buffer and its configuration. #[non_exhaustive] pub struct Sequence<'d> { /// The words comprising the sequence. Must not exceed 32767 words. diff --git a/examples/nrf/src/bin/pwm_sequence.rs b/examples/nrf/src/bin/pwm_sequence.rs index 6fb861e8f..d3ddf558c 100644 --- a/examples/nrf/src/bin/pwm_sequence.rs +++ b/examples/nrf/src/bin/pwm_sequence.rs @@ -32,7 +32,7 @@ async fn main(_spawner: Spawner, p: Peripherals) { let _ = pwm.start( Sequence::new(&mut seq_words_1, seq_config.clone()), None, - SequenceMode::Infinite, + SequenceMode::Times(1), ); info!("pwm started!"); @@ -43,7 +43,7 @@ async fn main(_spawner: Spawner, p: Peripherals) { let _ = pwm.start( Sequence::new(&mut seq_words_2, seq_config), None, - SequenceMode::Infinite, + SequenceMode::Times(1), ); // we can abort a sequence if we need to before its complete with pwm.stop()