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

    Variable ina226Const

    ina226: {
        baseAddress: number;
        busLsbMicrovolts: number;
        configReset: number;
        deviceId: number;
        manufacturerId: number;
        pin: { ground: number; scl: number; sda: number; supply: number };
        powerLsbRatio: number;
        register: {
            alertLimit: number;
            busVoltage: number;
            calibration: number;
            configuration: number;
            current: number;
            dieId: number;
            manufacturerId: number;
            maskEnable: number;
            power: number;
            shuntVoltage: number;
        };
        shuntLsbNanovolts: number;
        activeAlertFunction(
            mask: sensors.Ina226MaskEnable,
        ): Ina226AlertFunction | null;
        address(a1: number, a0: number): number;
        averagingSamples(averaging: number): number;
        busMicrovolts(raw: number): number;
        busRegister(microvolts: number): number;
        busVolts(raw: number): number;
        calibration(currentLsbMicroamps: number, shuntMilliohms: number): number;
        configFromRegister(raw: number): sensors.Ina226Config;
        configToRegister(config: sensors.Ina226Config): number;
        conversionMicros(conversionTime: number): number;
        currentAmps(raw: number, currentLsbMicroamps: number): number;
        currentMicroamps(raw: number, currentLsbMicroamps: number): number;
        currentRegister(microamps: number, currentLsbMicroamps: number): number;
        currentRegisterFromShunt(shunt: number, calibration: number): number;
        dieId(raw: number): sensors.Ina226DieIdFields;
        identify(manufacturerId: number, dieId: number): sensors.Ina226DieIdFields;
        maskEnableFromRegister(raw: number): sensors.Ina226MaskEnable;
        maskEnableToRegister(mask: sensors.Ina226MaskEnable): number;
        minimumCurrentLsbMicroamps(maxExpectedMicroamps: number): number;
        modeIsContinuous(mode: number): boolean;
        modeMeasuresBus(mode: number): boolean;
        modeMeasuresShunt(mode: number): boolean;
        powerMicrowatts(raw: number, currentLsbMicroamps: number): number;
        powerRegister(microwatts: number, currentLsbMicroamps: number): number;
        powerRegisterFromCurrent(current: number, bus: number): number;
        powerWatts(raw: number, currentLsbMicroamps: number): number;
        shuntMillivolts(raw: number): number;
        shuntNanovolts(raw: number): number;
        shuntRegister(nanovolts: number): number;
        updateMicroseconds(config: sensors.Ina226Config): number;
    }

    A TI INA226 current, voltage, and power monitor with an alert pin.

    Type Declaration

    • baseAddress: number

      The address with both A1 and A0 tied to GND.

    • busLsbMicrovolts: number

      The bus voltage one count carries, in microvolts.

    • configReset: number

      The value the configuration register reads after a reset.

    • deviceId: number

      The device identifier the die-ID register carries for an INA226.

    • manufacturerId: number

      The value the manufacturer-ID register reads.

    • pin: { ground: number; scl: number; sda: number; supply: number }

      What an address pin is tied to, as the code the address helper takes.

      • ground: number

        Tied to GND.

      • scl: number

        Tied to SCL.

      • sda: number

        Tied to SDA.

      • supply: number

        Tied to VS.

    • powerLsbRatio: number

      How many times the power LSB is the current LSB.

    • register: {
          alertLimit: number;
          busVoltage: number;
          calibration: number;
          configuration: number;
          current: number;
          dieId: number;
          manufacturerId: number;
          maskEnable: number;
          power: number;
          shuntVoltage: number;
      }

      The registers a driver reads and writes.

      • alertLimit: number

        The alert limit.

      • busVoltage: number

        The bus voltage result.

      • calibration: number

        The calibration register.

      • configuration: number

        The configuration register.

      • current: number

        The current result.

      • dieId: number

        The die-ID register.

      • manufacturerId: number

        The manufacturer-ID register.

      • maskEnable: number

        The Mask/Enable register.

      • power: number

        The power result.

      • shuntVoltage: number

        The shunt voltage result.

    • shuntLsbNanovolts: number

      The shunt voltage one count carries, in nanovolts.

    • activeAlertFunction: function
      • Returns the limit comparison the alert pin actually responds to.

        Only one limit function drives the pin at a time; with several enabled the part honours the most significant bit.

        Parameters

        Returns Ina226AlertFunction | null

        The highest-priority enabled function, or null if none is enabled.

    • address: function
      • Returns the 7-bit address the A1 and A0 pins select.

        Parameters

        • a1: number

          What the A1 pin is tied to, one of pin.

        • a0: number

          What the A0 pin is tied to.

        Returns number

        The address, 0x40 to 0x4F.

        If either pin code is not 0, 1, 2, or 3.

    • averagingSamples: function
      • Returns how many samples an averaging code folds into one result.

        Parameters

        • averaging: number

          The averaging code, 0 to 7.

        Returns number

        The sample count, 1 to 1024.

    • busMicrovolts: function
      • Converts a raw bus-voltage register to microvolts.

        Parameters

        • raw: number

          The register value.

        Returns number

        The bus voltage, at 1.25 mV per count.

    • busRegister: function
      • Builds the bus-voltage register a monitor reports for a bus voltage.

        Parameters

        • microvolts: number

          The bus voltage.

        Returns number

        The register value.

    • busVolts: function
      • Converts a raw bus-voltage register to volts.

        Parameters

        • raw: number

          The register value.

        Returns number

        The bus voltage.

    • calibration: function
      • Computes the calibration register for a shunt and current resolution.

        Parameters

        • currentLsbMicroamps: number

          The microamps per count the current register should carry.

        • shuntMilliohms: number

          The shunt resistor value.

        Returns number

        The register value to write.

    • configFromRegister: function
      • Parses the configuration register.

        Parameters

        • raw: number

          The register value, as read from the device.

        Returns sensors.Ina226Config

        The decoded settings; reserved bits are ignored.

    • configToRegister: function
      • Assembles the configuration register value.

        Parameters

        Returns number

        The register value to write, with reserved bit 14 set as at reset.

    • conversionMicros: function
      • Returns how long a conversion-time code takes.

        Parameters

        • conversionTime: number

          The conversion-time code, 0 to 7.

        Returns number

        The typical conversion time in microseconds.

    • currentAmps: function
      • Converts a raw current register to amps.

        Parameters

        • raw: number

          The signed register value.

        • currentLsbMicroamps: number

          The resolution the calibration selected.

        Returns number

        The current.

    • currentMicroamps: function
      • Converts a raw current register to microamps.

        Parameters

        • raw: number

          The signed register value.

        • currentLsbMicroamps: number

          The resolution the calibration selected.

        Returns number

        The current.

    • currentRegister: function
      • Builds the current register a monitor reports for a current.

        Parameters

        • microamps: number

          The current.

        • currentLsbMicroamps: number

          The current LSB the calibration was set for.

        Returns number

        The signed register value.

    • currentRegisterFromShunt: function
      • Computes the current register the part derives from a shunt reading.

        Parameters

        • shunt: number

          The signed shunt-voltage register.

        • calibration: number

          The calibration register in force.

        Returns number

        The signed current register.

    • dieId: function
      • Splits a die-ID register into its device and revision fields.

        Parameters

        • raw: number

          The die-ID register.

        Returns sensors.Ina226DieIdFields

        The 12-bit device identifier and the 4-bit revision.

    • identify: function
      • Checks that a pair of identification registers belongs to an INA226.

        A node reads both at start-up, so a wrong part on the address, or a bus that reads all ones, is caught before its readings are trusted.

        Parameters

        • manufacturerId: number

          The manufacturer-ID register.

        • dieId: number

          The die-ID register.

        Returns sensors.Ina226DieIdFields

        The decoded die ID.

        If either register does not carry the value the datasheet fixes.

    • maskEnableFromRegister: function
      • Parses the Mask/Enable register.

        Parameters

        • raw: number

          The register value, as read from the device.

        Returns sensors.Ina226MaskEnable

        The decoded enables and flags.

    • maskEnableToRegister: function
      • Assembles the Mask/Enable register value.

        Parameters

        Returns number

        The register value to write.

    • minimumCurrentLsbMicroamps: function
      • Returns the smallest current resolution that still covers a maximum.

        Parameters

        • maxExpectedMicroamps: number

          The largest current the application measures.

        Returns number

        The minimum current LSB in microamps.

    • modeIsContinuous: function
      • Reports whether a mode code keeps converting after the first result.

        Parameters

        • mode: number

          The mode code, 0 to 7.

        Returns boolean

        Whether the mode is one of the three continuous ones.

    • modeMeasuresBus: function
      • Reports whether a mode code converts the bus voltage.

        Parameters

        • mode: number

          The mode code, 0 to 7.

        Returns boolean

        Whether the bus input is measured.

    • modeMeasuresShunt: function
      • Reports whether a mode code converts the shunt voltage.

        Parameters

        • mode: number

          The mode code, 0 to 7.

        Returns boolean

        Whether the shunt input is measured.

    • powerMicrowatts: function
      • Converts a raw power register to microwatts.

        Parameters

        • raw: number

          The register value.

        • currentLsbMicroamps: number

          The resolution the calibration selected.

        Returns number

        The power. The power LSB is fixed at 25 times the current LSB.

    • powerRegister: function
      • Builds the power register a monitor reports for a power.

        Parameters

        • microwatts: number

          The power.

        • currentLsbMicroamps: number

          The current LSB the calibration was set for.

        Returns number

        The register value.

    • powerRegisterFromCurrent: function
      • Computes the power register the part derives from a current and a bus voltage.

        Parameters

        • current: number

          The signed current register.

        • bus: number

          The bus-voltage register.

        Returns number

        The power register.

    • powerWatts: function
      • Converts a raw power register to watts.

        Parameters

        • raw: number

          The register value.

        • currentLsbMicroamps: number

          The resolution the calibration selected.

        Returns number

        The power.

    • shuntMillivolts: function
      • Converts a raw shunt-voltage register to millivolts.

        Parameters

        • raw: number

          The signed register value.

        Returns number

        The shunt voltage.

    • shuntNanovolts: function
      • Converts a raw shunt-voltage register to nanovolts.

        Parameters

        • raw: number

          The signed register value.

        Returns number

        The shunt voltage, at 2.5 uV per count.

    • shuntRegister: function
      • Builds the shunt-voltage register a monitor reports for a shunt voltage.

        The inverse of shuntNanovolts, so a node can be written and tested against what a monitor sends without one attached.

        Parameters

        • nanovolts: number

          The shunt voltage.

        Returns number

        The signed register value.

    • updateMicroseconds: function
      • Returns how often the result registers update with these settings.

        Parameters

        Returns number

        The update interval in microseconds, or 0 in power-down.