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
All Methods Instance Methods Abstract Methods Default Methods 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 Detail
-
getPwmNum
int getPwmNum()
Get the device PWM output device number- Returns:
- Device native PWM output
-
getValue
float getValue() throws RuntimeIOException
Get the current PWM output value (0..1)- Returns:
- Range is 0..1
- Throws:
RuntimeIOException
- if an I/O error occurs
-
setValue
void setValue(float value) throws RuntimeIOException
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
void setPwmFrequency(int frequencyHz) throws RuntimeIOException
Set the PWM output frequency- Parameters:
frequencyHz
- frequency in Hz- Throws:
RuntimeIOException
- if an I/O error occurs
-
getMode
default DeviceMode getMode()
- Specified by:
getMode
in interfaceGpioDeviceInterface
-
-