I2CDriverBase#

class I2CDriverBase[source]#

Bases: ABC

Vendor I2C-adapter driver contract. Concrete drivers own their transport and lifecycle.

address arguments are 7-bit device addresses (the adapter SDK handles the R/W bit). Drivers translate this contract to the vendor SDK’s master primitives.

Methods

close

Close the adapter handle.

open

Open the adapter (typically a USB host adapter) and prepare it for transactions.

read

Read length bytes from the 7-bit address (master read transaction).

set_bitrate

Set the master clock rate in kHz.

set_power_enable

Enable or disable target-power output on the adapter (where supported).

set_pullups

Enable or disable the adapter's internal bus pull-ups (typical: ~10 kΩ to VCC).

write

Write data to the 7-bit address (master write transaction).

write_read

Write data then immediately read read_len bytes from address using a repeated START.