Struct nrf52840_hal::pwm::Pwm [−][src]
pub struct Pwm<T> where
T: Instance, { /* fields omitted */ }
Expand description
A safe wrapper around the raw peripheral.
Implementations
Sets the PWM clock prescaler.
Sets the maximum duty cycle value.
Sets the PWM output frequency.
Sets the associated output pin for the PWM channel.
Modifying the pin configuration while the PWM instance is enabled is not recommended.
Sets the output pin of channel
, and returns the old pin (if any).
Modifying the pin configuration while the PWM instance is enabled is not recommended.
Disables the output pin of channel
.
The output pin is returned, if one was previously configured.
Modifying the pin configuration while the PWM instance is enabled is not recommended.
Enables a PWM channel.
Disables a PWM channel.
Enables a PWM group.
Disables a PWM group.
Cofigures how a sequence is read from RAM and is spread to the compare register.
Returns how a sequence is read from RAM and is spread to the compare register.
Selects operating mode of the wave counter.
Returns selected operating mode of the wave counter.
Selects source for advancing the active sequence.
Sets duty cycle (15 bit) for all PWM channels. Will replace any ongoing sequence playback.
Sets inverted duty cycle (15 bit) for all PWM channels. Will replace any ongoing sequence playback.
Returns the common duty cycle value for all PWM channels in Common
load mode.
Returns the inverted common duty cycle value for all PWM channels in Common
load mode.
Sets duty cycle (15 bit) for a PWM group. Will replace any ongoing sequence playback.
Sets inverted duty cycle (15 bit) for a PWM group. Will replace any ongoing sequence playback.
Returns duty cycle value for a PWM group.
Returns inverted duty cycle value for a PWM group.
Sets duty cycle (15 bit) for a PWM channel. Will replace any ongoing sequence playback and the other channels will return to their previously set value.
Sets inverted duty cycle (15 bit) for a PWM channel. Will replace any ongoing sequence playback and the other channels will return to their previously set value.
Returns the inverted duty cycle value for a PWM group.
Sets number of additional PWM periods between samples loaded into compare register.
Sets number of additional PWM periods after the sequence ends.
Loads the first PWM value on all enabled channels from a sequence and starts playing that sequence. Causes PWM generation to start if not running.
Steps by one value in the current sequence on all enabled channels, if the NextStep
step mode is selected.
Does not cause PWM generation to start if not running.
Stops PWM pulse generation on all channels at the end of current PWM period, and stops sequence playback.
Loads the given sequence buffers and optionally (re-)starts sequence playback.
Returns a PemSeq
, containing Pwm<T>
and the buffers.
Enables interrupt triggering on the specified event.
Disables interrupt triggering on the specified event.
Checks if an event has been triggered.
Marks event as handled.
Returns reference to Stopped
event endpoint for PPI.
Returns reference to LoopsDone
event endpoint for PPI.
Returns reference to PwmPeriodEnd
event endpoint for PPI.
Returns reference to Seq0 End
event endpoint for PPI.
Returns reference to Seq1 End
event endpoint for PPI.
Returns reference to Seq0 Started
event endpoint for PPI.
Returns reference to Seq1 Started
event endpoint for PPI.
Returns reference to Seq0 Start
task endpoint for PPI.
Returns reference to Seq1 Started
task endpoint for PPI.
Returns reference to NextStep
task endpoint for PPI.
Returns reference to Stop
task endpoint for PPI.
pub fn split_channels(
&self
) -> (PwmChannel<'_, T>, PwmChannel<'_, T>, PwmChannel<'_, T>, PwmChannel<'_, T>)
pub fn split_channels(
&self
) -> (PwmChannel<'_, T>, PwmChannel<'_, T>, PwmChannel<'_, T>, PwmChannel<'_, T>)
Returns individual handles to the four PWM channels.
Returns individual handles to the two PWM groups.
Trait Implementations
Returns the current duty cycle
Sets a new duty cycle
Returns the maximum duty cycle value
Returns the current PWM period