drivers.TCA9548A.TCA9548A¶
TCA9548A 8-channel I2C bus multiplexer driver and host-side interface.
The Texas Instruments TCA9548A is a 1-of-8 bidirectional translating switch
that lets a single upstream I2C master fan out to eight isolated downstream
I2C segments. This module wraps the part in a thin TCA9548A class
that opens the Linux /dev/i2c-N bus through smbus2, drives the
upstream GPIO mux into I2C mode via drivers.gpio, and exposes helpers
to select a channel, scan for downstream devices, and perform raw byte I/O
against the multiplexer’s control register.
The driver is a utility shim and not a sensor: it carries no measurement
state of its own. Higher-level sensor drivers (notably
drivers.MAX31875.MAX31875.MAX31875) instantiate a TCA9548A to
arbitrate access to multiple identical-address slaves sitting on different
downstream channels.
Example
>>> from drivers.TCA9548A.TCA9548A import TCA9548A
>>> mux = TCA9548A(port=0, address=0x70)
>>> mux.select_channel(2)
>>> # ... talk to devices on channel 2 ...
Note
Valid 7-bit I2C addresses for the TCA9548A span 0x70–0x77,
selected by the A0/A1/A2 strap pins. The channel-select byte written to
the device is a one-hot mask computed as 1 << channel (bit n
enables downstream channel n); writing 0x00 disables all
channels.
See also
drivers.MAX31875.MAX31875.MAX31875: Temperature sensor driver
that sits behind this multiplexer to support up to eight identical-
address probes on one physical I2C bus.
Attributes¶
Classes¶
Host-side interface to a TCA9548A 8-channel I2C bus multiplexer. |
Module Contents¶
- drivers.TCA9548A.TCA9548A.TCA_DEFAULT_ADDRESS = 112¶
- drivers.TCA9548A.TCA9548A.basic_logger¶
- drivers.TCA9548A.TCA9548A.context_logger¶
- drivers.TCA9548A.TCA9548A.mux¶