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

    Variable ina226Const

    ina226: {
        averaging: {
            samples1: number;
            samples1024: number;
            samples128: number;
            samples16: number;
            samples256: number;
            samples4: number;
            samples512: number;
            samples64: number;
        };
        baseAddress: number;
        busLsbMicrovolts: number;
        configReset: number;
        conversionTime: {
            us1100: number;
            us140: number;
            us204: number;
            us2116: number;
            us332: number;
            us4156: number;
            us588: number;
            us8244: number;
        };
        deviceId: number;
        manufacturerId: number;
        mode: {
            busContinuous: number;
            busTriggered: number;
            powerDown: number;
            shuntAndBusContinuous: number;
            shuntAndBusTriggered: number;
            shuntContinuous: number;
            shuntTriggered: 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;
        sim: {
            busMicrovolts: number;
            maxMicroamps: number;
            microamps: number;
            shuntMilliohms: number;
            part(address: number): hal.WordPart;
            reporting(
                address: number,
                shuntMilliohms: number,
                maxMicroamps: number,
                busMicrovolts: number,
                microamps: number,
            ): hal.WordPart;
        };
        activeAlertFunction(mask: 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): Ina226Config;
        configToRegister(config: 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): Ina226DieIdFields;
        identify(manufacturerId: number, dieId: number): Ina226DieIdFields;
        maskEnableFromRegister(raw: number): Ina226MaskEnable;
        maskEnableToRegister(mask: 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: Ina226Config): number;
    } = ...

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

    Type Declaration

    • averaging: {
          samples1: number;
          samples1024: number;
          samples128: number;
          samples16: number;
          samples256: number;
          samples4: number;
          samples512: number;
          samples64: number;
      }

      The averaging codes: how many samples each result folds together.

      • samples1: number

        Every conversion reported, the reset setting.

      • samples1024: number

        1024 samples.

      • samples128: number

        128 samples.

      • samples16: number

        16 samples.

      • samples256: number

        256 samples.

      • samples4: number

        4 samples.

      • samples512: number

        512 samples.

      • samples64: number

        64 samples.

    • 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.

    • conversionTime: {
          us1100: number;
          us140: number;
          us204: number;
          us2116: number;
          us332: number;
          us4156: number;
          us588: number;
          us8244: number;
      }

      The conversion-time codes, for the bus and the shunt voltage alike.

      • us1100: number

        1.1 ms, the reset setting.

      • us140: number

        140 us.

      • us204: number

        204 us.

      • us2116: number

        2.116 ms.

      • us332: number

        332 us.

      • us4156: number

        4.156 ms.

      • us588: number

        588 us.

      • us8244: number

        8.244 ms.

    • deviceId: number

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

    • manufacturerId: number

      The value the manufacturer-ID register reads.

    • mode: {
          busContinuous: number;
          busTriggered: number;
          powerDown: number;
          shuntAndBusContinuous: number;
          shuntAndBusTriggered: number;
          shuntContinuous: number;
          shuntTriggered: number;
      }

      The operating-mode codes.

      • busContinuous: number

        Bus conversions back to back.

      • busTriggered: number

        One bus conversion.

      • powerDown: number

        No conversions; the registers stay readable and writable.

      • shuntAndBusContinuous: number

        Shunt and bus conversions back to back, the reset setting.

      • shuntAndBusTriggered: number

        One shunt and one bus conversion.

      • shuntContinuous: number

        Shunt conversions back to back.

      • shuntTriggered: number

        One shunt conversion.

    • 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.

    • sim: {
          busMicrovolts: number;
          maxMicroamps: number;
          microamps: number;
          shuntMilliohms: number;
          part(address: number): hal.WordPart;
          reporting(
              address: number,
              shuntMilliohms: number,
              maxMicroamps: number,
              busMicrovolts: number,
              microamps: number,
          ): hal.WordPart;
      }

      An INA226 that is not there, for a bus with nothing plugged in. It carries TI's manufacturer id and the INA226 die id, its conversion-ready flag is set, and reporting takes the same shunt and largest current a driver is given.

      • busMicrovolts: number

        The bus voltage part reports, in microvolts.

      • maxMicroamps: number

        The largest current part is sized for, in microamps.

      • microamps: number

        The current part reports, in microamps.

      • shuntMilliohms: number

        The shunt part sits across, in milliohms.

      • part: function
        • A part carrying 500 mA at 12 V through the shunt a driver starts with.

          Parameters

          • address: number

            The address it answers to.

          Returns hal.WordPart

          The part, to put on a simulated bus.

      • reporting: function
        • A part that reads what it is asked to, on the steps its registers count in: 1.25 mV of bus, 2.5 uV of shunt, and the calibration's current step.

          Parameters

          • address: number

            The address it answers to.

          • shuntMilliohms: number

            The shunt, as the driver is given it.

          • maxMicroamps: number

            The largest current, as the driver is given it.

          • busMicrovolts: number

            The bus voltage it reports.

          • microamps: number

            The current it reports; negative flows the other way.

          Returns hal.WordPart

          The part, to put on a simulated bus.

    • activeAlertFunction: function
    • 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 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
    • 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 Ina226DieIdFields

        The decoded die ID.

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

    • maskEnableFromRegister: function
    • maskEnableToRegister: function
    • 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.