public class I2CBlock extends Object
Such a buffer is limited to 32 bytes.
| Modifier and Type | Field and Description |
|---|---|
static int |
SIZE
The length of a buffer.
|
| Constructor and Description |
|---|
I2CBlock()
Allocates a block.
|
| Modifier and Type | Method and Description |
|---|---|
I2CBlock |
clear()
Fills the block with 0.
|
int |
get(int index)
Retrieves the byte at the given position.
|
int |
length()
Retrieves the current length of this block.
|
I2CBlock |
set(int index,
int b)
Sets the byte at the given position.
|
public static final int SIZE
public I2CBlock clear()
public int length()
Setting a byte to an index adjusts the length of the block to the highest index.
set( int, int )public int get(int index)
index - Where.public I2CBlock set(int index, int b)
The length of this block will be adjusted to reflect the highest index of a byte set by the user or by an SMBUS operation.
index - Which one.b - An unsigned byte.