Struct nrf52832_hal::pwm::Pwm[][src]

pub struct Pwm<T> where
    T: Instance
{ /* fields omitted */ }
Expand description

A safe wrapper around the raw peripheral.

Implementations

Takes ownership of the peripheral and applies sane defaults.

Sets the PWM clock prescaler.

Sets the PWM clock prescaler.

Sets the maximum duty cycle value.

Returns the maximum duty cycle value.

Sets the PWM output frequency.

Returns 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 the PWM generator.

Disables the PWM generator.

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.

Returns selected 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 duty cycle value for a PWM channel.

Returns the inverted duty cycle value for a PWM group.

Sets number of playbacks of sequences.

Looping disabled (stop at the end of the sequence).

Loops playback of sequences indefinitely.

Sets number of playbacks of sequences.

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.

Returns individual handles to the four PWM channels.

Returns individual handles to the two PWM groups.

Consumes self and returns back the raw peripheral.

Trait Implementations

Formats the value using the given formatter. Read more

Enumeration of channels that can be used with this Pwm interface Read more

Type for the duty methods Read more

A time unit that can be converted into a human time unit (e.g. seconds)

Enables a PWM channel

Disables a PWM channel

Returns the current duty cycle

Sets a new duty cycle

Returns the maximum duty cycle value

Returns the current PWM period

Sets a new PWM period

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Casts the value.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Casts the value.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Casts the value.

Should always be Self

Casts the value.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Casts the value.

Casts the value.