public class SysFsPwmOutputDevice extends AbstractDevice implements PwmOutputDeviceInterface
Modifier and Type | Class and Description |
---|---|
static class |
SysFsPwmOutputDevice.Polarity |
Constructor and Description |
---|
SysFsPwmOutputDevice(String key,
DeviceFactoryInterface deviceFactory,
int pwmChip,
PwmPinInfo pinInfo,
int frequency,
float initialValue) |
Modifier and Type | Method and Description |
---|---|
void |
closeDevice() |
int |
getGpio() |
int |
getPwmNum()
Get the device PWM output device number
|
float |
getValue()
Get the current PWM output value (0..1)
|
protected void |
setPolarity(SysFsPwmOutputDevice.Polarity polarity) |
void |
setValue(float value)
Set the PWM output value (0..1)
|
close, getDeviceFactory, getKey, isOpen
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, getKey, isOpen
public SysFsPwmOutputDevice(String key, DeviceFactoryInterface deviceFactory, int pwmChip, PwmPinInfo pinInfo, int frequency, float initialValue)
public void closeDevice()
closeDevice
in class AbstractDevice
public int getGpio()
getGpio
in interface GpioDeviceInterface
public int getPwmNum()
PwmOutputDeviceInterface
getPwmNum
in interface PwmOutputDeviceInterface
public float getValue() throws RuntimeIOException
PwmOutputDeviceInterface
getValue
in interface PwmOutputDeviceInterface
RuntimeIOException
- if an I/O error occurspublic void setValue(float value) throws RuntimeIOException
PwmOutputDeviceInterface
setValue
in interface PwmOutputDeviceInterface
value
- Relative value in the range 0..1RuntimeIOException
- if an I/O error occursprotected void setPolarity(SysFsPwmOutputDevice.Polarity polarity)
Copyright © 2016–2017 mattjlewis. All rights reserved.