PCA9547 Support/Autodetect #87
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "mwojcik/zynq-rs:pca9547_support"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
With the recent chip shortage, I2C multiplexer got changed from PCA9548 to PCA9547 on kasli-soc only.
This PR incorporates autodetect code for the I2C driver for kasli-soc. It resets the PCA954x with I2C_SW_RESET (MIO_33) and checks the config register contents - which default behaviour of differs (0x00 for PCA9548, 0x08 for PCA9547) - and uses that knowledge to properly set chosen channel, making the interface simpler too.
Since i2c::pca9548_select function name changed to i2c::pca954x_select this will also require an update in artiq-zynq.
@ -113,0 +166,4 @@
0x00 => I2cMultiplexer::PCA9548,
0x08 => I2cMultiplexer::PCA9547,
_ => { return Err("Unknown response for PCA954X autodetect")},
};
I suggest logging which chip was detected to help troubleshooting possible problems.