Struct wiringpi::pin::PwmPin
[−]
[src]
pub struct PwmPin<Pin>(_, _);
To understand more about the PWM system, you’ll need to read the Broadcom ARM peripherals manual.
Methods
impl<P: Pin + Pwm> PwmPin<P>
[src]
pub fn new(pin: c_int) -> PwmPin<P>
[src]
pub fn number(&self) -> c_int
[src]
pub fn into_input(self) -> InputPin<P>
[src]
pub fn into_output(self) -> OutputPin<P>
[src]
pub fn into_soft_pwm(self) -> SoftPwmPin<P>
[src]
pub fn write(&self, value: u16)
[src]
Writes the value to the PWM register for the given pin.
The value must be between 0 and 1024.
pub fn set_mode(&self, mode: PwmMode)
[src]
The PWM generator can run in 2 modes – "balanced" and "mark:space".
The mark:space mode is traditional, however the default mode in the
Pi is "balanced". You can switch modes by supplying the parameter:
Balanced
or MarkSpace
.
pub fn set_range(&self, value: u16)
[src]
This sets the range register in the PWM generator. The default is 1024.
pub fn set_clock(&self, value: u16)
[src]
This sets the divisor for the PWM clock.