I2CInterface#
- class I2CInterface(
- name: str,
- driver: I2CDriverBase,
- system_definition: SystemDefinition,
- publishers: list[Publisher] | None = None,
- **kwargs,
Bases:
InstrumentI2C interface supporting register-based and command-based devices.
Commands are enum values OR’d together and sent as a single byte stream. The
SystemDefinitionis read-only —I2CInterfaceresolves names to transactions on every call; the vendor driver never sees it.Initialize an I2CInterface.
- Parameters:
name – Channel-name prefix for published data.
driver –
Concrete I2C-adapter driver; owns its own transport:
i2c = I2CInterface( "main", driver=Aardvark(serial_number="2239-764425"), system_definition=system, )
system_definition – Bus description (devices, register maps, comms params).
publishers – Publishers that receive emitted Measurement/Command data.
**kwargs – Default tags applied to every emitted Measurement/Command. Pass
dataset_rid="<rid>"to auto-create a NominalCorePublisher (uses the on-disk ‘default’ Nominal credential).
Attributes
Seconds between background daemon iterations (0 = no wait). |
|
Return an insertion-ordered snapshot of all published channel names. |
Methods
Append |
|
Register a publisher to receive this instrument's Measurement/Command data. |
|
Close the underlying driver and stop the daemon. |
|
Replace all daemon functions with a single |
|
Return the most recent |
|
Return the most recent sample for |
|
Open the underlying I2C-adapter driver. |
|
Fan |
|
Send a batch command (OR of its enum members) to |
|
Read a register (or one of its named fields) on |
|
Read |
|
Write a register's defined default value back to hardware (initialization/recovery). |
|
Start the background daemon thread. |
|
Signal the background daemon to stop and join it. |
|
Write a register (or one of its named fields) on |
|
Write |
|
Write-then-read without an intermediate I2C STOP (uses repeated START); decode as integer. |
|
Write-then-read with an I2C STOP between operations (required by devices that need STOP to process input). |