Interface I2C

Hierarchy

  • I2C

Methods

  • Find an I2C interface by its pin.

    Parameters

    • pin: number

      The pin the I2C interface is connected to.

    Returns I2C

    The I2C interface, or undefined if not found.

  • Read from the given address.

    Parameters

    • address: number

      The address to read from.

    • quantity: number

      The number of bytes to read.

    Returns Uint8Array

    The bytes read.

  • Setup the I2C interface.

    Parameters

    • options: {
          bitrate?: number;
          scl?: number;
          sda?: number;
      }

      The options to use when setting up the I2C interface.

      • Optional bitrate?: number
      • Optional scl?: number
      • Optional sda?: number

    Returns void

  • Write to the given address.

    Parameters

    • address: number

      The address to write to.

    • buffer: string | number | number[] | ArrayBuffer | Uint8Array

      The data to write.

    Returns void

Generated using TypeDoc