Comments (3)
I am also looking for such a function
from pifacecommon.
I've had an idea for this for a very long time - just not got around to implementing it. I'm not even sure if Raspbian is still organised like this but I imagine it would work something like this:
-
Bring up GPIO25 in userland with
echo 25 > /sys/class/gpio/export
. -
In Python, use epoll to wait on changes:
with open('/sys/class/gpio/gpio25/value', 'r') as gpio25: epoll = select.epoll() epoll.register(gpio25, select.EPOLLIN | select.EPOLLET) events = epoll.poll() # wait for interrupt epoll.close()
This could be wrapped up into a wait_for_edge
function. This is how the C libs work: https://github.com/piface/libmcp23s17/blob/master/src/mcp23s17.c#L189-L203
from pifacecommon.
libgpiod is the future of Linux gpio, so when someone gets around to implementing this, it should use that:
from pifacecommon.
Related Issues (20)
- Deregister a pin from an event listener
- Import of errno is needed HOT 4
- spi.py OSError (9) Bad File Descriptor
- Documentation HOT 7
- errno not imported in pifacecommon/interrupts.py HOT 1
- pifacecommon.interrupts references undefined Timeout exception HOT 1
- Version 4.1.2 available through PyPi HOT 1
- Thread detector & dispatcher are not daemon threads.... HOT 1
- Piface2 board not detected (Rpi3 B) HOT 8
- Wrong version used in latest release. HOT 3
- Please release new pifacecommon version 4.2.2 to get the fix for SPI speed setting HOT 3
- bring_gpio_interrupt_into_userspace fails on Debian Buster, Rpi3B / 3B+
- E: Unable to locate package python-pifacecommon E: Unable to locate package python3-pifacecommon
- IOError: [Errno 2] No such file or directory: '/sys/devices/virtual/gpio/gpio25/value' HOT 1
- pip install fails HOT 3
- Upgrade to 4.0 has UnboundLocalError in deinit HOT 4
- SPI device error HOT 18
- Interrupt flag not cleared on mcp when interrupt handler start HOT 1
- SPI Device not found HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pifacecommon.