Package com.diozero.internal.spi
Interface InternalPwmOutputDeviceInterface
-
- All Superinterfaces:
AutoCloseable
,DeviceInterface
,GpioDeviceInterface
,InternalDeviceInterface
- All Known Implementing Classes:
OdroidC2SysFsPwmOutputDevice
,PiconZero.PiconZeroPwmOutputDevice
,SoftwarePwmOutputDevice
,SysFsPwmOutputDevice
public interface InternalPwmOutputDeviceInterface 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 percentage that the device is "on", range 0..1void
setPwmFrequency(int frequencyHz)
Set the PWM output frequencyvoid
setValue(float value)
Set the percentage relative "on" time, range 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, isChild, isOpen, setChild
-
-
-
-
Method Detail
-
getPwmNum
int getPwmNum()
Get the device PWM output device number- Returns:
- Device native PWM output
-
getValue
float getValue() throws RuntimeIOException
Get the percentage that the device is "on", range 0..1- Returns:
- the percentage "on" time, range 0..1
- Throws:
RuntimeIOException
- if an I/O error occurs
-
setValue
void setValue(float value) throws RuntimeIOException
Set the percentage relative "on" time, range 0..1- Parameters:
value
- new "on" time, range 0..1- Throws:
RuntimeIOException
- if an I/O error occurs
-
getPwmFrequency
int getPwmFrequency() throws RuntimeIOException
Get the PWM frequency in Hz- Returns:
- frequency in Hz
- Throws:
RuntimeIOException
- if an I/O error occurs
-
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
-
-