[−][src]Struct wiringpi::pin::SoftPwmPin
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]
impl<P: Pin + RequiresRoot> SoftPwmPin<P>
pub fn new(pin: c_int) -> SoftPwmPin<P>
[src]
pub fn new(pin: c_int) -> SoftPwmPin<P>
Configures the given pin
to output a software controlled PWM
signal.
pub fn number(&self) -> c_int
[src]
pub fn number(&self) -> c_int
pub fn pwm_write(&self, value: c_int)
[src]
pub fn pwm_write(&self, value: c_int)
Sets the duty cycle.
value
has to be in the interval [0,100].
pub fn pwm_stop(self)
[src]
pub fn pwm_stop(self)
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_input(self) -> InputPin<P>
pub fn into_output(self) -> OutputPin<P>
[src]
pub fn into_output(self) -> OutputPin<P>
impl<P: Pin + Pwm> SoftPwmPin<P>
[src]
impl<P: Pin + Pwm> SoftPwmPin<P>
impl<P: Pin + GpioClock> SoftPwmPin<P>
[src]
impl<P: Pin + GpioClock> SoftPwmPin<P>
pub fn into_clock(self) -> ClockPin<P>
[src]
pub fn into_clock(self) -> ClockPin<P>
Auto Trait Implementations
impl<Pin> Send for SoftPwmPin<Pin> where
Pin: Send,
impl<Pin> Send for SoftPwmPin<Pin> where
Pin: Send,
impl<Pin> Sync for SoftPwmPin<Pin> where
Pin: Sync,
impl<Pin> Sync for SoftPwmPin<Pin> where
Pin: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,