Comments (4)
The actual value (0, non-zero) is modeling "active" state for the line which can be inverted in the kernel via the active-low setting. I could see is_active
and set_active
as an API that modeled what this is in the kernel being something that make sense. This could be in addition to the value or as a full replacement.
from gpio-cdev.
Whenever I wrap a C library or API in a language that has a bool type (C++, Rust, etc), I usually prefer to convert the C integer boolean (0, non-zero) to a bool to be a little more explicit about the possible values, and remove ambiguities. But it's no big deal either way.
from gpio-cdev.
Possibly relevant. I've been working on a reusable abstraction for logic levels.
The idea is to abstract over whether an I/O line is active high or low and only expose whether or not it is currently asserted.
https://github.com/rubberduck203/switch-hal
from gpio-cdev.
i can't find it right now but i believe there is discussion about introducing a LogicLevel
(or similar) enum along with some more gpio accessors somewhere amongst our issues and PRs.
from gpio-cdev.
Related Issues (20)
- gpio-cdev = { version = "0.3", features = ["async-tokio"] } fails HOT 4
- GPIO electrical configuration HOT 6
- How would one configure a PWM using this crate? HOT 4
- Non-blocking polling of events HOT 2
- Update to Tokio 1 HOT 1
- Switch CI to GitHub Actions HOT 2
- Does Line.request()'s default arg matter for Input lines? HOT 1
- Is kernel event queueing per-process? HOT 1
- Seeming deadlock on select! HOT 9
- Please include Async documentation on docs.rs HOT 5
- possible to target wasm32-wasi? HOT 6
- Error: "There is no reactor running, must be called from the context of a Tokio 0.2.x runtime" from tokio::task::spawn HOT 1
- Servo example? HOT 1
- Support uAPI v2 HOT 13
- Fix CI HOT 1
- New release? HOT 1
- Control the mode or peripheral function aka alternate mode of GPIO PINs. HOT 3
- Ambiguity of Line.request()'s default arg polarity in light of ACTIVE_LOW outputs HOT 5
- Example for async multiread
- Fix CI
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 gpio-cdev.