Package com.diozero.internal.provider
Class BaseNativeDeviceFactory
java.lang.Object
com.diozero.internal.provider.AbstractDeviceFactory
com.diozero.internal.provider.BaseNativeDeviceFactory
- All Implemented Interfaces:
AnalogInputDeviceFactoryInterface
,AnalogOutputDeviceFactoryInterface
,DeviceFactoryInterface
,GpioDeviceFactoryInterface
,I2CDeviceFactoryInterface
,NativeDeviceFactoryInterface
,PwmOutputDeviceFactoryInterface
,SpiDeviceFactoryInterface
,java.io.Closeable
,java.lang.AutoCloseable
- Direct Known Subclasses:
SysFsDeviceFactory
public abstract class BaseNativeDeviceFactory extends AbstractDeviceFactory implements NativeDeviceFactoryInterface
Helper class for instantiating different devices via the configured provider.
To set the provider edit META-INF/services/com.diozero.internal.provider.NativeDeviceFactoryInterface
While the ServiceLoader supports multiple service providers, only the first entry in this file is used
-
Field Summary
Fields inherited from class com.diozero.internal.provider.AbstractDeviceFactory
closed, deviceStates
Fields inherited from interface com.diozero.internal.provider.SpiDeviceFactoryInterface
DEFAULT_SPI_BUFFER_SIZE, SPI_PREFIX
-
Constructor Summary
Constructors Constructor Description BaseNativeDeviceFactory()
-
Method Summary
Modifier and Type Method Description void
close()
BoardInfo
getBoardInfo()
BoardPinInfo
getBoardPinInfo()
float
getVRef()
protected BoardInfo
initialiseBoardInfo()
void
registerDeviceFactory(DeviceFactoryInterface deviceFactory)
Methods inherited from class com.diozero.internal.provider.AbstractDeviceFactory
createI2CKey, createPinKey, createSpiKey, deviceClosed, deviceOpened, getDevice, getDevice, isClosed, isDeviceOpened
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.diozero.internal.provider.AnalogInputDeviceFactoryInterface
createAnalogInputDevice, provisionAnalogInputDevice
Methods inherited from interface com.diozero.internal.provider.AnalogOutputDeviceFactoryInterface
createAnalogOutputDevice, provisionAnalogOutputDevice
Methods inherited from interface com.diozero.internal.provider.DeviceFactoryInterface
createI2CKey, createPinKey, createSpiKey, deviceClosed, deviceOpened, getDevice, getDevice, getName, isClosed, isDeviceOpened
Methods inherited from interface com.diozero.internal.provider.GpioDeviceFactoryInterface
createDigitalInputDevice, createDigitalInputOutputDevice, createDigitalOutputDevice, provisionDigitalInputDevice, provisionDigitalInputOutputDevice, provisionDigitalOutputDevice
Methods inherited from interface com.diozero.internal.provider.I2CDeviceFactoryInterface
createI2CDevice, provisionI2CDevice
Methods inherited from interface com.diozero.internal.provider.PwmOutputDeviceFactoryInterface
createPwmOutputDevice, getBoardPwmFrequency, provisionPwmOutputDevice, setBoardPwmFrequency
Methods inherited from interface com.diozero.internal.provider.SpiDeviceFactoryInterface
createSpiDevice, getSpiBufferSize, provisionSpiDevice
-
Constructor Details
-
BaseNativeDeviceFactory
public BaseNativeDeviceFactory()
-
-
Method Details
-
initialiseBoardInfo
-
getBoardInfo
- Specified by:
getBoardInfo
in interfaceNativeDeviceFactoryInterface
-
getBoardPinInfo
- Specified by:
getBoardPinInfo
in interfaceDeviceFactoryInterface
-
getVRef
public float getVRef()- Specified by:
getVRef
in interfaceAnalogInputDeviceFactoryInterface
-
registerDeviceFactory
- Specified by:
registerDeviceFactory
in interfaceNativeDeviceFactoryInterface
-
close
public void close()- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in interfaceDeviceFactoryInterface
- Overrides:
close
in classAbstractDeviceFactory
-