public class GPIODriver extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
GPIODriver.GPIOChannel
A class representing a single GPIO Channel
|
class |
GPIODriver.GPIOChip
A class representing a GPIOChip
|
| Constructor and Description |
|---|
GPIODriver()
Create an instance of GPIO driver
|
| Modifier and Type | Method and Description |
|---|---|
List<GPIODriver.GPIOChip> |
enumerateChips()
Enumerate the GPIO chips on this machine
|
List<GPIODriver.GPIOChannel> |
enumerateExportedChannels()
Enumerate the currently exported GPIO channels on this machine
|
GPIODriver.GPIOChannel |
export(int channel)
Export the specified channel.
|
List<GPIODriver.GPIOChannel> |
exportRange(int base,
int ngpio)
Export all of the channels in the given range.
|
GPIODriver.GPIOChannel |
getChannel(int channel)
Get a specified GPIO channel
|
boolean |
isExported(int channel)
Test if the given channel is already exported
|
void |
unexport(int channel)
Unexport the specified channel
|
void |
unexportRange(int base,
int ngpio)
Unexport all of the channels in the given range.
|
public GPIODriver()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException - If the system does not support GPIOpublic List<GPIODriver.GPIOChip> enumerateChips() throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException - If an IO error occurs while enumerating the chipspublic List<GPIODriver.GPIOChannel> enumerateExportedChannels() throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException - If an IO exception occurs during the enumerationpublic GPIODriver.GPIOChannel getChannel(int channel) throws org.lsst.ccs.drivers.commons.DriverException
channel - The channel to fetchorg.lsst.ccs.drivers.commons.DriverException - If the GPIO can not be fetched, for example if it
has not been exported.public boolean isExported(int channel)
channel - The channel to testtrue if and only if the channel has already been
exported.public GPIODriver.GPIOChannel export(int channel) throws org.lsst.ccs.drivers.commons.DriverException
channel - The channel numberorg.lsst.ccs.drivers.commons.DriverException - If the channel is invalid, or cannot be exportedpublic List<GPIODriver.GPIOChannel> exportRange(int base, int ngpio) throws org.lsst.ccs.drivers.commons.DriverException
base - The first channel to exportngpio - The number of channels to exportorg.lsst.ccs.drivers.commons.DriverException - If an error occurs.public void unexportRange(int base,
int ngpio)
throws org.lsst.ccs.drivers.commons.DriverException
base - The first channel to unexportngpio - The number of channels to unexportorg.lsst.ccs.drivers.commons.DriverException - If an error occurs.public void unexport(int channel)
throws org.lsst.ccs.drivers.commons.DriverException
channel - The channel numberorg.lsst.ccs.drivers.commons.DriverException - If the channel is invalid, or cannot be un
exportedCopyright © 2018 LSST. All rights reserved.