PioDriverManager
public
class
PioDriverManager
extends Object
Manager for PIO userspace drivers.
Registered drivers are individually synchronized to guarantee that no calls will be
made before open() or after close(), and no calls will be made concurrently on the same driver.
Driver registration and unregistration is also thread-safe and may be done while a driver is
in use. If a driver is unregistered while in use, subsequent calls will raise an exception.
Summary
Inherited methods |
From
class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long millis, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long millis)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
|
Public methods
registerGpioDriver
void registerGpioDriver (String name,
GpioDriver driver)
Registers a new GPIO driver with the PIO manager.
Parameters |
name |
String : GPIO name. |
driver |
GpioDriver : GPIO driver. |
registerI2cBusDriver
void registerI2cBusDriver (String name,
I2cBusDriver driver)
Registers a new I2C driver with the PIO manager.
Parameters |
name |
String : I2C bus name. |
driver |
I2cBusDriver : I2cBusDriver driver. |
registerPwmDriver
void registerPwmDriver (String name,
PwmDriver driver)
Registers a new PWM driver with the PIO manager.
Parameters |
name |
String : PWM name. |
driver |
PwmDriver : PWM driver. |
registerSpiBusDriver
void registerSpiBusDriver (String busName,
SpiBusDriver driver)
Registers a new SPI driver with the PIO manager.
The SPI bus name may match an existing SPI bus in order to add more chip selects, but a
single PioDriverManager cannot register multiple drivers with the same bus name.
Parameters |
busName |
String : SPI bus name. |
driver |
SpiBusDriver : SpiBusDriver driver. |
registerUartDeviceDriver
void registerUartDeviceDriver (String name,
UartDeviceDriver driver)
Registers a new UART driver with the PIO manager.
Parameters |
name |
String : UART name. |
driver |
UartDeviceDriver : UART driver. |
unregisterGpioDriver
void unregisterGpioDriver (String name)
Unregisters an existing GPIO driver from the PIO manager.
If the named driver is open it will be closed and any subsequent usage by the owner will
throw IOException.
If the named driver doesn't exist this method has no effect.
Parameters |
name |
String : GPIO name. |
Throws |
IOException |
error while closing the driver; driver will still be unregistered.
|
unregisterI2cBusDriver
void unregisterI2cBusDriver (String name)
Unregisters an existing I2C driver from the PIO manager.
If the named driver is open it will be closed and any subsequent usage by the owner will
throw IOException.
If the named driver doesn't exist this method has no effect.
Parameters |
name |
String : I2C bus name. |
Throws |
IOException |
error while closing the driver; driver will still be unregistered.
|
unregisterPwmDriver
void unregisterPwmDriver (String name)
Unregisters an existing PWM driver from the PIO manager.
If the named driver is open it will be closed and any subsequent usage by the owner will
throw IOException.
If the named driver doesn't exist this method has no effect.
Parameters |
name |
String : PWM name. |
Throws |
IOException |
error while closing the driver; driver will still be unregistered.
|
unregisterSpiBusDriver
void unregisterSpiBusDriver (String busName)
Unregisters an existing SPI driver from the PIO manager.
If any devices on the named driver are open they will be closed and any subsequent usage by
the owner will throw IOException.
If the named driver doesn't exist this method has no effect.
Parameters |
busName |
String : SPI bus name. |
Throws |
IOException |
error while closing the driver; driver will still be unregistered.
|
unregisterUartDeviceDriver
void unregisterUartDeviceDriver (String name)
Unregisters an existing UART driver from the PIO manager.
If the named driver is open it will be closed and any subsequent usage by the owner will
throw IOException.
If the named driver doesn't exist this method has no effect.
Parameters |
name |
String : UART name. |
Throws |
IOException |
error while closing the driver; driver will still be unregistered.
|