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 SoftPwmPin
s 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]
pub fn new(pin: c_int) -> SoftPwmPin<P>
[src]
Configures the given pin
to output a software controlled PWM
signal.
pub fn number(&self) -> c_int
[src]
pub fn pwm_write(&self, value: c_int)
[src]
Sets the duty cycle.
value
has to be in the interval [0,100].
pub fn pwm_stop(self)
[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()
.
pub fn into_input(self) -> InputPin<P>
[src]
pub fn into_output(self) -> OutputPin<P>
[src]
impl<P: Pin + Pwm> SoftPwmPin<P>
[src]
impl<P: Pin + GpioClock> SoftPwmPin<P>
[src]
pub fn into_clock(self) -> ClockPin<P>
[src]
Trait Implementations
Auto Trait Implementations
impl<Pin> Send for SoftPwmPin<Pin> where
Pin: Send,
Pin: Send,
impl<Pin> Sync for SoftPwmPin<Pin> where
Pin: Sync,
Pin: Sync,