PWM class
PWM wrapper functions for Linux userspace sysfs PWMs.
c-periphery PCM documentation.
Properties
Methods
-
disable(
) → void - Disables the PWM output.
-
dispose(
) → void - Releases all internal native resources.
-
enable(
) → void - Enables the PWM output.
-
getChannel(
) → int - Returns the channel number of the PWM handle.
-
getChip(
) → int - Return the chip number of the PWM handle.
-
getDutyCycle(
) → double - Gets the duty cycle as a ratio between 0.0 to 1.0 in second of the PWM.
-
getDutyCycleNs(
) → int - Gets the duty cycle in nanoseconds of the PWM.
-
getEnabled(
) → bool -
getErrno(
) → int - Returns the libc errno of the last failure that occurred.
-
getFrequency(
) → double - Gets the frequency in Hz of the PWM.
-
getPeriod(
) → double - Gets the period in seconds of the PWM.
-
getPeriodNs(
) → int - Gets the period in nanoseconds of the PWM.
-
getPolarity(
) → Polarity - Returns the polarity of the PWM.
-
getPWMinfo(
) → String - Returns a string representation of the PWM handle.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setDutyCycle(
double dutyCycle) → void -
Sets the
dutyCycle
as a ratio between 0.0 to 1.0 in second of the PWM. -
setDutyCycleNs(
int nanoseconds) → void -
Sets the duty cycle in
nanoseconds
of the PWM. -
setEnabled(
bool flag) → void - Sets the output state of the PWM.
-
setFrequency(
double frequency) → void -
Sets the
frequency
in Hz of the PWM. -
setPeriod(
double seconds) → void -
Sets the period in
seconds
of the PWM. -
setPeriodNs(
int nanoseconds) → void -
Sets the period in
nanoseconds
of the PWM. -
setPolarity(
Polarity polarity) → void -
Sets the output
polarity
of the PWM. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
getPWMerrorCode(
int value) → PWMerrorCode -
Converts the native error code
value
to PWMerrorCode.