public static enum I2cDeviceSynch.ReadMode extends java.lang.Enum<I2cDeviceSynch.ReadMode>
I2cDeviceSynch.ReadMode
controls whether when asked to read we read only once or read multiple times.
In all modes, it is guaranteed that a read() which follows a write() operation will
see the state of the device after the write has had effect.Enum Constant and Description |
---|
BALANCED
Continuously issue I2C reads as in REPEAT when we can, but do not automatically
transition back to read-mode following a write operation in order to do so.
|
ONLY_ONCE
Only issue a single I2C read, then set the read window to null to disable further reads.
|
REPEAT
Continuously issue I2C reads whenever there's nothing else needing to be done.
|
Modifier and Type | Method and Description |
---|---|
static I2cDeviceSynch.ReadMode |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static I2cDeviceSynch.ReadMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final I2cDeviceSynch.ReadMode REPEAT
read()
will not necessarily execute an I2C transaction
for every call but might instead return data previously read from the I2C device.
This mode is most useful in a device that spends most of its time doing read operations
and only very infrequently writes, if ever.I2cDeviceSynchSimple.read(int, int)
public static final I2cDeviceSynch.ReadMode BALANCED
REPEAT
, this mode might return data that was
previously read a short while ago.public static final I2cDeviceSynch.ReadMode ONLY_ONCE
read()
in this mode will always get fresh data
from the I2C device.public static I2cDeviceSynch.ReadMode[] values()
for (I2cDeviceSynch.ReadMode c : I2cDeviceSynch.ReadMode.values()) System.out.println(c);
public static I2cDeviceSynch.ReadMode valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null