Module capsules_extra::pca9544a
source · Expand description
SyscallDriver for the PCA9544A I2C Selector.
This chip allows for multiple I2C devices with the same addresses to sit on the same I2C bus.
http://www.ti.com/product/PCA9544A
The PCA9544A is a quad bidirectional translating switch controlled via the I2C bus. The SCL/SDA upstream pair fans out to four downstream pairs, or channels. One SCL/SDA pair can be selected at a time, and this is determined by the contents of the programmable control register. Four interrupt inputs (INT3–INT0), one for each of the downstream pairs, are provided. One interrupt output (INT) acts as an AND of the four interrupt inputs.
§Usage
ⓘ
let pca9544a_i2c = static_init!(
capsules::virtual_i2c::I2CDevice,
capsules::virtual_i2c::I2CDevice::new(i2c_bus, 0x70));
let pca9544a_buffer = static_init!([u8; capsules::pca9544a::BUFFER_LENGTH],
[0; capsules::pca9544a::BUFFER_LENGTH]);
let pca9544a = static_init!(
capsules::pca9544a::PCA9544A<'static>,
capsules::pca9544a::PCA9544A::new(pca9544a_i2c, pca9544a_buffer));
pca9544a_i2c.set_client(pca9544a);