com.qualcomm.robotcore.hardware

## Enum I2cDeviceSynch.ReadMode

- java.lang.Object
- - java.lang.Enum<I2cDeviceSynch.ReadMode>
  - - com.qualcomm.robotcore.hardware.I2cDeviceSynch.ReadMode

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<I2cDeviceSynch.ReadMode>
  Enclosing interface:
    I2cDeviceSynch

      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 Summary

    Enum Constants
    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.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    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.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### REPEAT

          public static final I2cDeviceSynch.ReadMode REPEAT

      Continuously issue I2C reads whenever there's nothing else needing to be done. In this mode, `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.
      See Also:
        `I2cDeviceSynchSimple.read(int, int)`

    - #### BALANCED

          public static final I2cDeviceSynch.ReadMode 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. This mode is most useful in a device which has a balanced mix of read() and write() operations, such as a motor controller. Like `REPEAT`, this mode might return data that was previously read a short while ago.

    - #### ONLY_ONCE

          public static final I2cDeviceSynch.ReadMode ONLY_ONCE

      Only issue a single I2C read, then set the read window to null to disable further reads. Executing a `read()` in this mode will always get fresh data from the I2C device.

  - ### Method Detail

    - #### values

          public static I2cDeviceSynch.ReadMode[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (I2cDeviceSynch.ReadMode c : I2cDeviceSynch.ReadMode.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static I2cDeviceSynch.ReadMode valueOf(java.lang.String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `java.lang.IllegalArgumentException` - if this enum type has no constant with the specified name
        `java.lang.NullPointerException` - if the argument is null