Device::Chip::Adapter::Gpiod - Device::Chip::Adapter implementation for Linux GPIO character devices
This module allows Device::Chip to use Linux GPIO character devices through the libgpiod library.
my $adapter = Device::Chip::Adapter::Gpiod->new(device => "gpiochip0");
Returns a new Device::Chip::Adapter::Gpiod instance. The device argument indicates the GPIO chip to use. It is passed to gpiod_chip_open_lookup(), which takes either a device node name, full path, or chip number. For example, it is possible to use either "gpiochip2", "/dev/gpiochip2", or 2 to open the same device.
Device::Chip::Adapter::Gpiod
device
gpiod_chip_open_lookup()
"gpiochip2"
"/dev/gpiochip2"
2
Only the GPIO protocol is supported:
GPIO
my $protocol = $adapter->make_protocol('GPIO');
The meta_gpios method is not yet supported.
meta_gpios
The tris_gpios method is not yet supported.
tris_gpios
Libgpiod supports passing a consumer string when GPIO lines are opened that can identify the application using them. This is currently always set to "Device::Chip".
consumer
"Device::Chip"
Stephen Cavilia <sac@atomicradi.us>
Copyright 2021 Stephen Cavilia
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Device::Chip::Adapter::Gpiod, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Device::Chip::Adapter::Gpiod
CPAN shell
perl -MCPAN -e shell install Device::Chip::Adapter::Gpiod
For more information on module installation, please visit the detailed CPAN module installation guide.