uci-gpio/readme.md

26 lines
1.3 KiB
Markdown

# uCOMmandIt GPIO Package for SBC GPio Pins
<!-- find and replace the package name to match -->
[![Build Status](https://img.shields.io/travis/uCOMmandIt/uci-interrupt.svg?branch=master)](https://travis-ci.org/uCOMmandIt/uci-interrupt)
[![Inline docs](http://inch-ci.org/github/uCOMmandIt/uci-interrupt.svg?branch=master)](http://inch-ci.org/github/uCOMmandIt/uci-interrupt)
[![devDependencies](https://img.shields.io/david/dev/uCOMmandIt/uci-interrupt.svg)](https://david-dm.org/uCOMmandIt/uci-interrupt?type=dev)
[![codecov](https://img.shields.io/codecov/c/github/uCOMmandIt/uci-interrupt/master.svg)](https://codecov.io/gh/uCOMmandIt/uci-interrupt)
This module creates an instance of UCI Packet GPIO for a SBC gpio pin. This class does NOT include support for interrupt based input. See UCI-Interrupt package for that.
## Set up hardware GPio bus pins as interrupts for use with UCI Interrupt
### Enable access to GPios
create (if need be) a gpio group and make sure your user is in the `gpio` group
change group to gpio for /sys/class/gpio/export and unexport and mode to 770.
make a new udev rules file.
```
SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c 'find -L /sys/class/gpio/ -maxdepth 2 -exec chown root:gpio {} \; -exec chmod 770 {} \; || true'"
```
That should allow access via the on/off package which is a dependency.