|
RobotCore 1.0
WPILib port to raspberry Pi
|
Public Member Functions | |
| int | read (byte[] buffer, int offset, int length) throws IOException |
| void | write (byte[] data) throws IOException |
| int | writeRead (byte[] writeData, byte[] buffer, int offset, int length) throws IOException |
Thin wrapper around a single I2C device on bus 1, using Pi4J V4.
Pi4J V4 methods throw unchecked exceptions; this class converts them to IOException so existing callers keep the same error handling they had with Pi4J V1.
Definition at line 16 of file I2CInterface.java.
| int robotCore.I2CInterface.read | ( | byte[] | buffer, |
| int | offset, | ||
| int | length ) throws IOException |
Reads bytes from the device.
| buffer | buffer to read into |
| offset | offset in the buffer to start storing data |
| length | number of bytes to read |
Definition at line 52 of file I2CInterface.java.
| void robotCore.I2CInterface.write | ( | byte[] | data | ) | throws IOException |
Writes bytes to the device.
| data | bytes to write |
Definition at line 70 of file I2CInterface.java.
| int robotCore.I2CInterface.writeRead | ( | byte[] | writeData, |
| byte[] | buffer, | ||
| int | offset, | ||
| int | length ) throws IOException |
Writes bytes to the device and then reads a response, as one combined I2C transaction (repeated start, no stop between the write and the read).
| writeData | bytes to write first (e.g. a register address or command) |
| buffer | buffer to read the response into |
| offset | offset in the buffer to start storing data |
| length | number of bytes to read |
Definition at line 92 of file I2CInterface.java.