Giter Site home page Giter Site logo

Comments (3)

rubberduck203 avatar rubberduck203 commented on August 19, 2024 1

I don't think #35 should have closed this issue.
While it's possible to monitor multiple lines for events, it's not nearly as ergonomic as the single line API.
I would personally love to see something like the Line::events() and LineEventHandle iterator implemented for Lines and (a new?) MultiLineEventHandle.

from gpio-cdev.

posborne avatar posborne commented on August 19, 2024

Polling using your mechanism of choice is fine -- Providing a way to conveniently integrate this lib with tokio is not in the lib today but is something that probably should be added (probably behind a feature flag).

Events on the GPIO are queued using cdev so you will not miss them unless you really are not keeping up in your userspace application. Each event comes with a timestamp from interrupt context which is what should be used if you care about when an event really happened.

If the lines are on the same gpiochip you can read multiple using a MultiLineHandle (see https://github.com/rust-embedded/gpio-cdev/blob/master/examples/multiread.rs). The equivalent of events on this type of handle is not implemented at present although I think it should be possible (though I haven't tested this).

from gpio-cdev.

massimiliano-mantione avatar massimiliano-mantione commented on August 19, 2024

The equivalent of events on this type of handle is not implemented at present although I think it should be possible (though I haven't tested this).

Could you please provide a pointer to the docs of the C API that specify how to do it?
I am really interested in this and could provide a PR.
I would test it reading the two lines of a quadrature encoder (this is the use case I have).

from gpio-cdev.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.