GpioDriver

public abstract class GpioDriver
extends Gpio

java.lang.Object
   ↳ com.google.android.things.pio.Gpio
     ↳ com.google.android.things.pio.GpioDriver


Allow users to register GPIO expanders. A GpioDriver must implement all Gpio functions, but additionally this class provides an open() function that will be called whenever a process obtains ownership of the GPIO, to match the existing close() function.

Summary

Inherited constants

From class com.google.android.things.pio.Gpio

Public constructors

GpioDriver()

Public methods

abstract void close()

Closes the GPIO pin.

abstract void open()

Opens the GPIO pin.

Inherited methods

From class com.google.android.things.pio.Gpio
From class java.lang.Object
From interface java.io.Closeable
From interface java.lang.AutoCloseable

Public constructors

GpioDriver

</div>

GpioDriver ()

</div>

Public methods

close

</div>

void close ()

Closes the GPIO pin.

This will be called when the GPIO is closed by its owner. Any resources that need to be cleaned up should be done so here.

This method may throw IOException to indicate I/O failure, but the GPIO will still be considered closed and may attempt to be re-opened in the future.</p>

Throws
IOException on I/O failure; the driver will still be considered closed.

</div>

open

</div>

void open ()

Opens the GPIO pin.

This will be called when ownership of a GPIO is obtained. The driver should do any initialization needed to configure the GPIO pin for use here.</p>

Throws
IOException on I/O failure; the driver will remain closed.

results matching ""

    No results matching ""