HiPi
Perl Modules for Raspberry Pi
Version 0.70 - released 08 May 2018

HiPi::Interface::PCA9544

This module provides an interface to the PCA9544 I2C multiplexer. This IC allows you to have up to four devices using the same address on your I2C bus.

The PCA9544A documentation states a maximum I2C bus speed of 400 kbit/s. This means it will be fine if you are using the Raspberry Pi default setting of 100 kbit/s

It uses HiPi::Device::I2C as a backend.

Methods

Create a new instance of the module class.

use HiPi::Interface::PCA9544;
my $mux = HiPi::Interface::PCA9544->new(
    address    => 0x70,
);

Set the channel to open. $channel can be 0, 1, 2 or 3

. . .
$mux->set_channel( 1 );

Get current open channel and interrupt status for all four channels.

. . .
my ( $channel, @interupts ) = $mux->get_status();