Package com.diozero.internal.spi
Interface PwmOutputDeviceInterface
- All Superinterfaces:
AutoCloseable
,DeviceInterface
,GpioDeviceInterface
,InternalDeviceInterface
- All Known Implementing Classes:
OdroidC2SysFsPwmOutputDevice
,PiconZero.PiconZeroPwmOutputDevice
,SoftwarePwmOutputDevice
,SysFsPwmOutputDevice
public interface PwmOutputDeviceInterface extends GpioDeviceInterface
-
Method Summary
Modifier and Type Method Description default DeviceMode
getMode()
int
getPwmFrequency()
Get the PWM frequency in Hzint
getPwmNum()
Get the device PWM output device numberfloat
getValue()
Get the current PWM output value (0..1)void
setPwmFrequency(int frequencyHz)
Set the PWM output frequencyvoid
setValue(float value)
Set the PWM output value (0..1)Methods inherited from interface com.diozero.api.DeviceInterface
close
Methods inherited from interface com.diozero.internal.spi.GpioDeviceInterface
getGpio
Methods inherited from interface com.diozero.internal.spi.InternalDeviceInterface
getKey, isOpen
-
Method Details
-
getPwmNum
int getPwmNum()Get the device PWM output device number- Returns:
- Device native PWM output
-
getValue
Get the current PWM output value (0..1)- Returns:
- Range is 0..1
- Throws:
RuntimeIOException
- if an I/O error occurs
-
setValue
Set the PWM output value (0..1)- Parameters:
value
- Relative value in the range 0..1- Throws:
RuntimeIOException
- if an I/O error occurs
-
getPwmFrequency
int getPwmFrequency()Get the PWM frequency in Hz- Returns:
- frequency in Hz
-
setPwmFrequency
Set the PWM output frequency- Parameters:
frequencyHz
- frequency in Hz- Throws:
RuntimeIOException
- if an I/O error occurs
-
getMode
- Specified by:
getMode
in interfaceGpioDeviceInterface
-