libgpiod: Add Rust bindings
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v10 Latest6 patches 9 repliesIn review
- v98 patches 40 repliesSuperseded
- v89 patches 9 repliesSuperseded
Earlier versions · 7
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v7 | 8 patches | 41 replies | Superseded | |
| v6 | 8 patches | 28 replies | Superseded | |
| v5 | 8 patches | 2 replies | Superseded | |
| v4 | 8 patches | 57 replies | Superseded | |
| v3 | 4 patches | 0 replies | Superseded | |
| v2 | 4 patches | 21 replies | Superseded | |
| v1 | 2 patches | 2 replies | Superseded |
Changes in v10 from the cover letter
- Removed auto-built bindings.rs files.
- Updated license and copyright information for all files.
- Renamed gpiosim crate as gpiosim-sys.
- Cargo specific .gitnore changes moved to bindings/rust/.gitignore.
- Fixed few SAFETY comments.
- Added Reviewed-by tag from Kent. Since the changes were all minor, I haven't dropped them.
Patches in v10 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | bindings: rust: Add libgpiod-sys rust cratebindings/ bindings/ bindings/ +3 more | +100 | 0 replies | |
| 2/6 | bindings: rust: Add libgpiod cratebindings/ bindings/ bindings/ +9 more | +2049 | 6 replies | |
| 3/6 | bindings: rust: Add gpiosim-sys cratebindings/ bindings/ bindings/ +3 more | +485 | 0 replies | |
| 4/6 | bindings: rust: Add examples to libgpiod cratebindings/ bindings/ bindings/ +6 more | +618 | 0 replies | |
| 5/6 | bindings: rust: Add tests for libgpiod cratebindings/ bindings/ bindings/ +8 more | +1834 | 0 replies | |
| 6/6 | bindings: rust: Integrate building of bindings with makeREADME TODO bindings/ +2 more | +46 | 0 replies |
Reviews trailers per patch
All 6 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Kent Gibson | Linus Walleij |
|---|---|---|
| Series | A-b | |
| 1/6 | R-b | |
| 2/6 | R-b | |
| 3/6 | R-b | |
| 4/6 | R-b | |
| 5/6 | R-b | |
| 6/6 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [libgpiod][PATCH V10 0/6] libgpiod: Add Rust bindings
Hello,
Here is another version of the rust bindings, based of the master branch.
Pushed here:
https://github.com/vireshk/libgpiod v10
V9->V10:
- Removed auto-built bindings.rs files.
- Updated license and copyright information for all files.
- Renamed gpiosim crate as gpiosim-sys.
- Cargo specific .gitnore changes moved to bindings/rust/.gitignore.
- Fixed few SAFETY comments.
- Added Reviewed-by tag from Kent. Since the changes were all minor, I haven't dropped them.
V8->V9:
- Merged the last patch (supporting Events) with the other patches.
- Events implementation is simplified and made efficient. nth() is also implemented for the iterator.
- Unnecessary comment removed from Cargo.toml files.
- Updated categories in libgpiod's Cargo.toml.
- Updated gpio_events example to show cloned events live past another read_edge_events().
- Implement AsRawFd for Chip.
- Other minor changes.
V7->V8:
- Several updates to cargo.toml files, like license, version, etc.
- Removed Sync support for chip and gpiosim.
- Implemented, in a separate patch, iterator support for Events.
- Fixed missing SAFETY comments.
- Fixed build for 32 bit systems.
- Use errno::Errno.
- Removed Clone derive for many structures, that store raw pointers.
- line setting helpers return the object back, so another helper can be called directly on them. Also made all helpers public and used the same in tests and example for single configurations.
- Enums for gpiosim constants.
- New examples to demonstrate parallelism and event handling.
- Separated out HTE tests and marked as #[ignore] now.
- Updated commit subjects.
- Other minor changes.
V6->V7:
- Don't let buffer read new events if the earlier events are still referenced.
- BufferIntenal is gone now, to make the above work.
- Update example and tests too for the same.
V5->V6:
- Updates according to the new line-settings interface.
- New file, line_settings.rs.
- Renamed 'enum Setting' as 'SettingVal' to avoid conflicting names, as we also have 'struct Settings' now.
- Support for HTE clock type.
- Implement 'Eq' for public structure/enums (reported by build).
- Remove 'SettingKindMap' and 'SettingMap' as they aren't required anymore.
- Updated tests based on new interface.
V4->V5:
- Arrange as workspace with crates for libgpiod-sys, libgpiod, gpiosim.
- Use static libgpiod and libgpiosim libraries instead of rebuilding again.
- Arrange in modules instead of flattened approach.
- New enums like Setting and SettingKind and new types based on them SettingMap and SettingKindMap.
- New property independent helpers for line_config, like set_prop_default().
- Improved tests/examples, new example for gpiowatch.
- Add pre-built bindings for gpiosim too.
- Many other changes.
V3->V4:
- Rebased on top of new changes, and made changes accordingly.
- Added rust integration tests with gpiosim.
- Found a kernel bug with tests, sent a patch for that to LKML.
V2->V3:
- Remove naming redundancy, users just need to do this now
use libgpiod:{Chip, Direction, LineConfig} now (Bartosz);
- Fix lifetime issues between event-buffer and edge-event modules, the event buffer is released after the last edge-event reference is dropped (Bartosz).
- Allow edge-event to be copied, and freed later (Bartosz).
- Add two separate rust crates, sys and wrapper (Gerard).
- Null-terminate the strings passed to libgpiod (Wedson).
- Drop unnecessary checks to validate string returned from chip:name/label/path.
- Fix SAFETY comments (Wedson).
- Drop unnecessary clone() instances (Bartosz).
V1->V2:
- Added examples (I tested everything except gpiomon.rs, didn't have right hardware/mock device to test).
- Build rust bindings as part of Make, update documentation.
Thanks.
--
Viresh
Viresh Kumar (6):
bindings: rust: Add libgpiod-sys rust crate
bindings: rust: Add libgpiod crate
bindings: rust: Add gpiosim-sys crate
bindings: rust: Add examples to libgpiod crate
bindings: rust: Add tests for libgpiod crate
bindings: rust: Integrate building of bindings with make
README | 8 +- TODO | 8 - bindings/Makefile.am | 6 + bindings/rust/.gitignore | 4 + bindings/rust/Cargo.toml | 11 + bindings/rust/Makefile.am | 19 + bindings/rust/gpiosim-sys/Cargo.toml | 23 + bindings/rust/gpiosim-sys/README.md | 14 + bindings/rust/gpiosim-sys/build.rs | 43 ++ bindings/rust/gpiosim-sys/src/lib.rs | 74 +++ bindings/rust/gpiosim-sys/src/sim.rs | 330 ++++++++++++ bindings/rust/libgpiod-sys/Cargo.toml | 21 + bindings/rust/libgpiod-sys/README.md | 14 + bindings/rust/libgpiod-sys/build.rs | 41 ++ bindings/rust/libgpiod-sys/src/lib.rs | 11 + bindings/rust/libgpiod/Cargo.toml | 25 + .../rust/libgpiod/examples/gpio_events.rs | 88 +++ .../examples/gpio_threaded_info_events.rs | 132 +++++ bindings/rust/libgpiod/examples/gpiodetect.rs | 30 ++ bindings/rust/libgpiod/examples/gpiofind.rs | 36 ++ bindings/rust/libgpiod/examples/gpioget.rs | 45 ++ bindings/rust/libgpiod/examples/gpioinfo.rs | 97 ++++ bindings/rust/libgpiod/examples/gpiomon.rs | 74 +++ bindings/rust/libgpiod/examples/gpioset.rs | 63 +++ bindings/rust/libgpiod/examples/gpiowatch.rs | 53 ++ bindings/rust/libgpiod/src/chip.rs | 309 +++++++++++ bindings/rust/libgpiod/src/edge_event.rs | 92 ++++ bindings/rust/libgpiod/src/event_buffer.rs | 168 ++++++ bindings/rust/libgpiod/src/info_event.rs | 68 +++ bindings/rust/libgpiod/src/lib.rs | 478 ++++++++++++++++ bindings/rust/libgpiod/src/line_config.rs | 134 +++++ bindings/rust/libgpiod/src/line_info.rs | 161 ++++++ bindings/rust/libgpiod/src/line_request.rs | 226 ++++++++ bindings/rust/libgpiod/src/line_settings.rs | 296 ++++++++++ bindings/rust/libgpiod/src/request_config.rs | 94 ++++ bindings/rust/libgpiod/tests/chip.rs | 97 ++++ bindings/rust/libgpiod/tests/common/config.rs | 142 +++++ bindings/rust/libgpiod/tests/common/mod.rs | 9 + bindings/rust/libgpiod/tests/edge_event.rs | 297 ++++++++++ bindings/rust/libgpiod/tests/info_event.rs | 166 ++++++ bindings/rust/libgpiod/tests/line_config.rs | 95 ++++ bindings/rust/libgpiod/tests/line_info.rs | 275 ++++++++++ bindings/rust/libgpiod/tests/line_request.rs | 509 ++++++++++++++++++ bindings/rust/libgpiod/tests/line_settings.rs | 203 +++++++ .../rust/libgpiod/tests/request_config.rs | 38 ++ configure.ac | 16 + 46 files changed, 5132 insertions(+), 11 deletions(-) create mode 100644 bindings/rust/.gitignore create mode 100644 bindings/rust/Cargo.toml create mode 100644 bindings/rust/Makefile.am create mode 100644 bindings/rust/gpiosim-sys/Cargo.toml create mode 100644 bindings/rust/gpiosim-sys/README.md create mode 100644 bindings/rust/gpiosim-sys/build.rs create mode 100644 bindings/rust/gpiosim-sys/src/lib.rs create mode 100644 bindings/rust/gpiosim-sys/src/sim.rs create mode 100644 bindings/rust/libgpiod-sys/Cargo.toml create mode 100644 bindings/rust/libgpiod-sys/README.md create mode 100644 bindings/rust/libgpiod-sys/build.rs create mode 100644 bindings/rust/libgpiod-sys/src/lib.rs create mode 100644 bindings/rust/libgpiod/Cargo.toml create mode 100644 bindings/rust/libgpiod/examples/gpio_events.rs create mode 100644 bindings/rust/libgpiod/examples/gpio_threaded_info_events.rs create mode 100644 bindings/rust/libgpiod/examples/gpiodetect.rs create mode 100644 bindings/rust/libgpiod/examples/gpiofind.rs create mode 100644 bindings/rust/libgpiod/examples/gpioget.rs create mode 100644 bindings/rust/libgpiod/examples/gpioinfo.rs create mode 100644 bindings/rust/libgpiod/examples/gpiomon.rs create mode 100644 bindings/rust/libgpiod/examples/gpioset.rs create mode 100644 bindings/rust/libgpiod/examples/gpiowatch.rs create mode 100644 bindings/rust/libgpiod/src/chip.rs create mode 100644 bindings/rust/libgpiod/src/edge_event.rs create mode 100644 bindings/rust/libgpiod/src/event_buffer.rs create mode 100644 bindings/rust/libgpiod/src/info_event.rs create mode 100644 bindings/rust/libgpiod/src/lib.rs create mode 100644 bindings/rust/libgpiod/src/line_config.rs create mode 100644 bindings/rust/libgpiod/src/line_info.rs create mode 100644 bindings/rust/libgpiod/src/line_request.rs create mode 100644 bindings/rust/libgpiod/src/line_settings.rs create mode 100644 bindings/rust/libgpiod/src/request_config.rs create mode 100644 bindings/rust/libgpiod/tests/chip.rs create mode 100644 bindings/rust/libgpiod/tests/common/config.rs create mode 100644 bindings/rust/libgpiod/tests/common/mod.rs create mode 100644 bindings/rust/libgpiod/tests/edge_event.rs create mode 100644 bindings/rust/libgpiod/tests/info_event.rs create mode 100644 bindings/rust/libgpiod/tests/line_config.rs create mode 100644 bindings/rust/libgpiod/tests/line_info.rs create mode 100644 bindings/rust/libgpiod/tests/line_request.rs create mode 100644 bindings/rust/libgpiod/tests/line_settings.rs create mode 100644 bindings/rust/libgpiod/tests/request_config.rs
Signature · 1 line
2.31.1.272.g89b43f80a514