pamoja for TypeScript - v0.1.17
    Preparing search index...

    Variable i2cConst

    i2c: {
        RESERVED_BELOW: number;
        RESERVED_FROM: number;
        addressFrame(
            address: number,
            options?: { read?: boolean; tenBit?: boolean },
        ): Buffer;
        frameLen(address: number, tenBit?: boolean): number;
        isGeneralCall(address: number, tenBit?: boolean): boolean;
        isReserved(address: number, tenBit?: boolean): boolean;
    }

    I2C addressing per the NXP I2C-bus specification (UM10204).

    Type Declaration

    • RESERVED_BELOW: number

      The first 7-bit address above the reserved block at the bottom of the range.

    • RESERVED_FROM: number

      The lowest 7-bit address the specification keeps for itself.

    • addressFrame: function
      • Returns the address bytes a controller puts on the bus for a transfer.

        Parameters

        • address: number

          The device address.

        • Optionaloptions: { read?: boolean; tenBit?: boolean }

          read selects the direction, tenBit the address width.

        Returns Buffer

        One byte for a 7-bit address, two for a 10-bit one.

        If the address is outside its width's range.

    • frameLen: function
      • Returns how many bytes an address frame occupies.

        Parameters

        • address: number

          The device address.

        • OptionaltenBit: boolean

          Whether it is a 10-bit address.

        Returns number

        1 for a 7-bit address, 2 for a 10-bit one.

        If the address is outside its width's range.

    • isGeneralCall: function
      • Reports whether an address is the general call address 0x00.

        Parameters

        • address: number

          The device address.

        • OptionaltenBit: boolean

          Whether it is a 10-bit address.

        Returns boolean

        Whether this is the broadcast every device listens to.

        If the address is outside its width's range.

    • isReserved: function
      • Reports whether an address falls in a range the specification reserves.

        UM10204 reserves 0x00..=0x07 and 0x78..=0x7F, leaving 0x08..=0x77 for ordinary devices.

        Parameters

        • address: number

          The device address.

        • OptionaltenBit: boolean

          Whether it is a 10-bit address, which is never reserved.

        Returns boolean

        Whether the address is reserved.

        If the address is outside its width's range.