PhloemDocs
Markdown
Connector

Aardvark I2C

Read and write I2C registers through a Total Phase Aardvark

Category
Data acquisition
Kind
source
Capabilities
StreamsAssetsCommandsOperationsEntities
Runs on
Linux x64Linux ARM64macOS Apple siliconmacOS IntelWindows x64

Read and write registers on any I2C chip through a Total Phase Aardvark adapter. You describe the chip by pasting its register table from the datasheet. No code needed.

What you get

  • Live readings — each polled register or named bit field is a channel, such as /aardvark/i2c1/gpio/input or /aardvark/i2c1/gpio/output/led0.
  • Writes — registers marked writable, and their bit fields, accept values from Trellis via ch.write(path, value). A bit-field write leaves the other bits alone. Every write is recorded.
  • One adapter per input, named by its Bus name.

Setup

  1. Install the Aardvark Software API from totalphase.com and plug in the adapter. Phloem detects it over USB and offers a draft with its serial filled in. You still add the register map.
  2. In Inputs, add Total Phase Aardvark and fill in:
    • Bus name — a short label, e.g. i2c1

    • Adapter serial — as printed on the unit, e.g. 2239-764425. Leave empty to use the first adapter found.

    • Peripherals — the register map (JSON). For a PCA9554 I/O expander:

      [{"name": "gpio", "address": 56,
        "registers": [
          {"alias": "input", "register": 0},
          {"alias": "output", "register": 1, "writable": true,
           "fields": {"led0": {"lsb": 0}}}
        ],
        "poll": ["input", "output.led0"]}]
      KeyValue
      address7-bit I2C address
      addr_width_bytes1 or 2
      registerseach with alias, register, transfer_bits (default 8)
      data_width_bits, data_lsb, signedoptional
      scaleoptional {"gain": g, "offset": o}; value = offset + gain × raw
      endiannessbig (default)
      unit, writableper register
      fields{"name": {"lsb": n, "width": w}}
      pollwhat to read (alias or alias.field); omit to read every register
    • Bus bitrate / pull-ups / target power — the bus's electrical settings. The adapter rounds the bitrate to the nearest rate it supports.

  3. Press Test connection. It reads the first polled register, so a pass means a chip answered on the bus.
  4. Polled channels appear on Live. Writable registers are available in Trellis.

Notes

  • Without the Total Phase library, the connector tells you so.
  • Register reads use a repeated START. Bit-field writes read, change and rewrite the whole register.
  • Chips that take a command byte and reply, with no register addresses, are not supported.

#Supports

  • Total Phase Aardvark I2C/SPI host adapter (I2C master, USB)
  • Any register-based I2C peripheral via a pasted register map

#Connection fields

Every field the Add input form shows for this connector.

FieldTypeRequiredDefault
Bus name
i2c1
TextYes—
Adapter serial
2239-764425 (empty = first available)
Text——
Peripherals (JSON register map)
[{"name":"gpio","address":56,"registers":[{"alias":"output","register":1,"writable":true}]}]
TextYes—
Bus bitrate (kHz)
100
Number—100
Internal pull-upsOne of
off · on
—off
Target powerOne of
off · on
—off
Poll rate (Hz)
1
Number—1

Updated