-
-
19 Jun 2020 03:49:31 UTC
- Distribution: PINE64-GPIO
- Module version: 0.92
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues
- Testers (465 / 0 / 0)
- Kwalitee
Bus factor: 1- 11.54% Coverage
- License: artistic_2
- Perl: v5.6.0
- Activity
24 month- Tools
- Download (3.86KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- unknown
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
PINE64::GPIO - Perl interface to PineA64 and PineA64+ GPIO pins
SYNOPSIS
use PINE64::GPIO; #instantiate PINE64::GPIO object my $p64 = PINE64::GPIO->new(); #export pin 25 (physical pin 40) for output $p64->gpio_enable(25, 'out'); #continuously blink LED for(;;){ $p64->gpio_write(25, 1); sleep(1); $p64->gpio_write(25, 0); sleep(1); }#end for
DESCRIPTION
This module manipulates the GPIO file system interface of the PineA64 and PineA64+ single board computers so you can control the GPIO pins on the PineA64's PI-2 bus.
The PineA64's 40-pin PI-2 bus has the same pinout as the Raspberry Pi's 40-pin GPIO, however this module has it's own GPIO pin numbering convention for the 26 GPIO pins as follows:
Module# Physical# A64 sys# ------------------------------------------ 0 3 227 1 5 226 2 7 362 3 11 71 4 13 233 5 15 76 6 19 64 7 21 65 8 23 66 9 29 229 10 31 230 11 33 69 12 35 73 13 37 80 14 8 32 15 10 33 16 12 72 17 16 77 18 18 78 19 22 79 20 24 67 21 26 231 22 32 68 23 36 70 24 38 74 25 40 75
METHODS
new()
Returns a new
PINE64::GPIO
object.gpio_enable($pin, 'out')
Takes the GPIO pin number and direction as arguments and exports it for use as either an input or output.
Valid pin number arguments are 0-25, and the direction is either 'in' or 'out'.
$p64->gpio_enable(25, 'out');
gpio_read($pin)
Takes pin number as an argument and returns the logic value on the pin.
gpio_write($pin, $value)
Takes pin number and value as an argument and writes the value to the GPIO pin. Valid values are 0 or 1.
gpio_disable($pin)
Takes pin number as an argument and unexports the pin in the file system interface.
AUTHOR
Dustin La Ferney
Module Install Instructions
To install PINE64::GPIO, copy and paste the appropriate command in to your terminal.
cpanm PINE64::GPIO
perl -MCPAN -e shell install PINE64::GPIO
For more information on module installation, please visit the detailed CPAN module installation guide.