Struct wiringpi::pin::SoftPwmPin [] [src]

pub struct SoftPwmPin<Pin>(_, _);

A pin with software controlled PWM output.

Due to limitations of the chip only one pin is able to do hardware-controlled PWM output. The SoftPwmPins on the other hand allow for all GPIOs to output PWM signals.

The pulse width of the signal will be 100μs with a value range of [0,100] (where 0 is a constant low and 100 is a constant high) resulting in a frequenzy of 100 Hz.

Important: In order to use software PWM pins wiringPi has to be setup in GPIO mode via setup_gpio().

Methods

impl<P: Pin + RequiresRoot> SoftPwmPin<P>
[src]

[src]

Configures the given pin to output a software controlled PWM signal.

[src]

[src]

Sets the duty cycle.

value has to be in the interval [0,100].

[src]

Stops the software handling of this pin.

Note: In order to control this pin via software PWM again it will need to be recreated using new().

[src]

[src]

impl<P: Pin + Pwm> SoftPwmPin<P>
[src]

[src]

impl<P: Pin + GpioClock> SoftPwmPin<P>
[src]

[src]

Trait Implementations

Auto Trait Implementations

impl<Pin> Send for SoftPwmPin<Pin> where
    Pin: Send

impl<Pin> Sync for SoftPwmPin<Pin> where
    Pin: Sync