public class Pi4JDevice extends Device
This implementation requires the Pi4J library to be available on the classpath (its native JNI library is conveniently embedded in the jar itself.)
| Modifier and Type | Field and Description |
|---|---|
protected com.pi4j.io.i2c.I2CBus |
bus |
protected com.pi4j.io.i2c.I2CDevice |
device |
ADDR_GND, ADDR_SCL, ADDR_SDA, ADDR_VCC, CONFIG_AUDIO_INPUT, CONFIG_DISPLAY_MATRIX_1, CONFIG_DISPLAY_MATRIX_1_AND_2, CONFIG_DISPLAY_MATRIX_2, CONFIG_MATRIX_5X11, CONFIG_MATRIX_6X10, CONFIG_MATRIX_7X9, CONFIG_MATRIX_8X8, CONFIG_SOFTWARE_SHUTDOWN, errors, height, REG_BRIGHTNESS_CONFIG, REG_BRIGHTNESS_PWM, REG_CONFIG, REG_MATRIX1_DATA_START, REG_MATRIX2_DATA_START, REG_RESET, REG_UPDATE, shutdownHook, throwErrorCount, warnErrorCount, width| Constructor and Description |
|---|
Pi4JDevice() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
closeImpl()
Closes the I2C bus and device.
|
protected Device |
openImpl(int busNumber,
int address)
Opens the connection to the I2C bus and
to the device at the given address.
|
protected void |
writeImpl(byte register,
byte[] data,
int offset,
int length)
Writes a series of bytes of data starting at the given register.
|
protected void |
writeImpl(byte register,
int data)
Writes a single byte of data to the given register.
|
close, closeOnShutdown, configure, displayTestPatterns, getHeight, getWidth, handleError, init, main, newInstance, newInstance, open, open, reset, setBrightness, setDisplay, setDisplay, setDisplay, setDisplay, update, update, write, writeprotected com.pi4j.io.i2c.I2CBus bus
protected com.pi4j.io.i2c.I2CDevice device
protected Device openImpl(int busNumber, int address) throws IOException
DeviceopenImpl in class DevicebusNumber - the I2C bus number to useaddress - the I2C device addressIOException - if an error occursprotected void closeImpl()
throws IOException
Device
This method may be called multiple times, or
without a successful call to Device.open(int) before it.
closeImpl in class DeviceIOException - if an error occursprotected void writeImpl(byte register,
int data)
throws IOException
DevicewriteImpl in class Deviceregister - the register to write todata - the data to write (only the lower 8 bits are written)IOException - if an error occursprotected void writeImpl(byte register,
byte[] data,
int offset,
int length)
throws IOException
DevicewriteImpl in class Deviceregister - the register to write todata - an array containing the data to writeoffset - the offset within the array of the first byte to writelength - the number of bytes to writeIOException - if an error occursCopyright © 2017 freeutils.net. All rights reserved.