The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Device::Chip::MCP23x17::Adapter - Device::Chip::Adapter over MCP23x17 chip

SYNOPSIS

   use Device::Chip::MCP23S17;
   use Future::AsyncAwait;

   my $chip = Device::Chip::MCP23S17->new;
   await $chip->mount( Device::Chip::Adapter::...->new );

   my $adapter = $chip->as_adapter;

   my $second_chip = Device::Chip::...->new;
   await $second_chip->mount( $adapter );

DESCRIPTION

This implementation of the Device::Chip::Adapter API provides the GPIO protocol, by exposing the 16bit GPIO registers of a MCP23x17 chip as 16 named GPIO pins. It allows, for example, a second instance of some Device::Chip implementation that uses the GPIO protocol, to be attached via the MCP23x17 chip.

Instances of this class are not created directly; they are returned by "as_adapter" in Device::Chip::MCP23x17.

AUTHOR

Paul Evans <leonerd@leonerd.org.uk>