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

    Variable opt3001Const

    opt3001: {
        addressGnd: number;
        addressScl: number;
        addressSda: number;
        addressVdd: number;
        configurationReset: number;
        deviceId: number;
        highLimitReset: number;
        lowLimitEndOfConversion: number;
        lowLimitReset: number;
        manufacturerId: number;
        rangeAutomatic: number;
        rangeMax: number;
        register: {
            configuration: number;
            deviceId: number;
            highLimit: number;
            lowLimit: number;
            manufacturerId: number;
            result: number;
        };
        configBits(config: Opt3001Config): number;
        configFromBits(bits: number): Opt3001Config;
        fullScaleMilliLux(rangeNumber: number): number | null;
        isAutomaticRange(rangeNumber: number): boolean;
        lsbMilliLux(exponent: number): number | null;
        lux(raw: number): number;
        milliLux(raw: number): number;
        rawFromMilliLux(milliLux: number): number;
        wordFromBytes(bytes: Uint8Array): number;
        wordToBytes(word: number): Buffer;
    } = ...

    A TI OPT3001 ambient light sensor with a human-eye response.

    Type Declaration

    • addressGnd: number

      The address the part answers on with ADDR tied to GND.

    • addressScl: number

      The address it answers on with ADDR tied to SCL.

    • addressSda: number

      The address it answers on with ADDR tied to SDA.

    • addressVdd: number

      The address it answers on with ADDR tied to VDD.

    • configurationReset: number

      The value the configuration register reads after a reset.

    • deviceId: number

      The value the device-ID register reads, which confirms the part.

    • highLimitReset: number

      The value the high-limit register holds after a reset.

    • lowLimitEndOfConversion: number

      The low-limit value that turns the INT pin into an end-of-conversion signal.

    • lowLimitReset: number

      The value the low-limit register holds after a reset.

    • manufacturerId: number

      The value the manufacturer-ID register reads.

    • rangeAutomatic: number

      The range number that lets the part choose its own full scale.

    • rangeMax: number

      The highest fixed range number.

    • register: {
          configuration: number;
          deviceId: number;
          highLimit: number;
          lowLimit: number;
          manufacturerId: number;
          result: number;
      }

      The registers a driver reads and writes.

      • configuration: number

        The configuration register.

      • deviceId: number

        The device-ID register.

      • highLimit: number

        The high limit.

      • lowLimit: number

        The low limit.

      • manufacturerId: number

        The manufacturer-ID register.

      • result: number

        The result register.

    • configBits: function
      • Assembles the 16-bit configuration register value.

        The read-only status fields are written as zero.

        Parameters

        Returns number

        The register value to write.

        If the conversion time or fault count is not one the part offers.

    • configFromBits: function
      • Parses a 16-bit configuration register value.

        Parameters

        • bits: number

          The register value, as read from the device.

        Returns Opt3001Config

        The decoded settings, status flags included.

    • fullScaleMilliLux: function
      • Returns the full scale a range number covers.

        Parameters

        • rangeNumber: number

          The range, 0 to 11.

        Returns number | null

        The full scale in milli-lux, or null for a reserved range.

    • isAutomaticRange: function
      • Reports whether a range number lets the part choose its own full scale.

        Parameters

        • rangeNumber: number

          The range field of the configuration register.

        Returns boolean

        Whether the range is set to automatic.

    • lsbMilliLux: function
      • Returns the illuminance one count carries at a given exponent.

        Parameters

        • exponent: number

          The result's exponent field, 0 to 11.

        Returns number | null

        The step in milli-lux, or null for a reserved exponent.

    • lux: function
      • Converts a raw result register to lux.

        Parameters

        • raw: number

          The register value.

        Returns number

        The illuminance.

    • milliLux: function
      • Converts a raw result register to milli-lux.

        Parameters

        • raw: number

          The register value, exponent and mantissa together.

        Returns number

        The illuminance, exact in integer arithmetic.

    • rawFromMilliLux: function
      • Builds the result register that reports an illuminance.

        The inverse of milliLux, using the smallest exponent that fits and truncating the mantissa the way the part does.

        Parameters

        • milliLux: number

          The illuminance.

        Returns number

        The register value, saturating at the part's full scale.

    • wordFromBytes: function
      • Reads a register out of the two bytes the part sends.

        Parameters

        • bytes: Uint8Array

          The register, most significant byte first.

        Returns number

        The register value.

        If the read is not two bytes.

    • wordToBytes: function
      • Builds the two bytes a register is written as.

        Parameters

        • word: number

          The register value.

        Returns Buffer

        The register, most significant byte first.