Fix parallel PCA9458A's by disabling output at the end of communication.
The PCA9458A never disables the channel at the end of communication request. This results in cross-talk if same device is connected to the same channel number of two I2C multiplexers.
For example: Mux A has device with address 0x10 on channel 1. Mux B has device with address 0x10 on channel 1.
The following sequence demonstrates the problem.
- Read 0x10 from mux A channel 1. Mux A channel 1 is enabled.
- Read 0x10 from mux B channel 1. Mux B and A channel 1 is enabled. Mux A ch 1 is still enabled from 1.
This fixes by calling a new private restore_com
member function at the end of the communication request. The restore_com
restores the underlying m_com
device address (already done) and then disables all channels (new).