31 Jan 2022 00:06:42 UTC
- Distribution: Device-Chip-Adapter-LinuxKernel
- Module version: 0.00008
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (1)
- Testers (119 / 0 / 47)
- KwaliteeBus factor: 1
- % Coverage
- License: perl_5
- Activity24 month
- Download (23.64KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionSIMCOP Ryan Voots
This class implements the
Device::Chip::Adapterinterface for the LinuxKernel, allowing an instance of Device::Chip driver to communicate with the actual chip hardware by using the Linux Kernel interfaces for GPIO, I2C (SMbus), and SPI. Suitble for use on any Linux system including Raspberry PI (RPI), Beaglebone, Banana PI or any other single board computer that exposes IO via the standard Linux Kernel interfaces.
$adapter = Device::Chip::Adapter::LinuxKernel->new( %args )
- i2c_bus - Optional, which i2c bus to connect to. i2c-0, i2c-1, ...
- spi_bus - Optional, which spi controller to use. spidev0.0, ...
Returns a new instance of a
- I2C reading likely doesn't work properly
- GPIO performance is probably horrendous. We re-open the /value file in sysfs over and over for every action. This could be better by storing the filehandles
I'm going to release a companion module to this for Raspberry PI devices. It'll automatically detect which set of hardware you're on and select the appropriate busses for you. I'll also be working to add "interrupt" support for the GPIO so that you can use
select(2)to get a trigger on edge detection on some GPIO devices.
Ryan Voots <email@example.com>
Stephen Cavilia <firstname.lastname@example.org>
Paul "LeoNerd" Evans <email@example.com>
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install Device::Chip::Adapter::LinuxKernel, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Device::Chip::Adapter::LinuxKernel
For more information on module installation, please visit the detailed CPAN module installation guide.